emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: position on changing defaults?


From: Stefan Monnier
Subject: Re: position on changing defaults?
Date: Thu, 06 Mar 2008 11:46:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> How about adding a new type of binding, a "modifier binding", which
> could serve to implement CUA movement, and replace the current automatic
> S-foo => foo remapping.

I'm not sure I understand what you're proposing.
One thing we can do right now is:

  (define-key function-key-map [S-up]
    (lambda (prompt) (setq foo-shited t) [up]))

and one thing I'd like to do is to replace the C-level mapping of S-foo
to foo by some entry in function-key-map.  This requires extending the
function-key-map mechanism, tho.  I don't know what it would look like,
but just to make it more concrete, here's one possible way:

  (define-key function-key-map [S-*]
    (lambda (prompt key) (vector (remove-shift key))))

Obviously, this can't work as is.  Maybe an even better generalization
would be

  (define-key function-key-map [is-shifted-p]
    (lambda (prompt key) (vector (remove-shift key))))
  (define-key function-key-map [is-mouse-4-p]
    (lambda (prompt key)
      (vector (combine-modifiers (modifiers key) 'mwheel-up)))

where `is-shifted-p' and `is-mouse-4-p' are Lisp functions.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]