diff options
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 25 |
2 files changed, 19 insertions, 10 deletions
| @@ -56,6 +56,10 @@ affected by this, as SGI stopped supporting IRIX in December 2013. | |||
| 56 | 56 | ||
| 57 | * Changes in Emacs 25.2 | 57 | * Changes in Emacs 25.2 |
| 58 | 58 | ||
| 59 | --- | ||
| 60 | ** `find-library' now takes a prefix argument to pop to a different | ||
| 61 | window. | ||
| 62 | |||
| 59 | ** `find-library', `help-function-def' and `help-variable-def' now run | 63 | ** `find-library', `help-function-def' and `help-variable-def' now run |
| 60 | `find-function-after-hook'. | 64 | `find-function-after-hook'. |
| 61 | 65 | ||
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index b04a9d2dea5..3bbf8091a9e 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -255,9 +255,12 @@ TYPE should be nil to find a function, or `defvar' to find a variable." | |||
| 255 | (cons (current-buffer) (match-beginning 0)))) | 255 | (cons (current-buffer) (match-beginning 0)))) |
| 256 | 256 | ||
| 257 | ;;;###autoload | 257 | ;;;###autoload |
| 258 | (defun find-library (library) | 258 | (defun find-library (library &optional other-window) |
| 259 | "Find the Emacs Lisp source of LIBRARY. | 259 | "Find the Emacs Lisp source of LIBRARY. |
| 260 | LIBRARY should be a string (the name of the library)." | 260 | LIBRARY should be a string (the name of the library). If the |
| 261 | optional OTHER-WINDOW argument (i.e., the command argument) is | ||
| 262 | specified, pop to a different window before displaying the | ||
| 263 | buffer." | ||
| 261 | (interactive | 264 | (interactive |
| 262 | (let* ((dirs (or find-function-source-path load-path)) | 265 | (let* ((dirs (or find-function-source-path load-path)) |
| 263 | (suffixes (find-library-suffixes)) | 266 | (suffixes (find-library-suffixes)) |
| @@ -279,15 +282,17 @@ LIBRARY should be a string (the name of the library)." | |||
| 279 | (when (and def (not (test-completion def table))) | 282 | (when (and def (not (test-completion def table))) |
| 280 | (setq def nil)) | 283 | (setq def nil)) |
| 281 | (list | 284 | (list |
| 282 | (completing-read (if def (format "Library name (default %s): " def) | 285 | (completing-read (if def |
| 286 | (format "Library name (default %s): " def) | ||
| 283 | "Library name: ") | 287 | "Library name: ") |
| 284 | table nil nil nil nil def)))) | 288 | table nil nil nil nil def) |
| 285 | (let ((buf (find-file-noselect (find-library-name library)))) | 289 | current-prefix-arg))) |
| 286 | (condition-case nil | 290 | (prog1 |
| 287 | (prog1 | 291 | (funcall (if other-window |
| 288 | (switch-to-buffer buf) | 292 | 'pop-to-buffer |
| 289 | (run-hooks 'find-function-after-hook)) | 293 | 'pop-to-buffer-same-window) |
| 290 | (error (pop-to-buffer buf))))) | 294 | (find-file-noselect (find-library-name library))) |
| 295 | (run-hooks 'find-function-after-hook))) | ||
| 291 | 296 | ||
| 292 | ;;;###autoload | 297 | ;;;###autoload |
| 293 | (defun find-function-search-for-symbol (symbol type library) | 298 | (defun find-function-search-for-symbol (symbol type library) |