emacs-diffs
[Top][All Lists]
Advanced

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

master ada429c3752: * lisp/emacs-lisp/lisp.el (forward-sexp-function): S


From: Juri Linkov
Subject: master ada429c3752: * lisp/emacs-lisp/lisp.el (forward-sexp-function): Set back to nil.
Date: Wed, 17 Apr 2024 02:53:37 -0400 (EDT)

branch: master
commit ada429c375235c4d8bd3bf5e6bb2507fb44f63dd
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/emacs-lisp/lisp.el (forward-sexp-function): Set back to nil.
    
    (forward-sexp): Revert back to checking 'forward-sexp-function'
    for nil (bug#70426).
---
 etc/NEWS                | 4 ----
 lisp/emacs-lisp/lisp.el | 8 ++++----
 lisp/treesit.el         | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 99f33a7b8dd..bc8be557711 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2103,10 +2103,6 @@ All tree-sitter enabled modes that define 'sentence' in
 
 ** Functions and variables to move by program sexps
 
-*** New function 'forward-sexp-default-function'.
-The previous implementation of 'forward-sexp' is moved into its
-own function, to be bound by 'forward-sexp-function'.
-
 *** New function 'treesit-forward-sexp'.
 Tree-sitter conditionally sets 'forward-sexp-function' for major modes
 that have defined 'sexp' in 'treesit-thing-settings' to enable
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index bd0b38db7ea..7e6db51b1d5 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -50,7 +50,7 @@ This affects `insert-parentheses' and `insert-pair'."
   (goto-char (or (scan-sexps (point) arg) (buffer-end arg)))
   (if (< arg 0) (backward-prefix-chars)))
 
-(defvar forward-sexp-function #'forward-sexp-default-function
+(defvar forward-sexp-function nil
   ;; FIXME:
   ;; - for some uses, we may want a "sexp-only" version, which only
   ;;   jumps over a well-formed sexp, rather than some dwimish thing
@@ -79,9 +79,9 @@ report errors as appropriate for this kind of usage."
                                     "No next sexp"
                                   "No previous sexp"))))
     (or arg (setq arg 1))
-    (funcall (or forward-sexp-function
-                 #'forward-sexp-default-function)
-             arg)))
+    (if forward-sexp-function
+        (funcall forward-sexp-function arg)
+      (forward-sexp-default-function arg))))
 
 (defun backward-sexp (&optional arg interactive)
   "Move backward across one balanced expression (sexp).
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 2973aba771c..2b899a84183 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2153,7 +2153,7 @@ by `text' and `sexp' in `treesit-thing-settings'."
   (let ((arg (or arg 1))
         (pred (or treesit-sexp-type-regexp 'sexp)))
     (or (when (treesit-node-match-p (treesit-node-at (point)) 'text t)
-          (funcall #'forward-sexp-default-function arg)
+          (forward-sexp-default-function arg)
           t)
         (if (> arg 0)
             (treesit-end-of-thing pred (abs arg) 'restricted)



reply via email to

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