From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chunyang Xu Newsgroups: gmane.emacs.bugs 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-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1486795336 1442 195.159.176.226 (11 Feb 2017 06:42:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Feb 2017 06:42:16 +0000 (UTC) To: 25687@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 11 07:42:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ccRNo-0008JQ-5Y for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Feb 2017 07:42:08 +0100 Original-Received: from localhost ([::1]:47346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccRNt-00017A-LH for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Feb 2017 01:42:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccRNl-00016y-GY for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 01:42:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccRNi-0003if-CQ for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 01:42:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37075) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ccRNi-0003ib-9K for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 01:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ccRNi-0005rk-3O for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 01:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Chunyang Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Feb 2017 06:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25687 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148679527222487 (code B ref -1); Sat, 11 Feb 2017 06:42:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Feb 2017 06:41:12 +0000 Original-Received: from localhost ([127.0.0.1]:35274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccRMt-0005qd-Q7 for submit@debbugs.gnu.org; Sat, 11 Feb 2017 01:41:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccRMp-0005qD-26 for submit@debbugs.gnu.org; Sat, 11 Feb 2017 01:41:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccRMi-0003b7-PB for submit@debbugs.gnu.org; Sat, 11 Feb 2017 01:41:01 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:49956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccRMi-0003b2-Ld for submit@debbugs.gnu.org; Sat, 11 Feb 2017 01:41:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccRMh-0000wc-5d for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 01:41:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccRMe-0003aV-1U for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 01:40:59 -0500 Original-Received: from smtpbgbr2.qq.com ([54.207.22.56]:45019) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccRMd-0003ZU-LG for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 01:40:55 -0500 X-QQ-mid: bizesmtp5t1486795242t3ys1ynpy Original-Received: from Chunyangs-MacBook-Air.local (unknown [121.234.19.12]) by esmtp4.qq.com (ESMTP) with SMTP id 0 for ; Sat, 11 Feb 2017 14:40:41 +0800 (CST) X-QQ-SSF: 0110000000200060F410B00A0000000 X-QQ-FEAT: cVyAxUU2dcit7p5k1hpsic5hk90y9FRZYlsqphybZ9CKNbOKUmNw39Vi4B0Ak U54pW285CWKnAv7HPt1dOifkgJtEyVgRSydib1YYm6BOrslo5Cq+f/DS73iWSkwz5m8dy+v xgIvbt1VU/Af2nElOlylOb40qll9ow+KcL6mtfHVL0uQ+FvL6ekInRCdHKnbYmODMEVhyYK 7B0HyEMqHfUytW1X0ylsyAvbA11ca3bzCeoOJBLT3Sd/cLpcgdwCDfGW3rJ0aZtk= X-QQ-GoodBg: 0 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129234 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-completing-read-call-in-reb-change-syntax.patch >From c0b4621083a6947f75ea58b4c535452a4caad4a5 Mon Sep 17 00:00:00 2001 From: Chunyang Xu 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 --=-=-=--