Binding C-a to select all
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
Binding C-a to select all         


Author: Davin Pearson
Date: Jun 24, 2008 18:55

I am using Emacs to teach computer programming to computer novices and
therefore I need to modify Emacs to make it more like a standard
Windows application.

I have downloaded cua.el to implement certain windows keybindings but
cua.el doesn't bind C-a to select all, a feature which I would like.

Could someone present me with some Elisp code that provides this
feature?
12 Comments
Re: Binding C-a to select all         


Author: B. T. Raven
Date: Jun 24, 2008 20:19

Davin Pearson wrote:
> I am using Emacs to teach computer programming to computer novices and
> therefore I need to modify Emacs to make it more like a standard
> Windows application.
>
> I have downloaded cua.el to implement certain windows keybindings but
> cua.el doesn't bind C-a to select all, a feature which I would like.
>
> Could someone present me with some Elisp code that provides this
> feature?

Evaluate this form with C-x C-e or put it in .emacs:

(define-key global-map [(control a)] 'mark-whole-buffer)
Show full article (1.06Kb)
no comments
Re: Binding C-a to select all         


Author: Davin Pearson
Date: Jun 24, 2008 21:33

On Jun 25, 3:19 pm, "B. T. Raven" nihilo.net> wrote:
> (define-key global-map [(control a)] 'mark-whole-buffer)

Thank you for your help but there is problem with the above code in
that it doesn't highlight the region in the face "region" or "primary-
selection". Please advise me how I can go about getting this
functionality online.
> But I advise against it. C-a C-e M-a and M-e work together mnemonically
> if you think of a and e as Anfang and Ende (German beginning and end).
> Making the change you suggest disturbs this symmetry among related
> commands. Using Dvorak layout and Keytweak on w2000 I have needed to
> change only about half a dozen Emacs bindings (4 of them for single
> character cursor movement via keys close to home row and so as to avoid
> the arrow keys). This layout enables me to type ALL commands as easily
> as I can type a shifted number key.

You might barf but a long time ago I rebound keys like

C-f to find-file,
C-e to call-last-kbd-macro
Show full article (1.18Kb)
1 Comment
Re: Binding C-a to select all         


Author: Jordan Greenberg
Date: Jun 24, 2008 22:23

Davin Pearson wrote:
> On Jun 25, 3:19 pm, "B. T. Raven" nihilo.net> wrote:
>> (define-key global-map [(control a)] 'mark-whole-buffer)
>
> Thank you for your help but there is problem with the above code in
> that it doesn't highlight the region in the face "region" or "primary-
> selection". Please advise me how I can go about getting this
> functionality online.

You probably want to add (transient-mark-mode 1) to your .emacs.
-Jordan
no comments
Re: Binding C-a to select all         


Author: Joost Kremers
Date: Jun 24, 2008 23:02

Davin Pearson wrote:
> and I have never looked back! To me this seems sensible because a PC
> keyboard already has cursor keys and home/end keys so I believe that
> there is no need for the those standard Emacs keybindings.

the reason for using control key combos for cursor movement rather than the
cursor keys is that you don't need to take your hands off the keyboard to
move the cursor. that way you can move around the text a lot faster,
especially if you're a touch-typist.

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
no comments
Re: Binding C-a to select all         


Author: Lennart Borgman (gmail)
Date: Jun 25, 2008 00:52

Davin Pearson wrote:
> On Jun 25, 3:19 pm, "B. T. Raven" nihilo.net> wrote:
>> (define-key global-map [(control a)] 'mark-whole-buffer)
>
> Thank you for your help but there is problem with the above code in
> that it doesn't highlight the region in the face "region" or "primary-
> selection". Please advise me how I can go about getting this
> functionality online.

Since you use the arrow keys you might want cua-mode or cua-selection-mode.
no comments
Re: Binding C-a to select all         


Author: Davin Pearson
Date: Jun 25, 2008 00:58

2008/6/25 Lennart Borgman (gmail) gmail.com>:
> Since you use the arrow keys you might want cua-mode or cua-selection-mode.

It works... thanks

--
Sincerely and kindest regards, Davin.
Davin Pearson http://www.davinpearson.com
no comments
Re: Binding C-a to select all         


Author: Joel J. Adamson
Date: Jun 25, 2008 11:36

Davin Pearson gmail.com> writes:
> I am using Emacs to teach computer programming to computer novices

They'll continue being novices unless forced out of their comfort
zones.

What I mean is that if you get them to learn the Emacs way, suddenly
they'll be advanced computer users ;)
> and therefore I need to modify Emacs to make it more like a standard
> Windows application.

I disagree that you need to: at least some of the people in your class
will find Emacs keybindings (and the rest of the interface) more
comfortable and logical, and they'll see why they've been so frustrated
with "standard Windows" applications.

Joel
no comments
Re: Binding C-a to select all         


Author: Xah
Date: Jun 25, 2008 16:12

On Jun 24, 6:55 pm, Davin Pearson gmail.com> wrote:
> I am using Emacs to teach computer programming to computer novices and
> therefore I need to modify Emacs to make it more like a standard
> Windows application.
>
> I have downloaded cua.el to implement certain windows keybindings but
> cua.el doesn't bind C-a to select all, a feature which I would like.
>
> Could someone present me with some Elisp code that provides this
> feature?

Please see:

How To Make Emacs Use Modern User Interface
http://xahlee.org/emacs/emacs_make_modern.html

which include several tips and elisp code to make emacs conform to
modern UI standards. Comments welcome.

Xah
http://xahlee.org/

no comments
Re: Binding C-a to select all         


Author: Xah
Date: Jun 25, 2008 17:34

On Jun 25, 11:36 am, adams...@email.unc.edu (Joel J. Adamson) wrote:
> Davin Pearson gmail.com> writes:
>> I am using Emacs to teach computer programming to computer novices
>
> They'll continue being novices unless forced out of their comfort
> zones.
>
> What I mean is that if you get them to learn the Emacs way, suddenly
> they'll be advanced computer users ;)
>
>> and therefore I need to modify Emacs to make it more like a standard
>> Windows application.
>
> I disagree that you need to: at least some of the people in your class
> will find Emacs keybindings (and the rest of the interface) more
> comfortable and logical, and they'll see why they've been so frustrated
> with "standard Windows" applications.

Emacs keybindings actually has very little technical merit.
Show full article (0.95Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Re: How to do Selective Desaturation (Selective Black and White) in video?rec.video.desktop ·
1 2