From bffa381cd9847b22b3589076b9dabeb572577580 Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Tue, 13 Sep 2016 13:17:32 -0700 Subject: [PATCH] Fix off-by-one error when going forward in end-of-defun end-of-defun (C-M-e) goes forward one too many defuns when given a prefix argument. Fix this so that doing 'C-M-e' foo times and using 'C-u foo C-M-e' do the same thing. * lisp/emacs-lisp/lisp.el (end-of-defun): Fix off-by-one error when going forward. --- lisp/emacs-lisp/lisp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index ea7cce6..bf03c44 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -452,7 +452,7 @@ end-of-defun ;; We started from after the end of the previous function. (goto-char pos)) (unless (zerop arg) - (beginning-of-defun-raw (- arg)) + (beginning-of-defun-raw (1+ (- arg))) (funcall end-of-defun-function))) ((< arg 0) ;; Moving backward. -- 2.7.4