Mercurial > hg > xemacs-beta
diff 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 |
line wrap: on
line diff
--- a/lisp/mule/mule-cmds.el Wed Sep 07 16:26:45 2011 +0100 +++ b/lisp/mule/mule-cmds.el Wed Sep 07 21:21:36 2011 +0100 @@ -835,9 +835,9 @@ (if (symbolp language-name) (setq language-name (symbol-name language-name))) (let ((doc (get-language-info language-name 'documentation))) - (flet ((princ-list (&rest args) - (while args (princ (car args)) (setq args (cdr args))) - (princ "\n"))) + (labels ((princ-list (&rest args) + (while args (princ (car args)) (setq args (cdr args))) + (princ "\n"))) (with-output-to-temp-buffer "*Help*" (princ-list language-name " language environment" "\n") (if (stringp doc) @@ -1228,38 +1228,39 @@ setting it using `set-current-locale' and maybe also `mswindows-set-current-locale'. Also sets the LANG environment variable. Returns non-nil if successfully set the locale(s)." - (flet ((mswindows-get-and-set-locale-from-langenv (langenv) - ;; find the mswindows locale for the langenv, make it current, - ;; and return it. first we check the langenv-to-locale table - ;; ... - (let ((ms-locale - (gethash langenv mswindows-langenv-to-locale-table))) - (if ms-locale (progn - (declare-fboundp (mswindows-set-current-locale - ms-locale)) - ms-locale) - ;; ... if not, see if the langenv specifies any locale(s). - ;; if not, construct one from the langenv name. - (let* ((mslocs (get-language-info langenv 'mswindows-locale)) - (mslocs (or mslocs (cons (upcase langenv) "DEFAULT"))) - (mslocs (if (and (consp mslocs) - (listp (cdr mslocs))) - mslocs (list mslocs)))) - (dolist (msloc mslocs) - ;; Sometimes a language with DEFAULT is different from - ;; with SYS_DEFAULT, and on my system - ;; (set-current-locale "chinese") is NOT the same as - ;; (set-current-locale "chinese-default")! The latter - ;; gives Taiwan (DEFAULT), the former PRC (SYS_DEFAULT). - ;; In the interests of consistency, we always use DEFAULT. - (or (consp msloc) (setq msloc (cons msloc "DEFAULT"))) - (when (condition-case nil - (progn - (declare-fboundp (mswindows-set-current-locale - msloc)) - t) - (error nil)) - (return msloc)))))))) + (labels + ((mswindows-get-and-set-locale-from-langenv (langenv) + ;; find the mswindows locale for the langenv, make it current, + ;; and return it. first we check the langenv-to-locale table + ;; ... + (let ((ms-locale + (gethash langenv mswindows-langenv-to-locale-table))) + (if ms-locale (progn + (declare-fboundp (mswindows-set-current-locale + ms-locale)) + ms-locale) + ;; ... if not, see if the langenv specifies any locale(s). + ;; if not, construct one from the langenv name. + (let* ((mslocs (get-language-info langenv 'mswindows-locale)) + (mslocs (or mslocs (cons (upcase langenv) "DEFAULT"))) + (mslocs (if (and (consp mslocs) + (listp (cdr mslocs))) + mslocs (list mslocs)))) + (dolist (msloc mslocs) + ;; Sometimes a language with DEFAULT is different from + ;; with SYS_DEFAULT, and on my system + ;; (set-current-locale "chinese") is NOT the same as + ;; (set-current-locale "chinese-default")! The latter + ;; gives Taiwan (DEFAULT), the former PRC (SYS_DEFAULT). + ;; In the interests of consistency, we always use DEFAULT. + (or (consp msloc) (setq msloc (cons msloc "DEFAULT"))) + (when (condition-case nil + (progn + (declare-fboundp (mswindows-set-current-locale + msloc)) + t) + (error nil)) + (return msloc)))))))) (if (eq system-type 'windows-nt) (let ((ms-locale (mswindows-get-and-set-locale-from-langenv langenv))) (when ms-locale @@ -1339,13 +1340,13 @@ ; Russian, ISO-2022-JP will continue to be automatically recognized, since ; ISO-8859-5 and ISO-2022-JP are different coding categories.)" - (flet ((maybe-change-coding-system-with-eol (codesys eol-type) - ;; if the EOL type specifies a specific type of ending, - ;; then add that ending onto the given CODESYS; otherwise, - ;; return CODESYS unchanged. - (if (memq eol-type '(lf crlf cr unix dos mac)) - (coding-system-change-eol-conversion codesys eol-type) - codesys))) + (labels ((maybe-change-coding-system-with-eol (codesys eol-type) + ;; if the EOL type specifies a specific type of ending, + ;; then add that ending onto the given CODESYS; otherwise, + ;; return CODESYS unchanged. + (if (memq eol-type '(lf crlf cr unix dos mac)) + (coding-system-change-eol-conversion codesys eol-type) + codesys))) ;; initialize category mappings and priority list. (let* ((priority (get-language-info language-name 'coding-priority))