comparison lisp/syntax.el @ 4806:fd36a980d701

Use uninterned symbols in various information-hiding contexts. lisp/ChangeLog addition: 2010-01-01 Aidan Kehoe <kehoea@parhasard.net> * syntax.el (map-syntax-table): * subr.el (map-plist): * startup.el (load-init-file): * minibuf.el (read-from-minbuffer): * cus-edit.el (custom-load-custom-defines-1): * cmdloop.el (execute-extended-command): Replace symbol names using underscore, whether to avoid dynamic scope problems or to ensure helpful arguments to #'call-with-condition-handler, with uninterned symbols. src/ChangeLog addition: 2010-01-01 Aidan Kehoe <kehoea@parhasard.net> * mule-charset.c (Fmake_charset): Don't intern the symbols used to refer to temporary character sets, that doesn't bring us anything.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 01 Jan 2010 19:45:39 +0000
parents a78d697ccd2c
children 99e465e2da2e
comparison
equal deleted inserted replaced
4767:dba492ef7440 4806:fd36a980d701
203 (syntax-table)) 203 (syntax-table))
204 (t 204 (t
205 (wrong-type-argument 'syntax-table-p syntax-table)))) 205 (wrong-type-argument 'syntax-table-p syntax-table))))
206 nil) 206 nil)
207 207
208 (defun map-syntax-table (__function __syntax_table &optional __range) 208 ((macro
209 "Map FUNCTION over entries in SYNTAX-TABLE, collapsing inheritance. 209 . (lambda (map-syntax-definition)
210 "Replace the variable names in MAP-SYNTAX-DEFINITION with uninterned
211 symbols, at byte-compile time. This avoids the risk of variable names
212 within the functions called from MAP-SYNTAX-DEFINITION being shared with
213 MAP-SYNTAX-DEFINITION, and as such subject to modification, one of the
214 common downsides of dynamic scope."
215 (nsublis
216 '((syntax-table . #:syntax-table)
217 (m-s-function . #:function)
218 (range . #:range)
219 (key . #:key)
220 (value . #:value))
221 map-syntax-definition)))
222 (defun map-syntax-table (m-s-function syntax-table &optional range)
223 "Map FUNCTION over entries in SYNTAX-TABLE, collapsing inheritance.
210 This is similar to `map-char-table', but works only on syntax tables, and 224 This is similar to `map-char-table', but works only on syntax tables, and
211 collapses any entries that call for inheritance by invisibly substituting 225 collapses any entries that call for inheritance by invisibly substituting
212 the inherited values from the standard syntax table." 226 the inherited values from the standard syntax table."
213 (check-argument-type 'syntax-table-p __syntax_table) 227 (check-argument-type 'syntax-table-p syntax-table)
214 (map-char-table #'(lambda (__key __value) 228 (map-char-table #'(lambda (key value)
215 (if (eq ?@ (char-syntax-from-code __value)) 229 (if (eq ?@ (char-syntax-from-code value))
216 (map-char-table #'(lambda (__key __value) 230 (map-char-table
217 (funcall __function 231 #'(lambda (key value)
218 __key __value)) 232 (funcall m-s-function key value))
219 (standard-syntax-table) 233 (standard-syntax-table)
220 __key) 234 key)
221 (funcall __function __key __value))) 235 (funcall m-s-function key value)))
222 __syntax_table __range)) 236 syntax-table range)))
223 237
224 ;(defun test-xm () 238 ;(defun test-xm ()
225 ; (let ((o (copy-syntax-table)) 239 ; (let ((o (copy-syntax-table))
226 ; (n (copy-syntax-table)) 240 ; (n (copy-syntax-table))
227 ; (codes (syntax-designator-chars)) 241 ; (codes (syntax-designator-chars))