diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/prog-mode.el | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8bf63a4bbb0..acc7d6566d3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-06-05 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * progmodes/prog-mode.el (prog-prettify-symbols) | ||
| 4 | (prog-prettify-install): Update docstrings. | ||
| 5 | |||
| 1 | 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * simple.el: Move all the prog-mode code to prog-mode.el. | 8 | * simple.el: Move all the prog-mode code to prog-mode.el. |
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index c1e2857eb89..483d1cd9cda 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el | |||
| @@ -58,8 +58,8 @@ instead." | |||
| 58 | 58 | ||
| 59 | (defcustom prog-prettify-symbols nil | 59 | (defcustom prog-prettify-symbols nil |
| 60 | "Whether symbols should be prettified. | 60 | "Whether symbols should be prettified. |
| 61 | When set to an alist in the form `(STRING . CHARACTER)' it will | 61 | When set to an alist in the form `((STRING . CHARACTER)...)' it |
| 62 | augment the mode's native prettify alist." | 62 | will augment the mode's native prettify alist." |
| 63 | :type '(choice | 63 | :type '(choice |
| 64 | (const :tag "No thanks" nil) | 64 | (const :tag "No thanks" nil) |
| 65 | (const :tag "Mode defaults" t) | 65 | (const :tag "Mode defaults" t) |
| @@ -96,6 +96,12 @@ Regexp match data 0 points to the chars." | |||
| 96 | (0 (prog--prettify-font-lock-compose-symbol ',alist))))))) | 96 | (0 (prog--prettify-font-lock-compose-symbol ',alist))))))) |
| 97 | 97 | ||
| 98 | (defun prog-prettify-install (alist) | 98 | (defun prog-prettify-install (alist) |
| 99 | "Install prog-mode support to prettify symbols according to ALIST. | ||
| 100 | |||
| 101 | ALIST is in the format `((STRING . CHARACTER)...)' like | ||
| 102 | `prog-prettify-symbols'. | ||
| 103 | |||
| 104 | Internally, `font-lock-add-keywords' is called." | ||
| 99 | (setq-local prog-prettify-symbols-alist alist) | 105 | (setq-local prog-prettify-symbols-alist alist) |
| 100 | (let ((keywords (prog-prettify-font-lock-symbols-keywords))) | 106 | (let ((keywords (prog-prettify-font-lock-symbols-keywords))) |
| 101 | (if keywords (font-lock-add-keywords nil keywords)))) | 107 | (if keywords (font-lock-add-keywords nil keywords)))) |