Mercurial > emacs
changeset 28896:0c70e1541a95
(what-cursor-position): If DETAIL is non-nil, call
describe-char-after instead of displaying the detail in the echo
area.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sat, 13 May 2000 00:28:57 +0000 |
parents | 8acc94b96cbb |
children | f8602df501c6 |
files | lisp/simple.el |
diffstat | 1 files changed, 36 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/simple.el Sat May 13 00:28:33 2000 +0000 +++ b/lisp/simple.el Sat May 13 00:28:57 2000 +0000 @@ -472,10 +472,8 @@ code is shown in hex. If the character is encoded into more than one byte, just \"...\" is shown. -With prefix argument, print additional details about that character, -instead of the cursor position. This includes the character set name, -the codes that identify the character within that character set. In -addition, the encoding is fully shown." +In addition, with prefix argument, show details about that character +in *Help* buffer. See also the command `describe-char-after'." (interactive "P") (let* ((char (following-char)) (beg (point-min)) @@ -507,34 +505,26 @@ (setq encoded (and (>= char 128) (encode-coding-char char coding))) (setq encoding-msg (if encoded - (format "(0%o, %d, 0x%x, ext %s)" + (format "(0%o, %d, 0x%x, file %s)" char char char - (if (and (not detail) - (> (length encoded) 1)) + (if (> (length encoded) 1) "..." - (concat - (encoded-string-description encoded coding) - (if (nth 2 (find-composition (point))) - " (composed)" "")))) + (encoded-string-description encoded coding))) (format "(0%o, %d, 0x%x)" char char char)))) (if detail - ;; We show the detailed information of CHAR. - (message "Char: %s %s %s" + ;; We show the detailed information about CHAR. + (describe-char-after (point))) + (if (or (/= beg 1) (/= end (1+ total))) + (message "Char: %s %s point=%d of %d (%d%%) <%d - %d> column %d %s" (if (< char 256) (single-key-description char) (buffer-substring-no-properties (point) (1+ (point)))) - encoding-msg (split-char char)) - (if (or (/= beg 1) (/= end (1+ total))) - (message "Char: %s %s point=%d of %d (%d%%) <%d - %d> column %d %s" - (if (< char 256) - (single-key-description char) - (buffer-substring-no-properties (point) (1+ (point)))) - encoding-msg pos total percent beg end col hscroll) - (message "Char: %s %s point=%d of %d (%d%%) column %d %s" - (if (< char 256) - (single-key-description char) - (buffer-substring-no-properties (point) (1+ (point)))) - encoding-msg pos total percent col hscroll))))))) + encoding-msg pos total percent beg end col hscroll) + (message "Char: %s %s point=%d of %d (%d%%) column %d %s" + (if (< char 256) + (single-key-description char) + (buffer-substring-no-properties (point) (1+ (point)))) + encoding-msg pos total percent col hscroll)))))) (defvar read-expression-map (cons 'keymap minibuffer-local-map) "Minibuffer keymap used for reading Lisp expressions.") @@ -4204,28 +4194,29 @@ ;;; Syntax stuff. (defconst syntax-code-table - '((?\ . 0) - (?- . 0) ;whitespace - (?. . 1) ;punctuation - (?w . 2) ;word - (?_ . 3) ;symbol - (?\( . 4) ;open parenthesis - (?\) . 5) ;close parenthesis - (?\' . 6) ;expression prefix - (?\" . 7) ;string quote - (?$ . 8) ;paired delimiter - (?\\ . 9) ;escape - (?/ . 10) ;character quote - (?< . 11) ;comment start - (?> . 12) ;comment end - (?@ . 13) ;inherit - (nil . 14) ;comment fence - (nil . 15)) ;string fence - "Alist of pairs (CHAR . CODE) mapping characters to syntax codes. + '((?\ 0 "whitespace") + (?- 0 "whitespace") + (?. 1 "punctuation") + (?w 2 "word") + (?_ 3 "symbol") + (?\( 4 "open parenthesis") + (?\) 5 "close parenthesis") + (?\' 6 "expression prefix") + (?\" 7 "string quote") + (?$ 8 "paired delimiter") + (?\\ 9 "escape") + (?/ 10 "character quote") + (?< 11 "comment start") + (?> 12 "comment end") + (?@ 13 "inherit") + (nil 14 "comment fence") + (nil 15 "string fence")) + "Alist of forms (CHAR CODE DESCRIPTION) mapping characters to syntax info. CHAR is a character that is allowed as first char in the string specifying the syntax when calling `modify-syntax-entry'. CODE is the corresponing syntax code as it is stored in a syntax cell, and -can be used as value of a `syntax-table' property..") +can be used as value of a `syntax-table' property. +DESCRIPTION is the descriptive string for the syntax.") (defconst syntax-flag-table '((?1 . #b10000000000000000) @@ -4248,7 +4239,7 @@ \(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table' text property." (let* ((first-char (aref string 0)) - (code (or (cdr (assq first-char syntax-code-table)) + (code (or (nth 1 (assq first-char syntax-code-table)) (error "Invalid syntax specification `%s'" string))) (length (length string)) (i 1)