[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master ca717aa 2/3: Buttonize the whole line, including th
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master ca717aa 2/3: Buttonize the whole line, including the number at the beginning |
Date: |
Tue, 05 May 2015 02:18:42 +0000 |
branch: master
commit ca717aa0fd048d3529ad8f5cedb37e0b31169b96
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
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.
---
lisp/progmodes/xref.el | 37 ++++++++++++++++++-------------------
1 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 657657c..4b2a4ee 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -439,10 +439,9 @@ Used for temporary buffers.")
(xref-show-location-at-point))
(defun xref--location-at-point ()
- (let ((pos (next-single-char-property-change (line-beginning-position)
- 'xref-location
- nil (line-end-position))))
- (and pos (get-text-property pos 'xref-location))))
+ (save-excursion
+ (back-to-indentation)
+ (get-text-property (point) 'xref-location)))
(defvar-local xref--window nil
"ACTION argument to call `display-buffer' with.")
@@ -548,21 +547,21 @@ GROUP is a string for decoration purposes and XREF is an
(xref--insert-propertized '(face compilation-info) group "\n")
(cl-loop for (xref . more2) on xrefs do
(with-slots (description location) xref
- (let ((line (xref-location-line location)))
- (if line
- (xref--insert-propertized
- '(face compilation-line-number)
- (format line-format line))
- (insert " ")))
- (xref--insert-propertized
- (list 'xref-location location
- ;; 'face 'font-lock-keyword-face
- 'mouse-face 'highlight
- 'keymap xref--button-map
- 'help-echo
- (concat "mouse-2: display in another window, "
- "RET or mouse-1: follow reference"))
- description))
+ (let* ((line (xref-location-line location))
+ (prefix
+ (if line
+ (propertize (format line-format line)
+ 'face 'compilation-line-number)
+ " ")))
+ (xref--insert-propertized
+ (list 'xref-location location
+ ;; 'face 'font-lock-keyword-face
+ 'mouse-face 'highlight
+ 'keymap xref--button-map
+ 'help-echo
+ (concat "mouse-2: display in another window, "
+ "RET or mouse-1: follow reference"))
+ prefix description)))
(insert "\n"))))
(defun xref--analyze (xrefs)