* bug#30064: 27.0.50; Improve grammar of map-y-or-n-p help text
@ 2018-01-10 14:25 Basil L. Contovounesios
2018-01-10 15:25 ` Basil L. Contovounesios
0 siblings, 1 reply; 3+ messages in thread
From: Basil L. Contovounesios @ 2018-01-10 14:25 UTC (permalink / raw)
To: 30064
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Improve-grammar-of-map-y-or-n-p-help-text.patch --]
[-- Type: text/x-diff, Size: 1360 bytes --]
From c846d0f52a398e97f0cf705c2ae17a93629e2e66 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Wed, 10 Jan 2018 13:55:29 +0000
Subject: [PATCH] Improve grammar of map-y-or-n-p help text
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Do not follow a
definite article with an action verb in C-h help text.
---
lisp/emacs-lisp/map-ynp.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index 2a7eddedad..5aa2a6fad1 100644
--- a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -197,14 +197,14 @@ map-y-or-n-p
(objects (if help (nth 1 help) "objects"))
(action (if help (nth 2 help) "act on")))
(concat
- (format-message "\
+ (format-message
+ "\
Type SPC or `y' to %s the current %s;
DEL or `n' to skip the current %s;
-RET or `q' to give up on the %s (skip all remaining %s);
+RET or `q' to skip the current and all remaining %s;
C-g to quit (cancel the whole command);
! to %s all remaining %s;\n"
- action object object action objects action
- objects)
+ action object object objects action objects)
(mapconcat (function
(lambda (elt)
(format "%s to %s"
--
2.15.1
[-- Attachment #2: Type: text/plain, Size: 771 bytes --]
The help text displayed by the function map-y-or-n-p when the user types
C-h contains the following grammatically dubious phrase:
RET or ‘q’ to give up on the act on (skip all remaining objects);
^^^^^^^^^^
where an (configurable) action verb follows the definite article.
I attach a patch to both avoid this and clarify that the current object
is skipped as well as all remaining ones.
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)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#30064: 27.0.50; Improve grammar of map-y-or-n-p help text
2018-01-10 14:25 bug#30064: 27.0.50; Improve grammar of map-y-or-n-p help text Basil L. Contovounesios
@ 2018-01-10 15:25 ` Basil L. Contovounesios
2018-01-20 12:25 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Basil L. Contovounesios @ 2018-01-10 15:25 UTC (permalink / raw)
To: 30064
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Improve-grammar-of-map-y-or-n-p-help-text-bug-30064.patch --]
[-- Type: text/x-diff, Size: 1376 bytes --]
From eddabf4a3cba46000ba04356b38e86b3616aff82 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Wed, 10 Jan 2018 13:55:29 +0000
Subject: [PATCH 1/2] Improve grammar of map-y-or-n-p help text (bug#30064)
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Do not follow a
definite article with an action verb in C-h help text.
---
lisp/emacs-lisp/map-ynp.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index 2a7eddedad..5aa2a6fad1 100644
--- a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -197,14 +197,14 @@ map-y-or-n-p
(objects (if help (nth 1 help) "objects"))
(action (if help (nth 2 help) "act on")))
(concat
- (format-message "\
+ (format-message
+ "\
Type SPC or `y' to %s the current %s;
DEL or `n' to skip the current %s;
-RET or `q' to give up on the %s (skip all remaining %s);
+RET or `q' to skip the current and all remaining %s;
C-g to quit (cancel the whole command);
! to %s all remaining %s;\n"
- action object object action objects action
- objects)
+ action object object objects action objects)
(mapconcat (function
(lambda (elt)
(format "%s to %s"
--
2.15.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Simplify-map-y-or-n-p-help-text-logic-bug-30064.patch --]
[-- Type: text/x-diff, Size: 2606 bytes --]
From 8d84b1bdfb2c974720cb3bff43a5114150422eca Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Wed, 10 Jan 2018 15:07:37 +0000
Subject: [PATCH 2/2] Simplify map-y-or-n-p help text logic (bug#30064)
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
Use with-help-window instead of with-output-to-temp-buffer.
Simplify string concatenation.
---
lisp/emacs-lisp/map-ynp.el | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index 5aa2a6fad1..dd80524a15 100644
--- a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -191,11 +191,11 @@ map-y-or-n-p
(funcall actor elt)
(setq actions (1+ actions))))))
((eq def 'help)
- (with-output-to-temp-buffer "*Help*"
+ (with-help-window (help-buffer)
(princ
- (let ((object (if help (nth 0 help) "object"))
- (objects (if help (nth 1 help) "objects"))
- (action (if help (nth 2 help) "act on")))
+ (let ((object (or (nth 0 help) "object"))
+ (objects (or (nth 1 help) "objects"))
+ (action (or (nth 2 help) "act on")))
(concat
(format-message
"\
@@ -205,20 +205,16 @@ map-y-or-n-p
C-g to quit (cancel the whole command);
! to %s all remaining %s;\n"
action object object objects action objects)
- (mapconcat (function
- (lambda (elt)
- (format "%s to %s"
- (single-key-description
- (nth 0 elt))
- (nth 2 elt))))
+ (mapconcat (lambda (elt)
+ (format "%s to %s;\n"
+ (single-key-description
+ (nth 0 elt))
+ (nth 2 elt)))
action-alist
- ";\n")
- (if action-alist ";\n")
- (format "or . (period) to %s \
-the current %s and exit."
- action object))))
- (with-current-buffer standard-output
- (help-mode)))
+ "")
+ (format
+ "or . (period) to %s the current %s and exit."
+ action object)))))
(funcall try-again))
((and (symbolp def) (commandp def))
--
2.15.1
[-- Attachment #3: Type: text/plain, Size: 249 bytes --]
I was able to make some minor improvements/simplifications to the logic
surrounding my last patch. I attach a patch to this effect, along with
a reworded version of the original patch to include the assigned bug
ticket number.
Thanks,
--
Basil
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#30064: 27.0.50; Improve grammar of map-y-or-n-p help text
2018-01-10 15:25 ` Basil L. Contovounesios
@ 2018-01-20 12:25 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2018-01-20 12:25 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 30064-done
> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Date: Wed, 10 Jan 2018 15:25:39 +0000
>
> I was able to make some minor improvements/simplifications to the logic
> surrounding my last patch. I attach a patch to this effect, along with
> a reworded version of the original patch to include the assigned bug
> ticket number.
Thanks, pushed to the master branch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-20 12:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10 14:25 bug#30064: 27.0.50; Improve grammar of map-y-or-n-p help text Basil L. Contovounesios
2018-01-10 15:25 ` Basil L. Contovounesios
2018-01-20 12:25 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).