emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iswitchb


From: Robert Pluim
Subject: Re: iswitchb
Date: Mon, 12 Mar 2018 17:56:59 +0100

Noam Postavsky <address@hidden> writes:

> On Mon, Mar 12, 2018 at 9:57 AM, Robert Pluim <address@hidden> wrote:
>
>> [1]  Info-goto-node only works if you're in an *info* file.  Should it
>> be taught to work from *Help* buffers as well? Or perhaps
>> "(filename)Node name" strings should be clickable?
>
> It works if you say "Info node `(filename) Node name'" (not if you say
> "Info nodeS `(filename) Node name' etc"), so completing-read docstring
> could be changed to
>
> See also Info node `(elisp) Basic Completion' for the details
> about completion, and Info node `(elisp) Programmed Completion'
> for expectations from COLLECTION when it’s a function.

Indeed, that works, as does

Info node `(elisp)Basic Completion'

(without the space after the right paren)

Patch for this and one other instance of the same issue attached. I've
also attached a proposed patch for hiding the 'Info node' and 'URL'
prefixes in *Help* buffers, since I find they just get in the way.

First one could go to either emacs-26 or master. Second one I think is
master-only (does it require a NEWS entry?).

Robert

>From a59d3fc1a7059064518f3842140f0df2e19799a1 Mon Sep 17 00:00:00 2001
From: Robert Pluim <address@hidden>
Date: Mon, 12 Mar 2018 17:43:23 +0100
Subject: [PATCH 1/2] Correct Info link markup

* lisp/gnus/gnus-agent.el (gnus-agent-auto-agentize-methods):
Correct markup for Info link.
* src/minibuf.c (Fcompleting_read): Likewise.
---
 lisp/gnus/gnus-agent.el | 2 +-
 src/minibuf.c           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index ada148d20b..628c9430c9 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -172,7 +172,7 @@ gnus-agent-expire-unagentized-dirs
 (defcustom gnus-agent-auto-agentize-methods nil
   "Initially, all servers from these methods are agentized.
 The user may remove or add servers using the Server buffer.
-See Info nodes `(gnus)Server Buffer', `(gnus)Agent Variables'."
+See Info node `(gnus)Server Buffer' and Info node `(gnus)Agent Variables'."
   :version "22.1"
   :type '(repeat symbol)
   :group 'gnus-agent)
diff --git a/src/minibuf.c b/src/minibuf.c
index 95e62cedda..d4484efb04 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1626,8 +1626,8 @@ COLLECTION can also be a function to do the completion 
itself.
 PREDICATE limits completion to a subset of COLLECTION.
 See `try-completion', `all-completions', `test-completion',
 and `completion-boundaries', for more details on completion,
-COLLECTION, and PREDICATE.  See also Info nodes `(elisp)Basic Completion'
-for the details about completion, and `(elisp)Programmed Completion' for
+COLLECTION, and PREDICATE.  See also Info node `(elisp)Basic Completion'
+for the details about completion, and Info node `(elisp)Programmed Completion' 
for
 expectations from COLLECTION when it's a function.
 
 REQUIRE-MATCH can take the following values:
-- 
2.16.1.72.g5be1f00a9

>From de6c4f2ba6defa8dca15e13d64c6371f3f23e6af Mon Sep 17 00:00:00 2001
From: Robert Pluim <address@hidden>
Date: Mon, 12 Mar 2018 17:50:08 +0100
Subject: [PATCH 2/2] Hide URL and Info node markup in help buffers

* lisp/help-mode.el (help-make-xrefs): Make URL and Info node
markup invisible.
---
 lisp/help-mode.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 4fb3fb85c9..f64915e541 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -470,17 +470,23 @@ 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))
+                        (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)))
+                      (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]