aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2000-05-13 00:28:57 +0000
committerKenichi Handa2000-05-13 00:28:57 +0000
commit24dad5d5d3a457ffa9ea522d69bb4e2b0bf74dcb (patch)
tree9b59a81c76aaac36971f19a52c2328a493324b44 /lisp
parent43fe9244dff5adf2232d4381ab8768ed0a9849ba (diff)
downloademacs-24dad5d5d3a457ffa9ea522d69bb4e2b0bf74dcb.tar.gz
emacs-24dad5d5d3a457ffa9ea522d69bb4e2b0bf74dcb.zip
(what-cursor-position): If DETAIL is non-nil, call
describe-char-after instead of displaying the detail in the echo area.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/simple.el81
1 files changed, 36 insertions, 45 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 78a40cdcee8..69eab7d5bcb 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -472,10 +472,8 @@ character safely. If the character is encoded into one byte, that
472code is shown in hex. If the character is encoded into more than one 472code is shown in hex. If the character is encoded into more than one
473byte, just \"...\" is shown. 473byte, just \"...\" is shown.
474 474
475With prefix argument, print additional details about that character, 475In addition, with prefix argument, show details about that character
476instead of the cursor position. This includes the character set name, 476in *Help* buffer. See also the command `describe-char-after'."
477the codes that identify the character within that character set. In
478addition, the encoding is fully shown."
479 (interactive "P") 477 (interactive "P")
480 (let* ((char (following-char)) 478 (let* ((char (following-char))
481 (beg (point-min)) 479 (beg (point-min))
@@ -507,34 +505,26 @@ addition, the encoding is fully shown."
507 (setq encoded (and (>= char 128) (encode-coding-char char coding))) 505 (setq encoded (and (>= char 128) (encode-coding-char char coding)))
508 (setq encoding-msg 506 (setq encoding-msg
509 (if encoded 507 (if encoded
510 (format "(0%o, %d, 0x%x, ext %s)" 508 (format "(0%o, %d, 0x%x, file %s)"
511 char char char 509 char char char
512 (if (and (not detail) 510 (if (> (length encoded) 1)
513 (> (length encoded) 1))
514 "..." 511 "..."
515 (concat 512 (encoded-string-description encoded coding)))
516 (encoded-string-description encoded coding)
517 (if (nth 2 (find-composition (point)))
518 " (composed)" ""))))
519 (format "(0%o, %d, 0x%x)" char char char)))) 513 (format "(0%o, %d, 0x%x)" char char char))))
520 (if detail 514 (if detail
521 ;; We show the detailed information of CHAR. 515 ;; We show the detailed information about CHAR.
522 (message "Char: %s %s %s" 516 (describe-char-after (point)))
523 (if (< char 256) 517 (if (or (/= beg 1) (/= end (1+ total)))
524 (single-key-description char) 518 (message "Char: %s %s point=%d of %d (%d%%) <%d - %d> column %d %s"
525 (buffer-substring-no-properties (point) (1+ (point))))
526 encoding-msg (split-char char))
527 (if (or (/= beg 1) (/= end (1+ total)))
528 (message "Char: %s %s point=%d of %d (%d%%) <%d - %d> column %d %s"
529 (if (< char 256)
530 (single-key-description char)
531 (buffer-substring-no-properties (point) (1+ (point))))
532 encoding-msg pos total percent beg end col hscroll)
533 (message "Char: %s %s point=%d of %d (%d%%) column %d %s"
534 (if (< char 256) 519 (if (< char 256)
535 (single-key-description char) 520 (single-key-description char)
536 (buffer-substring-no-properties (point) (1+ (point)))) 521 (buffer-substring-no-properties (point) (1+ (point))))
537 encoding-msg pos total percent col hscroll))))))) 522 encoding-msg pos total percent beg end col hscroll)
523 (message "Char: %s %s point=%d of %d (%d%%) column %d %s"
524 (if (< char 256)
525 (single-key-description char)
526 (buffer-substring-no-properties (point) (1+ (point))))
527 encoding-msg pos total percent col hscroll))))))
538 528
539(defvar read-expression-map (cons 'keymap minibuffer-local-map) 529(defvar read-expression-map (cons 'keymap minibuffer-local-map)
540 "Minibuffer keymap used for reading Lisp expressions.") 530 "Minibuffer keymap used for reading Lisp expressions.")
@@ -4204,28 +4194,29 @@ the front of the list of recently selected ones."
4204;;; Syntax stuff. 4194;;; Syntax stuff.
4205 4195
4206(defconst syntax-code-table 4196(defconst syntax-code-table
4207 '((?\ . 0) 4197 '((?\ 0 "whitespace")
4208 (?- . 0) ;whitespace 4198 (?- 0 "whitespace")
4209 (?. . 1) ;punctuation 4199 (?. 1 "punctuation")
4210 (?w . 2) ;word 4200 (?w 2 "word")
4211 (?_ . 3) ;symbol 4201 (?_ 3 "symbol")
4212 (?\( . 4) ;open parenthesis 4202 (?\( 4 "open parenthesis")
4213 (?\) . 5) ;close parenthesis 4203 (?\) 5 "close parenthesis")
4214 (?\' . 6) ;expression prefix 4204 (?\' 6 "expression prefix")
4215 (?\" . 7) ;string quote 4205 (?\" 7 "string quote")
4216 (?$ . 8) ;paired delimiter 4206 (?$ 8 "paired delimiter")
4217 (?\\ . 9) ;escape 4207 (?\\ 9 "escape")
4218 (?/ . 10) ;character quote 4208 (?/ 10 "character quote")
4219 (?< . 11) ;comment start 4209 (?< 11 "comment start")
4220 (?> . 12) ;comment end 4210 (?> 12 "comment end")
4221 (?@ . 13) ;inherit 4211 (?@ 13 "inherit")
4222 (nil . 14) ;comment fence 4212 (nil 14 "comment fence")
4223 (nil . 15)) ;string fence 4213 (nil 15 "string fence"))
4224 "Alist of pairs (CHAR . CODE) mapping characters to syntax codes. 4214 "Alist of forms (CHAR CODE DESCRIPTION) mapping characters to syntax info.
4225CHAR is a character that is allowed as first char in the string 4215CHAR is a character that is allowed as first char in the string
4226specifying the syntax when calling `modify-syntax-entry'. CODE is the 4216specifying the syntax when calling `modify-syntax-entry'. CODE is the
4227corresponing syntax code as it is stored in a syntax cell, and 4217corresponing syntax code as it is stored in a syntax cell, and
4228can be used as value of a `syntax-table' property..") 4218can be used as value of a `syntax-table' property.
4219DESCRIPTION is the descriptive string for the syntax.")
4229 4220
4230(defconst syntax-flag-table 4221(defconst syntax-flag-table
4231 '((?1 . #b10000000000000000) 4222 '((?1 . #b10000000000000000)
@@ -4248,7 +4239,7 @@ STRING should be a string as it is allowed as argument of
4248\(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table' 4239\(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'
4249text property." 4240text property."
4250 (let* ((first-char (aref string 0)) 4241 (let* ((first-char (aref string 0))
4251 (code (or (cdr (assq first-char syntax-code-table)) 4242 (code (or (nth 1 (assq first-char syntax-code-table))
4252 (error "Invalid syntax specification `%s'" string))) 4243 (error "Invalid syntax specification `%s'" string)))
4253 (length (length string)) 4244 (length (length string))
4254 (i 1) 4245 (i 1)