>From daf641a0c57bd8fdcf1fad40bcfbc23a8fb40101 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Wed, 22 Feb 2017 10:02:47 +0100 Subject: [PATCH] Fix (beginning-of-defun-raw 0) * lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): fix behavior with arg equal to zero Unless `beginning-of-defun-function' is non-nil (and should take care of that situation), do nothing when argument is 0. --- lisp/emacs-lisp/lisp.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 0172e3af26..b2dd8edf42 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -337,6 +337,8 @@ beginning-of-defun-raw (dotimes (_ (- arg)) (funcall end-of-defun-function)))))) + ((eq arg 0) nil) + ((or defun-prompt-regexp open-paren-in-column-0-is-defun-start) (and (< arg 0) (not (eobp)) (forward-char 1)) (and (re-search-backward (if defun-prompt-regexp @@ -356,8 +358,6 @@ beginning-of-defun-raw ;; call to scan-lists below can be extremely slow. This is because ;; back_comment in syntax.c may have to scan from bob to find the ;; beginning of each comment. Fixing this is not trivial -- cyd. - - ((eq arg 0)) (t (let ((floor (point-min)) (ceiling (point-max)) -- 2.11.1