Commit 6f0e09d4 authored by Richard M. Stallman's avatar Richard M. Stallman

(beginning-of-sexp): New function.

(bounds-of-thing-at-point): Fix typo in computing real-beg.
parent 53520519
...@@ -114,7 +114,7 @@ of the textual entity that was found." ...@@ -114,7 +114,7 @@ of the textual entity that was found."
(real-beg (real-beg
(progn (progn
(funcall (funcall
(or (get thing 'end-op) (or (get thing 'beginning-op)
(function (lambda () (forward-thing thing -1))))) (function (lambda () (forward-thing thing -1)))))
(point)))) (point))))
(if (and real-beg end (<= real-beg orig) (<= orig end)) (if (and real-beg end (<= real-beg orig) (<= orig end))
...@@ -173,6 +173,15 @@ a symbol as a valid THING." ...@@ -173,6 +173,15 @@ a symbol as a valid THING."
(put 'sexp 'end-op 'end-of-sexp) (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 ;; Lists
(put 'list 'end-op (function (lambda () (up-list 1)))) (put 'list 'end-op (function (lambda () (up-list 1))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment