From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#16333: 24.3.50; Info manuals: link defined terms to their glossary entries Date: Thu, 29 Oct 2020 10:51:59 -0700 (PDT) Message-ID: <1f8767bb-1912-42ea-abba-dd666bea48b0@default> References: <> <<87pnfk1ozm.fsf@marxist.se>> <<44a24b90-adf8-41f1-8d06-b35f55f1850c@default>> <> <<83tuudaz1y.fsf@gnu.org>> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39758"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 16333@debbugs.gnu.org, stefan@marxist.se To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 29 18:53:10 2020 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 1kYC6o-000AAl-2p for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Oct 2020 18:53:10 +0100 Original-Received: from localhost ([::1]:57580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYC6m-0003bO-Ma for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Oct 2020 13:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYC6g-0003b6-Ek for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 13:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43345) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYC6g-0008JN-5U for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 13:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYC6g-0002v3-3x for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 13:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Oct 2020 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16333 X-GNU-PR-Package: emacs Original-Received: via spool by 16333-submit@debbugs.gnu.org id=B16333.160399392911152 (code B ref 16333); Thu, 29 Oct 2020 17:53:02 +0000 Original-Received: (at 16333) by debbugs.gnu.org; 29 Oct 2020 17:52:09 +0000 Original-Received: from localhost ([127.0.0.1]:54891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYC5p-0002to-0h for submit@debbugs.gnu.org; Thu, 29 Oct 2020 13:52:09 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:57276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYC5n-0002tc-R3 for 16333@debbugs.gnu.org; Thu, 29 Oct 2020 13:52:08 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09THnAAA176606; Thu, 29 Oct 2020 17:52:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=vcLrvQ2TZA/zgvpAQjVTFqcuP7Cs1VifAtHtEQwC20s=; b=QeFFdiVhZgusJm6MMEuFV0VTgEnOPjUVmqTVmUUwf/G31tZ/C6/bLJIA1jgx0CEImyaB i2/3YaHgkEfSTNLcEogHu7qK2S7S/4DV+ZwLmrcs9qatCn+S93Q1Kj2JVJ0A5BPbpc33 8Br0GAPDaZB8cgpB6/lq5jzqo8S1ugzB6FesYhTA6mKM0hpGeYZGjC1M8yNdUvil2qk8 /7+B5RDAhHiem0Jx8ujqgmUDlSTY5oL++xKMUFFJm46DhP8821E3h3RdnQ+dcuAA/ELB HZUAi217RPdBhNdlmbtnQ9U1D0tBz357mgnBoB2FuN//TDBh9JyyPyyNPIPtWWDFv/Q6 nQ== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 34cc7m67cb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 29 Oct 2020 17:52:01 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09THkXCG147953; Thu, 29 Oct 2020 17:52:01 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 34cwuq2gkd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Oct 2020 17:52:01 +0000 Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09THq0xT022598; Thu, 29 Oct 2020 17:52:00 GMT In-Reply-To: <<83tuudaz1y.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9789 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010290124 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9789 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 clxscore=1015 mlxscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010290124 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:191978 Archived-At: > > It turns out that the text need not exactly start with > > "mouse-2". >=20 > Yes. >=20 > > Dunno where that text transformation is implemented > > (in C?) - I didn't find it in the Lisp. >=20 > It's in mouse-fixup-help-message. Ah, very good. Thanks. I grepped and searched a fair amount, but I missed that. But I think that shows (what I think I've seen - see my correction to what I wrote that you replied to) that the text _does_ need to start with "mouse-2": (string-match-p "\\`mouse-2" msg) BTW, that doc string is not great. It should mention `help-echo', I think. Grep `mouse-fixup-help-message' finds no uses of it in Lisp. So it's not clear, but I'm guessing that it ends up being used indirectly(?) only(?) by `help-echo'. ___ In any case, could this behavior (if not that function) please be pointed out in the Elisp manual? Users writing help-echo text should be aware of the behavior. ___ Here's a suggestion, to make this less rigid/fragile: Substitute for "mouse-2" everywhere in the help text, as follows. (defun mouse-fixup-help-message (msg) "Fix help message MSG for `mouse-1-click-follows-link'." (let (mp pos) (when (and mouse-1-click-follows-link (stringp msg) (string-match-p "mouse-2" msg) (setq mp (mouse-pixel-position)) (consp (setq pos (cdr mp))) (car pos) (>=3D (car pos) 0) (cdr pos) (>=3D (cdr pos) 0) (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp))) (windowp (posn-window pos))) (with-current-buffer (window-buffer (posn-window pos)) (when (mouse-on-link-p pos) (setq msg (replace-regexp-in-string "mouse-2" (concat (cond ((eq mouse-1-click-follows-link 'double) "double-") ((and (integerp mouse-1-click-follows-link) (< mouse-1-click-follows-link 0)) "Long ") (t "")) "mouse-1") msg)))))) msg) ___ Or if you think it's more appropriate for some reason, then substitute only the first occurrence of "mouse-2". Of if you think we should let users specify exactly which occurrences of "mouse-2" to substitute, then define a formatting escape for that (e.g. "%m"), so only "mouse-2" occurrences preceded by that escape get substituted. E.g., "xxx%mmouse-2" would substitute the "mouse-2", but "xxxmouse-2" would not.