unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: 9661@debbugs.gnu.org
Subject: bug#9661: 24.0.90; language-info-custom-alist defcustom
Date: Mon, 03 Oct 2011 13:23:09 +0200	[thread overview]
Message-ID: <877h4mz5cy.fsf@escher.home> (raw)

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	other threads:[~2011-10-03 11:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 11:23 Stephen Berman [this message]
2011-10-03 14:22 ` bug#9661: 24.0.90; language-info-custom-alist defcustom Stefan Monnier
2011-10-04  7:37   ` Stephen Berman
2011-10-04 13:01     ` Stefan Monnier
2011-10-04 13:06       ` Stephen Berman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877h4mz5cy.fsf@escher.home \
    --to=stephen.berman@gmx.net \
    --cc=9661@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).