diff lisp/coding.el @ 4597:7191a7b120f1

Some cosmetic namespace cleanup, glyphs.el, coding.el. lisp/ChangeLog addition: 2009-01-15 Aidan Kehoe <kehoea@parhasard.net> * coding.el (force-coding-system-equivalency): Move three functions that we don't want to advertise to being anonymous lambdas instead. * glyphs.el : Remove #'define-constant-glyph and some functions it uses, replace the latter with anonymous lambdas and the former and its uses with a call to loop. Do the same with #'define-obsolete-pointer-glyph and the functions it uses. (init-glyphs): Untern this symbol once the associated function has been called; it's only needed at dump time, not at runtime.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 15 Jan 2009 19:21:43 +0000
parents e6a7054a9c30
children 8891b0477058
line wrap: on
line diff
--- a/lisp/coding.el	Tue Jan 13 12:07:27 2009 +0000
+++ b/lisp/coding.el	Thu Jan 15 19:21:43 2009 +0000
@@ -243,30 +243,24 @@
 	)))
 
 
-;;; Make certain variables equivalent to coding-system aliases
-(defun dontusethis-set-value-file-name-coding-system-handler (sym args fun harg handlers)
-  (define-coding-system-alias 'file-name (or (car args) 'binary)))
-
-(dontusethis-set-symbol-value-handler
- 'file-name-coding-system
- 'set-value
- 'dontusethis-set-value-file-name-coding-system-handler)
-
-(defun dontusethis-set-value-terminal-coding-system-handler (sym args fun harg handlers)
-  (define-coding-system-alias 'terminal (or (car args) 'binary)))
-
-(dontusethis-set-symbol-value-handler
- 'terminal-coding-system
- 'set-value
- 'dontusethis-set-value-terminal-coding-system-handler)
-
-(defun dontusethis-set-value-keyboard-coding-system-handler (sym args fun harg handlers)
-  (define-coding-system-alias 'keyboard (or (car args) 'binary)))
-
-(dontusethis-set-symbol-value-handler
- 'keyboard-coding-system
- 'set-value
- 'dontusethis-set-value-keyboard-coding-system-handler)
+;;; Make certain variables equivalent to coding-system aliases:
+(macrolet
+    ((force-coding-system-equivalency (&rest details-list)
+       (loop for (alias variable-symbol)
+         in details-list
+         with result = (list 'progn)
+         do
+         (push 
+          `(dontusethis-set-symbol-value-handler ',variable-symbol
+            'set-value #'(lambda (sym args fun harg handlers)
+                           (define-coding-system-alias ',alias
+                             (or (car args) 'binary))))
+          result)
+         finally return (nreverse result))))
+  (force-coding-system-equivalency
+   (file-name file-name-coding-system)
+   (terminal terminal-coding-system)
+   (keyboard keyboard-coding-system)))
 
 (when (not (featurep 'mule))
   (define-coding-system-alias 'escape-quoted 'binary)