unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 17250@debbugs.gnu.org
Subject: bug#17250: 24.3; find-variable gives search-failed error message
Date: Fri, 27 Apr 2018 22:27:25 -0400	[thread overview]
Message-ID: <8736zgqd4i.fsf@gmail.com> (raw)
In-Reply-To: <87zi21e8yo.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Wed, 18 Apr 2018 00:58:39 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> But there are several places that use this function without checking the
> return value.  Are they relying on this function to bug out with a
> cryptic error, or are they all confident that the file name can be
> found?
>
> So I haven't applied it yet.  Perhaps somebody else will weigh in...

I think it's okay.  Here's my analysis of the call-sites found by M-x
rgrep:

./help-fns.el:163:;; (defun help-C-file-name (subr-or-var kind)
./help-fns.el:170:(defun help-C-file-name (subr-or-var kind)
./help-fns.el:319:	  (help-C-file-name type 'subr)
./help-fns.el:325:	  (help-C-file-name object 'var)

These 2 are in the return value position of
`find-lisp-object-file-name', whose docstring says "If no suitable file
is found, return nil".

./emacs-lisp/find-func.el:436:            (help-C-file-name def 'subr))

This one is only called if `def' satisfies `subrp', so I think failing
to find it can't happen anyway.  

./emacs-lisp/find-func.el:555:                       (help-C-file-name variable 'var))))

This one is in find-variable-noselect.  Before your change, it would
throw (search-failed "\037Vfoo\n"), with your change it throws (error
"Don’t know where ‘foo’ is defined") which seems better.

./progmodes/elisp-mode.el:693:              (push (elisp--xref-make-xref nil symbol (help-C-file-name (symbol-function symbol) 'subr)) xrefs))
./progmodes/elisp-mode.el:770:              ;; yet; help-C-file-name does that.  Second call will
./progmodes/elisp-mode.el:772:              (push (elisp--xref-make-xref 'defvar symbol (help-C-file-name symbol 'var)) xrefs))
./ldefs-boot.el:15592:(autoload 'help-C-file-name "help-fns" "\
./help-mode.el:203:                             (help-C-file-name (indirect-function fun) 'fun)))
./help-mode.el:243:		     (setq file (help-C-file-name var 'var)))

As far as I can tell, all of these calls only happen if the symbol has
already been found by `find-lisp-object-file-name', so they won't
trigger the failure case.






  parent reply	other threads:[~2018-04-28  2:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12 12:38 bug#17250: 24.3; find-variable gives search-failed error message Johan Claesson
2018-04-17 22:58 ` Lars Ingebrigtsen
2018-04-18  6:23   ` Eli Zaretskii
2018-04-28  2:27   ` Noam Postavsky [this message]
2019-06-26 14:06     ` Lars Ingebrigtsen

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=8736zgqd4i.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=17250@debbugs.gnu.org \
    --cc=larsi@gnus.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).