]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/lisp.el (mark-defun): Simplify moving the point.
authorNoam Postavsky <npostavs@gmail.com>
Thu, 20 Apr 2017 12:07:19 +0000 (14:07 +0200)
committerMarcin Borkowski <mbork@mbork.pl>
Fri, 12 May 2017 09:36:45 +0000 (11:36 +0200)
lisp/emacs-lisp/lisp.el

index e74e2474ee9be561902c2727fd30b794cda102e1..71c27d08a2f3b59d98b2ae8fb75ca7fe495cf915 100644 (file)
@@ -569,13 +569,9 @@ the one(s) already marked."
                                         ; https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-02/msg00196.html
                     (beginning-of-defun (1- (- arg))))
                   (push-mark end nil t))))))
-  (let (nbobp)
-    (while (progn
-             (setq nbobp (zerop (forward-line -1)))
-             (and (looking-at "^\\s-*$")
-                  nbobp)))
-    (when nbobp
-      (forward-line 1))))
+  (skip-chars-backward "[:space:]\n")
+  (unless (bobp)
+    (forward-line 1)))
 
 (defvar narrow-to-defun-include-comments nil
   "If non-nil, `narrow-to-defun' will also show comments preceding the defun.")