From: Chong Yidong Date: Wed, 18 Jul 2012 14:29:34 +0000 (+0800) Subject: * simple.el (count-words): Report on narrowing. X-Git-Tag: emacs-24.2.90~1144 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9587c6884290b04935c9e099690e95b0d282c628;p=emacs.git * simple.el (count-words): Report on narrowing. Fixes: debbugs:9959 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42e8e9a84fc..794de32b69b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-07-18 Chong Yidong + * 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). diff --git a/lisp/simple.el b/lisp/simple.el index c958c460f98..3240ede0299 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -986,7 +986,11 @@ END, without printing any message." ((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))