emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109144: * simple.el (count-words): R


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109144: * simple.el (count-words): Report on narrowing.
Date: Wed, 18 Jul 2012 22:29:34 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109144
fixes bug: http://debbugs.gnu.org/9959
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2012-07-18 22:29:34 +0800
message:
  * simple.el (count-words): Report on narrowing.
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-07-18 14:17:49 +0000
+++ b/lisp/ChangeLog    2012-07-18 14:29:34 +0000
@@ -1,5 +1,7 @@
 2012-07-18  Chong Yidong  <address@hidden>
 
+       * simple.el (count-words): Report on narrowing (Bug#9959).
+
        * bindings.el: Bind M-= to count-words.
 
        * faces.el (face-spec-reset-face): Handle reverse video (Bug#4238).

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2012-07-17 18:40:15 +0000
+++ b/lisp/simple.el    2012-07-18 14:29:34 +0000
@@ -986,7 +986,11 @@
        ((use-region-p)
         (call-interactively 'count-words-region))
        (t
-        (count-words--message "Buffer" (point-min) (point-max)))))
+        (count-words--message
+         (if (= (point-max) (1+ (buffer-size)))
+             "Buffer"
+           "Narrowed part of buffer")
+         (point-min) (point-max)))))
 
 (defun count-words--message (str start end)
   (let ((lines (count-lines start end))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]