summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorYuan Fu <yuan@debian-BULLSEYE-live-builder-AMD64>2022-08-29 11:41:10 -0700
committerYuan Fu <yuan@debian-BULLSEYE-live-builder-AMD64>2022-08-29 11:41:10 -0700
commit77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273 (patch)
tree969937ec44ce5ddf9447b074aa15314e0b9e8e95 /lisp/emacs-lisp/lisp.el
parente98b4715bb986524bde9356b62429af9786ae716 (diff)
parentdf2f6fb7fc4b79834ae40db8be2ccdc1e4a273f1 (diff)
downloademacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.tar.gz
emacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.tar.bz2
emacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.zip
Merge remote-tracking branch 'origin/master' into feature/tree-sitter
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
-rw-r--r--lisp/emacs-lisp/lisp.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 641ce0d5c02..acae1a0b0a9 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -507,6 +507,11 @@ It is called with no argument, right after calling `beginning-of-defun-raw'.
So the function can assume that point is at the beginning of the defun body.
It should move point to the first position after the defun.")
+(defvar end-of-defun-moves-to-eol t
+ "Whether `end-of-defun' moves to eol before doing anything else.
+Set this to nil if this movement adversely affects the buffer's
+major mode's decisions about context.")
+
(defun buffer-end (arg)
"Return the \"far end\" position of the buffer, in direction ARG.
If ARG is positive, that's the end of the buffer.
@@ -538,7 +543,9 @@ report errors as appropriate for this kind of usage."
(push-mark))
(if (or (null arg) (= arg 0)) (setq arg 1))
(let ((pos (point))
- (beg (progn (end-of-line 1) (beginning-of-defun-raw 1) (point)))
+ (beg (progn (when end-of-defun-moves-to-eol
+ (end-of-line 1))
+ (beginning-of-defun-raw 1) (point)))
(skip (lambda ()
;; When comparing point against pos, we want to consider that
;; if point was right after the end of the function, it's
@@ -943,14 +950,7 @@ character."
(defun field-complete (table &optional predicate)
(declare (obsolete completion-in-region "24.4"))
(let ((minibuffer-completion-table table)
- (minibuffer-completion-predicate predicate)
- ;; This made sense for lisp-complete-symbol, but for
- ;; field-complete, this is out of place. --Stef
- ;; (completion-annotate-function
- ;; (unless (eq predicate 'fboundp)
- ;; (lambda (str)
- ;; (if (fboundp (intern-soft str)) " <f>"))))
- )
+ (minibuffer-completion-predicate predicate))
(call-interactively 'minibuffer-complete)))
(defun lisp-complete-symbol (&optional _predicate)