unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <f92capac@gmail.com>
To: 21950@debbugs.gnu.org
Subject: bug#21950: 25.1.50; find-lisp-object-file-name sometimes cannot find file-name
Date: Wed, 18 Nov 2015 19:48:59 +0900 (JST)	[thread overview]
Message-ID: <alpine.LRH.2.20.1511181937380.27287@calancha-ilc.kek.jp> (raw)

[-- 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'

             reply	other threads:[~2015-11-18 10:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 10:48 Tino Calancha [this message]
2015-11-18 15:59 ` bug#21950: 25.1.50; find-lisp-object-file-name sometimes cannot find file-name 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1511181937380.27287@calancha-ilc.kek.jp \
    --to=f92capac@gmail.com \
    --cc=21950@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).