From 961c963df34e7cc193774b2c7d1956df129db8c3 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Wed, 3 Jun 1998 14:39:19 +0000 Subject: [PATCH] (find-function-noselect): Don't call format twice with the error message. Quote the function name before splicing into regexp. --- lisp/emacs-lisp/find-func.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 31ed83d331d..22b96ac6c51 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -115,7 +115,7 @@ defined is searched in PATH instead of `load-path' (see (nth 1 def)) ((describe-function-find-file function)))) (if (null library) - (error (format "`%s' is not in `load-history'" function))) + (error "`%s' is not in `load-history'" function)) (if (string-match "\\(\\.elc?\\'\\)" library) (setq library (substring library 0 (match-beginning 1)))) (let* ((path (or path find-function-source-path)) @@ -135,7 +135,8 @@ defined is searched in PATH instead of `load-path' (see (set-buffer (find-file-noselect filename)) (save-match-data (let (;; avoid defconst, defgroup, defvar (any others?) - (regexp (format "^\\s-*(def[^cgv\W]\\w+\\s-+%s\\s-" function)) + (regexp (format "^\\s-*(def[^cgv\W]\\w+\\s-+%s\\s-" + (regexp-quote (symbol-name function)))) (syntable (syntax-table))) (set-syntax-table emacs-lisp-mode-syntax-table) (goto-char (point-min)) -- 2.39.2