Mercurial > emacs
comparison lisp/simple.el @ 23944:b5617ede97a8
(what-cursor-position): Print character encoding also.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 27 Dec 1998 04:09:09 +0000 |
parents | 62965fadf048 |
children | c242e2dc93a9 |
comparison
equal
deleted
inserted
replaced
23943:7555c77bc4f0 | 23944:b5617ede97a8 |
---|---|
511 (if (or (/= beg 1) (/= end (1+ total))) | 511 (if (or (/= beg 1) (/= end (1+ total))) |
512 (message "point=%d of %d(%d%%) <%d - %d> column %d %s" | 512 (message "point=%d of %d(%d%%) <%d - %d> column %d %s" |
513 pos total percent beg end col hscroll) | 513 pos total percent beg end col hscroll) |
514 (message "point=%d of %d(%d%%) column %d %s" | 514 (message "point=%d of %d(%d%%) column %d %s" |
515 pos total percent col hscroll)) | 515 pos total percent col hscroll)) |
516 (if detail | 516 (let* ((coding-system buffer-file-coding-system) |
517 (let* ((internal (split-char char)) | 517 (encoding |
518 (charset (char-charset char)) | 518 (encode-coding-string (char-to-string char) coding-system t)) |
519 (slot (assq charset charset-origin-alist)) | 519 (encoding-string-hex |
520 external) | 520 (mapconcat (lambda (ch) (format "0x%x" ch)) encoding " ")) |
521 (if slot | 521 (encoding-msg |
522 (setq external (list (nth 1 slot) (funcall (nth 2 slot) char))) | 522 (if (and coding-system |
523 (if (eq charset 'composition) | 523 (not (and (= (length encoding) 1) |
524 (setq internal '("composite-character")) | 524 (= (aref encoding 0) char)))) |
525 (setq external (cons (charset-short-name charset) | 525 (format "(0%o, %d, 0x%x, ext %s)" |
526 (copy-sequence (cdr internal)))) | 526 char char char |
527 (if (= (charset-iso-graphic-plane charset) 1) | 527 encoding-string-hex) |
528 (progn | 528 (format "(%s, %s, %s)" |
529 (setcar (cdr external) (+ (nth 1 external) 128)) | 529 encoding-string-oct |
530 (if (nth 2 external) | 530 encoding-string-dec |
531 (setcar (nthcdr 2 external) | 531 encoding-string-hex)))) |
532 (+ (nth 2 external) 128))))))) | 532 (if detail |
533 (message "Char: %s (0%o, %d, 0x%x) %s %s" | 533 (let* ((internal (split-char char)) |
534 (charset (char-charset char)) | |
535 (slot (assq charset charset-origin-alist)) | |
536 external) | |
537 (if slot | |
538 (setq external (list (nth 1 slot) (funcall (nth 2 slot) char))) | |
539 (if (eq charset 'composition) | |
540 (setq internal '("composite-character")) | |
541 (setq external (cons (charset-short-name charset) | |
542 (copy-sequence (cdr internal)))) | |
543 (if (= (charset-iso-graphic-plane charset) 1) | |
544 (progn | |
545 (setcar (cdr external) (+ (nth 1 external) 128)) | |
546 (if (nth 2 external) | |
547 (setcar (nthcdr 2 external) | |
548 (+ (nth 2 external) 128))))))) | |
549 (message "Char: %s %s %s %s" | |
550 (if (< char 256) | |
551 (single-key-description char) | |
552 (char-to-string char)) | |
553 encoding-msg (or internal "") (or external ""))) | |
554 (if (or (/= beg 1) (/= end (1+ total))) | |
555 (message "Char: %s %s point=%d of %d(%d%%) <%d - %d> column %d %s" | |
556 (if (< char 256) | |
557 (single-key-description char) | |
558 (char-to-string char)) | |
559 encoding-msg pos total percent beg end col hscroll) | |
560 (message "Char: %s %s point=%d of %d(%d%%) column %d %s" | |
534 (if (< char 256) | 561 (if (< char 256) |
535 (single-key-description char) | 562 (single-key-description char) |
536 (char-to-string char)) | 563 (char-to-string char)) |
537 char char char (or internal "") (or external ""))) | 564 encoding-msg pos total percent col hscroll))))))) |
538 (if (or (/= beg 1) (/= end (1+ total))) | |
539 (message "Char: %s (0%o, %d, 0x%x) point=%d of %d(%d%%) <%d - %d> column %d %s" | |
540 (if (< char 256) | |
541 (single-key-description char) | |
542 (char-to-string char)) | |
543 char char char pos total percent beg end col hscroll) | |
544 (message "Char: %s (0%o, %d, 0x%x) point=%d of %d(%d%%) column %d %s" | |
545 (if (< char 256) | |
546 (single-key-description char) | |
547 (char-to-string char)) | |
548 char char char pos total percent col hscroll)))))) | |
549 | 565 |
550 (defun fundamental-mode () | 566 (defun fundamental-mode () |
551 "Major mode not specialized for anything in particular. | 567 "Major mode not specialized for anything in particular. |
552 Other major modes are defined by comparison with this one." | 568 Other major modes are defined by comparison with this one." |
553 (interactive) | 569 (interactive) |