all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#9661: 24.0.90; language-info-custom-alist defcustom
@ 2011-10-03 11:23 Stephen Berman
  2011-10-03 14:22 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Berman @ 2011-10-03 11:23 UTC (permalink / raw)
  To: 9661

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)))))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9661: 24.0.90; language-info-custom-alist defcustom
  2011-10-03 11:23 bug#9661: 24.0.90; language-info-custom-alist defcustom Stephen Berman
@ 2011-10-03 14:22 ` Stefan Monnier
  2011-10-04  7:37   ` Stephen Berman
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2011-10-03 14:22 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 9661-done

> 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9661: 24.0.90; language-info-custom-alist defcustom
  2011-10-03 14:22 ` Stefan Monnier
@ 2011-10-04  7:37   ` Stephen Berman
  2011-10-04 13:01     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Berman @ 2011-10-04  7:37 UTC (permalink / raw)
  To: 9661

On Mon, 03 Oct 2011 10:22:50 -0400 Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> 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,

For the record, I confirm the problems I reported are fixed; thanks.
(Obviously, I failed to understand the nature of the problem; all the
more surprising/interesting, that my patch also worked, at least for
these cases, despite using apply-partially...)

Steve Berman





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9661: 24.0.90; language-info-custom-alist defcustom
  2011-10-04  7:37   ` Stephen Berman
@ 2011-10-04 13:01     ` Stefan Monnier
  2011-10-04 13:06       ` Stephen Berman
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2011-10-04 13:01 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 9661

> For the record, I confirm the problems I reported are fixed; thanks.
> (Obviously, I failed to understand the nature of the problem; all the
> more surprising/interesting, that my patch also worked, at least for
> these cases, despite using apply-partially...)

It fixed the first problem because it moved the code outside of the
surrounding `(...).  The second problem is much less visible (you'd
have to load a file that adds a new input method after having loaded
mule-cmds.el in order to see the difference).


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9661: 24.0.90; language-info-custom-alist defcustom
  2011-10-04 13:01     ` Stefan Monnier
@ 2011-10-04 13:06       ` Stephen Berman
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Berman @ 2011-10-04 13:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9661

On Tue, 04 Oct 2011 09:01:03 -0400 Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> For the record, I confirm the problems I reported are fixed; thanks.
>> (Obviously, I failed to understand the nature of the problem; all the
>> more surprising/interesting, that my patch also worked, at least for
>> these cases, despite using apply-partially...)
>
> It fixed the first problem because it moved the code outside of the
> surrounding `(...).  The second problem is much less visible (you'd
> have to load a file that adds a new input method after having loaded
> mule-cmds.el in order to see the difference).

Ah, ok; thanks for elaborating.

Steve Berman





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-04 13:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-03 11:23 bug#9661: 24.0.90; language-info-custom-alist defcustom Stephen Berman
2011-10-03 14:22 ` Stefan Monnier
2011-10-04  7:37   ` Stephen Berman
2011-10-04 13:01     ` Stefan Monnier
2011-10-04 13:06       ` Stephen Berman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.