GNU bug report logs - #24697
25.1; find-lisp-object-file-name may return wrong locations

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alex <agrambot@HIDDEN>; dated Fri, 14 Oct 2016 22:20:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 24697 <at> debbugs.gnu.org:


Received: (at 24697) by debbugs.gnu.org; 29 Sep 2017 00:10:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 28 20:10:37 2017
Received: from localhost ([127.0.0.1]:37293 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dxit3-0007WP-2Q
	for submit <at> debbugs.gnu.org; Thu, 28 Sep 2017 20:10:37 -0400
Received: from mail-wm0-f47.google.com ([74.125.82.47]:47127)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dxit1-0007Vx-7S
 for 24697 <at> debbugs.gnu.org; Thu, 28 Sep 2017 20:10:35 -0400
Received: by mail-wm0-f47.google.com with SMTP id t69so367005wmt.2
 for <24697 <at> debbugs.gnu.org>; Thu, 28 Sep 2017 17:10:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=bXdK2ryXZrBhxoLukjdlfLw/T8iPXRx7TygvvKc+vYI=;
 b=U7DJl2kXe5yzr1uuZdO5aT43GxlIs1PbKVmyQu5UcU8BNvRsSM/yrBJ7SFBVafRERr
 pfetfNiTN0+/asf0ydfAsFeqFVU1kNhfhv7Qx7fEOUn+AJccTd2iTglAZyoNHcp2nQZI
 0hNKBx8+JV05VXhlslD/kVU17wQbyOVqiLtI7eumjLb1ZsEV4QFBLeIRRMQ0v/anZuAm
 eXpF8zaX9u2APAqo9f3OAJwXfm/vR7YVt8AUbQNG7tiivLAuxHrvsHumH+xx7BKD1skl
 IhylBriMdAhxIwp3Kmzd7K6vD5GazyRP958RvfNXcGCVZ4ZeDEmtAiWKNg9N0PyEvKWF
 h8tQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=bXdK2ryXZrBhxoLukjdlfLw/T8iPXRx7TygvvKc+vYI=;
 b=sz9GarlKkIGnjbBt/iLzCwUaBbYvus9EeNpWNHSsrpPSRh6t7kPItn9I9kO6RzuMGQ
 Zxc5evUrL/+mJWyJpu0N6ns1jvLcEZO2IQge4RJSYmEIgnGg+AbKG/b1NGLcyxIXx71c
 OS7WZogwGVGHlTdAsWp5nmzbl6fp+WW/aucLurKqyIQSQS0iWu9rYtR+ryj5N6Z/zCLz
 w9uNNHS7F7t+Kqjfi4DUXhdC8Kh46/d6W0Scjm/asBr/Fb3g8iA/JHQzU/6wyHZDnx0o
 OoesjQ6q2I54tfFL6yISoDtvmQVpvP3KZ8vOr2Ior6VQSWbtzhGO8C2jd0pKHtWwexFg
 n09w==
X-Gm-Message-State: AHPjjUgjk9sSw7z3t0qefYrQPCNtXMwWC5fREvXI/0EfqA13EPyPCxin
 AVArkCpk8kwj+hjgM5e4PoEkDJcK3yQ=
X-Google-Smtp-Source: AOwi7QA5Ult3bwdUYITV7jVAJlrlLE8FRNKPW+Xf/RwXxEEY/XaO/gsmcT3ILPrRPEW9880pMWYbLQ==
X-Received: by 10.80.175.165 with SMTP id h34mr7700017edd.292.1506643829306;
 Thu, 28 Sep 2017 17:10:29 -0700 (PDT)
Received: from [192.168.0.97] (catv-80-98-57-21.catv.broadband.hu.
 [80.98.57.21])
 by smtp.googlemail.com with ESMTPSA id r30sm2353481edb.59.2017.09.28.17.10.26
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 28 Sep 2017 17:10:28 -0700 (PDT)
Subject: Re: bug#24697: 25.1; find-lisp-object-file-name may return wrong
 locations
To: Alex <agrambot@HIDDEN>
References: <87mvi68tg4.fsf@HIDDEN> <87r2yiz1w8.fsf@lylat>
 <5f2268ec-ae50-a75a-cc28-5e407b524974@HIDDEN> <87y3soel82.fsf@lylat>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <3eac4397-73f0-380b-1a28-5750ce555f2c@HIDDEN>
Date: Fri, 29 Sep 2017 00:26:22 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101
 Thunderbird/56.0
MIME-Version: 1.0
In-Reply-To: <87y3soel82.fsf@lylat>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 24697
Cc: 24697 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

On 6/19/17 5:59 AM, Alex wrote:

>> Thanks. Do you think you can write test cases for these problems? There are some
>> existing ones in test/lisp/help-fns-tests.el.
> 
> Sure, I've attached a patch below for the simple cases. As I couldn't
> find a satisfactory way to make a temporary face, I just made an
> uninterned symbol that find-lisp-object-file-name would treat as an
> internal variable.

Thanks.

Now, the patch looks correct to me, but did you encounter a practical 
problem that prompted you to look into this discrepancy? I'd like to 
know what it was.

>> With a test case, you might also find it easier to make a choice regarding this
>> problem.
> 
> I'm not sure. I still don't understand why the design decision was made.
> I suppose one benefit is that one can search explicitly for internal
> functions rather than lisp functions, but the function could have just
> accepted 'subr instead of 'defun to do that.

There is a FIXME comment with the same question there. So you are not 
alone in wondering.

> Perhaps the current use of searching with TYPE should be left in for
> backwards compatibility (a Github search shows at least 2 instances of
> 3rd-party code that makes use of that behaviour).
> 
> For instance, here's how you find mapatoms' file:
> 
>    (find-lisp-object-file-name 'mapatoms (symbol-function 'mapatoms))
> 
> You should just be able to do the following:
> 
>    (find-lisp-object-file-name 'mapatoms 'defun)
> 
> Or without searching for lisp functions named mapatoms first:
> 
>    (find-lisp-object-file-name 'mapatoms 'subr)
> 
> What do you think?

