summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-12-24 06:30:41 +0100
committerStefan Kangas <stefan@marxist.se>2021-12-24 06:30:41 +0100
commit6a17bb48798bf88458d43e7417e64d2efd74494b (patch)
treec4b91a081ff58e2425350b9271c35c5bc95fafd0
parentfbe026cb3e2f8148dd1841e0f9974915ca32c84d (diff)
parent04be23f19f6d1290906d2a392a05c58703ea76c5 (diff)
downloademacs-6a17bb48798bf88458d43e7417e64d2efd74494b.tar.gz
Merge from origin/emacs-28
04be23f19f Improve Xref documentation edb1d491d9 * lisp/net/shr.el (shr-expand-url): Also strip trailing wh...
-rw-r--r--lisp/net/shr.el4
-rw-r--r--lisp/progmodes/xref.el16
2 files changed, 17 insertions, 3 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 44fb5ec6e9a..bd16a779593 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 ca3594d253b..c1981cc1ce0 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)