diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 9 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 2 | ||||
-rw-r--r-- | lisp/net/browse-url.el | 2 | ||||
-rw-r--r-- | lisp/ses.el | 4 | ||||
-rw-r--r-- | lisp/simple.el | 8 | ||||
-rw-r--r-- | lisp/subr.el | 4 |
6 files changed, 19 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 33e641b5fc1..7aae8fd7854 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,13 @@ 2012-09-07 Chong Yidong <cyd@gnu.org> - * simple.el (count-words--buffer-message): Fix narrowing check. + * subr.el (buffer-narrowed-p): New function. + + * ses.el (ses-widen): + * simple.el (count-words--buffer-message): + * net/browse-url.el (browse-url-of-buffer): Use it + + * simple.el (count-words-region): Don't signal an error if there + is a non-nil prefix arg and the mark is not set. * help.el (describe-key-briefly): Allow the message to be seen when invoked from the minibuffer (Bug#7014). diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 7d70d22c9cd..a59beaeb7ac 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "e09b4be5072a8b52d40af6e073876e76") +;;;;;; "cl-macs" "cl-macs.el" "9f9bae5b8ccaf325bd59ba9be2b27c44") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 20d71215926..d1d33bfe566 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -743,7 +743,7 @@ narrowed." (and buffer (set-buffer buffer)) (let ((file-name ;; Ignore real name if restricted - (and (= (- (point-max) (point-min)) (buffer-size)) + (and (not (buffer-narrowed-p)) (or buffer-file-name (and (boundp 'dired-directory) dired-directory))))) (or file-name diff --git a/lisp/ses.el b/lisp/ses.el index 8add16a6996..7cdac74e310 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -1270,11 +1270,9 @@ when the width of cell (ROW,COL) has changed." ;; The data area ;;---------------------------------------------------------------------------- -(defun ses-narrowed-p () (/= (- (point-max) (point-min)) (buffer-size))) - (defun ses-widen () "Turn off narrowing, to be reenabled at end of command loop." - (if (ses-narrowed-p) + (if (buffer-narrowed-p) (setq ses--deferred-narrow t)) (widen)) diff --git a/lisp/simple.el b/lisp/simple.el index ca73ba1b03a..d87ae3c5c15 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -974,7 +974,9 @@ rather than the region. If called from Lisp, return the number of words between positions START and END." - (interactive "r\nP") + (interactive (if current-prefix-arg + (list nil nil current-prefix-arg) + (list (region-beginning) (region-end) nil))) (cond ((not (called-interactively-p 'any)) (count-words start end)) (arg @@ -1008,9 +1010,7 @@ END, without printing any message." (defun count-words--buffer-message () (count-words--message - (if (= (- (point-max) (point-min)) (buffer-size)) - "Buffer" - "Narrowed part of buffer") + (if (buffer-narrowed-p) "Narrowed part of buffer" "Buffer") (point-min) (point-max))) (defun count-words--message (str start end) diff --git a/lisp/subr.el b/lisp/subr.el index 74afd59f8d5..621622e70eb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2647,6 +2647,10 @@ directory if it does not exist." ;;;; Misc. useful functions. +(defsubst buffer-narrowed-p () + "Return non-nil if the current buffer is narrowed." + (/= (- (point-max) (point-min)) (buffer-size))) + (defun find-tag-default () "Determine default tag to search for, based on text at point. If there is no plausible default, return nil." |