aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBasil L. Contovounesios2018-01-20 14:19:34 +0200
committerEli Zaretskii2018-01-20 14:19:34 +0200
commit9e9b71189adaa559a7a6b2780ef25578980d9751 (patch)
treeb6c1c277ecc37b1001f9178c6fcd1ad0693e404b
parentf1e4249e377cdb7f4136484925d89afa85a70477 (diff)
downloademacs-9e9b71189adaa559a7a6b2780ef25578980d9751.tar.gz
emacs-9e9b71189adaa559a7a6b2780ef25578980d9751.zip
Use map-y-or-n-p in bibtex.el
* lisp/textmodes/bibtex.el (bibtex-reformat): Use map-y-or-n-p. (Bug#30065)
-rw-r--r--lisp/textmodes/bibtex.el37
1 files changed, 20 insertions, 17 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index f6cc98241c3..15004ed9c49 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -4925,23 +4925,26 @@ If mark is active reformat entries in region, if not in whole buffer."
4925 (cond (read-options 4925 (cond (read-options
4926 (if use-previous-options 4926 (if use-previous-options
4927 bibtex-reformat-previous-options 4927 bibtex-reformat-previous-options
4928 (setq bibtex-reformat-previous-options 4928 (let (answers)
4929 (delq nil 4929 (map-y-or-n-p
4930 (mapcar (lambda (option) 4930 #'car
4931 (if (y-or-n-p (car option)) (cdr option))) 4931 (lambda (option)
4932 `(("Realign entries (recommended)? " . realign) 4932 (push (cdr option) answers))
4933 ("Remove empty optional and alternative fields? " . opts-or-alts) 4933 `(("Realign entries (recommended)? " . realign)
4934 ("Remove delimiters around pure numerical fields? " . numerical-fields) 4934 ("Remove empty optional and alternative fields? " . opts-or-alts)
4935 (,(concat (if bibtex-comma-after-last-field "Insert" "Remove") 4935 ("Remove delimiters around pure numerical fields? " . numerical-fields)
4936 " comma at end of entry? ") . last-comma) 4936 (,(concat (if bibtex-comma-after-last-field "Insert" "Remove")
4937 ("Replace double page dashes by single ones? " . page-dashes) 4937 " comma at end of entry? ") . last-comma)
4938 ("Delete whitespace at the beginning and end of fields? " . whitespace) 4938 ("Replace double page dashes by single ones? " . page-dashes)
4939 ("Inherit booktitle? " . inherit-booktitle) 4939 ("Delete whitespace at the beginning and end of fields? " . whitespace)
4940 ("Force delimiters? " . delimiters) 4940 ("Inherit booktitle? " . inherit-booktitle)
4941 ("Unify case of entry types and field names? " . unify-case) 4941 ("Force delimiters? " . delimiters)
4942 ("Enclose parts of field entries by braces? " . braces) 4942 ("Unify case of entry types and field names? " . unify-case)
4943 ("Replace parts of field entries by string constants? " . strings) 4943 ("Enclose parts of field entries by braces? " . braces)
4944 ("Sort fields? " . sort-fields))))))) 4944 ("Replace parts of field entries by string constants? " . strings)
4945 ("Sort fields? " . sort-fields))
4946 '("formatting action" "formatting actions" "perform"))
4947 (setq bibtex-reformat-previous-options (nreverse answers)))))
4945 ;; Do not include required-fields because `bibtex-reformat' 4948 ;; Do not include required-fields because `bibtex-reformat'
4946 ;; cannot handle the error messages of `bibtex-format-entry'. 4949 ;; cannot handle the error messages of `bibtex-format-entry'.
4947 ;; Use `bibtex-validate' to check for required fields. 4950 ;; Use `bibtex-validate' to check for required fields.