From 9f7212ad42420efe951a8c5412bd47b890e3b482 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Tue, 19 Feb 2019 19:54:44 +0100 Subject: [PATCH] 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. --- lisp/emacs-lisp/easy-mmode.el | 4 +--- 1 file changed, 1 insertion(+), 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)) -- 2.39.2