From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#24697: 25.1; find-lisp-object-file-name may return wrong locations Date: Sat, 17 Jun 2017 16:26:47 -0600 Message-ID: <87r2yiz1w8.fsf@lylat> References: <87mvi68tg4.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1497738434 20168 195.159.176.226 (17 Jun 2017 22:27:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2017 22:27:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: 24697@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 18 00:27:10 2017 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 1dMMBR-0004xe-Gm for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Jun 2017 00:27:09 +0200 Original-Received: from localhost ([::1]:36404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMMBW-0006b6-NM for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jun 2017 18:27:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMMBO-0006b0-El for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 18:27:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMMBK-0005IR-Fl for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 18:27:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMMBK-0005I5-Aj for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 18:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dMMBK-0004PI-1y for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 18:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Jun 2017 22:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24697 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24697-submit@debbugs.gnu.org id=B24697.149773842116933 (code B ref 24697); Sat, 17 Jun 2017 22:27:02 +0000 Original-Received: (at 24697) by debbugs.gnu.org; 17 Jun 2017 22:27:01 +0000 Original-Received: from localhost ([127.0.0.1]:53785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMMBI-0004P3-T5 for submit@debbugs.gnu.org; Sat, 17 Jun 2017 18:27:01 -0400 Original-Received: from mail-io0-f180.google.com ([209.85.223.180]:33912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMMBH-0004Oq-7a for 24697@debbugs.gnu.org; Sat, 17 Jun 2017 18:26:59 -0400 Original-Received: by mail-io0-f180.google.com with SMTP id i7so46814044ioe.1 for <24697@debbugs.gnu.org>; Sat, 17 Jun 2017 15:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=CXwdyjLxOF+QssxbsCzGARng3ufSxiwH9pCBp/BpknU=; b=lJZ/9M9kRBqdJdZtH6me+WG/l4Ip1vUZpFOP2HLhblDH/cqlp6FMrN4my3B30Pq+7Q khiyt96lgHSBvjEKJwiGqoNBvOO2BXAl46G/zI+HhzddyvzyQFqf1Hh3KkfHes+Xp9lK 4W8jEFDKnW2Pc19ras7T3sGPFAXr3nA6tCzYQXfHBZgPWPF/Plup+Z5SMBC31hFkWbwe /tfUztzVI6kfiT84WGtC9kLBAEbJe6x2ESpXZ7HH6aIKF0HAVn7BT9D2/I7pcSGJsZSp rChMTZTex1vNJI/4Sdo6D3TIJMady6Lg5CsyLQlJl90O9RDijYG5f8wzSTyWOzYpmGzt 3LgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=CXwdyjLxOF+QssxbsCzGARng3ufSxiwH9pCBp/BpknU=; b=kGY3Cd3m00xqeGXjVjXL1hB5Hcv4EuOjBcJ5Kz9cLVTY3CdJFN6NgDlotrZqIy4icb W9l/cjbAy9oNYHiA/WqHp0HwlyOq6tvHUyfcRpb2UQrMAMZWtEZllCk6QcxFKeQHLL/u p8QoBvVZJnfwP+eRAHNkFGcHCWo1FYy0zWSElKG+zrYGcg2MKm5YAJEWx7Qj02t/UQem MZV9l+diM45/a/p5bwGZOQB7dXg1cVzgkrdPFmmCWUDn7kJoLT/RxV1W71zMdFvCXdx7 62uhq140biYqjYltFYRFCeQJLqW2RCJBADejIY4aISHGQBQfy91K9MSTVDf7UHP6FX8x alcg== X-Gm-Message-State: AKS2vOzAyD3UGLD8VgO1+KS5beSRO80CULf6CZ/0yZL1sbkE932lNybN xW7ZwCqvZePmhhDW X-Received: by 10.107.201.213 with SMTP id z204mr15287522iof.160.1497738413409; Sat, 17 Jun 2017 15:26:53 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id v10sm3356343iod.36.2017.06.17.15.26.51 for <24697@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Jun 2017 15:26:51 -0700 (PDT) In-Reply-To: <87mvi68tg4.fsf@gmail.com> (Alex's message of "Fri, 14 Oct 2016 16:19:23 -0600") 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:133713 Archived-At: --=-=-= Content-Type: text/plain Alex writes: > #+BEGIN_SRC elisp > (defface tab-width > '((t :foreground "red")) > "A face with the same name as a variable.") > > > (find-lisp-object-file-name 'tab-width 'defface) > #+END_SRC > > > The above results in the symbol 'C-source'. The result should be nil as > the 'tab-width' face was evaluated in *scratch*. > > Putting the above definition into an actual file and using `load-file' > does return the proper source location. > > #+BEGIN_SRC elisp > (find-lisp-object-file-name 'mapatoms 1) > #+END_SRC > > > This should return 'C-source' but instead it returns nil. > > #+BEGIN_SRC elisp > (find-lisp-object-file-name 'tab-width 1) > #+END_SRC > > This should return nil but instead it returns 'C-source'. The first and last of these are fixed by the following diff. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=find-lisp-object.diff diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 2c635ffa50..bcf33131fa 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -319,6 +319,7 @@ find-lisp-object-file-name (help-C-file-name type 'subr) 'C-source)) ((and (not file-name) (symbolp object) + (eq type 'defvar) (integerp (get object 'variable-documentation))) ;; A variable defined in C. The form is from `describe-variable'. (if (get-buffer " *DOC*") --=-=-= Content-Type: text/plain The second is a bit odder. For some reason, find-lisp-object-file-name searches for an internal function definition using TYPE instead of OBJECT. I would have expected it to use OBJECT like the rest of the tests do. I see no reason for the current behaviour. Either the documentation should be changed to clearly indicate the current behaviour, or the function should be changed so that OBJECTs for which (subrp (symbol-function OBJECT)) returns t should return 'C-source'. --=-=-=--