Maybe you're right, but backward compatibility seems important here as 
well. You're talking about a separate change, right? We could consider 
it for Emacs 27.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#24697; Package emacs. Full text available.

Message received at 24697 <at> debbugs.gnu.org:


Received: (at 24697) by debbugs.gnu.org; 19 Jun 2017 03:00:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 18 23:00:14 2017
Received: from localhost ([127.0.0.1]:55489 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMmvF-0000mN-Ty
	for submit <at> debbugs.gnu.org; Sun, 18 Jun 2017 23:00:14 -0400
Received: from mail-it0-f46.google.com ([209.85.214.46]:37305)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1dMmvE-0000mA-Eo
 for 24697 <at> debbugs.gnu.org; Sun, 18 Jun 2017 23:00:13 -0400
Received: by mail-it0-f46.google.com with SMTP id m47so49892693iti.0
 for <24697 <at> debbugs.gnu.org>; Sun, 18 Jun 2017 20:00:12 -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;
 bh=7GQmB4pXwHKMpqrbsW3Uiecf3I+RlU5ifOsOzLcXe+8=;
 b=MPnmTUROFcj9tgpRHGcR/Unk6VtJAv8+wINToxHkzayC1grifnuZWhFGJ+D6DMdy5F
 AKK5PjW7LN4M5b12S/1yg8FfCqRbTn6RI0s1da+Z2GiTpeM0LSVT4yvzIHF0XC+OpExO
 DkxUrn8ztkczHA58KY6i8DBi8mfyLdIcBXaIkYywJknyXSHIMNYBnIssNWqNqv3AoJZq
 MwTutfn/55R1RgG3JbbytJY0bYgrsaIAF8uFLnXprOJ7hNzMnp4CZWFL0htL4Bd0pqks
 vtrrW0DihsfBCIyjDGIfdBYyGXq8yEkwLsaxKJ/s2XOjnbmztkICz4B7FMSnr6Xr1VSP
 dz8A==
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;
 bh=7GQmB4pXwHKMpqrbsW3Uiecf3I+RlU5ifOsOzLcXe+8=;
 b=cnbSIP9XVn6LWNRajS/TZ1W7hYR5kG0YVcdzBqBsm6u7tRpHARWB4Pqd4Ex6tG6nHG
 iUsRFw8WJU7E/vFKSXGWpDfrXsfco71Q/6jWFhGeBzSnJJVzlY45NAVLbbbIWCnf2ST4
 x8am9HXniUgPhfSU8a5GnB9drnzC/W63Bat03pcy4UW29tKU6wcFtVKrw+ORUnczQOUF
 CznlEQCh3XRJTEcfddipUcz1lvpvDZ7spjK/Cvy4oRPAb4LxSWhNYsH6Q5eLXG/F6KvB
 6HTjv9EKpa3gHh0BXO1fzsCRvbQtzolh9mQOi7MvBYoJMnnklSg1QD+/gyiZ1Cn5CLwl
 wIYg==
X-Gm-Message-State: AKS2vOx2pblsmXSK5jT1LMIau2Kue4MIDZsg6WNK0rpJiMzoI10+ya7s
 WikxcS8Bvyj9cX8d
X-Received: by 10.36.194.71 with SMTP id i68mr21133381itg.106.1497841206372;
 Sun, 18 Jun 2017 20:00:06 -0700 (PDT)
Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59])
 by smtp.gmail.com with ESMTPSA id b70sm5052184ioe.57.2017.06.18.20.00.04
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sun, 18 Jun 2017 20:00:05 -0700 (PDT)
From: Alex <agrambot@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#24697: 25.1;
 find-lisp-object-file-name may return wrong locations
