changeset 59023:fa849ef3cf2c

(widget-specify-field, widget-specify-button): Map a :follow-link keyword into a follow-link property. (link): Add :follow-link keyword, map to RET binding.
author Kim F. Storm <storm@cua.dk>
date Fri, 17 Dec 2004 15:17:47 +0000
parents 0b09c3970de0
children f71e5777b783
files lisp/wid-edit.el
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/wid-edit.el	Fri Dec 17 15:17:35 2004 +0000
+++ b/lisp/wid-edit.el	Fri Dec 17 15:17:47 2004 +0000
@@ -327,6 +327,7 @@
   (let ((keymap (widget-get widget :keymap))
 	(face (or (widget-get widget :value-face) 'widget-field-face))
 	(help-echo (widget-get widget :help-echo))
+	(follow-link (widget-get widget :follow-link))
 	(rear-sticky
 	 (or (not widget-field-add-space) (widget-get widget :size))))
     (if (functionp help-echo)
@@ -345,6 +346,7 @@
 	;; works in the field when, say, Custom uses `suppress-keymap'.
 	(overlay-put overlay 'local-map keymap)
 	(overlay-put overlay 'face face)
+	(overlay-put overlay 'follow-link follow-link)
 	(overlay-put overlay 'help-echo help-echo))
       (setq to (1- to))
       (setq rear-sticky t))
@@ -354,6 +356,7 @@
       (overlay-put overlay 'field widget)
       (overlay-put overlay 'local-map keymap)
       (overlay-put overlay 'face face)
+      (overlay-put overlay 'follow-link follow-link)
       (overlay-put overlay 'help-echo help-echo)))
   (widget-specify-secret widget))
 
@@ -378,6 +381,7 @@
 (defun widget-specify-button (widget from to)
   "Specify button for WIDGET between FROM and TO."
   (let ((overlay (make-overlay from to nil t nil))
+	(follow-link (widget-get widget :follow-link))
 	(help-echo (widget-get widget :help-echo)))
     (widget-put widget :button-overlay overlay)
     (if (functionp help-echo)
@@ -389,6 +393,7 @@
     (unless (widget-get widget :suppress-face)
       (overlay-put overlay 'face (widget-apply widget :button-face-get)))
     (overlay-put overlay 'pointer 'hand)
+    (overlay-put overlay 'follow-link follow-link)
     (overlay-put overlay 'help-echo help-echo)))
 
 (defun widget-mouse-help (window overlay point)
@@ -1705,6 +1710,7 @@
   "An embedded link."
   :button-prefix 'widget-link-prefix
   :button-suffix 'widget-link-suffix
+  :follow-link "\C-m"
   :help-echo "Follow the link."
   :format "%[%t%]")