From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#24697: 25.1; find-lisp-object-file-name may return wrong locations Date: Fri, 29 Sep 2017 00:26:22 +0300 Message-ID: <3eac4397-73f0-380b-1a28-5750ce555f2c@yandex.ru> References: <87mvi68tg4.fsf@gmail.com> <87r2yiz1w8.fsf@lylat> <5f2268ec-ae50-a75a-cc28-5e407b524974@yandex.ru> <87y3soel82.fsf@lylat> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1506643879 32405 195.159.176.226 (29 Sep 2017 00:11:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2017 00:11:19 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: 24697@debbugs.gnu.org To: Alex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 29 02:11:15 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 1dxitb-0007wI-FB for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Sep 2017 02:11:11 +0200 Original-Received: from localhost ([::1]:33105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxiti-0007jR-UZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Sep 2017 20:11:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxitV-0007gf-S8 for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2017 20:11:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxitS-0007Gw-NA for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2017 20:11:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dxitS-0007GA-ID for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2017 20:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dxitS-0007X6-7A for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2017 20:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2017 00:11: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.150664383728921 (code B ref 24697); Fri, 29 Sep 2017 00:11:02 +0000 Original-Received: (at 24697) by debbugs.gnu.org; 29 Sep 2017 00:10:37 +0000 Original-Received: from localhost ([127.0.0.1]:37293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxit3-0007WP-2Q for submit@debbugs.gnu.org; Thu, 28 Sep 2017 20:10:37 -0400 Original-Received: from mail-wm0-f47.google.com ([74.125.82.47]:47127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxit1-0007Vx-7S for 24697@debbugs.gnu.org; Thu, 28 Sep 2017 20:10:35 -0400 Original-Received: by mail-wm0-f47.google.com with SMTP id t69so367005wmt.2 for <24697@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) Original-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) In-Reply-To: <87y3soel82.fsf@lylat> Content-Language: en-US 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:137551 Archived-At: 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.