References: <87mvi68tg4.fsf@HIDDEN> <87r2yiz1w8.fsf@lylat>
 <5f2268ec-ae50-a75a-cc28-5e407b524974@HIDDEN>
Date: Sun, 18 Jun 2017 20:59:25 -0600
In-Reply-To: <5f2268ec-ae50-a75a-cc28-5e407b524974@HIDDEN> (Dmitry Gutov's
 message of "Sun, 18 Jun 2017 22:51:43 +0300")
Message-ID: <87y3soel82.fsf@lylat>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 24697
Cc: 24697 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

Dmitry Gutov <dgutov@HIDDEN> writes:

> On 6/18/17 1:26 AM, Alex wrote:
>
>> The first and last of these are fixed by the following diff.
>>
>> ...
>>
>>
>> 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.
>
> Thanks. Do you think you can write test cases for these problems? There are some
> existing ones in test/lisp/help-fns-tests.el.

Sure, I've attached a patch below for the simple cases. As I couldn't
find a satisfactory way to make a temporary face, I just made an
uninterned symbol that find-lisp-object-file-name would treat as an
internal variable.

>> 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'.
>
> With a test case, you might also find it easier to make a choice regarding this
> problem.

I'm not sure. I still don't understand why the design decision was made.
I suppose one benefit is that one can search explicitly for internal
functions rather than lisp functions, but the function could have just
accepted 'subr instead of 'defun to do that.

Perhaps the current use of searching with TYPE should be left in for
backwards compatibility (a Github search shows at least 2 instances of
3rd-party code that makes use of that behaviour).

For instance, here's how you find mapatoms' file:

  (find-lisp-object-file-name 'mapatoms (symbol-function 'mapatoms))

You should just be able to do the following:

  (find-lisp-object-file-name 'mapatoms 'defun)

Or without searching for lisp functions named mapatoms first:

  (find-lisp-object-file-name 'mapatoms 'subr)

What do you think?


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Only-search-for-a-variable-when-instructed.patch

From 2ff6a3417278a5fae3328b1bdae5afcc7094d646 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@HIDDEN>
Date: Sun, 18 Jun 2017 18:59:11 -0600
Subject: [PATCH] Only search for a variable when instructed

