diff options
| author | Kenichi Handa | 1999-03-22 04:12:42 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-03-22 04:12:42 +0000 |
| commit | 28fd4883f6f01490e75301d50c072b828b708f18 (patch) | |
| tree | 357fb80e576305775d5efbe2b64a878edfafd99d | |
| parent | a399edf459254db53675f999d001c51b2b254f1d (diff) | |
| download | emacs-28fd4883f6f01490e75301d50c072b828b708f18.tar.gz emacs-28fd4883f6f01490e75301d50c072b828b708f18.zip | |
(what-cursor-position): Don't cause error when point
is at invalid multibyte sequence.
| -rw-r--r-- | lisp/simple.el | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index ac3506a377a..92874f5f02e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -524,18 +524,21 @@ addition, the encoding is fully shown." | |||
| 524 | (if (or (not coding) | 524 | (if (or (not coding) |
| 525 | (eq (coding-system-type coding) t)) | 525 | (eq (coding-system-type coding) t)) |
| 526 | (setq coding default-buffer-file-coding-system)) | 526 | (setq coding default-buffer-file-coding-system)) |
| 527 | (setq encoded (and (>= char 128) (encode-coding-char char coding))) | 527 | (if (not (char-valid-p char)) |
| 528 | (setq encoding-msg | 528 | (setq encoding-msg |
| 529 | (if encoded | 529 | (format "(0%o, %d, 0x%x, invalid)" char char char)) |
| 530 | (format "(0%o, %d, 0x%x, ext %s)" | 530 | (setq encoded (and (>= char 128) (encode-coding-char char coding))) |
| 531 | char char char | 531 | (setq encoding-msg |
| 532 | (if (and (not detail) | 532 | (if encoded |
| 533 | (> (length encoded) 1)) | 533 | (format "(0%o, %d, 0x%x, ext %s)" |
| 534 | "..." | 534 | char char char |
| 535 | (concat | 535 | (if (and (not detail) |
| 536 | (encoded-string-description encoded coding) | 536 | (> (length encoded) 1)) |
| 537 | (if (cmpcharp char) "..." "")))) | 537 | "..." |
| 538 | (format "(0%o, %d, 0x%x)" char char char))) | 538 | (concat |
| 539 | (encoded-string-description encoded coding) | ||
| 540 | (if (cmpcharp char) "..." "")))) | ||
| 541 | (format "(0%o, %d, 0x%x)" char char char)))) | ||
| 539 | (if detail | 542 | (if detail |
| 540 | ;; We show the detailed information of CHAR. | 543 | ;; We show the detailed information of CHAR. |
| 541 | (let ((internal | 544 | (let ((internal |
| @@ -549,18 +552,18 @@ addition, the encoding is fully shown." | |||
| 549 | (message "Char: %s %s %s" | 552 | (message "Char: %s %s %s" |
| 550 | (if (< char 256) | 553 | (if (< char 256) |
| 551 | (single-key-description char) | 554 | (single-key-description char) |
| 552 | (char-to-string char)) | 555 | (buffer-substring (point) (1+ (point)))) |
| 553 | encoding-msg internal)) | 556 | encoding-msg internal)) |
| 554 | (if (or (/= beg 1) (/= end (1+ total))) | 557 | (if (or (/= beg 1) (/= end (1+ total))) |
| 555 | (message "Char: %s %s point=%d of %d(%d%%) <%d - %d> column %d %s" | 558 | (message "Char: %s %s point=%d of %d(%d%%) <%d - %d> column %d %s" |
| 556 | (if (< char 256) | 559 | (if (< char 256) |
| 557 | (single-key-description char) | 560 | (single-key-description char) |
| 558 | (char-to-string char)) | 561 | (buffer-substring (point) (1+ (point)))) |
| 559 | encoding-msg pos total percent beg end col hscroll) | 562 | encoding-msg pos total percent beg end col hscroll) |
| 560 | (message "Char: %s %s point=%d of %d(%d%%) column %d %s" | 563 | (message "Char: %s %s point=%d of %d(%d%%) column %d %s" |
| 561 | (if (< char 256) | 564 | (if (< char 256) |
| 562 | (single-key-description char) | 565 | (single-key-description char) |
| 563 | (char-to-string char)) | 566 | (buffer-substring (point) (1+ (point)))) |
| 564 | encoding-msg pos total percent col hscroll))))))) | 567 | encoding-msg pos total percent col hscroll))))))) |
| 565 | 568 | ||
| 566 | (defun fundamental-mode () | 569 | (defun fundamental-mode () |