[Top][All Lists]

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

Re: Suggestion: Mapping of M-g should be goto-line

From: Stefan Monnier
Subject: Re: Suggestion: Mapping of M-g should be goto-line
Date: 26 Mar 2004 09:25:49 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>> > Try
>> >         M-x recursive-edit RET C-h k C-c C-c
>> > =>
>> >         C-c C-c runs the command exit-recursive-edit

Exactly my point: yet another example of C-c C-c used for "I'm done editing,
now process it".  In the context of recursive-edit, of course this should
not be `compile'.

It seems people don't understand what I really want to say, so here's
another take on it:

1 - let's create a new command

   (defvar done-editing-now-do-it-function 'compile)
   (defun done-editing-now-do-it ()
     "Do what needs to be done with what you've just finished editing."
     (call-interactively done-editing-now-do-it-function))
   (global-set-key "\C-c\C-c" 'done-editing-now-do-it)

2 - let's optimize it away:

   (global-set-key "\C-c\C-c" 'compile)

    Notice it's only an optimization that relies on the fact that the
    binding can trivially be overridden by local maps and on the fact that
    done-editing-now-do-it did not do anything more than call the
    done-editing-now-do-it-function function.  The intention is still that
    major modes (or recursive-edit or minor-modes or whatever else shows up)
    should rebind it to something more appropriate if applicable.
    In elisp-mode, I've rebound it to byte-compile-file.

I.e. this is not "a standard binding for `compile'", but "a formalization
of what C-c C-c is expected to do".


reply via email to

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