unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: 35981@debbugs.gnu.org
Subject: bug#35981: [PATCH] Use ngettext in `count-lines-page'
Date: Wed, 29 May 2019 11:34:12 +0200	[thread overview]
Message-ID: <CADwFkmnnnvaimo2hc=pZtFRkOfuky5KZLq=ueFgFgh3mQX2Kpw@mail.gmail.com> (raw)

[-- 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


             reply	other threads:[~2019-05-29  9:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29  9:34 Stefan Kangas [this message]
2019-05-29 11:41 ` bug#35981: [PATCH] Use ngettext in `count-lines-page' Basil L. Contovounesios
2019-05-29 11:46   ` Stefan Kangas
2019-06-10  0:03 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmnnnvaimo2hc=pZtFRkOfuky5KZLq=ueFgFgh3mQX2Kpw@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=35981@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).