bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9661: 24.0.90; language-info-custom-alist defcustom


From: Stephen Berman
Subject: bug#9661: 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)))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]