From: Stefan Monnier Date: Mon, 3 Oct 2011 14:18:42 +0000 (-0400) Subject: * lisp/international/mule-cmds.el: Fix abuses of apply-partially. X-Git-Tag: emacs-pretest-24.0.91~217 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c24b7f65f81cc12d51c3a819737b3221b109ee5;p=emacs.git * lisp/international/mule-cmds.el: Fix abuses of apply-partially. (mule-input-method-string): New widget. (default-input-method, language-info-custom-alist): Use it. Fixes: debbugs:9661 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e1d3559d607..a7258eec2a4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-10-03 Stefan Monnier + + * international/mule-cmds.el: Fix abuses of apply-partially (bug#9661). + (mule-input-method-string): New widget. + (default-input-method, language-info-custom-alist): Use it. + 2011-10-02 Stefan Monnier * pcomplete.el: Require comint. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 3276447e72f..0a5d6ed954c 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1306,17 +1306,22 @@ If nil, that means no input method is activated now.") (make-variable-buffer-local 'current-input-method-title) (put 'current-input-method-title 'permanent-local t) +(define-widget 'mule-input-method-string 'string + "String widget with completion for input method." + :completions + (lambda (string pred action) + (let ((completion-ignore-case t)) + (complete-with-action action input-method-alist string pred))) + :prompt-history 'input-method-history) + (defcustom default-input-method nil "Default input method for multilingual text (a string). This is the input method activated automatically by the command `toggle-input-method' (\\[toggle-input-method])." :link '(custom-manual "(emacs)Input Methods") :group 'mule - :type '(choice (const nil) - (string - :completions (apply-partially - #'completion-table-case-fold input-method-alist) - :prompt-history input-method-history)) + :type `(choice (const nil) + mule-input-method-string) :set-after '(current-language-environment)) (put 'input-method-function 'permanent-local t) @@ -1879,10 +1884,11 @@ specifies the character set for the major languages of Western Europe." (define-widget 'charset 'symbol "An Emacs charset." :tag "Charset" - :completions (apply-partially #'completion-table-with-predicate - (apply-partially #'completion-table-case-fold - obarray) - #'charsetp 'strict) + :completions + (lambda (string pred action) + (let ((completion-ignore-case t)) + (completion-table-with-predicate + obarray #'charsetp 'strict string pred action))) :value 'ascii :validate (lambda (widget) (unless (charsetp (widget-value widget)) @@ -1917,8 +1923,10 @@ See `set-language-info-alist' for use in programs." :type `(alist :key-type (string :tag "Language environment" :completions - (apply-partially #'completion-table-case-fold - language-info-alist)) + (lambda (string pred action) + (let ((completion-ignore-case t)) + (complete-with-action + action language-info-alist string pred)))) :value-type (alist :key-type symbol :options ((documentation string) @@ -1929,12 +1937,7 @@ See `set-language-info-alist' for use in programs." (coding-system (repeat coding-system)) (coding-priority (repeat coding-system)) (nonascii-translation charset) - (input-method - (string - :completions - (apply-partially #'completion-table-case-fold - input-method-alist) - :prompt-history input-method-history)) + (input-method mule-input-method-string) (features (repeat symbol)) (unibyte-display coding-system)))))