comparison lisp/emacs-lisp/find-func.el @ 22867:7e35e50acaa4

(find-function-search-for-symbol): Ignore directories when looking for a library file.
author Richard M. Stallman <rms@gnu.org>
date Sat, 01 Aug 1998 19:15:12 +0000
parents 2c2eb47ec8e3
children 043247d0ced9
comparison
equal deleted inserted replaced
22866:011361a15bac 22867:7e35e50acaa4
26 26
27 ;;; Commentary: 27 ;;; Commentary:
28 ;; 28 ;;
29 ;; The funniest thing about this is that I can't imagine why a package 29 ;; The funniest thing about this is that I can't imagine why a package
30 ;; so obviously useful as this hasn't been written before!! 30 ;; so obviously useful as this hasn't been written before!!
31 ;;
32 ;; Put this file in your `load-path', byte-compile it and add the
33 ;; following code in your init file:
34 ;;
35 ;; ;;; find-func 31 ;; ;;; find-func
36 ;; (find-function-setup-keys) 32 ;; (find-function-setup-keys)
37 ;; 33 ;;
38 ;; or just: 34 ;; or just:
39 ;; 35 ;;
113 (if (null library) 109 (if (null library)
114 (error "Don't know where `%s' is defined" symbol)) 110 (error "Don't know where `%s' is defined" symbol))
115 (if (string-match "\\.el\\(c\\)\\'" library) 111 (if (string-match "\\.el\\(c\\)\\'" library)
116 (setq library (substring library 0 (match-beginning 1)))) 112 (setq library (substring library 0 (match-beginning 1))))
117 (let* ((path find-function-source-path) 113 (let* ((path find-function-source-path)
118 (filename (if (file-exists-p library) 114 (filename (if (and (file-exists-p library)
115 (not (file-directory-p library)))
119 library 116 library
120 ;; use `file-name-sans-extension' here? (if it gets fixed) 117 ;; use `file-name-sans-extension' here? (if it gets fixed)
121 (if (string-match "\\(\\.el\\)\\'" library) 118 (if (string-match "\\(\\.el\\)\\'" library)
122 (setq library (substring library 0 119 (setq library (substring library 0
123 (match-beginning 1)))) 120 (match-beginning 1))))