mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-23 07:19:15 +00:00
(beginning-of-sexp): New function.
(bounds-of-thing-at-point): Fix typo in computing real-beg.
This commit is contained in:
parent
5352051926
commit
6f0e09d4d0
@ -114,7 +114,7 @@ of the textual entity that was found."
|
||||
(real-beg
|
||||
(progn
|
||||
(funcall
|
||||
(or (get thing 'end-op)
|
||||
(or (get thing 'beginning-op)
|
||||
(function (lambda () (forward-thing thing -1)))))
|
||||
(point))))
|
||||
(if (and real-beg end (<= real-beg orig) (<= orig end))
|
||||
@ -173,6 +173,15 @@ a symbol as a valid THING."
|
||||
|
||||
(put 'sexp 'end-op 'end-of-sexp)
|
||||
|
||||
(defun beginning-of-sexp ()
|
||||
(let ((char-syntax (char-syntax (char-before (point)))))
|
||||
(if (or (eq char-syntax ?\()
|
||||
(and (eq char-syntax ?\") (in-string-p)))
|
||||
(forward-char -1)
|
||||
(forward-sexp -1))))
|
||||
|
||||
(put 'sexp 'beginning-op 'beginning-of-sexp)
|
||||
|
||||
;; Lists
|
||||
|
||||
(put 'list 'end-op (function (lambda () (up-list 1))))
|
||||
|
Loading…
Reference in New Issue
Block a user