diff options
| author | Chong Yidong | 2012-07-18 22:29:34 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-07-18 22:29:34 +0800 |
| commit | 9587c6884290b04935c9e099690e95b0d282c628 (patch) | |
| tree | 0afdc043f00a24c49e0a69957e6982a0b14ea505 | |
| parent | 0fe776a1e40a7ce3c192d7a134c15b3a9ee7fc6e (diff) | |
| download | emacs-9587c6884290b04935c9e099690e95b0d282c628.tar.gz emacs-9587c6884290b04935c9e099690e95b0d282c628.zip | |
* simple.el (count-words): Report on narrowing.
Fixes: debbugs:9959
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/simple.el | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42e8e9a84fc..794de32b69b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2012-07-18 Chong Yidong <cyd@gnu.org> | 1 | 2012-07-18 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * simple.el (count-words): Report on narrowing (Bug#9959). | ||
| 4 | |||
| 3 | * bindings.el: Bind M-= to count-words. | 5 | * bindings.el: Bind M-= to count-words. |
| 4 | 6 | ||
| 5 | * faces.el (face-spec-reset-face): Handle reverse video (Bug#4238). | 7 | * 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." | |||
| 986 | ((use-region-p) | 986 | ((use-region-p) |
| 987 | (call-interactively 'count-words-region)) | 987 | (call-interactively 'count-words-region)) |
| 988 | (t | 988 | (t |
| 989 | (count-words--message "Buffer" (point-min) (point-max))))) | 989 | (count-words--message |
| 990 | (if (= (point-max) (1+ (buffer-size))) | ||
| 991 | "Buffer" | ||
| 992 | "Narrowed part of buffer") | ||
| 993 | (point-min) (point-max))))) | ||
| 990 | 994 | ||
| 991 | (defun count-words--message (str start end) | 995 | (defun count-words--message (str start end) |
| 992 | (let ((lines (count-lines start end)) | 996 | (let ((lines (count-lines start end)) |