From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: iswitchb Date: Tue, 13 Mar 2018 17:42:35 +0100 Message-ID: <87fu54apvo.fsf@gmail.com> References: <20180311031648.8003.90161@vcs0.savannah.gnu.org> <20180311031649.A9FBF20F52@vcs0.savannah.gnu.org> <87r2opk2yl.fsf@gmail.com> <1A9BA5E5-3700-4B32-9709-10B112F0E76F@gnu.org> <87efkpjt16.fsf@gmail.com> <874llljkpw.fsf@gmail.com> <83fu55ryba.fsf@gnu.org> <87zi3di3e0.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1520959814 25252 195.159.176.226 (13 Mar 2018 16:50:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Mar 2018 16:50:14 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 13 17:50:09 2018 Return-path: Envelope-to: ged-emacs-devel@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 1evn7m-0006NM-Sc for ged-emacs-devel@m.gmane.org; Tue, 13 Mar 2018 17:50:07 +0100 Original-Received: from localhost ([::1]:41209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evn9p-0005XO-Pf for ged-emacs-devel@m.gmane.org; Tue, 13 Mar 2018 12:52:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evn0d-0005lF-H4 for emacs-devel@gnu.org; Tue, 13 Mar 2018 12:42:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evn0Y-0007Hd-FC for emacs-devel@gnu.org; Tue, 13 Mar 2018 12:42:43 -0400 Original-Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:39163) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evn0Y-0007H6-4U for emacs-devel@gnu.org; Tue, 13 Mar 2018 12:42:38 -0400 Original-Received: by mail-wr0-x22a.google.com with SMTP id k3so692985wrg.6 for ; Tue, 13 Mar 2018 09:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=ZmODgc9qhlFsaCASwKs2RxIaPnffIp/2ELNfV9zhLlk=; b=aTQlvwzMEav+7QgygtD0DtJA8929zhHXG2Un/x05CDR7zbuprOjUYwBLPlwZCjYX7v W/lKxSE9I2Eiey1PmOl41THox8WnxJzFJW5zDv5EVR2c4XtTNWOgjomqTL7vmufWc48F maNty0ImB6U92kKij2uO48dt3ZaHiO2u9bWR/7hwSvbhvArOj8egyAmpC4eca4NOFijv R4Ew55tOiXEtjtFv0lWwT4zYbNn+UAPO/bT2oA3PlmNp5tuLICRdC1TlJAN4NZn0PD6C s71X/p7ibQKOkNdqSkii5KxG+flKXHfHBiCZOpE29xJjrkJT7V6b/nv0JSNCbLoiZyWF NCzA== 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:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:in-reply-to:message-id :mime-version; bh=ZmODgc9qhlFsaCASwKs2RxIaPnffIp/2ELNfV9zhLlk=; b=Qr6K6jcAu1ITzrcOpw1DrwD63vBtq+3668IVB4zcHcGLWLkH0f3H2B0/8H3UDYVWe6 ecTbkPF3p5ShQOsswGK8A77xE1xRHqbEhzWNvxc49dH07NE4LiaNMzh9TXDsoI5mg/0g JAxNUhpv5gcrkqO/0OKUJS77K+H05Cfy9QuqRiXPq96ZJZAVsBwXG3pt/sAwYnTuBQmV xRIlZ+vnkHn3F2SldSGC4ZOptyFMOwPyRBLn4p3lNViTG1Cc/Vvy+YbByX182ypZ5+tt WKZ5caC1VkRGT2wCpkeFE6tsjHZ0UQipJwkPnvUIh4ZFSPLQ1TaFUnHg8OxEXGfmXOa4 5CFQ== X-Gm-Message-State: AElRT7HGfTxXpLhJ7kjfienZt3MVI3n1QSteW/SJ7dx9ePvg/3VPzNq8 JyZCDhVFOA3rE92dUQS4Sea5MMqzuxM= X-Google-Smtp-Source: AG47ELvfvwjSyMbpGBgsXP/2cF6LJMO1ge011nzEc2w2OoszH4/3iDFvnn6Q469E+BXtHuAIVzXFNg== X-Received: by 10.223.188.69 with SMTP id a5mr1083137wrh.97.1520959356513; Tue, 13 Mar 2018 09:42:36 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id d8sm849964wrf.8.2018.03.13.09.42.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 09:42:35 -0700 (PDT) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <87zi3di3e0.fsf@gmail.com> (Robert Pluim's message of "Mon, 12 Mar 2018 18:56:39 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:223696 Archived-At: --=-=-= Content-Type: text/plain Robert Pluim writes: >> >> Not unless you provide an option to get back old behavior (which I >> think you should, if we accept this change). Personally, I'm not so >> sure it's a good idea to install that, as having Info called out >> explicitly has its merits. Proposed patch attached. I've boldly defaulted the functionality to enabled, but we can flip that if people feel strongly about it. I documented it in the lisp reference manual, but we can put it in the user manual as well. Robert --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Hide-URL-and-Info-node-markup-in-help-buffers.patch >From b374d99ae7e9d16a99ce6a178ab06ab3d5634044 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 13 Mar 2018 17:03:11 +0100 Subject: [PATCH] Hide URL and Info node markup in help buffers * lisp/help-mode.el (help-mode-hide-markup): New custom variable. (help-make-xrefs): Make URL and Info node markup invisible. * etc/NEWS: Describe help markup hiding changes. * doc/lispref/tips.texi (Documentation Tips): Document 'help-mode-hide-markup' --- doc/lispref/tips.texi | 7 +++++++ etc/NEWS | 5 +++++ lisp/help-mode.el | 22 +++++++++++++++++++--- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index c62cfcfa8f..3a623541e5 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -756,6 +756,13 @@ Documentation Tips `https://www.gnu.org/'). @end smallexample +@vindex help-mode-hide-markup +By default, the prefixes that are used to indicate Info and URL +hyperlinks (such as @samp{Info node} and @samp{URL}) are hidden when +the documentation string is displayed. This behavior can be changed +by customizing @code{help-mode-hide-markup} to +@code{nil}. + @item Don't write key sequences directly in documentation strings. Instead, use the @samp{\\[@dots{}]} construct to stand for them. For example, diff --git a/etc/NEWS b/etc/NEWS index 57236b52f0..bdefc0970c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -202,6 +202,11 @@ and commands in the same format as the edit buffer of the buffer generated by 'view-lossage' to the "*Edit Macro*" buffer created by 'edit-last-kbd-macro', and to save the macro by 'C-c C-c'. ++++ +*** New variable 'help-mode-hide-markup'. +When non-nil, help-mode buffers will not display the 'Info node' and +'URL' prefixes to hyperlinks. Default is t. + ** Ibuffer --- diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 4fb3fb85c9..bca160a7d2 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -98,6 +98,14 @@ help-mode-hook "Hook run by `help-mode'." :type 'hook :group 'help) + +(defcustom help-mode-hide-markup t + "If non-nil, hide markup used for Info and URL links. +Otherwise, show explicit 'Info node' and 'URL' markup in help +buffers." + :version "27.1" + :type 'boolean + :group 'help) ;; Button types used by help @@ -470,17 +478,25 @@ help-make-xrefs ;; Info references (save-excursion (while (re-search-forward help-xref-info-regexp nil t) - (let ((data (match-string 2))) + (let ((data (match-string 2)) + (beg (match-beginning 0)) + (end (match-beginning 2))) (save-match-data (unless (string-match "^([^)]+)" data) (setq data (concat "(emacs)" data))) (setq data ;; possible newlines if para filled - (replace-regexp-in-string "[ \t\n]+" " " data t t))) + (replace-regexp-in-string "[ \t\n]+" " " data t t)) + (when help-mode-hide-markup + (put-text-property beg end 'invisible t))) (help-xref-button 2 'help-info data)))) ;; URLs (save-excursion (while (re-search-forward help-xref-url-regexp nil t) - (let ((data (match-string 1))) + (let ((data (match-string 1)) + (beg (match-beginning 0)) + (end (match-beginning 1))) + (when help-mode-hide-markup + (put-text-property beg end 'invisible t)) (help-xref-button 1 'help-url data)))) ;; Mule related keywords. Do this before trying ;; `help-xref-symbol-regexp' because some of Mule -- 2.16.1.72.g5be1f00a9 --=-=-=--