From: Richard M. Stallman Date: Sat, 29 Jun 1996 01:02:59 +0000 (+0000) Subject: (mouse-start-end): Support selecting strings by double X-Git-Tag: emacs-19.34~301 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5377087736872b0ea7e400647a986ef6f74d58ef;p=emacs.git (mouse-start-end): Support selecting strings by double clicking on a character with quote syntax. --- diff --git a/lisp/mouse.el b/lisp/mouse.el index 41fda55689b..23f5c192e3f 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -651,6 +651,31 @@ If DIR is positive skip forward; if negative, skip backward." (backward-sexp 1) (point)) (1+ start))) + ((and (= mode 1) + (= start end) + (char-after start) + (= (char-syntax (char-after start)) ?\")) + (let ((open (or (eq start (point-min)) + (save-excursion + (goto-char (- start 1)) + (looking-at "\\s(\\|\\s \\|\\s>"))))) + (if open + (list start + (save-excursion + (condition-case nil + (progn + (goto-char start) + (forward-sexp 1) + (point)) + (error end)))) + (list (1+ start) + (save-excursion + (condition-case nil + (progn + (goto-char (1+ start)) + (backward-sexp 1) + (point)) + (error end))))))) ((= mode 1) (list (save-excursion (goto-char start)