all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21950: 25.1.50; find-lisp-object-file-name sometimes cannot find file-name
@ 2015-11-18 10:48 Tino Calancha
  2015-11-18 15:59 ` Stephen Leake
  2016-05-09  1:52 ` bug#21950: 25.1.50; Show the filename where an alias is defined Tino Calancha
  0 siblings, 2 replies; 8+ messages in thread
From: Tino Calancha @ 2015-11-18 10:48 UTC (permalink / raw)
  To: 21950

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]



* lisp/help-fns.el (find-lisp-object-file-name):
   Restrict second argument of symbol-file to just 'defvar 'defface 'defun

emacs -Q:
;; following returns nil (it should be the value of file)
(let ((alias 'd)
       (def   'dired)
       (file  (expand-file-name "test-alias-v25.1.50-tmp.el"
 			       user-emacs-directory)))
   (with-temp-file file
     (insert (format "(defalias '%s '%s)"
 		    (symbol-name alias)
 		    (symbol-name def))))
   (load-file file)
   (find-lisp-object-file-name alias def))

[-- Attachment #2: Type: text/plain, Size: 768 bytes --]

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 4e0bfee..af9b918 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -223,7 +223,10 @@ find-lisp-object-file-name
                          ;; FIXME: Why do we have this weird "If TYPE is the
                          ;; value returned by `symbol-function' for a function
                          ;; symbol" exception?
-			 object (or (if (symbolp type) type) 'defun)))))
+                       object (if (and (symbolp type)
+                                       (memq type (list 'defvar 'defface)))
+                                  type
+                                'defun)))))
     (cond
      (autoloaded
       ;; An autoloaded function: Locate the file since `symbol-function'

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-07 20:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-18 10:48 bug#21950: 25.1.50; find-lisp-object-file-name sometimes cannot find file-name Tino Calancha
2015-11-18 15:59 ` Stephen Leake
2015-11-19  0:27   ` Tino Calancha
2015-11-19 17:47     ` Stephen Leake
2015-11-20 10:20       ` Tino Calancha
2015-11-20 10:48         ` bug#21950: [SPAM UNSURE] " Stephen Leake
2016-05-09  1:52 ` bug#21950: 25.1.50; Show the filename where an alias is defined Tino Calancha
2016-06-07 20:46   ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.