aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2015-05-05 05:05:02 +0300
committerDmitry Gutov2015-05-05 05:14:01 +0300
commitca717aa0fd048d3529ad8f5cedb37e0b31169b96 (patch)
tree203d3d78c758de928ba97cc312d27daf8a8ce0eb
parent46c94cd599374556d65daffa173e7028df69bc1c (diff)
downloademacs-ca717aa0fd048d3529ad8f5cedb37e0b31169b96.tar.gz
emacs-ca717aa0fd048d3529ad8f5cedb37e0b31169b96.zip
Buttonize the whole line, including the number at the beginning
* lisp/progmodes/xref.el (xref--location-at-point): Revert the previous change. (xref--insert-xrefs): Buttonize the whole line, including the number at the beginning.
-rw-r--r--lisp/progmodes/xref.el37
1 files changed, 18 insertions, 19 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 657657c687a..4b2a4ee7200 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -439,10 +439,9 @@ Used for temporary buffers.")
439 (xref-show-location-at-point)) 439 (xref-show-location-at-point))
440 440
441(defun xref--location-at-point () 441(defun xref--location-at-point ()
442 (let ((pos (next-single-char-property-change (line-beginning-position) 442 (save-excursion
443 'xref-location 443 (back-to-indentation)
444 nil (line-end-position)))) 444 (get-text-property (point) 'xref-location)))
445 (and pos (get-text-property pos 'xref-location))))
446 445
447(defvar-local xref--window nil 446(defvar-local xref--window nil
448 "ACTION argument to call `display-buffer' with.") 447 "ACTION argument to call `display-buffer' with.")
@@ -548,21 +547,21 @@ GROUP is a string for decoration purposes and XREF is an
548 (xref--insert-propertized '(face compilation-info) group "\n") 547 (xref--insert-propertized '(face compilation-info) group "\n")
549 (cl-loop for (xref . more2) on xrefs do 548 (cl-loop for (xref . more2) on xrefs do
550 (with-slots (description location) xref 549 (with-slots (description location) xref
551 (let ((line (xref-location-line location))) 550 (let* ((line (xref-location-line location))
552 (if line 551 (prefix
553 (xref--insert-propertized 552 (if line
554 '(face compilation-line-number) 553 (propertize (format line-format line)
555 (format line-format line)) 554 'face 'compilation-line-number)
556 (insert " "))) 555 " ")))
557 (xref--insert-propertized 556 (xref--insert-propertized
558 (list 'xref-location location 557 (list 'xref-location location
559 ;; 'face 'font-lock-keyword-face 558 ;; 'face 'font-lock-keyword-face
560 'mouse-face 'highlight 559 'mouse-face 'highlight
561 'keymap xref--button-map 560 'keymap xref--button-map
562 'help-echo 561 'help-echo
563 (concat "mouse-2: display in another window, " 562 (concat "mouse-2: display in another window, "
564 "RET or mouse-1: follow reference")) 563 "RET or mouse-1: follow reference"))
565 description)) 564 prefix description)))
566 (insert "\n")))) 565 (insert "\n"))))
567 566
568(defun xref--analyze (xrefs) 567(defun xref--analyze (xrefs)