From: Dmitry Gutov Date: Tue, 5 May 2015 02:05:02 +0000 (+0300) Subject: Buttonize the whole line, including the number at the beginning X-Git-Tag: emacs-25.0.90~2202 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ca717aa0fd048d3529ad8f5cedb37e0b31169b96;p=emacs.git 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. --- 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.") (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)