[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 6a17bb4: Merge from origin/emacs-28
From: |
Stefan Kangas |
Subject: |
master 6a17bb4: Merge from origin/emacs-28 |
Date: |
Fri, 24 Dec 2021 00:50:46 -0500 (EST) |
branch: master
commit 6a17bb48798bf88458d43e7417e64d2efd74494b
Merge: fbe026c 04be23f
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Merge from origin/emacs-28
04be23f19f Improve Xref documentation
edb1d491d9 * lisp/net/shr.el (shr-expand-url): Also strip trailing wh...
---
lisp/net/shr.el | 4 +++-
lisp/progmodes/xref.el | 16 ++++++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 44fb5ec..bd16a77 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -857,9 +857,11 @@ size, and full-buffer size."
shr-base))
(when (zerop (length url))
(setq url nil))
- ;; Strip leading whitespace
+ ;; Strip leading/trailing whitespace
(and url (string-match "\\`\\s-+" url)
(setq url (substring url (match-end 0))))
+ (and url (string-match "\\s-+\\'" url)
+ (setq url (substring url 0 (match-beginning 0))))
(cond ((zerop (length url))
(nth 3 base))
((or (not base)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index ca3594d..c1981cc 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -44,7 +44,7 @@
;;
;; The last three methods operate with "xref" and "location" values.
;;
-;; One would usually call `make-xref' and `xref-make-file-location',
+;; One would usually call `xref-make' and `xref-make-file-location',
;; `xref-make-buffer-location' or `xref-make-bogus-location' to create
;; them. More generally, a location must be an instance of a type for
;; which methods `xref-location-group' and `xref-location-marker' are
@@ -206,7 +206,19 @@ is not known."
(:constructor xref-make (summary location))
(:noinline t))
"An xref item describes a reference to a location somewhere."
- summary location)
+ (summary nil :documentation "String which describes the location.
+
+When `xref-location-line' returns non-nil (a number), the summary
+is implied to be the contents of a file or buffer line containing
+the location. When multiple locations in a row report the same
+line, in the same group (corresponding to the case of multiple
+locations on one line), the summaries are concatenated in the
+Xref output buffer. Consequently, any code that creates xref
+values should take care to slice the summary values when several
+locations point to the same line.
+
+This behavior is new in Emacs 28.")
+ location)
(xref--defstruct (xref-match-item
(:include xref-item)