summaryrefslogtreecommitdiff
path: root/lisp/descr-text.el
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2005-11-20 15:25:35 +0000
committerAndreas Schwab <schwab@suse.de>2005-11-20 15:25:35 +0000
commit6398b88f531f0498ff30ad9b658890298c6ebf6b (patch)
tree05a9f695faffbf68d1d8b5fd2214f702dffd1d30 /lisp/descr-text.el
parenta7b0a0e36ec59a34ba09ba6bbfbe0c1a297e0ea8 (diff)
downloademacs-6398b88f531f0498ff30ad9b658890298c6ebf6b.tar.gz
(describe-char): When copying overlays put them
over the full char description instead of just the first character of it.
Diffstat (limited to 'lisp/descr-text.el')
-rw-r--r--lisp/descr-text.el28
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 307fd465472..547970a585b 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -458,6 +458,12 @@ as well as widgets, buttons, overlays, and text properties."
(multibyte-p enable-multibyte-characters)
(overlays (mapcar #'(lambda (o) (overlay-properties o))
(overlays-at pos)))
+ (char-description (if (not multibyte-p)
+ (single-key-description char)
+ (if (< char 128)
+ (single-key-description char)
+ (string-to-multibyte
+ (char-to-string char)))))
item-list max-width unicode)
(if (or (< char 256)
@@ -468,12 +474,7 @@ as well as widgets, buttons, overlays, and text properties."
(setq item-list
`(("character"
,(format "%s (%d, #o%o, #x%x%s)"
- (apply 'propertize (if (not multibyte-p)
- (single-key-description char)
- (if (< char 128)
- (single-key-description char)
- (string-to-multibyte
- (char-to-string char))))
+ (apply 'propertize char-description
(text-properties-at pos))
char char char
(if unicode
@@ -639,13 +640,14 @@ as well as widgets, buttons, overlays, and text properties."
(goto-char (point-min))
(re-search-forward "character:[ \t\n]+")
(setq pos (point)))
- (if overlays
- (mapc #'(lambda (props)
- (let ((o (make-overlay pos (1+ pos))))
- (while props
- (overlay-put o (car props) (nth 1 props))
- (setq props (cddr props)))))
- overlays))
+ (let ((end (+ pos (length char-description))))
+ (if overlays
+ (mapc #'(lambda (props)
+ (let ((o (make-overlay pos end)))
+ (while props
+ (overlay-put o (car props) (nth 1 props))
+ (setq props (cddr props)))))
+ overlays)))
(when disp-vector
(insert