From bd3921f0b884011ff267faf3a2301b3653a9f20f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Per=20Starb=C3=A4ck?= Date: Mon, 11 Mar 2013 13:45:23 -0400 Subject: [PATCH] * lisp/international/characters.el (glyphless-set-char-table-range): New fun. (update-glyphless-char-display): Use it. Fixes: debbugs:13744 --- lisp/ChangeLog | 5 +++++ lisp/international/characters.el | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 924519e661..0361e5af0a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-03-11 Per Starbäck + + * international/characters.el (glyphless-set-char-table-range): New fun. + (update-glyphless-char-display): Use it (bug#13744). + 2013-03-11 Teodor Zlatanov * progmodes/cfengine.el: Update for CFEngine 3.4.2 and higher: diff --git a/lisp/international/characters.el b/lisp/international/characters.el index ad0353f93f..d973ccf2d7 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) -- 2.20.1