comparison lisp/prim/help.el @ 177:6075d714658b r20-3b15

Import from CVS: tag r20-3b15
author cvs
date Mon, 13 Aug 2007 09:51:16 +0200
parents 8eaf7971accc
children 9ad43877534d
comparison
equal deleted inserted replaced
176:6866abce6aaf 177:6075d714658b
1172 (message "%s is on %s" definition (sorted-key-descriptions keys)) 1172 (message "%s is on %s" definition (sorted-key-descriptions keys))
1173 (message "%s is not on any keys" definition))) 1173 (message "%s is not on any keys" definition)))
1174 nil) 1174 nil)
1175 1175
1176 ;; Synched with Emacs 19.35 1176 ;; Synched with Emacs 19.35
1177 (defun locate-library (library &optional nosuffix path interactive-call) 1177 ;; Moved to packages.el
1178 "Show the precise file name of Emacs library LIBRARY. 1178 ;(defun locate-library (library &optional nosuffix path interactive-call)
1179 This command searches the directories in `load-path' like `M-x load-library' 1179 ; "Show the precise file name of Emacs library LIBRARY.
1180 to find the file that `M-x load-library RET LIBRARY RET' would load. 1180 ;This command searches the directories in `load-path' like `M-x load-library'
1181 Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el' 1181 ;to find the file that `M-x load-library RET LIBRARY RET' would load.
1182 to the specified name LIBRARY. 1182 ;Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el'
1183 1183 ;to the specified name LIBRARY.
1184 If the optional third arg PATH is specified, that list of directories 1184
1185 is used instead of `load-path'." 1185 ;If the optional third arg PATH is specified, that list of directories
1186 (interactive (list (read-string "Locate library: ") 1186 ;is used instead of `load-path'."
1187 nil nil 1187 ; (interactive (list (read-string "Locate library: ")
1188 t)) 1188 ; nil nil
1189 (let (result) 1189 ; t))
1190 (catch 'answer 1190 ; (let (result)
1191 (mapcar 1191 ; (catch 'answer
1192 (lambda (dir) 1192 ; (mapcar
1193 (mapcar 1193 ; (lambda (dir)
1194 (lambda (suf) 1194 ; (mapcar
1195 (let ((try (expand-file-name (concat library suf) dir))) 1195 ; (lambda (suf)
1196 (and (file-readable-p try) 1196 ; (let ((try (expand-file-name (concat library suf) dir)))
1197 (null (file-directory-p try)) 1197 ; (and (file-readable-p try)
1198 (progn 1198 ; (null (file-directory-p try))
1199 (setq result try) 1199 ; (progn
1200 (throw 'answer try))))) 1200 ; (setq result try)
1201 (if nosuffix 1201 ; (throw 'answer try)))))
1202 '("") 1202 ; (if nosuffix
1203 (let ((basic '(".elc" ".el" "")) 1203 ; '("")
1204 (compressed '(".Z" ".gz" ""))) 1204 ; (let ((basic '(".elc" ".el" ""))
1205 ;; If autocompression mode is on, 1205 ; (compressed '(".Z" ".gz" "")))
1206 ;; consider all combinations of library suffixes 1206 ; ;; If autocompression mode is on,
1207 ;; and compression suffixes. 1207 ; ;; consider all combinations of library suffixes
1208 (if (rassq 'jka-compr-handler file-name-handler-alist) 1208 ; ;; and compression suffixes.
1209 (apply 'nconc 1209 ; (if (rassq 'jka-compr-handler file-name-handler-alist)
1210 (mapcar (lambda (compelt) 1210 ; (apply 'nconc
1211 (mapcar (lambda (baselt) 1211 ; (mapcar (lambda (compelt)
1212 (concat baselt compelt)) 1212 ; (mapcar (lambda (baselt)
1213 basic)) 1213 ; (concat baselt compelt))
1214 compressed)) 1214 ; basic))
1215 basic))))) 1215 ; compressed))
1216 (or path load-path))) 1216 ; basic)))))
1217 (and interactive-call 1217 ; (or path load-path)))
1218 (if result 1218 ; (and interactive-call
1219 (message "Library is file %s" result) 1219 ; (if result
1220 (message "No library %s in search path" library))) 1220 ; (message "Library is file %s" result)
1221 result)) 1221 ; (message "No library %s in search path" library)))
1222 ; result))
1222 1223
1223 ;; Functions ported from C into Lisp in XEmacs 1224 ;; Functions ported from C into Lisp in XEmacs
1224 1225
1225 (defun describe-syntax () 1226 (defun describe-syntax ()
1226 "Describe the syntax specifications in the syntax table. 1227 "Describe the syntax specifications in the syntax table.