summaryrefslogtreecommitdiff
path: root/lisp/wid-edit.el
diff options
context:
space:
mode:
authorSam Steingold <sds@gnu.org>2019-07-16 17:23:27 -0400
committerSam Steingold <sds@gnu.org>2019-07-16 17:24:32 -0400
commit5aa6a15e20f6e97febff45bb291fac59c11ec1ac (patch)
treea7a5d78f8776a36128c698419d83edfa30f9b530 /lisp/wid-edit.el
parent585fb957399f21a93cbfabd182b76262466797e3 (diff)
downloademacs-5aa6a15e20f6e97febff45bb291fac59c11ec1ac.tar.gz
Treat the "Link" link in gnus-summary-browse-urls specially
* lisp/gnus/gnus-sum.el (gnus-collect-urls): Make sure that the URL labeled "Link" is the first in the return list. (gnus-summary-browse-url): Use the 1st URL as the default. * lisp/wid-edit.el (widget-text): New function.
Diffstat (limited to 'lisp/wid-edit.el')
-rw-r--r--lisp/wid-edit.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 376e3e5526f..5dee898991b 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -831,6 +831,13 @@ button end points."
(delete-overlay field))
(mapc 'widget-leave-text (widget-get widget :children))))
+(defun widget-text (widget)
+ "Get the text representation of the widget."
+ (when-let ((from (widget-get widget :from))
+ (to (widget-get widget :to)))
+ (when (eq (marker-buffer from) (marker-buffer to)) ; is this check necessary?
+ (buffer-substring-no-properties from to))))
+
;;; Keymap and Commands.
;; This alias exists only so that one can choose in doc-strings (e.g.