From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#17250: 24.3; find-variable gives search-failed error message Date: Fri, 27 Apr 2018 22:27:25 -0400 Message-ID: <8736zgqd4i.fsf@gmail.com> References: <87y4zaiuz7.fsf@bredband.net> <87zi21e8yo.fsf@mouse.gnus.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1524882369 15187 195.159.176.226 (28 Apr 2018 02:26:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 28 Apr 2018 02:26:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 17250@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 28 04:26:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCFYq-0003r0-Ii for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Apr 2018 04:26:04 +0200 Original-Received: from localhost ([::1]:50642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fCFax-0004Um-H8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Apr 2018 22:28:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fCFao-0004Ug-7D for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 22:28:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fCFak-0002GH-8X for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 22:28:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fCFak-0002FZ-3h for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 22:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fCFaj-0004LA-My for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 22:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Apr 2018 02:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17250 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch Original-Received: via spool by 17250-submit@debbugs.gnu.org id=B17250.152488246216660 (code B ref 17250); Sat, 28 Apr 2018 02:28:01 +0000 Original-Received: (at 17250) by debbugs.gnu.org; 28 Apr 2018 02:27:42 +0000 Original-Received: from localhost ([127.0.0.1]:41491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCFaM-0004Kb-LY for submit@debbugs.gnu.org; Fri, 27 Apr 2018 22:27:42 -0400 Original-Received: from mail-it0-f49.google.com ([209.85.214.49]:36434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fCFaI-0004KK-1e for 17250@debbugs.gnu.org; Fri, 27 Apr 2018 22:27:38 -0400 Original-Received: by mail-it0-f49.google.com with SMTP id e20-v6so4022262itc.1 for <17250@debbugs.gnu.org>; Fri, 27 Apr 2018 19:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=UDHsArYGfxeyyiG1Za+i5EHvLAlBlteg5TCKSpjNvNc=; b=DAwCYwtZKEnQGPoPpPXlOela3t82Uw4lN+feyJb5lJNi1zMDB9FhrsO5WAPi9kmMsa BGs/XQiM/fNprcjlZoMri4Tbab/xEg/H2grWfQXsFKs871kupw1uU0OYLadoqYonPMbY YwqwX3kbG04w+3Fvwag/oyTpw4xh6IAmrKaaQ0JRFf4WLqNJ6tyoHHU8QEsA0ybXixmT 15OaRmHdvMRM/g0czfhQ/jleLLaxapL+G+kzXNNhkNjT+Cp1B7Osu2TB8V9VKsbxn4Yt 6YznzV3/YFU2L3rhElI5yAW3ddx5wh/LRxoR9omzKLVkpGYpLe5AhNwS/FuWSGnv3MLS Rp0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=UDHsArYGfxeyyiG1Za+i5EHvLAlBlteg5TCKSpjNvNc=; b=Hpy7tbsKGR9K5fa+xPAih2DcS+FZgJLd7/5PpJvBsrdVVunGyI+icKveKVfpo1puWl qkrd8jEkuv1NLSbAzMPuizc4WtcczwqYku+3rUm16QxNFSPmkU3LSKdGf8Ebh2i4AERv Pj3JMxpxEkMQuMR5zFGvbx1ryWLuV+v0HrLLE+C9aBmhhwxLhY9g5OA0+Q8sAjDc/mj/ uBeVFy58NJON05bOVRtvvUNoqFckuG8lsZM4V0FRDQMbGyJkSGU2E33HZW5deXRx6mMc wi+VbK50WM1bzI4yoUJcR/2CC0fw+kIfrrtbEmOSmwxPsJZM/sjSc6t+WGtAgB/kAZF1 UfaA== X-Gm-Message-State: ALQs6tBVqUhc0vbVTdNr6/3bdIYe2pJRp+IyMgLbXgkfA2rBBeOfhHz9 psuuwzy0aX6tBFp54yiMisYZIw== X-Google-Smtp-Source: AB8JxZpFkG+uz1q/+9i4/qXqppz/9Xx8X5rs6Kp8kWiewPyvFZm+fucUM0/54zuz1VQ0U9OesnM0MA== X-Received: by 2002:a24:4f14:: with SMTP id c20-v6mr4069881itb.59.1524882448446; Fri, 27 Apr 2018 19:27:28 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id e19-v6sm1292816iob.31.2018.04.27.19.27.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Apr 2018 19:27:27 -0700 (PDT) In-Reply-To: <87zi21e8yo.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Wed, 18 Apr 2018 00:58:39 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:145794 Archived-At: Lars Ingebrigtsen 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.=20=20 ./emacs-lisp/find-func.el:555: (help-C-file-name vari= able '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=E2=80=99t know where =E2=80=98foo=E2=80=99 is defined") which seems be= tter. ./progmodes/elisp-mode.el:693: (push (elisp--xref-make-xref ni= l symbol (help-C-file-name (symbol-function symbol) 'subr)) xrefs)) ./progmodes/elisp-mode.el:770: ;; yet; help-C-file-name does t= hat. Second call will ./progmodes/elisp-mode.el:772: (push (elisp--xref-make-xref 'd= efvar 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.