>From ec6d7c242f7d19bfcaa760e9a991e83244f44974 Mon Sep 17 00:00:00 2001 From: Charles A. Roelli Date: Sun, 4 Jun 2017 11:56:58 +0200 Subject: [PATCH 2/2] Make 'find-function-setup-keys' bindings default * etc/NEWS: Mention the default bindings that were formerly made by 'find-function-setup-keys'. Remove a previous entry that has been superceded by the recent addition of 'find-library-other-window'. * doc/emacs/help.texi (Misc Help): Document the new bindings. * lisp/bindings.el: Add bindings formerly made by 'find-function-setup-keys': 'C-x F', 'C-x K', 'C-x V' and 'C-x 4'/'C-x 5' variants. * lisp/find-func.el (find-function-setup-keys): Alias to #'ignore, and make it obsolete. --- doc/emacs/help.texi | 49 ++++++++++++++++++++++++++++++++++++++++++ etc/NEWS | 17 ++++++------- lisp/bindings.el | 11 +++++++++ lisp/emacs-lisp/find-func.el | 14 ++--------- 4 files changed, 71 insertions(+), 20 deletions(-) diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 548ca6a..74a06f5 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -588,6 +588,55 @@ Misc Help which marks a defun. However, @kbd{@key{ESC} @key{F1}} and @kbd{@key{ESC} ?} work fine.) +@kindex C-x F +@findex find-function-or-library +@kindex C-x 4 F +@findex find-function-or-library-other-window +@kindex C-x 5 F +@findex find-function-or-library-other-frame +@kindex C-x K +@findex find-function-on-key +@kindex C-x 4 K +@findex find-function-on-key-other-window +@kindex C-x 5 K +@findex find-function-on-key-other-frame +@kindex C-x V +@findex find-variable +@kindex C-x 4 V +@findex find-variable-other-window +@kindex C-x 5 V +@findex find-variable-other-frame + When reading or writing Emacs Lisp code, it is often helpful to +visit the source of other Emacs Lisp functions, libraries and +variables. The following commands are helpful for doing that: + +@table @kbd +@item C-x F +Find a function or library, with the function or library closest to +point as a suggestion (@code{find-function-or-library}). +@item C-x 4 F +Idem., in another window +(@code{find-function-or-library-other-window}). +@item C-x 5 F +Idem., in another frame (@code{find-function-or-library-other-frame}). +@item C-x K +Find a function on a given key, which you type interactively +(@code{find-function-on-key}). +@item C-x 4 K +Idem., in another window +(@code{find-function-on-key-other-window}). +@item C-x 5 K +Idem., in another frame (@code{find-function-on-key-other-frame}). +@item C-x V +Find a variable, with the variable closest to point as a suggestion +(@code{find-variable}). +@item C-x 4 V +Idem., in another window +(@code{find-variable-other-window}). +@item C-x 5 V +Idem., in another frame (@code{find-variable-other-frame}). +@end table + @node Help Files @section Help Files diff --git a/etc/NEWS b/etc/NEWS index 6ed668c..2b31cc0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -211,10 +211,6 @@ face instead of the 'escape-glyph' face. part of minibuffers. --- -** 'find-library' now takes a prefix argument to pop to a different -window. - ---- ** 'process-attributes' on Darwin systems now returns more information. +++ @@ -370,11 +366,14 @@ display of raw bytes from octal to hex. ** You can now provide explicit field numbers in format specifiers. For example, '(format "%2$s %1$s" "X" "Y")' produces "Y X". -** 'find-function-setup-keys' now binds 'C-x F', 'C-x 4 F' and 'C-x 5 -F' to the new command 'find-function-or-library' and its -other-window/-frame counterparts. The new commands find the Emacs -Lisp source code of a function or library, defaulting to the function -or library closest to point. +** 'C-x F', 'C-x 4 F' and 'C-x 5 F' are bound to the new command +'find-function-or-library' and its other-window/-frame counterparts. +The new commands find the Emacs Lisp source code of a function or +library, defaulting to the function or library closest to point. 'C-x +K' and 'C-x V' are bound to 'find-function-on-key' and +'find-variable', with equivalent other-window/-frame commands in the +'C-x 4' and 'C-x 5' keymaps. These were formerly bound by the +function 'find-function-setup-keys', which is now obsolete. * Editing Changes in Emacs 26.1 diff --git a/lisp/bindings.el b/lisp/bindings.el index 0994b71..4807b57 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1325,6 +1325,17 @@ esc-map (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) (define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window) +;; from emacs-lisp/find-func.el +(define-key ctl-x-map "F" 'find-function-or-library) +(define-key ctl-x-4-map "F" 'find-function-or-library-other-window) +(define-key ctl-x-5-map "F" 'find-function-or-library-other-frame) +(define-key ctl-x-map "K" 'find-function-on-key) +(define-key ctl-x-4-map "K" 'find-function-on-key-other-window) +(define-key ctl-x-5-map "K" 'find-function-on-key-other-frame) +(define-key ctl-x-map "V" 'find-variable) +(define-key ctl-x-4-map "V" 'find-variable-other-window) +(define-key ctl-x-5-map "V" 'find-variable-other-frame) + ;; Signal handlers (define-key special-event-map [sigusr1] 'ignore) (define-key special-event-map [sigusr2] 'ignore) diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 9943598..c08df49 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -773,17 +773,9 @@ find-variable-at-point (find-variable-other-window symb)))) ;;;###autoload -(defun find-function-setup-keys () - "Define some key bindings for the find-function family of functions." - (define-key ctl-x-map "F" 'find-function-or-library) - (define-key ctl-x-4-map "F" 'find-function-or-library-other-window) - (define-key ctl-x-5-map "F" 'find-function-or-library-other-frame) - (define-key ctl-x-map "K" 'find-function-on-key) - (define-key ctl-x-4-map "K" 'find-function-on-key-other-window) - (define-key ctl-x-5-map "K" 'find-function-on-key-other-frame) - (define-key ctl-x-map "V" 'find-variable) - (define-key ctl-x-4-map "V" 'find-variable-other-window) - (define-key ctl-x-5-map "V" 'find-variable-other-frame)) +(defalias 'find-function-setup-keys 'ignore) +(make-obsolete 'find-function-setup-keys + "commands from `find-func' are bound by default." "26.1") (provide 'find-func) -- 1.7.4.4