diff options
| author | David Aspinall | 2008-02-06 23:38:50 +0000 |
|---|---|---|
| committer | David Aspinall | 2008-02-06 23:38:50 +0000 |
| commit | dbbcda6360e5b56ed38a2dba9177a4f7a7f6abc7 (patch) | |
| tree | df3a144f82bda8f95b041af627ce6118f7ee3abc /lib | |
| parent | 2b30ea500ee9e6fc3ed4d26d7c2efbc33733378e (diff) | |
Tweak initialisation (no difference if setup properrly via proof-unicode-tokens)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/unicode-tokens.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/unicode-tokens.el b/lib/unicode-tokens.el index b6b5c4d7..8b81fd6a 100644 --- a/lib/unicode-tokens.el +++ b/lib/unicode-tokens.el @@ -104,7 +104,8 @@ Behaviour is much like abbrev.") "Alist mapping unicode code point to character names.") (defvar unicode-tokens-token-alist nil - "Mapping of tokens to Unicode strings.") + "Mapping of tokens to Unicode strings. +Also used as a flag to detect if `unicode-tokens-initialise' has been called.") (defvar unicode-tokens-ustring-alist nil "Mapping of Unicode strings to tokens.") @@ -386,6 +387,8 @@ Also sets `unicode-tokens-token-alist'." t nil) "Value for `format-alist'.") +(add-to-list 'format-alist unicode-tokens-format-entry) + (defconst unicode-tokens-ignored-properties '(vanilla type fontified face auto-composed) "Text properties to ignore when saving files.") @@ -522,6 +525,8 @@ after next character (single character control sequence)." "Minor mode for unicode token input." nil " Utoks" unicode-tokens-mode-map (make-variable-buffer-local 'text-property-default-nonsticky) + (unless unicode-tokens-token-alist + (unicode-tokens-initialise)) (when unicode-tokens-mode (setq text-property-default-nonsticky ;; We want to use display property with stickyness @@ -578,7 +583,6 @@ after next character (single character control sequence)." unicode-tokens-token-name-alist :initial-value nil))) (unicode-tokens-quail-define-rules) - (add-to-list 'format-alist unicode-tokens-format-entry) ;; Key bindings (if (= (length unicode-tokens-token-suffix) 1) (define-key unicode-tokens-mode-map |
