GNU bug report logs - #25687
26.0.50; [PATCH] Fix completing-read call in reb-change-syntax

Previous Next

Package: emacs;

Reported by: Chunyang Xu <mail <at> xuchunyang.me>

Date: Sat, 11 Feb 2017 06:42:01 UTC

Severity: minor

Tags: fixed, patch

Found in version 26.0.50

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chunyang Xu <mail <at> xuchunyang.me>
To: 25687 <at> debbugs.gnu.org
Subject: bug#25687: 26.0.50; [PATCH] Fix completing-read call in reb-change-syntax
Date: Sat, 11 Feb 2017 14:40:41 +0800
[Message part 1 (text/plain, inline)]
Hi,

I find it makes more sense to use 'default' arg of completing-read than
'initial-input' arg, because I don't have to delete it before I can
actually change to another.

[0001-Fix-completing-read-call-in-reb-change-syntax.patch (text/x-patch, inline)]
From c0b4621083a6947f75ea58b4c535452a4caad4a5 Mon Sep 17 00:00:00 2001
From: Chunyang Xu <mail <at> xuchunyang.me>
Date: Sat, 11 Feb 2017 14:17:26 +0800
Subject: [PATCH] Fix completing-read call in reb-change-syntax

* lisp/emacs-lisp/re-builder.el (reb-change-syntax): Use 'default' arg
of completing-read.

Copyright-paperwork-exempt: yes
---
 lisp/emacs-lisp/re-builder.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 5264dae52a..f60d723a88 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -488,10 +488,10 @@ reb-change-syntax
 Optional argument SYNTAX must be specified if called non-interactively."
   (interactive
    (list (intern
-	  (completing-read "Select syntax: "
-			   (mapcar (lambda (el) (cons (symbol-name el) 1))
-				   '(read string sregex rx))
-			   nil t (symbol-name reb-re-syntax)))))
+	  (completing-read
+	   (format "Select syntax (default %s): " reb-re-syntax)
+	   '(read string sregex rx)
+	   nil t nil nil (symbol-name reb-re-syntax)))))
 
   (if (memq syntax '(read string sregex rx))
       (let ((buffer (get-buffer reb-buffer)))
-- 
2.11.0


This bug report was last modified 8 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.