From 02f22865f68896b1c4c73153a28d7045384dc024 Mon Sep 17 00:00:00 2001 From: Tomas Nordin Date: Tue, 9 Jun 2026 22:00:26 +0300 Subject: [PATCH] Partially revert changes from bug#6157 (bug#81170, bug#45226) * lisp/emacs-lisp/lisp.el (narrow-to-defun): Partially revert changes from bug#6157 (bug#81170, bug#45226) --- lisp/emacs-lisp/lisp.el | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 936d5f91a06..41c740912f7 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -756,15 +756,10 @@ Interactively, the behavior depends on `narrow-to-defun-include-comments'." ;; the function might go to the previous function. ;; ;; Therefore we first move one character forward and then call - ;; `beginning-of-defun'. However now we must check that we did - ;; not move into the next function. - (let ((here (point))) - (unless (eolp) - (forward-char)) - (beginning-of-defun) - (when (< (point) here) - (goto-char here) - (beginning-of-defun))) + ;; `beginning-of-defun'. + (unless (eolp) + (forward-char)) + (beginning-of-defun) (setq beg (point)) (end-of-defun) (setq end (point))