From 5377087736872b0ea7e400647a986ef6f74d58ef Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 29 Jun 1996 01:02:59 +0000 Subject: [PATCH] (mouse-start-end): Support selecting strings by double clicking on a character with quote syntax. --- lisp/mouse.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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) -- 2.39.2