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: Fri, 30 Oct 2020 14:14:54 -0700 (PDT) Message-ID: <3b9fabae-fbe4-4c4a-b11b-8aad73016ace@default> References: <> <<87pnfk1ozm.fsf@marxist.se>> <<44a24b90-adf8-41f1-8d06-b35f55f1850c@default>> <> <<83tuudaz1y.fsf@gnu.org>> <1f8767bb-1912-42ea-abba-dd666bea48b0@default> 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="13156"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 16333@debbugs.gnu.org, stefan@marxist.se To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 30 22:16:20 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 1kYbky-0003KO-FD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 22:16:20 +0100 Original-Received: from localhost ([::1]:35416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYbkx-0002f3-CD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 17:16:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYbki-0002ee-KL for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 17:16:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYbkg-0005wq-9V for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 17:16:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYbkg-0001h6-5B for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 17:16: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: Fri, 30 Oct 2020 21:16: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.16040925086441 (code B ref 16333); Fri, 30 Oct 2020 21:16:02 +0000 Original-Received: (at 16333) by debbugs.gnu.org; 30 Oct 2020 21:15:08 +0000 Original-Received: from localhost ([127.0.0.1]:59946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYbjn-0001fp-NY for submit@debbugs.gnu.org; Fri, 30 Oct 2020 17:15:07 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:37750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYbjk-0001er-Vd for 16333@debbugs.gnu.org; Fri, 30 Oct 2020 17:15:06 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09ULEvNk144962; Fri, 30 Oct 2020 21:14:57 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=MHlZsFQ9dER9+atoD4YbFNmrUaqYYyGrKtIlePKUJJ8=; b=uaFJgtF4F/c9T1j760Cn4BW48MYH3VQCcMwW4xDX7xbzOlS/ijh3j/5AYdKZKvQ1xwUY 1jETnGR0ktG6qjffXAHoU1rRVkUhjywBImhWORWCvWiyzDukwaFi9dk+shhgwMhcqC+O +pmovU4xy/pWX1WrbeWT2NDVVH7EDMapqumq1N9WYBxTqI9Vc+K+YeKxi94Raq1QViiO 7jJDEYP8nwOPofJwV03idSW0kScZWHwHzbNcPA+5Xmy2Ae9B9J/LA5G1tgPOj/FNn7dh KZK4jT7e4ChgDVxZo96Boc9ZeHnx2C7yi3/D+94pUdwHZgzvMhVUd9JVIDssJC9Bh+kS Aw== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 34dgm4hbak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 30 Oct 2020 21:14:57 +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 09ULAZRv134230; Fri, 30 Oct 2020 21:14:57 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 34cwurd3u8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Oct 2020 21:14:56 +0000 Original-Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09ULEtAh018071; Fri, 30 Oct 2020 21:14:56 GMT In-Reply-To: <1f8767bb-1912-42ea-abba-dd666bea48b0@default> 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=9790 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-2010300158 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9790 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010300158 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:192205 Archived-At: > Here's a suggestion, to make this less rigid/fragile: > Substitute for "mouse-2" everywhere in the help text, > as follows. >=20 > (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) > ___ >=20 > Or if you think it's more appropriate for some reason, > then substitute only the first occurrence of "mouse-2". >=20 > 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. Actually, the following is much better. It lets code use different patterns in different contexts, by binding the variable. Should I submit this as a separate bug report, or can it be considered in the context of this one? (defvar mouse-fixup-help-replace-regexp '("\\(?:\\|[[:space:]]\\)\\(mouse-2\\)" . 1) "Regexp to match \"mouse-2\" in MSG. The value is a cons (REGEXP . N). Function `mouse-fixup-help-message' replaces the match of subexpression N, of the text that matches REGEXP, with \"mouse-1\".") (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 (car mouse-fixup-help-replace-regexp) (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 nil nil (cdr mouse-fixup-help-replace-regexp)))))= )) msg)