GNU bug report logs -
#24427
25.1.50; end-of-defun jumps too far
Previous Next
Reported by: Marcin Borkowski <mbork <at> mbork.pl>
Date: Tue, 13 Sep 2016 12:54:02 UTC
Severity: normal
Tags: fixed, patch
Found in version 25.1.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Appears to be an off-by-one error when calling `beginning-of-defun-raw`
during the second part of moving forward. This patch `1+`s the `(- arg)`
to make both methods equivalent.
Please do not hesitate to mention anything I may have missed.
-----
[0001-Fix-off-by-one-error-when-going-forward-in-end-of-de.patch (text/x-patch, inline)]
From 0f4facc6ea2bfe01ba3b8c7e3a0e99210d1bb1e1 Mon Sep 17 00:00:00 2001
From: Robert Cochran <robert-git <at> 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
[Message part 3 (text/plain, inline)]
-----
HTH,
--
~Robert Cochran
GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26 AD2D E5C3 EB36 4886 8871
This bug report was last modified 4 years and 287 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.