comparison lisp/mule/mule-cmds.el @ 5567:3bc58dc9d688

Replace #'flet by #'labels where appropriate, core code. lisp/ChangeLog addition: 2011-09-07 Aidan Kehoe <kehoea@parhasard.net> * simple.el (transpose-subr): * specifier.el (let-specifier): * specifier.el (derive-device-type-from-tag-set): * test-harness.el (batch-test-emacs): * x-compose.el (alias-colon-to-doublequote): * mule/chinese.el (make-chinese-cns11643-charset): * mule/mule-cmds.el (set-locale-for-language-environment): * mule/mule-cmds.el (set-language-environment-coding-systems): * mule/mule-x-init.el (x-use-halfwidth-roman-font): * about.el (about-xemacs): * about.el (about-hackers): * diagnose.el (show-memory-usage): * diagnose.el (show-object-memory-usage-stats): * diagnose.el (show-mc-alloc-memory-usage): * diagnose.el (show-gc-stats): * dialog.el (make-dialog-box): * faces.el: * faces.el (Face-frob-property): * faces.el (set-face-stipple): * glyphs.el: * glyphs.el (init-glyphs): Removed. * help-macro.el (make-help-screen): * info.el (Info-construct-menu): * keymap.el (key-sequence-list-description): * lisp-mode.el (construct-lisp-mode-menu): * loadhist.el (unload-feature): * minibuf.el (get-user-response): * mouse.el (default-mouse-track-check-for-activation): * mouse.el (mouse-track-insert-1): Follow my own advice from the last commit and use #'labels instead of #'flet in core code.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 07 Sep 2011 21:21:36 +0100
parents 48a3d3281b48
children 071b810ceb18
comparison
equal deleted inserted replaced
5566:4654c01af32b 5567:3bc58dc9d688
833 (null (get-language-info language-name 'documentation))) 833 (null (get-language-info language-name 'documentation)))
834 (error "No documentation for the specified language")) 834 (error "No documentation for the specified language"))
835 (if (symbolp language-name) 835 (if (symbolp language-name)
836 (setq language-name (symbol-name language-name))) 836 (setq language-name (symbol-name language-name)))
837 (let ((doc (get-language-info language-name 'documentation))) 837 (let ((doc (get-language-info language-name 'documentation)))
838 (flet ((princ-list (&rest args) 838 (labels ((princ-list (&rest args)
839 (while args (princ (car args)) (setq args (cdr args))) 839 (while args (princ (car args)) (setq args (cdr args)))
840 (princ "\n"))) 840 (princ "\n")))
841 (with-output-to-temp-buffer "*Help*" 841 (with-output-to-temp-buffer "*Help*"
842 (princ-list language-name " language environment" "\n") 842 (princ-list language-name " language environment" "\n")
843 (if (stringp doc) 843 (if (stringp doc)
844 (progn 844 (progn
845 (princ-list doc) 845 (princ-list doc)
1226 LANGENV is a language environment. The locale is determined by looking at 1226 LANGENV is a language environment. The locale is determined by looking at
1227 the 'locale (or maybe 'mswindows-locale) property of LANGENV, and then 1227 the 'locale (or maybe 'mswindows-locale) property of LANGENV, and then
1228 setting it using `set-current-locale' and maybe also 1228 setting it using `set-current-locale' and maybe also
1229 `mswindows-set-current-locale'. Also sets the LANG environment variable. 1229 `mswindows-set-current-locale'. Also sets the LANG environment variable.
1230 Returns non-nil if successfully set the locale(s)." 1230 Returns non-nil if successfully set the locale(s)."
1231 (flet ((mswindows-get-and-set-locale-from-langenv (langenv) 1231 (labels
1232 ;; find the mswindows locale for the langenv, make it current, 1232 ((mswindows-get-and-set-locale-from-langenv (langenv)
1233 ;; and return it. first we check the langenv-to-locale table 1233 ;; find the mswindows locale for the langenv, make it current,
1234 ;; ... 1234 ;; and return it. first we check the langenv-to-locale table
1235 (let ((ms-locale 1235 ;; ...
1236 (gethash langenv mswindows-langenv-to-locale-table))) 1236 (let ((ms-locale
1237 (if ms-locale (progn 1237 (gethash langenv mswindows-langenv-to-locale-table)))
1238 (declare-fboundp (mswindows-set-current-locale 1238 (if ms-locale (progn
1239 ms-locale)) 1239 (declare-fboundp (mswindows-set-current-locale
1240 ms-locale) 1240 ms-locale))
1241 ;; ... if not, see if the langenv specifies any locale(s). 1241 ms-locale)
1242 ;; if not, construct one from the langenv name. 1242 ;; ... if not, see if the langenv specifies any locale(s).
1243 (let* ((mslocs (get-language-info langenv 'mswindows-locale)) 1243 ;; if not, construct one from the langenv name.
1244 (mslocs (or mslocs (cons (upcase langenv) "DEFAULT"))) 1244 (let* ((mslocs (get-language-info langenv 'mswindows-locale))
1245 (mslocs (if (and (consp mslocs) 1245 (mslocs (or mslocs (cons (upcase langenv) "DEFAULT")))
1246 (listp (cdr mslocs))) 1246 (mslocs (if (and (consp mslocs)
1247 mslocs (list mslocs)))) 1247 (listp (cdr mslocs)))
1248 (dolist (msloc mslocs) 1248 mslocs (list mslocs))))
1249 ;; Sometimes a language with DEFAULT is different from 1249 (dolist (msloc mslocs)
1250 ;; with SYS_DEFAULT, and on my system 1250 ;; Sometimes a language with DEFAULT is different from
1251 ;; (set-current-locale "chinese") is NOT the same as 1251 ;; with SYS_DEFAULT, and on my system
1252 ;; (set-current-locale "chinese-default")! The latter 1252 ;; (set-current-locale "chinese") is NOT the same as
1253 ;; gives Taiwan (DEFAULT), the former PRC (SYS_DEFAULT). 1253 ;; (set-current-locale "chinese-default")! The latter
1254 ;; In the interests of consistency, we always use DEFAULT. 1254 ;; gives Taiwan (DEFAULT), the former PRC (SYS_DEFAULT).
1255 (or (consp msloc) (setq msloc (cons msloc "DEFAULT"))) 1255 ;; In the interests of consistency, we always use DEFAULT.
1256 (when (condition-case nil 1256 (or (consp msloc) (setq msloc (cons msloc "DEFAULT")))
1257 (progn 1257 (when (condition-case nil
1258 (declare-fboundp (mswindows-set-current-locale 1258 (progn
1259 msloc)) 1259 (declare-fboundp (mswindows-set-current-locale
1260 t) 1260 msloc))
1261 (error nil)) 1261 t)
1262 (return msloc)))))))) 1262 (error nil))
1263 (return msloc))))))))
1263 (if (eq system-type 'windows-nt) 1264 (if (eq system-type 'windows-nt)
1264 (let ((ms-locale (mswindows-get-and-set-locale-from-langenv langenv))) 1265 (let ((ms-locale (mswindows-get-and-set-locale-from-langenv langenv)))
1265 (when ms-locale 1266 (when ms-locale
1266 ;; also need to set the clib locale. 1267 ;; also need to set the clib locale.
1267 (or (set-current-locale 1268 (or (set-current-locale
1337 ; ISO 8859-5, and cannot be automatically recognized without resetting the 1338 ; ISO 8859-5, and cannot be automatically recognized without resetting the
1338 ; language environment to Hebrew. However, if you shift from Japanese to 1339 ; language environment to Hebrew. However, if you shift from Japanese to
1339 ; Russian, ISO-2022-JP will continue to be automatically recognized, since 1340 ; Russian, ISO-2022-JP will continue to be automatically recognized, since
1340 ; ISO-8859-5 and ISO-2022-JP are different coding categories.)" 1341 ; ISO-8859-5 and ISO-2022-JP are different coding categories.)"
1341 1342
1342 (flet ((maybe-change-coding-system-with-eol (codesys eol-type) 1343 (labels ((maybe-change-coding-system-with-eol (codesys eol-type)
1343 ;; if the EOL type specifies a specific type of ending, 1344 ;; if the EOL type specifies a specific type of ending,
1344 ;; then add that ending onto the given CODESYS; otherwise, 1345 ;; then add that ending onto the given CODESYS; otherwise,
1345 ;; return CODESYS unchanged. 1346 ;; return CODESYS unchanged.
1346 (if (memq eol-type '(lf crlf cr unix dos mac)) 1347 (if (memq eol-type '(lf crlf cr unix dos mac))
1347 (coding-system-change-eol-conversion codesys eol-type) 1348 (coding-system-change-eol-conversion codesys eol-type)
1348 codesys))) 1349 codesys)))
1349 1350
1350 ;; initialize category mappings and priority list. 1351 ;; initialize category mappings and priority list.
1351 (let* ((priority (get-language-info language-name 'coding-priority)) 1352 (let* ((priority (get-language-info language-name 'coding-priority))
1352 (default-coding (car priority))) 1353 (default-coding (car priority)))
1353 (if priority 1354 (if priority