From: Charles A. Roelli Date: Tue, 19 Feb 2019 18:54:44 +0000 (+0100) Subject: Simplify easy-mmode-define-navigation X-Git-Tag: emacs-27.0.90~3572 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f7212ad42420efe951a8c5412bd47b890e3b482;p=emacs.git 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. --- 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))