diff options
| author | Juanma Barranquero | 2009-01-19 15:48:15 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2009-01-19 15:48:15 +0000 |
| commit | d703f9385eae35e0f6179cd7a58017688f950bc0 (patch) | |
| tree | e23c2715d81c5fcb76fce705d06023b64cb0b988 | |
| parent | 803ee7b9b1e33ef920245b8daaf3d9601716cf65 (diff) | |
| download | emacs-d703f9385eae35e0f6179cd7a58017688f950bc0.tar.gz emacs-d703f9385eae35e0f6179cd7a58017688f950bc0.zip | |
* descr-text.el (describe-char-categories): New defsubst.
(describe-char): Use it.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/descr-text.el | 23 |
2 files changed, 23 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8a0bb2412ac..dbea6cd19fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-01-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * descr-text.el (describe-char-categories): New defsubst. | ||
| 4 | (describe-char): Use it. | ||
| 5 | |||
| 1 | 2009-01-19 Michael Albinus <michael.albinus@gmx.de> | 6 | 2009-01-19 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also | 8 | * net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also |
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 53a8cd298e2..022acd67b9e 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -353,6 +353,21 @@ This function is semi-obsolete. Use `get-char-code-property'." | |||
| 353 | (defsubst describe-char-padded-string (ch) | 353 | (defsubst describe-char-padded-string (ch) |
| 354 | (compose-string (string ch) 0 1 (format "\t%c\t" ch))) | 354 | (compose-string (string ch) 0 1 (format "\t%c\t" ch))) |
| 355 | 355 | ||
| 356 | ;; Return a nicely formated list of categories; extended category | ||
| 357 | ;; description is added to the category name as a tooltip | ||
| 358 | (defsubst describe-char-categories (category-set) | ||
| 359 | (let ((mnemonics (category-set-mnemonics category-set))) | ||
| 360 | (unless (eq mnemonics "") | ||
| 361 | (list (mapconcat | ||
| 362 | #'(lambda (x) | ||
| 363 | (let* ((c (category-docstring x)) | ||
| 364 | (doc (if (string-match "\\`\\(.*?\\)\n\\(.*\\)\\'" c) | ||
| 365 | (propertize (match-string 1 c) | ||
| 366 | 'help-echo (match-string 2 c)) | ||
| 367 | c))) | ||
| 368 | (format "%c:%s" x doc))) | ||
| 369 | mnemonics ", "))))) | ||
| 370 | |||
| 356 | ;;;###autoload | 371 | ;;;###autoload |
| 357 | (defun describe-char (pos) | 372 | (defun describe-char (pos) |
| 358 | "Describe the character after POS (interactively, the character after point). | 373 | "Describe the character after POS (interactively, the character after point). |
| @@ -430,11 +445,9 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 430 | (buffer-string)))) | 445 | (buffer-string)))) |
| 431 | ("category" | 446 | ("category" |
| 432 | ,@(let ((category-set (char-category-set char))) | 447 | ,@(let ((category-set (char-category-set char))) |
| 433 | (if (not category-set) | 448 | (if category-set |
| 434 | '("-- none --") | 449 | (describe-char-categories category-set) |
| 435 | (mapcar #'(lambda (x) (format "%c:%s" | 450 | '("-- none --")))) |
| 436 | x (category-docstring x))) | ||
| 437 | (category-set-mnemonics category-set))))) | ||
| 438 | ("to input" | 451 | ("to input" |
| 439 | ,@(let ((key-list (and (eq input-method-function | 452 | ,@(let ((key-list (and (eq input-method-function |
| 440 | 'quail-input-method) | 453 | 'quail-input-method) |