From: Per Starbäck Date: Mon, 11 Mar 2013 17:45:23 +0000 (-0400) Subject: * lisp/international/characters.el (glyphless-set-char-table-range): New fun. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~568^2~38 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bd3921f0b884011ff267faf3a2301b3653a9f20f;p=emacs.git * lisp/international/characters.el (glyphless-set-char-table-range): New fun. (update-glyphless-char-display): Use it. Fixes: debbugs:13744 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 924519e661d..0361e5af0aa 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 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)