# HG changeset patch # User Romain Francoise # Date 1130518548 0 # Node ID ecdadc99bf8c62878ab11c40110c69f0f38a27b1 # Parent fcde30dab36e701e60e4fa52ac5e93cd6f5ba87c * subr.el (locate-library): Move from help-fns.el. * help-fns.el (locate-library): Move to subr.el. diff -r fcde30dab36e -r ecdadc99bf8c lisp/ChangeLog --- a/lisp/ChangeLog Fri Oct 28 16:44:46 2005 +0000 +++ b/lisp/ChangeLog Fri Oct 28 16:55:48 2005 +0000 @@ -1,3 +1,8 @@ +2005-10-28 Romain Francoise + + * subr.el (locate-library): Move from help-fns.el. + * help-fns.el (locate-library): Move to subr.el. + 2005-10-28 Richard M. Stallman * net/tramp.el (tramp-completion-mode): defvar moved up. @@ -20,7 +25,7 @@ * textmodes/flyspell.el (flyspell-large-region): Pass -t if Tex file. (flyspell-external-point-words): Error if misspelled word is not found. Set flyspell-large-region-beg at end of word. - + 2005-10-28 Andreas Schwab * view.el (View-revert-buffer-scroll-page-forward): Use diff -r fcde30dab36e -r ecdadc99bf8c lisp/help-fns.el --- a/lisp/help-fns.el Fri Oct 28 16:44:46 2005 +0000 +++ b/lisp/help-fns.el Fri Oct 28 16:55:48 2005 +0000 @@ -100,34 +100,6 @@ (setq buffer-undo-list nil) (set-buffer-modified-p nil)))) -;;;###autoload -(defun locate-library (library &optional nosuffix path interactive-call) - "Show the precise file name of Emacs library LIBRARY. -This command searches the directories in `load-path' like `\\[load-library]' -to find the file that `\\[load-library] RET LIBRARY RET' would load. -Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes' -to the specified name LIBRARY. - -If the optional third arg PATH is specified, that list of directories -is used instead of `load-path'. - -When called from a program, the file name is normaly returned as a -string. When run interactively, the argument INTERACTIVE-CALL is t, -and the file name is displayed in the echo area." - (interactive (list (completing-read "Locate library: " - 'locate-file-completion - (cons load-path load-suffixes)) - nil nil - t)) - (let ((file (locate-file library - (or path load-path) - (append (unless nosuffix load-suffixes) '(""))))) - (if interactive-call - (if file - (message "Library is file %s" (abbreviate-file-name file)) - (message "No library %s in search path" library))) - file)) - ;; Functions diff -r fcde30dab36e -r ecdadc99bf8c lisp/subr.el --- a/lisp/subr.el Fri Oct 28 16:44:46 2005 +0000 +++ b/lisp/subr.el Fri Oct 28 16:55:48 2005 +0000 @@ -1309,6 +1309,34 @@ (setq files (cdr files))) file))) +;;;###autoload +(defun locate-library (library &optional nosuffix path interactive-call) + "Show the precise file name of Emacs library LIBRARY. +This command searches the directories in `load-path' like `\\[load-library]' +to find the file that `\\[load-library] RET LIBRARY RET' would load. +Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes' +to the specified name LIBRARY. + +If the optional third arg PATH is specified, that list of directories +is used instead of `load-path'. + +When called from a program, the file name is normaly returned as a +string. When run interactively, the argument INTERACTIVE-CALL is t, +and the file name is displayed in the echo area." + (interactive (list (completing-read "Locate library: " + 'locate-file-completion + (cons load-path load-suffixes)) + nil nil + t)) + (let ((file (locate-file library + (or path load-path) + (append (unless nosuffix load-suffixes) '(""))))) + (if interactive-call + (if file + (message "Library is file %s" (abbreviate-file-name file)) + (message "No library %s in search path" library))) + file)) + ;;;; Specifying things to do later.