diff options
| author | jave | 2015-01-05 14:12:26 +0100 |
|---|---|---|
| committer | jave | 2015-01-05 14:12:26 +0100 |
| commit | 5a0d5b71d55c73573c331e1e1a1dde9f206966e1 (patch) | |
| tree | abe791ef1dd1838121b43ab63aea630bd439a842 /lisp | |
| parent | 9681f300de4dddb250770d18dc417ec0027beb94 (diff) | |
| parent | c477f2073018ed4deb3810059c1032c1709164fa (diff) | |
| download | emacs-5a0d5b71d55c73573c331e1e1a1dde9f206966e1.tar.gz emacs-5a0d5b71d55c73573c331e1e1a1dde9f206966e1.zip | |
Merge branch 'master' into xwidget
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/progmodes/xref.el | 19 |
2 files changed, 28 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aa79a8d4b2e..f413526c0b2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2015-01-04 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | Add mouse interaction to xref. | ||
| 4 | |||
| 5 | * progmodes/xref.el (xref--button-map): New variable. | ||
| 6 | (xref--mouse-2): New command. | ||
| 7 | (xref--insert-xrefs): Add `mouse-face' and `keymap' properties to | ||
| 8 | the inserted references. | ||
| 9 | |||
| 1 | 2015-01-04 Paul Eggert <eggert@cs.ucla.edu> | 10 | 2015-01-04 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 11 | ||
| 3 | Less 'make' chatter for lisp dir | 12 | Less 'make' chatter for lisp dir |
| @@ -1903,7 +1912,7 @@ | |||
| 1903 | 2014-11-18 Paul Eggert <eggert@cs.ucla.edu> | 1912 | 2014-11-18 Paul Eggert <eggert@cs.ucla.edu> |
| 1904 | 1913 | ||
| 1905 | Port new time stamp handling to Emacs 23.2. | 1914 | Port new time stamp handling to Emacs 23.2. |
| 1906 | This fix is for Gnus. Problem reported by Katsumi Yamaoka. | 1915 | This fix is for Gnus. Reported by Katsumi Yamaoka. |
| 1907 | * calendar/time-date.el (time-add, time-subtract, time-less-p): | 1916 | * calendar/time-date.el (time-add, time-subtract, time-less-p): |
| 1908 | Use eval-and-compile, not eval-when-compile. | 1917 | Use eval-and-compile, not eval-when-compile. |
| 1909 | 1918 | ||
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 7bc6500a8de..41b70c7eff2 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -405,6 +405,21 @@ WINDOW controls how the buffer is displayed: | |||
| 405 | (defconst xref-buffer-name "*xref*" | 405 | (defconst xref-buffer-name "*xref*" |
| 406 | "The name of the buffer to show xrefs.") | 406 | "The name of the buffer to show xrefs.") |
| 407 | 407 | ||
| 408 | (defvar xref--button-map | ||
| 409 | (let ((map (make-sparse-keymap))) | ||
| 410 | (define-key map [(control ?m)] #'xref-goto-xref) | ||
| 411 | (define-key map [mouse-1] #'xref-goto-xref) | ||
| 412 | (define-key map [mouse-2] #'xref--mouse-2) | ||
| 413 | map)) | ||
| 414 | |||
| 415 | (defun xref--mouse-2 (event) | ||
| 416 | "Move point to the button and show the xref definition." | ||
| 417 | (interactive "e") | ||
| 418 | (mouse-set-point event) | ||
| 419 | (forward-line 0) | ||
| 420 | (xref--search-property 'xref-location) | ||
| 421 | (xref-show-location-at-point)) | ||
| 422 | |||
| 408 | (defun xref--insert-xrefs (xref-alist) | 423 | (defun xref--insert-xrefs (xref-alist) |
| 409 | "Insert XREF-ALIST in the current-buffer. | 424 | "Insert XREF-ALIST in the current-buffer. |
| 410 | XREF-ALIST is of the form ((GROUP . (XREF ...)) ...). Where | 425 | XREF-ALIST is of the form ((GROUP . (XREF ...)) ...). Where |
| @@ -417,7 +432,9 @@ GROUP is a string for decoration purposes and XREF is an | |||
| 417 | (with-slots (description location) xref | 432 | (with-slots (description location) xref |
| 418 | (xref--insert-propertized | 433 | (xref--insert-propertized |
| 419 | (list 'xref-location location | 434 | (list 'xref-location location |
| 420 | 'face 'font-lock-keyword-face) | 435 | 'face 'font-lock-keyword-face |
| 436 | 'mouse-face 'highlight | ||
| 437 | 'keymap xref--button-map) | ||
| 421 | description)) | 438 | description)) |
| 422 | (when (or more1 more2) | 439 | (when (or more1 more2) |
| 423 | (insert "\n"))))) | 440 | (insert "\n"))))) |