all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Change C-d binding from delete-char to backward-delete-char-untabify
@ 2011-04-06 23:59 B. T. Raven
  2011-04-07  9:19 ` Andrea Crotti
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: B. T. Raven @ 2011-04-06 23:59 UTC (permalink / raw)
  To: help-gnu-emacs

I notice that I use both of these functions in my .emacs:

global-set-key
define-key global-map

Is it enough to make the new binding with either of these or does the
default binding have to be unbound first? What is the difference between
using those two methods? Can I then use the same method to bind
[backspace] to delete-char?

Thanks,

Ed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Change C-d binding from delete-char to backward-delete-char-untabify
  2011-04-06 23:59 Change C-d binding from delete-char to backward-delete-char-untabify B. T. Raven
@ 2011-04-07  9:19 ` Andrea Crotti
  2011-04-07 10:10 ` Deniz Dogan
       [not found] ` <mailman.3.1302171076.24221.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Andrea Crotti @ 2011-04-07  9:19 UTC (permalink / raw)
  To: B. T. Raven; +Cc: help-gnu-emacs

"B. T. Raven" <nihil@nihilo.net> writes:

> I notice that I use both of these functions in my .emacs:
>
> global-set-key
> define-key global-map
>
> Is it enough to make the new binding with either of these or does the
> default binding have to be unbound first? What is the difference between
> using those two methods? Can I then use the same method to bind
> [backspace] to delete-char?

I always use global-set-key, I'm not sure what could be the difference
between the two methods anyway.

Bu yes you don't need to unbound anything before, and just use
global-set-key after everything else is loaded and you'll be fine.

-- 
GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0)
 of 2011-03-04 on plaetekopp



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Change C-d binding from delete-char to backward-delete-char-untabify
  2011-04-06 23:59 Change C-d binding from delete-char to backward-delete-char-untabify B. T. Raven
  2011-04-07  9:19 ` Andrea Crotti
@ 2011-04-07 10:10 ` Deniz Dogan
       [not found] ` <mailman.3.1302171076.24221.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Deniz Dogan @ 2011-04-07 10:10 UTC (permalink / raw)
  To: B. T. Raven; +Cc: help-gnu-emacs

2011/4/7 B. T. Raven <nihil@nihilo.net>:
> I notice that I use both of these functions in my .emacs:
>
> global-set-key
> define-key global-map
>
> Is it enough to make the new binding with either of these or does the
> default binding have to be unbound first? What is the difference between
> using those two methods? Can I then use the same method to bind
> [backspace] to delete-char?
>
> Thanks,
>
> Ed
>

The definition of global-set-key is basically:

(define-key (current-global-map) key command)

`current-global-map' is a function which simply returns the current
global keymap. The global keymap is set using
`use-global-keymap'. When you use (define-key global-map ...) you're
making a binding in the default global keymap, not necessarily the one
currently being used.

At least that's how I understand it...

-- 
Deniz Dogan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Change C-d binding from delete-char to backward-delete-char-untabify
       [not found] ` <mailman.3.1302171076.24221.help-gnu-emacs@gnu.org>
@ 2011-04-07 17:25   ` B. T. Raven
  2011-04-10  2:59     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: B. T. Raven @ 2011-04-07 17:25 UTC (permalink / raw)
  To: help-gnu-emacs

Deniz Dogan wrote:
> 2011/4/7 B. T. Raven <nihil@nihilo.net>:
>> I notice that I use both of these functions in my .emacs:
>>
>> global-set-key
>> define-key global-map
>>
>> Is it enough to make the new binding with either of these or does the
>> default binding have to be unbound first? What is the difference between
>> using those two methods? Can I then use the same method to bind
>> [backspace] to delete-char?
>>
>> Thanks,
>>
>> Ed
>>
> 
> The definition of global-set-key is basically:
> 
> (define-key (current-global-map) key command)
> 
> `current-global-map' is a function which simply returns the current
> global keymap. The global keymap is set using
> `use-global-keymap'. When you use (define-key global-map ...) you're
> making a binding in the default global keymap, not necessarily the one
> currently being used.
> 
> At least that's how I understand it...
> 


Thanks, Andrea and Deniz. My usage of these functions has been
unsophisticated enough that it doesn't seem to have made any practical
difference. Here the current global map and the default global map
appear to be synonymous. I haven't noticed any problems with mixing
these functions promiscuously in org, text, lisp, tex, etc. modes.

Ed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Change C-d binding from delete-char to backward-delete-char-untabify
  2011-04-07 17:25   ` B. T. Raven
@ 2011-04-10  2:59     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2011-04-10  2:59 UTC (permalink / raw)
  To: help-gnu-emacs

> Thanks, Andrea and Deniz. My usage of these functions has been
> unsophisticated enough that it doesn't seem to have made any practical
> difference. Here the current global map and the default global map
> appear to be synonymous. I haven't noticed any problems with mixing
> these functions promiscuously in org, text, lisp, tex, etc. modes.

`global-map' is pretty much always the current global map, except in
some unusual circumstances (e.g. it could be different within special
modes such as isearch, tho IIRC isearch does not affect the
current-global-map and uses another mechanism instead).
One of the main packages that uses use-global-map to change the
current-global-map is Viper.


        Stefan


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-10  2:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-06 23:59 Change C-d binding from delete-char to backward-delete-char-untabify B. T. Raven
2011-04-07  9:19 ` Andrea Crotti
2011-04-07 10:10 ` Deniz Dogan
     [not found] ` <mailman.3.1302171076.24221.help-gnu-emacs@gnu.org>
2011-04-07 17:25   ` B. T. Raven
2011-04-10  2:59     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.