emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/bindings.el ...


From: Stefan Monnier
Subject: [Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/bindings.el ...
Date: Fri, 11 Sep 2009 00:59:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/09/11 00:59:05

Modified files:
        etc            : NEWS 
        lisp           : ChangeLog bindings.el dired.el simple.el 
                         startup.el tutorial.el wid-edit.el 
        lisp/emulation : crisp.el 
        lisp/progmodes : xscheme.el 
        lisp/textmodes : picture.el 
        src            : keymap.c 

Log message:
        * keymap.c (QCadvertised_binding): New constant.
        (syms_of_keymap): Initialize it.
        (Fwhere_is_internal): Try and use bindings from :advertised-binding
        if applicable.
        
        * progmodes/xscheme.el (xscheme-evaluation-commands):
        Put a :advertised-binding property rather than using
        advertised-xscheme-send-previous-expression.
        (advertised-xscheme-send-previous-expression): Declare obsolete.
        * emulation/crisp.el (crisp-mode-map): Use `undo' rather than
        `advertised-undo'.
        (crisp-mode): Add corresponding bindings to
        undo's :advertised-binding instead.
        * dired.el (dired-mode-map): Put a :advertised-binding property rather
        than using dired-advertised-find-file.
        (dired-advertised-find-file):
        * simple.el (advertised-undo):
        * wid-edit.el (advertised-widget-backward): Declare obsolete.
        (widget-keymap): Put a :advertised-binding property rather
        than using advertised-widget-backward.
        * bindings.el (ctl-x-map): Put a :advertised-binding property rather
        than using advertised-undo.
        * tutorial.el (tutorial--default-keys): Adjust accordingly.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/NEWS?cvsroot=emacs&r1=1.2079&r2=1.2080
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16122&r2=1.16123
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/bindings.el?cvsroot=emacs&r1=1.222&r2=1.223
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/dired.el?cvsroot=emacs&r1=1.425&r2=1.426
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/simple.el?cvsroot=emacs&r1=1.1009&r2=1.1010
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/startup.el?cvsroot=emacs&r1=1.538&r2=1.539
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/tutorial.el?cvsroot=emacs&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/wid-edit.el?cvsroot=emacs&r1=1.201&r2=1.202
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emulation/crisp.el?cvsroot=emacs&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/xscheme.el?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/textmodes/picture.el?cvsroot=emacs&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/emacs/src/keymap.c?cvsroot=emacs&r1=1.383&r2=1.384

Patches:
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.2079
retrieving revision 1.2080
diff -u -b -r1.2079 -r1.2080
--- etc/NEWS    10 Sep 2009 06:27:04 -0000      1.2079
+++ etc/NEWS    11 Sep 2009 00:58:59 -0000      1.2080
@@ -204,6 +204,11 @@
 
 * Lisp changes in Emacs 23.2
 
+** You can control which binding is preferentially shown in menus and
+docstrings by adding a `:advertised-binding' property to the corresponding
+command's symbol.  That property can hold a single binding or a list
+of bindings.
+
 ** New macro with-silent-modifications to tweak text properties without
 affecting the buffer's modification state.
 ** All the default-FOO variables that hold the default value of the FOO

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16122
retrieving revision 1.16123
diff -u -b -r1.16122 -r1.16123
--- lisp/ChangeLog      10 Sep 2009 18:19:03 -0000      1.16122
+++ lisp/ChangeLog      11 Sep 2009 00:59:01 -0000      1.16123
@@ -1,3 +1,24 @@
+2009-09-11  Stefan Monnier  <address@hidden>
+
+       * progmodes/xscheme.el (xscheme-evaluation-commands):
+       Put a :advertised-binding property rather than using
+       advertised-xscheme-send-previous-expression.
+       (advertised-xscheme-send-previous-expression): Declare obsolete.
+       * emulation/crisp.el (crisp-mode-map): Use `undo' rather than
+       `advertised-undo'.
+       (crisp-mode): Add corresponding bindings to
+       undo's :advertised-binding instead.
+       * dired.el (dired-mode-map): Put a :advertised-binding property rather
+       than using dired-advertised-find-file.
+       (dired-advertised-find-file):
+       * simple.el (advertised-undo):
+       * wid-edit.el (advertised-widget-backward): Declare obsolete.
+       (widget-keymap): Put a :advertised-binding property rather
+       than using advertised-widget-backward.
+       * bindings.el (ctl-x-map): Put a :advertised-binding property rather
+       than using advertised-undo.
+       * tutorial.el (tutorial--default-keys): Adjust accordingly.
+
 2009-09-10  Stefan Monnier  <address@hidden>
 
        * subr.el (define-key-rebound-commands): Mark obsolete.

Index: lisp/bindings.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/bindings.el,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -b -r1.222 -r1.223
--- lisp/bindings.el    26 Aug 2009 03:07:25 -0000      1.222
+++ lisp/bindings.el    11 Sep 2009 00:59:04 -0000      1.223
@@ -757,7 +757,8 @@
 (define-key ctl-x-map "\e\e" 'repeat-complex-command)
 ;; New binding analogous to M-:.
 (define-key ctl-x-map "\M-:" 'repeat-complex-command)
-(define-key ctl-x-map "u" 'advertised-undo)
+(define-key ctl-x-map "u" 'undo)
+(put 'undo :advertised-binding [?\C-x ?u])
 ;; Many people are used to typing C-/ on X terminals and getting C-_.
 (define-key global-map [?\C-/] 'undo)
 (define-key global-map "\C-_" 'undo)

Index: lisp/dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/dired.el,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -b -r1.425 -r1.426
--- lisp/dired.el       28 Aug 2009 16:29:29 -0000      1.425
+++ lisp/dired.el       11 Sep 2009 00:59:04 -0000      1.426
@@ -1292,7 +1292,8 @@
     (define-key map "d" 'dired-flag-file-deletion)
     (define-key map "e" 'dired-find-file)
     (define-key map "f" 'dired-find-file)
-    (define-key map "\C-m" 'dired-advertised-find-file)
+    (define-key map "\C-m" 'dired-find-file)
+    (put 'dired-find-file :advertised-binding "\C-m")
     (define-key map "g" 'revert-buffer)
     (define-key map "h" 'describe-mode)
     (define-key map "i" 'dired-maybe-insert-subdir)
@@ -1685,7 +1686,7 @@
 Type \\[dired-unmark] to Unmark a file or all files of a subdirectory.
 Type \\[dired-unmark-backward] to back up one line and unflag.
 Type \\[dired-do-flagged-delete] to eXecute the deletions requested.
-Type \\[dired-advertised-find-file] to Find the current line's file
+Type \\[dired-find-file] to Find the current line's file
   (or dired it in another buffer, if it is a directory).
 Type \\[dired-find-file-other-window] to find file or dired directory in Other 
window.
 Type \\[dired-maybe-insert-subdir] to Insert a subdirectory in this buffer.
@@ -1859,7 +1860,7 @@
        (error "File no longer exists; type `g' to update dired buffer")))))
 
 ;; Force C-m keybinding rather than `f' or `e' in the mode doc:
-(defalias 'dired-advertised-find-file 'dired-find-file)
+(define-obsolete-function-alias 'dired-advertised-find-file 'dired-find-file 
"23.2")
 (defun dired-find-file ()
   "In Dired, visit the file or directory named on this line."
   (interactive)

Index: lisp/simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.1009
retrieving revision 1.1010
diff -u -b -r1.1009 -r1.1010
--- lisp/simple.el      10 Sep 2009 00:54:36 -0000      1.1009
+++ lisp/simple.el      11 Sep 2009 00:59:04 -0000      1.1010
@@ -1610,7 +1610,7 @@
 
 
 ;Put this on C-x u, so we can force that rather than C-_ into startup msg
-(defalias 'advertised-undo 'undo)
+(define-obsolete-function-alias 'advertised-undo 'undo "23.2")
 
 (defconst undo-equiv-table (make-hash-table :test 'eq :weakness t)
   "Table mapping redo records to the corresponding undo one.

Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.538
retrieving revision 1.539
diff -u -b -r1.538 -r1.539
--- lisp/startup.el     10 Sep 2009 18:19:06 -0000      1.538
+++ lisp/startup.el     11 Sep 2009 00:59:04 -0000      1.539
@@ -1841,7 +1841,7 @@
                    'action (lambda (button) (help-with-tutorial))
                    'follow-link t)
     (insert (substitute-command-keys
-             "\t   \\[help-with-tutorial]\tUndo changes\t   
\\[advertised-undo]\n"))
+             "\t   \\[help-with-tutorial]\tUndo changes\t   \\[undo]\n"))
     (insert-button "Buy manuals"
                    'action (lambda (button) (view-order-manuals))
                    'follow-link t)

Index: lisp/tutorial.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tutorial.el,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- lisp/tutorial.el    21 Aug 2009 07:24:30 -0000      1.35
+++ lisp/tutorial.el    11 Sep 2009 00:59:04 -0000      1.36
@@ -264,8 +264,7 @@
              (yank-pop [?\M-y])
 
              ;; * UNDO
-             (advertised-undo [?\C-x ?u])
-             (advertised-undo [?\C-x ?u])
+             (undo [?\C-x ?u])
 
              ;; * FILES
              (find-file [?\C-x ?\C-f])

Index: lisp/wid-edit.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/wid-edit.el,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -b -r1.201 -r1.202
--- lisp/wid-edit.el    1 Sep 2009 07:24:19 -0000       1.201
+++ lisp/wid-edit.el    11 Sep 2009 00:59:04 -0000      1.202
@@ -857,14 +857,16 @@
 ;; This alias exists only so that one can choose in doc-strings (e.g.
 ;; Custom-mode) which key-binding of widget-keymap one wants to refer to.
 ;; http://lists.gnu.org/archive/html/emacs-devel/2008-11/msg00480.html
-(defalias 'advertised-widget-backward 'widget-backward)
+(define-obsolete-function-alias 'advertised-widget-backward
+  'widget-backward "23.2")
 
 ;;;###autoload
 (defvar widget-keymap
   (let ((map (make-sparse-keymap)))
     (define-key map "\t" 'widget-forward)
     (define-key map "\e\t" 'widget-backward)
-    (define-key map [(shift tab)] 'advertised-widget-backward)
+    (define-key map [(shift tab)] 'widget-backward)
+    (put 'widget-backward :advertised-binding [(shift tab)])
     (define-key map [backtab] 'widget-backward)
     (define-key map [down-mouse-2] 'widget-button-click)
     (define-key map [down-mouse-1] 'widget-button-click)

Index: lisp/emulation/crisp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emulation/crisp.el,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- lisp/emulation/crisp.el     5 Jan 2009 03:21:13 -0000       1.33
+++ lisp/emulation/crisp.el     11 Sep 2009 00:59:04 -0000      1.34
@@ -55,6 +55,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+
 ;; local variables
 
 (defgroup crisp nil
@@ -205,8 +207,8 @@
 (define-key crisp-mode-map [(meta m)]       'set-mark-command)
 (define-key crisp-mode-map [(meta n)]       'bury-buffer)
 (define-key crisp-mode-map [(meta p)]       'crisp-unbury-buffer)
-(define-key crisp-mode-map [(meta u)]       'advertised-undo)
-(define-key crisp-mode-map [(f14)]          'advertised-undo)
+(define-key crisp-mode-map [(meta u)]       'undo)
+(define-key crisp-mode-map [(f14)]          'undo)
 (define-key crisp-mode-map [(meta w)]       'save-buffer)
 (define-key crisp-mode-map [(meta x)]       'crisp-meta-x-wrapper)
 (define-key crisp-mode-map [(meta ?0)]      (lambda ()
@@ -357,6 +359,9 @@
                       (not crisp-mode)
                     (> (prefix-numeric-value arg) 0)))
   (when crisp-mode
+    ;; Make menu entries show M-u or f14 in preference to C-x u.
+    (put 'undo :advertised-binding
+         (list* [?\M-u] [f14] (get 'undo :advertised-binding)))
     ;; Force transient-mark-mode, so that the marking routines work as
     ;; expected.  If the user turns off transient mark mode, most
     ;; things will still work fine except the crisp-(copy|kill)

Index: lisp/progmodes/xscheme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/xscheme.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- lisp/progmodes/xscheme.el   9 Jan 2009 04:16:05 -0000       1.19
+++ lisp/progmodes/xscheme.el   11 Sep 2009 00:59:04 -0000      1.20
@@ -134,7 +134,7 @@
 
 (defcustom xscheme-startup-message
   "This is the Scheme process buffer.
-Type \\[advertised-xscheme-send-previous-expression] to evaluate the 
expression before point.
+Type \\[xscheme-send-previous-expression] to evaluate the expression before 
point.
 Type \\[xscheme-send-control-g-interrupt] to abort evaluation.
 Type \\[describe-mode] for more information.
 
@@ -158,7 +158,8 @@
 
 (defun xscheme-evaluation-commands (keymap)
   (define-key keymap "\e\C-x" 'xscheme-send-definition)
-  (define-key keymap "\C-x\C-e" 'advertised-xscheme-send-previous-expression)
+  (define-key keymap "\C-x\C-e" 'xscheme-send-previous-expression)
+  (put 'xscheme-send-previous-expression :advertised-binding "\C-x\C-e")
   (define-key keymap "\eo" 'xscheme-send-buffer)
   (define-key keymap "\ez" 'xscheme-send-definition)
   (define-key keymap "\e\C-m" 'xscheme-send-previous-expression)
@@ -317,7 +318,7 @@
   "Major mode for interacting with an inferior MIT Scheme process.
 Like  scheme-mode  except that:
 
-\\[advertised-xscheme-send-previous-expression] sends the expression before 
point to the Scheme process as input
+\\[xscheme-send-previous-expression] sends the expression before point to the 
Scheme process as input
 \\[xscheme-yank-pop] yanks an expression previously sent to Scheme
 \\[xscheme-yank-push] yanks an expression more recently sent to Scheme
 
@@ -475,8 +476,8 @@
            (scheme-interaction-mode-initialize)
            (scheme-interaction-mode t)))))
 
-(fset 'advertised-xscheme-send-previous-expression
-      'xscheme-send-previous-expression)
+(define-obsolete-function-alias 'advertised-xscheme-send-previous-expression
+  'xscheme-send-previous-expression "23.2")
 
 ;;;; Debugger Mode
 

Index: lisp/textmodes/picture.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/picture.el,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- lisp/textmodes/picture.el   22 Aug 2009 19:29:29 -0000      1.59
+++ lisp/textmodes/picture.el   11 Sep 2009 00:59:05 -0000      1.60
@@ -719,7 +719,7 @@
   Insert rectangle from named register:           
\\[picture-yank-rectangle-from-register]
   Draw a rectangular box around mark and point:   \\[picture-draw-rectangle]
   Copies a rectangle to a register:               
\\[copy-rectangle-to-register]
-  Undo effects of rectangle overlay commands:     \\[advertised-undo]
+  Undo effects of rectangle overlay commands:     \\[undo]
 
 You can return to the previous mode with \\[picture-mode-exit], which
 also strips trailing whitespace from every line.  Stripping is suppressed

Index: src/keymap.c
===================================================================
RCS file: /sources/emacs/emacs/src/keymap.c,v
retrieving revision 1.383
retrieving revision 1.384
diff -u -b -r1.383 -r1.384
--- src/keymap.c        10 Sep 2009 16:47:47 -0000      1.383
+++ src/keymap.c        11 Sep 2009 00:59:05 -0000      1.384
@@ -97,6 +97,7 @@
 Lisp_Object Vdefine_key_rebound_commands;
 
 Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap;
+Lisp_Object QCadvertised_binding;
 
 /* Alist of elements like (DEL . "\d").  */
 static Lisp_Object exclude_keys;
@@ -2818,6 +2819,7 @@
      because remapping is not done recursively by Fcommand_remapping: you
      can't remap and remapped command.  */
   int remapped = 0;
+  Lisp_Object tem;
 
   /* Refresh the C version of the modifier preference.  */
   where_is_preferred_modifier
@@ -2843,6 +2845,20 @@
       && !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
     RETURN_UNGCPRO (Qnil);
 
+  if (SYMBOLP (definition)
+      && !NILP (firstonly)
+      && !NILP (tem = Fget (definition, QCadvertised_binding)))
+    {
+      /* We have a list of advertized bindings.  */
+      while (CONSP (tem))
+       if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil), definition))
+         return XCAR (tem);
+       else
+         tem = XCDR (tem);
+      if (EQ (shadow_lookup (keymaps, tem, Qnil), definition))
+       return tem;
+    }
+
   sequences = Freverse (where_is_internal (definition, keymaps,
                                           !NILP (noindirect), nomenus));
 
@@ -4036,6 +4052,9 @@
   Qremap = intern ("remap");
   staticpro (&Qremap);
 
+  QCadvertised_binding = intern (":advertised-binding");
+  staticpro (&QCadvertised_binding);
+
   command_remapping_vector = Fmake_vector (make_number (2), Qremap);
   staticpro (&command_remapping_vector);
 




reply via email to

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