all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 41905@debbugs.gnu.org, ej32u@protonmail.com
Subject: bug#41905: Small change: In Customize, display name with with spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 11:58:29 -0300	[thread overview]
Message-ID: <CABczVwe-vuZgPWbUkm-k3YRfhvAVvtnMjqozP3TBkidppRwZoA@mail.gmail.com> (raw)
In-Reply-To: <87a6y447eo.fsf@gnus.org>


[-- Attachment #1.1: Type: text/plain, Size: 469 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Mauro Aranda <maurooaranda@gmail.com> writes:
>
>> Sure, here is the patch I'm running with
>
> Thanks, that makes C-h S use the correct string.  However, the prompt is
> confusing:

[...]

> Because it's using the string from the buffer...  including the 'display
> text property.  Perhaps it should strip all text properties before being
> used?

Then I guess we must change info-lookup-interactive-arguments to do that.

[-- Attachment #1.2: Type: text/html, Size: 673 bytes --]

[-- Attachment #2: 0001-info-lookup-symbol-Fix-the-suggested-default-value-i.patch --]
[-- Type: text/x-patch, Size: 1961 bytes --]

From 1937e2d0119c692683c01eded8585ccafba5349c Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Sat, 5 Sep 2020 11:06:36 -0300
Subject: [PATCH] info-lookup-symbol: Fix the suggested default value in Custom
 buffers

* lisp/info-look.el (info-lookup-maybe-add-help 'Custom-mode): Don't
pass info-lookup-guess-custom-symbol as the :parse-rule, since we
don't need it anymore.  (Bug#41905)
(info-lookup-guess-custom-symbol): Now unused, mark as obsolete.
(info-lookup-interactive-arguments): Get rid of text properties before
passing the default value to completing-read.
---
 lisp/info-look.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/info-look.el b/lisp/info-look.el
index 4e379cadef..76c39bcd86 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -298,7 +298,8 @@ info-lookup-interactive-arguments
 	 (enable-recursive-minibuffers t)
 	 (value (completing-read
 		 (if default
-		     (format "Describe %s (default %s): " topic default)
+                     (progn (set-text-properties 0 (length default) nil default)
+		            (format "Describe %s (default %s): " topic default))
 		   (format "Describe %s: " topic))
 		 completions nil nil nil 'info-lookup-history default)))
     (list (if (equal value "") default value) mode)))
@@ -648,6 +649,9 @@ info-lookup-guess-custom-symbol
 		     (> end beg)))
 	    (buffer-substring-no-properties beg end)))))
     (error nil)))
+;; We don't need this anymore, because now Custom inserts the unlispified name
+;; in the buffer.  (Bug#41905)
+(make-obsolete 'info-lookup-guess-custom-symbol nil "28.1")
 
 (defun info-lookup-guess-gdb-script-symbol ()
   "Get symbol at point in GDB script buffers."
@@ -1065,7 +1069,6 @@ info-complete
  :mode 'Custom-mode
  :ignore-case t
  :regexp "[^][()`'‘’,:\" \t\n]+"
- :parse-rule 'info-lookup-guess-custom-symbol
  :other-modes '(emacs-lisp-mode))
 
 (info-lookup-maybe-add-help
-- 
2.28.0


  reply	other threads:[~2020-09-05 14:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  3:23 bug#41905: Small change: In Customize, display name with with spaces, but keep symbol name underneath ej32u--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-17 21:20 ` Juri Linkov
2020-06-18 22:44   ` Juri Linkov
2020-09-05 12:00 ` Mauro Aranda
2020-09-05 12:13   ` Lars Ingebrigtsen
2020-09-05 12:12 ` Lars Ingebrigtsen
2020-09-05 12:50 ` Mauro Aranda
2020-09-05 12:56   ` Lars Ingebrigtsen
2020-09-05 13:08     ` Mauro Aranda
2020-09-05 13:12       ` Mauro Aranda
2020-09-05 13:24       ` Lars Ingebrigtsen
2020-09-05 13:48         ` Mauro Aranda
2020-09-05 13:52           ` Lars Ingebrigtsen
2020-09-05 14:16             ` Mauro Aranda
2020-09-05 14:36               ` Lars Ingebrigtsen
2020-09-05 14:58                 ` Mauro Aranda [this message]
2020-09-05 15:08                   ` Lars Ingebrigtsen
2020-09-05 15:20                   ` Lars Ingebrigtsen
2020-09-05 15:27                     ` Lars Ingebrigtsen
2020-09-05 15:07               ` Drew Adams
2020-09-05 15:31                 ` Mauro Aranda
2020-09-05 16:37                   ` Lars Ingebrigtsen
2020-09-06 12:17                   ` Lars Ingebrigtsen
2020-09-06 12:35                     ` Mauro Aranda
2020-09-06 12:39                       ` Lars Ingebrigtsen
2020-09-06 12:54                         ` Mauro Aranda
2020-09-06 18:40                           ` Juri Linkov
2020-09-07 18:22                             ` Juri Linkov
2020-09-07 19:44                               ` Mauro Aranda
2020-09-07 20:28                               ` Lars Ingebrigtsen
2020-09-08 18:33                                 ` Juri Linkov
2020-09-08 20:50                                   ` Lars Ingebrigtsen
2020-09-08 19:09                                 ` Juri Linkov
2020-09-08 20:52                                   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABczVwe-vuZgPWbUkm-k3YRfhvAVvtnMjqozP3TBkidppRwZoA@mail.gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=41905@debbugs.gnu.org \
    --cc=ej32u@protonmail.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.