From: Robert Cochran <robert-emacs@cochranmail.com>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: 24427@debbugs.gnu.org
Subject: bug#24427: 25.1.50; end-of-defun jumps too far
Date: Tue, 13 Sep 2016 13:26:59 -0700 [thread overview]
Message-ID: <87d1k7a6lo.fsf@cochranmail.com> (raw)
In-Reply-To: <87fup4q7ut.fsf@mbork.pl> (Marcin Borkowski's message of "Tue, 13 Sep 2016 14:53:14 +0200")
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
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.
-----
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix off-by-one error in end-of-defun --]
[-- Type: text/x-patch, Size: 1065 bytes --]
From 0f4facc6ea2bfe01ba3b8c7e3a0e99210d1bb1e1 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
[-- Attachment #3: Type: text/plain, Size: 102 bytes --]
-----
HTH,
--
~Robert Cochran
GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26 AD2D E5C3 EB36 4886 8871
next prev parent reply other threads:[~2016-09-13 20:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-13 12:53 bug#24427: 25.1.50; end-of-defun jumps too far Marcin Borkowski
2016-09-13 20:26 ` Robert Cochran [this message]
2016-09-13 20:30 ` Robert Cochran
2016-09-20 18:31 ` Robert Cochran
2016-09-21 19:59 ` Marcin Borkowski
2016-09-22 10:35 ` Marcin Borkowski
2016-10-02 5:12 ` Robert Cochran
2018-06-17 17:50 ` Noam Postavsky
2020-08-11 14:03 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1k7a6lo.fsf@cochranmail.com \
--to=robert-emacs@cochranmail.com \
--cc=24427@debbugs.gnu.org \
--cc=mbork@mbork.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.