emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9f7212a: Simplify easy-mmode-define-navigation


From: Charles A. Roelli
Subject: [Emacs-diffs] master 9f7212a: Simplify easy-mmode-define-navigation
Date: Tue, 19 Feb 2019 13:44:11 -0500 (EST)

branch: master
commit 9f7212ad42420efe951a8c5412bd47b890e3b482
Author: Charles A. Roelli <address@hidden>
Commit: Charles A. Roelli <address@hidden>

    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 07a594f..0cb9a6f 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]