--- Begin Message ---
Subject: |
24.0.90; language-info-custom-alist defcustom |
Date: |
Mon, 03 Oct 2011 13:23:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) |
In GNU Emacs 24.0.90.2 (i686-suse-linux-gnu, GTK+ Version 2.22.1) of
2011-10-03 on escher
Windowing system distributor `The X.Org Foundation', version 11.0.10903000
configured using `configure '--without-toolkit-scroll-bars' 'CFLAGS=-g''
1. emacs -Q
2. M-x customize-option RET language-info-custom-alist RET.
3. Click or hit RET on the INS button to open up the customization
widgets.
4. Move the cursor to the first editable field, labelled "Language
environment".
5. Type ESC TAB, which should pop up a list of completions; instead:
=> An error is signalled: "completion--some: Invalid function:
(apply-partially (function completion-table-case-fold)
language-info-alist)"
The same error occurs on typing ESC TAB in the editable field associated
with the key "input-method". In the other editable fields, however,
completion works.
I believe the errors are due to the use of the :completions keyword on
the string widget in the defcustom code of language-info-custom-alist.
If I understand the source in the wid-edit library, the string widget
does not support this keyword. One way to fix this is to define new
widgets in the string class that have suitable values for :completions;
the patch below does this. Since these widgets are specific to the mule
API the patch puts them into mule-cmds.el (like e.g. the definition of
the charset widget). It would probably be better to have a more general
and modular solution, but I leave that to the widget gurus.
*** /data/steve/bzr/emacs/trunk/lisp/international/mule-cmds.el 2011-09-17
14:20:08.000000000 +0200
--- /data/steve/bzr/emacs/quickfixes/lisp/international/mule-cmds.el
2011-10-03 13:15:21.000000000 +0200
***************
*** 1891,1896 ****
--- 1891,1906 ----
widget))
:prompt-history 'charset-history)
+ (define-widget 'language-environment-string 'string
+ "String widget with completion for language environment."
+ :completions (apply-partially #'completion-table-case-fold
+ language-info-alist))
+
+ (define-widget 'input-method-string 'string
+ "String widget with completion for input method."
+ :completions (apply-partially #'completion-table-case-fold
+ input-method-alist))
+
(defcustom language-info-custom-alist nil
"Customizations of language environment parameters.
Value is an alist with elements like those of `language-info-alist'.
***************
*** 1915,1924 ****
;; re-set the environment in case its parameters changed
(set-language-environment current-language-environment)))
:type `(alist
! :key-type (string :tag "Language environment"
! :completions
! (apply-partially #'completion-table-case-fold
! language-info-alist))
:value-type
(alist :key-type symbol
:options ((documentation string)
--- 1925,1932 ----
;; re-set the environment in case its parameters changed
(set-language-environment current-language-environment)))
:type `(alist
! :key-type (language-environment-string
! :tag "Language environment")
:value-type
(alist :key-type symbol
:options ((documentation string)
***************
*** 1930,1939 ****
(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))
(features (repeat symbol))
(unibyte-display coding-system)))))
--- 1938,1944 ----
(coding-priority (repeat coding-system))
(nonascii-translation charset)
(input-method
! (input-method-string
:prompt-history input-method-history))
(features (repeat symbol))
(unibyte-display coding-system)))))
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#9661: 24.0.90; language-info-custom-alist defcustom |
Date: |
Mon, 03 Oct 2011 10:22:50 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) |
> 5. Type ESC TAB, which should pop up a list of completions; instead:
> => An error is signalled: "completion--some: Invalid function:
> (apply-partially (function completion-table-case-fold)
> language-info-alist)"
Thanks. There were two problems:
- the immediate one was that `apply-partially' was used in data and hence
never called (it needed an "unquote" comma just in front).
- after fixing it the new problem was that the constructed completion
tables stored the value of language-info-alist at the time
mule-cmds.el is loaded rather than at the time the user hits M-TAB.
So I've installed a slightly different patch to yours which goes a bit
further than yours. Should be fixed now,
Stefan
--- End Message ---