From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#30065: 27.0.50; Use map-y-or-n-p in bibtex-reformat Date: Wed, 10 Jan 2018 14:33:51 +0000 Message-ID: <87wp0peqb4.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1515594882 16053 195.159.176.226 (10 Jan 2018 14:34:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2018 14:34:42 +0000 (UTC) To: 30065@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 10 15:34:38 2018 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 1eZHSV-000351-Jj for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jan 2018 15:34:27 +0100 Original-Received: from localhost ([::1]:45653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZHUT-0002zN-Hw for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jan 2018 09:36:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZHT9-0002Cv-9h for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 09:35:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZHT5-00087L-0N for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 09:35:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42484) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZHT4-00087D-S4 for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 09:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eZHT4-00086e-LI for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 09:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2018 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30065 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151559484731091 (code B ref -1); Wed, 10 Jan 2018 14:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Jan 2018 14:34:07 +0000 Original-Received: from localhost ([127.0.0.1]:50381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZHSB-00085P-FP for submit@debbugs.gnu.org; Wed, 10 Jan 2018 09:34:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZHSA-00084w-BR for submit@debbugs.gnu.org; Wed, 10 Jan 2018 09:34:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZHS4-0007Tl-7t for submit@debbugs.gnu.org; Wed, 10 Jan 2018 09:34:01 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39665) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZHS4-0007Tc-3T for submit@debbugs.gnu.org; Wed, 10 Jan 2018 09:34:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZHS2-0001bH-MS for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 09:33:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZHRz-0007Qm-Ir for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 09:33:58 -0500 Original-Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:45440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZHRz-0007Ps-6h for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 09:33:55 -0500 Original-Received: by mail-wm0-x22b.google.com with SMTP id i186so10916462wmi.4 for ; Wed, 10 Jan 2018 06:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=EbXoTKevpz+0EV6ZnXOk52qfsgPl9jkrqMpPgkTvGjo=; b=FazDInfTxd+Dov/pdUlotI3hNRpBflH74BfscM0YHLXeEuQELJbFuGQ6ZaLIgkyv6q S8u6yrlt0c6JsMQgQ2350+VhqPib1f8dqGTpXo8EYFLQ8YBdbnYogzUqwLpWnQmDjBsJ j6BU6Ma6JOLBy8MgyZHxJqIsXtYD7R0Yn7oTyC19W9nBxYayMq+NuYjoL9WEh+Oxe+XD 9KxLzbK5pUSjAIBargPrAhUm7ln/NmfKfdx/lbiUZkwb0GSeTQBlW07eRSCIXDHfWhfq q0FqXH09QzrKRwj0misVotErl3ukcpoi14aCTmNNMfM577F3AYt5NU5IDuw8/lV2+1ol t6Ww== 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:date:message-id:mime-version; bh=EbXoTKevpz+0EV6ZnXOk52qfsgPl9jkrqMpPgkTvGjo=; b=dZLUrLa8eQ4dkohi60tEsEecImDv1KQ0PcuAc8af7gDfcA0eiK5MT57ujYJTpFJnn1 NNX/cyBQBpOfJQj5W3qGvgvnd/j6/tb5AdG6JqiYlKPLVX1YJnnWyfTKP0/RHwjwnlEa MTY4r6QSJUFZ/gz9EaDGCAcd3Nmzx6pv3X7o2fAZEBUxbMEV10G7gE1we7tQUPjGm3XY 1xQwV2cNiGy1+GD4OFTWGshsFLvHEdlAwYDn0u4Y8mrP87HK3RGk9I9uvqQNdFZXJwca IAESkR4LfZ+Wx95YuDi1e5ZcCNDX422SElUHdqHA1BmfrpFEKh8qOHS4OQ9+9+qcwRWW IosQ== X-Gm-Message-State: AKwxyteTshabA9CmyCLEQdmex91wy+xUTectvORac2YVc+TvmaROx8VK y4mMlNhuvdDT/l1sqLuU5pDPNcFN X-Google-Smtp-Source: ACJfBouBtdnoO28gBoZ72rx4EIoWrPQWQWKJHxMoIwQe8jm6YwHph3h2LT/2dcqjXpd1r07juj/PWw== X-Received: by 10.80.215.23 with SMTP id t23mr1615089edi.85.1515594833612; Wed, 10 Jan 2018 06:33:53 -0800 (PST) Original-Received: from localhost ([213.233.148.28]) by smtp.gmail.com with ESMTPSA id d9sm10432442edb.18.2018.01.10.06.33.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2018 06:33:52 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:141978 Archived-At: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-lisp-textmodes-bibtex.el-bibtex-reformat-Use-map-y-o.patch >From 68a207bbe1b6a6096e5a9c0c1c333315c7aab181 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 10 Jan 2018 14:06:20 +0000 Subject: [PATCH] * lisp/textmodes/bibtex.el (bibtex-reformat): Use map-y-or-n-p. --- lisp/textmodes/bibtex.el | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index a30e146892..b9f1720518 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -4925,23 +4925,26 @@ bibtex-reformat (cond (read-options (if use-previous-options bibtex-reformat-previous-options - (setq bibtex-reformat-previous-options - (delq nil - (mapcar (lambda (option) - (if (y-or-n-p (car option)) (cdr option))) - `(("Realign entries (recommended)? " . realign) - ("Remove empty optional and alternative fields? " . opts-or-alts) - ("Remove delimiters around pure numerical fields? " . numerical-fields) - (,(concat (if bibtex-comma-after-last-field "Insert" "Remove") - " comma at end of entry? ") . last-comma) - ("Replace double page dashes by single ones? " . page-dashes) - ("Delete whitespace at the beginning and end of fields? " . whitespace) - ("Inherit booktitle? " . inherit-booktitle) - ("Force delimiters? " . delimiters) - ("Unify case of entry types and field names? " . unify-case) - ("Enclose parts of field entries by braces? " . braces) - ("Replace parts of field entries by string constants? " . strings) - ("Sort fields? " . sort-fields))))))) + (let (answers) + (map-y-or-n-p + #'car + (lambda (option) + (push (cdr option) answers)) + `(("Realign entries (recommended)? " . realign) + ("Remove empty optional and alternative fields? " . opts-or-alts) + ("Remove delimiters around pure numerical fields? " . numerical-fields) + (,(concat (if bibtex-comma-after-last-field "Insert" "Remove") + " comma at end of entry? ") . last-comma) + ("Replace double page dashes by single ones? " . page-dashes) + ("Delete whitespace at the beginning and end of fields? " . whitespace) + ("Inherit booktitle? " . inherit-booktitle) + ("Force delimiters? " . delimiters) + ("Unify case of entry types and field names? " . unify-case) + ("Enclose parts of field entries by braces? " . braces) + ("Replace parts of field entries by string constants? " . strings) + ("Sort fields? " . sort-fields)) + '("formatting action" "formatting actions" "perform")) + (setq bibtex-reformat-previous-options (nreverse answers))))) ;; Do not include required-fields because `bibtex-reformat' ;; cannot handle the error messages of `bibtex-format-entry'. ;; Use `bibtex-validate' to check for required fields. -- 2.15.1 --=-=-= Content-Type: text/plain I attach a patch for the function bibtex-reformat in lisp/textmodes/bibtex.el to avail of the function and flexibility of map-y-or-n-p instead of emulating it. If bug reports are not the preferable channel for such minor suggestions, please let me know what to do in the future. Thanks, -- Basil In GNU Emacs 27.0.50 (build 13, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-01-03 built on thunk Repository revision: f8b4e87d5d4f57954b50677add76ce5136211dc1 Windowing system distributor 'The X.Org Foundation', version 11.0.11905000 System Description: Debian GNU/Linux testing (buster) --=-=-=--