]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify easy-mmode-define-navigation
authorCharles A. Roelli <charles@aurox.ch>
Tue, 19 Feb 2019 18:54:44 +0000 (19:54 +0100)
committerCharles A. Roelli <charles@aurox.ch>
Tue, 19 Feb 2019 18:54:44 +0000 (19:54 +0100)
* 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

index 07a594fdb567b027cef0c59fd64e5da06fa002ea..0cb9a6fa122389edd2fb1e18fe1d7e1fe2b0e63b 100644 (file)
@@ -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))