From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#9923: 24.0.91; `where-is' does not find recentf menu items (cmds, not files) Date: Sun, 05 Dec 2021 18:13:56 -0500 Message-ID: References: <76FA3F83D086455EAA01FF0FB000FCDB@us.oracle.com> <871r6hk99k.fsf@gnus.org> <87bl5k2ug1.fsf@gnus.org> <87czpwb4gw.fsf@mail.linkov.net> <8635n753o3.fsf@mail.linkov.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6119"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 9923@debbugs.gnu.org, Lars Ingebrigtsen To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 06 00:15:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mu0iu-0001Hm-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 00:15:12 +0100 Original-Received: from localhost ([::1]:56260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mu0it-0005Je-29 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Dec 2021 18:15:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mu0ik-0005J8-IE for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 18:15:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mu0ik-0005wu-AN for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 18:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mu0ik-0002pB-41 for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 18:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Dec 2021 23:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 9923-submit@debbugs.gnu.org id=B9923.163874606910793 (code B ref 9923); Sun, 05 Dec 2021 23:15:02 +0000 Original-Received: (at 9923) by debbugs.gnu.org; 5 Dec 2021 23:14:29 +0000 Original-Received: from localhost ([127.0.0.1]:59985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mu0iC-0002o0-Oe for submit@debbugs.gnu.org; Sun, 05 Dec 2021 18:14:29 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mu0iA-0002nk-FT for 9923@debbugs.gnu.org; Sun, 05 Dec 2021 18:14:27 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5BD8C801B5; Sun, 5 Dec 2021 18:14:20 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7EA6C80342; Sun, 5 Dec 2021 18:14:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1638746054; bh=C9tbMhZazLwon/CqPq/Rplheu+9gnucnGJmV0+9U2lk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=aTcwRievZef0BYdkgexuqqEmKRdazupabtTzsco4ksAox7yvKeR/XDWVOJ1aLnj5G M6MsypCXNNFgQQ+przKhpMEbVGZZtmceE3XyHhLD5+jrr3FjmRSwVOKfMv2vMH8qGP b26J6Exwnuo9oGrJEM3VSpOvRE64+E57wMZHnwTmB4ml68dc4qU315txXnoByN29kt Fz0ZKOStBXKLAIym9mRro6ggyZnEUB6icFLWMKIVMNhe3YwdyLs0sPUBd6NHxMbXna c/z1E5UJgyfG+veb7OsmBABhgpEmGp9LVkvcIHn+/JnryndTQ1WjLK2FMZBn5RSPN5 Ur6SS+3KTwWRQ== Original-Received: from ceviche (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1FCB31202CE; Sun, 5 Dec 2021 18:14:14 -0500 (EST) In-Reply-To: <8635n753o3.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 05 Dec 2021 20:04:28 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221681 Archived-At: > + (with-current-buffer (window-buffer) > + (when (let* ((pos (posn-point (event-end click))) > + (char (when pos (char-after pos)))) > + (or (and char (eq (char-syntax char) ?\")) > + (nth 3 (save-excursion (syntax-ppss pos))))) > + (define-key-after submenu [mark-string] > + `(menu-item "String" > + ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'string)) > + :help "Mark the string at click for a subsequent cut/copy")))) I think it would be more "obviously correct" if we switched to (window-buffer (posn-window (event-end click))) instead. > ;; Include text-mode select menu only in strings and comments. > - (when (nth 8 (save-excursion (syntax-ppss (posn-point (event-end click))))) > + (when (nth 8 (save-excursion > + (with-current-buffer (window-buffer) > + (syntax-ppss (posn-point (event-end click)))))) Same here. > An alternative is the patch that I proposed earlier: > > diff --git a/lisp/help-fns.el b/lisp/help-fns.el > index 2c7956d968..85f305617d 100644 > --- a/lisp/help-fns.el > +++ b/lisp/help-fns.el > @@ -1898,6 +1898,8 @@ help-fns--list-local-commands > (mapatoms > (lambda (sym) > (when (and (commandp sym) > + ;; Ignore 'ignore'. > + (not (eq sym 'ignore)) > ;; Ignore aliases. > (not (symbolp (symbol-function sym))) > ;; Ignore everything bound. I'm not sure what to think of this because I don't understand its motivation. IOW at the very least it should come with a comment explaining why we need to ignore `ignore`. Stefan