bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#24427: 25.1.50; end-of-defun jumps too far


From: Robert Cochran
Subject: bug#24427: 25.1.50; end-of-defun jumps too far
Date: Tue, 13 Sep 2016 13:30:21 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Oops, didn't double-space the sentence ending (again!). Fixed in this
copy.

-----

>From bffa381cd9847b22b3589076b9dabeb572577580 Mon Sep 17 00:00:00 2001
From: Robert Cochran <robert-git@cochranmail.com>
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

-----

HTH,
-- 
~Robert Cochran

GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26  AD2D E5C3 EB36 4886 8871

reply via email to

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