all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#35981: [PATCH] Use ngettext in `count-lines-page'
@ 2019-05-29  9:34 Stefan Kangas
  2019-05-29 11:41 ` Basil L. Contovounesios
  2019-06-10  0:03 ` Paul Eggert
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Kangas @ 2019-05-29  9:34 UTC (permalink / raw)
  To: 35981

[-- Attachment #1: Type: text/plain, Size: 112 bytes --]

See attached patch to correctly use ngettext in `count-lines-page' to get
pluralization.

Thanks,
Stefan Kangas

[-- Attachment #2: 0001-Use-ngettext-in-count-lines-page.patch --]
[-- Type: application/octet-stream, Size: 970 bytes --]

From 93092aa18ca4348d14c3154a6ffbdfc535536cba Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Wed, 29 May 2019 11:27:22 +0200
Subject: [PATCH] Use ngettext in `count-lines-page'

* textmodes/page.el (count-lines-page): Use ngettext.
---
 lisp/textmodes/page.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index 220ef2d7fd..1379880374 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -142,7 +142,10 @@ count-lines-page
       (setq total (count-lines beg end)
 	    before (count-lines beg opoint)
 	    after (count-lines opoint end))
-      (message "Page has %d lines (%d + %d)" total before after))))
+      (message "Page has %s (%d + %d)"
+               (format-message (ngettext "%d line" "%d lines" total) total)
+               before
+               after))))
 
 (defun what-page ()
   "Print page and line number of point."
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-10  0:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-29  9:34 bug#35981: [PATCH] Use ngettext in `count-lines-page' Stefan Kangas
2019-05-29 11:41 ` Basil L. Contovounesios
2019-05-29 11:46   ` Stefan Kangas
2019-06-10  0:03 ` Paul Eggert

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.