Mercurial > emacs
comparison lisp/emacs-lisp/find-func.el @ 22340:65cdb6a99775
(find-function-noselect): Don't call
format twice with the error message. Quote the function name
before splicing into regexp.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 03 Jun 1998 14:39:19 +0000 |
parents | 92d6cd3eebfa |
children | cd99ca6a8f1f |
comparison
equal
deleted
inserted
replaced
22339:69de59462e22 | 22340:65cdb6a99775 |
---|---|
113 (setq library | 113 (setq library |
114 (cond ((eq (car-safe def) 'autoload) | 114 (cond ((eq (car-safe def) 'autoload) |
115 (nth 1 def)) | 115 (nth 1 def)) |
116 ((describe-function-find-file function)))) | 116 ((describe-function-find-file function)))) |
117 (if (null library) | 117 (if (null library) |
118 (error (format "`%s' is not in `load-history'" function))) | 118 (error "`%s' is not in `load-history'" function)) |
119 (if (string-match "\\(\\.elc?\\'\\)" library) | 119 (if (string-match "\\(\\.elc?\\'\\)" library) |
120 (setq library (substring library 0 (match-beginning 1)))) | 120 (setq library (substring library 0 (match-beginning 1)))) |
121 (let* ((path (or path find-function-source-path)) | 121 (let* ((path (or path find-function-source-path)) |
122 (compression (or (rassq 'jka-compr-handler file-name-handler-alist) | 122 (compression (or (rassq 'jka-compr-handler file-name-handler-alist) |
123 (member 'crypt-find-file-hook find-file-hooks))) | 123 (member 'crypt-find-file-hook find-file-hooks))) |
133 (error "The library \"%s\" is not in the path." library)) | 133 (error "The library \"%s\" is not in the path." library)) |
134 (save-excursion | 134 (save-excursion |
135 (set-buffer (find-file-noselect filename)) | 135 (set-buffer (find-file-noselect filename)) |
136 (save-match-data | 136 (save-match-data |
137 (let (;; avoid defconst, defgroup, defvar (any others?) | 137 (let (;; avoid defconst, defgroup, defvar (any others?) |
138 (regexp (format "^\\s-*(def[^cgv\W]\\w+\\s-+%s\\s-" function)) | 138 (regexp (format "^\\s-*(def[^cgv\W]\\w+\\s-+%s\\s-" |
139 (regexp-quote (symbol-name function)))) | |
139 (syntable (syntax-table))) | 140 (syntable (syntax-table))) |
140 (set-syntax-table emacs-lisp-mode-syntax-table) | 141 (set-syntax-table emacs-lisp-mode-syntax-table) |
141 (goto-char (point-min)) | 142 (goto-char (point-min)) |
142 (if (prog1 | 143 (if (prog1 |
143 (re-search-forward regexp nil t) | 144 (re-search-forward regexp nil t) |