diff options
author | Per Starbäck <starback@stp.lingfil.uu.se> | 2013-03-11 13:45:23 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-03-11 13:45:23 -0400 |
commit | bd3921f0b884011ff267faf3a2301b3653a9f20f (patch) | |
tree | 80c897ab71fb8a724417f79c771ee4cc5782b284 /lisp/international/characters.el | |
parent | ccc4f9f186dfbee14a7041f70c802838a358601f (diff) | |
download | emacs-bd3921f0b884011ff267faf3a2301b3653a9f20f.tar.gz |
* lisp/international/characters.el (glyphless-set-char-table-range): New fun.
(update-glyphless-char-display): Use it.
Fixes: debbugs:13744
Diffstat (limited to 'lisp/international/characters.el')
-rw-r--r-- | lisp/international/characters.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/international/characters.el b/lisp/international/characters.el index ad0353f93f2..d973ccf2d7e 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1410,16 +1410,16 @@ This function updates the char-table `glyphless-char-display'." (or (memq method '(zero-width thin-space empty-box acronym hex-code)) (error "Invalid glyphless character display method: %s" method)) (cond ((eq target 'c0-control) - (set-char-table-range glyphless-char-display '(#x00 . #x1F) - method) + (glyphless-set-char-table-range glyphless-char-display + #x00 #x1F method) ;; Users will not expect their newlines and TABs be ;; displayed as anything but themselves, so exempt those ;; two characters from c0-control. (set-char-table-range glyphless-char-display #x9 nil) (set-char-table-range glyphless-char-display #xa nil)) ((eq target 'c1-control) - (set-char-table-range glyphless-char-display '(#x80 . #x9F) - method)) + (glyphless-set-char-table-range glyphless-char-display + #x80 #x9F method)) ((eq target 'format-control) (map-char-table #'(lambda (char category) @@ -1443,6 +1443,14 @@ This function updates the char-table `glyphless-char-display'." (t (error "Invalid glyphless character group: %s" target)))))) +(defun glyphless-set-char-table-range (chartable from to method) + (if (eq method 'acronym) + (let ((i from)) + (while (<= i to) + (set-char-table-range chartable i (aref char-acronym-table i)) + (setq i (1+ i)))) + (set-char-table-range chartable (cons from to) method))) + ;;; Control of displaying glyphless characters. (defcustom glyphless-char-display-control '((format-control . thin-space) |