aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2004-05-23 20:59:28 +0000
committerJuri Linkov2004-05-23 20:59:28 +0000
commitf13cc97d68d3cf3d3fe893e484c74e7602f5944d (patch)
treeed00ba2e3dac7e2f3c1bd16a21dc78a9d42afc26
parentc58bb024cbbfe40750305b46b82e869fb18aa710 (diff)
downloademacs-f13cc97d68d3cf3d3fe893e484c74e7602f5944d.tar.gz
emacs-f13cc97d68d3cf3d3fe893e484c74e7602f5944d.zip
(describe-property-list): Add [show] button for
`syntax-table' property with action to pp to a separate buffer. (describe-char): Replace search-forward by re-search-forward with whitespace regexp after "character:" to not fail in too narrow windows.
-rw-r--r--lisp/descr-text.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 75ce294dad6..c4758a081ce 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -111,7 +111,8 @@ into widget buttons that call `describe-text-category' or
111 (setq key (pop properties) 111 (setq key (pop properties)
112 val (pop properties) 112 val (pop properties)
113 len 0) 113 len 0)
114 (unless (or (memq key '(category face font-lock-face)) 114 (unless (or (memq key '(category face font-lock-face
115 syntax-table))
115 (widgetp val)) 116 (widgetp val))
116 (setq val (pp-to-string val) 117 (setq val (pp-to-string val)
117 len (length val))) 118 len (length val)))
@@ -134,7 +135,15 @@ into widget buttons that call `describe-text-category' or
134 :notify `(lambda (&rest ignore) 135 :notify `(lambda (&rest ignore)
135 (describe-face ',value)) 136 (describe-face ',value))
136 (format "%S" value))) 137 (format "%S" value)))
137 ((widgetp value) 138 ((eq key 'syntax-table)
139 (widget-create 'push-button
140 :tag "show"
141 :action (lambda (widget &optional event)
142 (with-output-to-temp-buffer
143 "*Pp Eval Output*"
144 (pp (widget-get widget :value))))
145 value))
146 ((widgetp value)
138 (describe-text-widget value)) 147 (describe-text-widget value))
139 (t 148 (t
140 (widget-insert value)))) 149 (widget-insert value))))
@@ -476,7 +485,7 @@ as well as widgets, buttons, overlays, and text properties."
476 (encode-char char 'ucs)))) 485 (encode-char char 'ucs))))
477 (setq item-list 486 (setq item-list
478 `(("character" 487 `(("character"
479 ,(format "%s (0%o, %d, 0x%x%s)" 488 ,(format "%s (0%o, %d, 0x%x%s)"
480 (apply 'propertize (if (not multibyte-p) 489 (apply 'propertize (if (not multibyte-p)
481 (single-key-description char) 490 (single-key-description char)
482 (if (< char 128) 491 (if (< char 128)
@@ -598,7 +607,7 @@ as well as widgets, buttons, overlays, and text properties."
598 607
599 (save-excursion 608 (save-excursion
600 (goto-char (point-min)) 609 (goto-char (point-min))
601 (search-forward "character: ") 610 (re-search-forward "character:[ \t\n]+")
602 (setq pos (point))) 611 (setq pos (point)))
603 (if overlays 612 (if overlays
604 (mapc #'(lambda (props) 613 (mapc #'(lambda (props)