diff options
author | Charles A. Roelli <charles@aurox.ch> | 2019-02-19 19:54:44 +0100 |
---|---|---|
committer | Charles A. Roelli <charles@aurox.ch> | 2019-02-19 19:54:44 +0100 |
commit | 9f7212ad42420efe951a8c5412bd47b890e3b482 (patch) | |
tree | e4d400a589c6fea1b6671d786262801e98d86914 /lisp/emacs-lisp | |
parent | 0a6c4479cff17b487580abe3a7ee202e71be25d2 (diff) | |
download | emacs-9f7212ad42420efe951a8c5412bd47b890e3b482.tar.gz |
Simplify easy-mmode-define-navigation
* lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
Simplify a one-argument call to "or" and use buffer-narrowed-p instead
of checking that condition by hand.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 07a594fdb56..0cb9a6fa122 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -624,9 +624,7 @@ BODY is executed after moving to the destination location." (when-narrowed (lambda (body) (if (null narrowfun) body - `(let ((was-narrowed - (prog1 (or (< (- (point-max) (point-min)) (buffer-size))) - (widen)))) + `(let ((was-narrowed (prog1 (buffer-narrowed-p) (widen)))) ,body (when was-narrowed (funcall #',narrowfun))))))) (unless name (setq name base-name)) |