* lisp/help-fns.el (find-lisp-object-file-name): Check for 'defvar
argument before searching for an internal variable (Bug#24697).
* test/lisp/help-fns-tests.el: New tests.
---
 lisp/help-fns.el            |  1 +
 test/lisp/help-fns-tests.el | 12 ++++++++++++
 2 files changed, 13 insertions(+)

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*")
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el
index 0ab6c3cae7..98898624db 100644
--- a/test/lisp/help-fns-tests.el
+++ b/test/lisp/help-fns-tests.el
@@ -118,4 +118,16 @@ defgh\\\[universal-argument\]b\`c\'d\\e\"f
     (goto-char (point-min))
     (should (looking-at "^font-lock-comment-face is "))))
 
+
+;;; Tests for find-lisp-object-file-name
+(ert-deftest help-fns-test-bug24697-function-search ()
+  (should-not (find-lisp-object-file-name 'tab-width 1)))
+
+(ert-deftest help-fns-test-bug24697-non-internal-variable ()
+  (let ((help-fns--test-var (make-symbol "help-fns--test-var")))
+    ;; simulate an internal variable
+    (put help-fns--test-var 'variable-documentation 1)
+    (should-not (find-lisp-object-file-name help-fns--test-var 'defface))
+    (should-not (find-lisp-object-file-name help-fns--test-var 1))))
+
 ;;; help-fns.el ends here
-- 
2.11.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#24697; Package emacs. Full text available.

Message received at 24697 <at> debbugs.gnu.org:


Received: (at 24697) by debbugs.gnu.org; 18 Jun 2017 19:51:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 18 15:51:54 2017
Received: from localhost ([127.0.0.1]:55425 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMgEj-0007Of-Vj
	for submit <at> debbugs.gnu.org; Sun, 18 Jun 2017 15:51:54 -0400
Received: from mail-wr0-f175.google.com ([209.85.128.175]:34744)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dMgEi-0007OR-4f
 for 24697 <at> debbugs.gnu.org; Sun, 18 Jun 2017 15:51:52 -0400
Received: by mail-wr0-f175.google.com with SMTP id 77so61474155wrb.1
 for <24697 <at> debbugs.gnu.org>; Sun, 18 Jun 2017 12:51:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=KLvm3j12kDMzqvCSe8MoUgGiFc369Tdlpfbkxk5M2GE=;
 b=sU1Tqa3Jl01fAsmCAWHQOwOmAwdOPJK1WbPQMiKfJPtvdeGe8/0edm0bAzcaMOzFhp
 74mnTp3zzkzYwAICrM5s2fWUzAWXZKlV6yvxnMfK5lA+IRCS+5pGnLTKczw4ZGHtrRqv
 qHiMxx008+YY/1A+EoJ1iFChdeS71ypnOv1YGSTo2TCkKpiiowgwa1msCLUO5sNXpvfR
 lAQz7/hmJ6CG5nVfXLsEee3IQsrJBJQ7MbbtvjFyEXv0jCrzMnviDYssSazz7gO6FK1x
 7Z/piRE2jb8qgL3ZXcSLRzZvbYVqsIEvB+4V2sH5C+GqOhphtq90OktkBm1SEAd4/q9k
 SUqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=KLvm3j12kDMzqvCSe8MoUgGiFc369Tdlpfbkxk5M2GE=;
 b=Zb/4gRN6KIjkEK6nsV3fkJVTONQteKzTD/5R0X5iGnGVeiXbUy6ZSwKz7QEb4tk7ih
 N7KxHL9gYQfLRl8JOv8UM4qBzAHX2iz1z7aXC92Kf2xTpnw5JQffWY6sQNDib2HwaPHR
 xHV/RVI0xPWHDYdnBqvnkb41ZXF7YifC1UZ3D0Tu+5pQb/ftNHJIwRTw7ub1ss/ShaU6
 qI+xAmdfu2C1fzFbOfcH5n05Ui0FoESSKt4s3jYpfRQn76FR0cRCn93BiPAeO98EulhT
 +B4uYJz0IOlbMJVmeURd5S+3dlFThmjUrdsF/DBgknEQoLvPA9/79yktO6c7Rx9gNCMo
 HRGQ==
X-Gm-Message-State: AKS2vOyhSZN6zN00sy7l43Vd/i1mszNNSgGqupfZcroQQ2FlJLL66W7V
 NQoZXc9a8sFMXT6yoZ8=
X-Received: by 10.223.176.61 with SMTP id f58mr13167713wra.74.1497815506179;
 Sun, 18 Jun 2017 12:51:46 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id 2sm11053389wrx.26.2017.06.18.12.51.44
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 18 Jun 2017 12:51:44 -0700 (PDT)
Subject: Re: bug#24697: 25.1; find-lisp-object-file-name may return wrong
 locations
To: Alex <agrambot@HIDDEN>, 24697 <at> debbugs.gnu.org
References: <87mvi68tg4.fsf@HIDDEN> <87r2yiz1w8.fsf@lylat>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <5f2268ec-ae50-a75a-cc28-5e407b524974@HIDDEN>
Date: Sun, 18 Jun 2017 22:51:43 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <87r2yiz1w8.fsf@lylat>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 6/18/17 1:26 AM, Alex wrote: > The first and last of these
 are fixed by the following diff. > > ... > > > 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. [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail
 domains are different
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (dgutov[at]yandex.ru)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [209.85.128.175 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.7 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.128.175 listed in wl.mailspike.net]
 0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid
 1.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom
 freemail headers are different
X-Debbugs-Envelope-To: 24697
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  On 6/18/17 1:26 AM, Alex wrote: > The first and last of these
    are fixed by the following diff. > > ... > > > 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.
    [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [209.85.128.175 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
                             trust
                             [209.85.128.175 listed in list.dnswl.org]
  1.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail
                             domains are different
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (raaahh[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid
  1.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom
                              freemail headers are different

On 6/18/17 1:26 AM, Alex wrote:

> The first and last of these are fixed by the following diff.
> 
> ...
> 
> 
> 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.

Thanks. Do you think you can write test cases for these problems? There 
are some existing ones in test/lisp/help-fns-tests.el.

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

With a test case, you might also find it easier to make a choice 
regarding this problem.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#24697; Package emacs. Full text available.

Message received at 24697 <at> debbugs.gnu.org:


Received: (at 24697) by debbugs.gnu.org; 17 Jun 2017 22:27:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 18:27:01 2017
Received: from localhost ([127.0.0.1]:53785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMMBI-0004P3-T5
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 18:27:01 -0400
Received: from mail-io0-f180.google.com ([209.85.223.180]:33912)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1dMMBH-0004Oq-7a
 for 24697 <at> debbugs.gnu.org; Sat, 17 Jun 2017 18:26:59 -0400
Received: by mail-io0-f180.google.com with SMTP id i7so46814044ioe.1
 for <24697 <at> 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)
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 <at> debbugs.gnu.org>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sat, 17 Jun 2017 15:26:51 -0700 (PDT)
From: Alex <agrambot@HIDDEN>
To: 24697 <at> debbugs.gnu.org
Subject: Re: bug#24697: 25.1;
 find-lisp-object-file-name may return wrong locations
References: <87mvi68tg4.fsf@HIDDEN>
Date: Sat, 17 Jun 2017 16:26:47 -0600
In-Reply-To: <87mvi68tg4.fsf@HIDDEN> (Alex's message of "Fri, 14 Oct 2016
 16:19:23 -0600")
Message-ID: <87r2yiz1w8.fsf@lylat>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 24697
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Alex <agrambot@HIDDEN> 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'.

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#24697; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Oct 2016 22:19:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 18:19:49 2016
Received: from localhost ([127.0.0.1]:56117 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bvApQ-0005TJ-VO
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 18:19:49 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41759)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1bvApP-0005T6-60
 for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 18:19:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <agrambot@HIDDEN>) id 1bvApG-0000Ti-Rw
 for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 18:19:42 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:40093)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <agrambot@HIDDEN>) id 1bvApG-0000TX-Oe
 for submit <at> debbugs.gnu.org; Fri, 14 Oct 2016 18:19:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60952)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <agrambot@HIDDEN>) id 1bvApD-0000wf-1Q
 for bug-gnu-emacs@HIDDEN; Fri, 14 Oct 2016 18:19:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <agrambot@HIDDEN>) id 1bvAp8-0000S3-NF
 for bug-gnu-emacs@HIDDEN; Fri, 14 Oct 2016 18:19:33 -0400
Received: from mail-it0-x22f.google.com ([2607:f8b0:4001:c0b::22f]:36848)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <agrambot@HIDDEN>) id 1bvAp8-0000Ry-Is
 for bug-gnu-emacs@HIDDEN; Fri, 14 Oct 2016 18:19:30 -0400
Received: by mail-it0-x22f.google.com with SMTP id l13so3456799itl.1
 for <bug-gnu-emacs@HIDDEN>; Fri, 14 Oct 2016 15:19:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:subject:date:message-id:mime-version;
 bh=EKVeeZg16LuSpPPu61+Ug7pl6tbV/Dt/tMyE0P6FkWo=;
 b=RdyDn8czecIPxo8ECiWM8NI7Wd79i5PUwvyLFHfkej55fL1hBBSCuOxYviS1gvRdoH
 aypiG+fdENfinAFqiMkhc5Ca/WMK5YS0/vaoeM9pVOFu5TACyNlPUFPBFIEFc4tpyV+B
 EQp8m/VhA0I5tjlE3aqP4IdIklt0BTnhWtNYsJy+ldvx0ogV9Kz7DzMiyZWla69pWyNr
 27u5QcVodMlkx/D3aG/I9+Bi1JiW1KBFppqWelR9Q5IcW5VkfKk9Ib7agt31VvIyGExI
 3nEsTyiLW7X97IeXI0efLG+DqMjpESX/iQ93ONPwh+T4AGVMUsHOcAu45hyNUUBoYyJ5
 XBBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=EKVeeZg16LuSpPPu61+Ug7pl6tbV/Dt/tMyE0P6FkWo=;
 b=VR8p4DYXkvfTUPCovaQDnB5QvOmtgIoA3m6Kzx+aFGYzJNm6tB12pWx1MACusOZzo2
 MK66aw9XaHeN9+RzFzfwxSU9TmJZBbJxarQgSxEdIWDFG6YvFW1IdwnDk/djTZZUI5n1
 r2taiMXu7AQgLoFuIBo5ODePVVS8p8eBf0Dp7ygdaFUGtlkVj/aeR/8nJjKEUu5SMeTb
 /CPybJhjHC71S3W8xoQGXjqzYgho+wbZEtOlHZZk9I+dn+s172N+aZ818AMts3l22S/0
 0Lc5JiaUTc10VE1jHkKAL7AYSt+VyTf226W2wNKmrE1qE3bAXO12cI/5W3gpnY8yxaH8
 bkJw==
X-Gm-Message-State: AA6/9RlumoGWZgKsrgNIvvscbxHietLFDc7JT+Tcnu36OshPSjPcu0gJvUlNr4VAsMB6Ig==
X-Received: by 10.36.25.82 with SMTP id b79mr384412itb.122.1476483569239;
 Fri, 14 Oct 2016 15:19:29 -0700 (PDT)
Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88])
 by smtp.gmail.com with ESMTPSA id t141sm387689ita.0.2016.10.14.15.19.28
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 14 Oct 2016 15:19:28 -0700 (PDT)
From: Alex <agrambot@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.1; find-lisp-object-file-name may return wrong locations
Date: Fri, 14 Oct 2016 16:19:23 -0600
Message-ID: <87mvi68tg4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)


#+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'.




Acknowledgement sent to Alex <agrambot@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#24697; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 29 Sep 2017 00:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.