Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-completing-read vs XEmacs 21.4
@ 2010-10-04 14:20 Dave Goldberg
  2010-10-04 14:32 ` Julien Danjou
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Goldberg @ 2010-10-04 14:20 UTC (permalink / raw)
  To: ding

After a git pull this morning (commit
896480a177c32f9c4449b796e3173fddba51c373 at the top of git log) I can
no longer complete most things.  This appears to be the addition of
gnus-completing-read.  The error appears to be that the objects
containing the lists of possible completions are not structured the
way gnus-completing-read wants.  I may be able to fix this with my
smime-keys by adding another set of parens around it, but I don't get
that option with dynamically created lists such as the list of groups
for doing things like moving/copying articles and jumping to groups,
and mime types for things like K t.  Not having seen any other
complaints here, I have to assume it's a compatibility issue with
XEmacs 21.4.

Thanks,
-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 14:20 gnus-completing-read vs XEmacs 21.4 Dave Goldberg
@ 2010-10-04 14:32 ` Julien Danjou
  2010-10-04 15:20   ` Dave Goldberg
  0 siblings, 1 reply; 18+ messages in thread
From: Julien Danjou @ 2010-10-04 14:32 UTC (permalink / raw)
  To: Dave Goldberg; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

On Mon, Oct 04 2010, Dave Goldberg wrote:

> After a git pull this morning (commit
> 896480a177c32f9c4449b796e3173fddba51c373 at the top of git log) I can
> no longer complete most things.  This appears to be the addition of
> gnus-completing-read.  The error appears to be that the objects
> containing the lists of possible completions are not structured the
> way gnus-completing-read wants.  I may be able to fix this with my
> smime-keys by adding another set of parens around it, but I don't get
> that option with dynamically created lists such as the list of groups
> for doing things like moving/copying articles and jumping to groups,
> and mime types for things like K t.  Not having seen any other
> complaints here, I have to assume it's a compatibility issue with
> XEmacs 21.4.

No, it's rather a code path I did not test, since there's a lot and some
of them I do/can not use.

Could you send me a backtrace when this happens so I can push a fix?

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 14:32 ` Julien Danjou
@ 2010-10-04 15:20   ` Dave Goldberg
  2010-10-04 15:29     ` Julien Danjou
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Goldberg @ 2010-10-04 15:20 UTC (permalink / raw)
  To: ding

> No, it's rather a code path I did not test, since there's a lot and some
> of them I do/can not use.

> Could you send me a backtrace when this happens so I can push a fix?

Here you go.  This when trying to copy an article to another group.

Debugger entered--Lisp error: (wrong-type-argument listp "nnml:emunah")
  all-completions("nnml:sof" ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nndoc+/home/dsg/dslmsg.mbox:dslmsg.mbox" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil)
  (setq poss (all-completions str table pred))
  (if (not (setq p ...)) (setq poss (all-completions str table pred)) (let (...) (setq p compl) (while p ... ...)))
  (if (and (eq mode ...) (PC-is-complete-p str table pred)) (quote complete) (setq dirlength (if filename ... 0)) (and filename (not ...) (progn ... ... ...)) (or (equal PC-word-delimiters PC-delims) (setq PC-delims PC-word-delimiters PC-delim-regex ... PC-ndelims-regex ... PC-delims-list ...)) (and filename (string-match "\\*.*/" str) (let ... ... ... ... ...)) (if filename (if incname ... ...) (setq basestr str)) (setq regex (regexp-quote basestr) offset (if ... 1 0) p offset) (while (setq p ...) (if ... ... ...)) (setq p 0) (if filename (while ... ...)) (setq regex (concat "\\`" regex)) (if (not ...) (setq poss ...) (let ... ... ...)) (cond (... ...) (... ... ... ... ... ...) (t ... t)))
  (let* ((table minibuffer-completion-table) (pred minibuffer-completion-predicate) (filename ...) (dirname nil) dirlength (str ...) (incname ...) (ambig nil) basestr regex p offset (poss nil) helpposs (case-fold-search completion-ignore-case)) (if (and ... ...) (quote complete) (setq dirlength ...) (and filename ... ...) (or ... ...) (and filename ... ...) (if filename ... ...) (setq regex ... offset ... p offset) (while ... ...) (setq p 0) (if filename ...) (setq regex ...) (if ... ... ...) (cond ... ... ...)))
  PC-do-completion(nil)
  (if (and window (window-buffer window) (buffer-name ...)) (save-excursion (set-buffer ...) (if ... ... ...)) (PC-do-completion nil))
  (let ((window minibuffer-scroll-window)) (if (and window ... ...) (save-excursion ... ...) (PC-do-completion nil)))
  (if (PC-was-meta-key) (minibuffer-complete) (or (eq last-command this-command) (setq minibuffer-scroll-window nil)) (let (...) (if ... ... ...)))
  (lambda nil "Like minibuffer-complete, but allows \"b--di\"-style abbreviations.\nFor example, \"M-x b--di\" would match `byte-recompile-directory', or any\nname which consists of three or more words, the first beginning with \"b\"\nand the third beginning with \"di\".\n\nThe pattern \"b--d\" is ambiguous for `byte-recompile-directory' and\n`beginning-of-defun', so this would produce a list of completions\njust like when normal Emacs completions are ambiguous.\n\nWord-delimiters for the purposes of Partial Completion are \"-\", \"_\",\n\".\", and SPC." (interactive) (if (PC-was-meta-key) (minibuffer-complete) (or ... ...) (let ... ...)))()
  call-interactively(PC-complete)
  read-minibuffer-internal("Copy this article to (default nnml:inbox): ")
  byte-code("..." [standard-output standard-input prompt recursion-depth minibuffer-depth t read-minibuffer-internal] 2)
  read-from-minibuffer("Copy this article to (default nnml:inbox): " "nnml:" #<keymap minibuffer-local-completion-map size 16 0xdaf> nil gnus-group-history nil "nnml:inbox")
  completing-read("Copy this article to (default nnml:inbox): " ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nndoc+/home/dsg/dslmsg.mbox:dslmsg.mbox" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil nil "nnml:" gnus-group-history "nnml:inbox")
  gnus-std-completing-read("Copy this article to (default nnml:inbox): " ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nndoc+/home/dsg/dslmsg.mbox:dslmsg.mbox" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil "nnml:" gnus-group-history "nnml:inbox")
  gnus-completing-read("Copy this article to" ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nndoc+/home/dsg/dslmsg.mbox:dslmsg.mbox" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil "nnml:" gnus-group-history "nnml:inbox")
  gnus-group-completing-read("Copy this article to" [nnml:emunah nnml:mm nnml:vv nnml:temple nnml:spam nnml:business nnml:bbdb-digest nndoc+/home/dsg/dslmsg\.mbox:dslmsg\.mbox nnml:friends nnml:personal nnml:misc nnml:software nnml:personal\.molly nndraft:drafts nnml:personal\.the_browns nnml:inbox\.mm nndraft:queue nnml:family nnml:ding-list nnml:inbox nnml:itac] nil "nnml:" gnus-group-history "nnml:inbox")
  gnus-read-move-group-name("Copy" nil (11592) "nnml:")
  gnus-summary-move-article(nil nil nil copy)
  gnus-summary-copy-article(nil)
  call-interactively(gnus-summary-copy-article)

-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 15:20   ` Dave Goldberg
@ 2010-10-04 15:29     ` Julien Danjou
  2010-10-04 15:38       ` Dave Goldberg
  0 siblings, 1 reply; 18+ messages in thread
From: Julien Danjou @ 2010-10-04 15:29 UTC (permalink / raw)
  To: Dave Goldberg; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

On Mon, Oct 04 2010, Dave Goldberg wrote:

>   gnus-std-completing-read("Copy this article to (default nnml:inbox):
>   " ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam"
>   "nnml:business" "nnml:bbdb-digest"
>   "nndoc+/home/dsg/dslmsg.mbox:dslmsg.mbox" "nnml:friends"
>   "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly"
>   "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm"
>   "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox"
>   "nnml:itac") nil "nnml:" gnus-group-history "nnml:inbox")

gnus % git grep gnus-std-completing-read | wc -l
0

gnus-std-completing-read is the old name of gnus-emacs-completing-read
(before the Florian's patch revert). So I'm guessing there's something
wrong on your side.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 15:29     ` Julien Danjou
@ 2010-10-04 15:38       ` Dave Goldberg
  2010-10-04 16:04         ` Dave Goldberg
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Goldberg @ 2010-10-04 15:38 UTC (permalink / raw)
  To: ding


> On Mon, Oct 04 2010, Dave Goldberg wrote:

>> gnus-std-completing-read("Copy this article to (default nnml:inbox):
>> " ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam"
>> "nnml:business" "nnml:bbdb-digest"
>> "nndoc+/home/dsg/dslmsg.mbox:dslmsg.mbox" "nnml:friends"
>> "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly"
>> "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm"
>> "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox"
>> "nnml:itac") nil "nnml:" gnus-group-history "nnml:inbox")

> gnus % git grep gnus-std-completing-read | wc -l
> 0

> gnus-std-completing-read is the old name of gnus-emacs-completing-read
> (before the Florian's patch revert). So I'm guessing there's something
> wrong on your side.

OK, I'll try a fresh git clone and see if that solves it.

Thanks,
-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 15:38       ` Dave Goldberg
@ 2010-10-04 16:04         ` Dave Goldberg
  2010-10-04 16:08           ` Julien Danjou
  2010-10-04 16:25           ` Lawrence Mitchell
  0 siblings, 2 replies; 18+ messages in thread
From: Dave Goldberg @ 2010-10-04 16:04 UTC (permalink / raw)
  To: ding


> OK, I'll try a fresh git clone and see if that solves it.

Still getting an error, but I have eliminated the use of the old
function (I had a current git pull, but had not copied it to my local
packages directory - Doh! - that is now fixed).  I've also commented
out requires of any external completion related packages in my
init.el to no avail.  I think.

Debugger entered--Lisp error: (wrong-type-argument listp "nnml:emunah")
  try-completion("nnml:" ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil)
  minibuffer-do-completion("nnml:")
  #<compiled-function nil "...(93)" [obuf this-command last-command minibuffer-scroll-window status window nil windowp window-buffer buffer-name (...) pos-visible-in-window-p set-window-start scroll-other-window minibuffer-do-completion buffer-string none unique temp-minibuffer-message " [Sole completion]" exact " [Complete, but not unique]" t] 4 879432 nil>()
  call-interactively(minibuffer-complete)
  read-minibuffer-internal("Group: ")
  byte-code("..." [standard-output standard-input prompt recursion-depth minibuffer-depth t read-minibuffer-internal] 2)
  read-from-minibuffer("Group: " nil #<keymap minibuffer-local-completion-map size 8 0xdaf> nil gnus-group-history nil nil)
  completing-read("Group: " ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil nil nil gnus-group-history nil)
  gnus-emacs-completing-read("Group: " ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil nil gnus-group-history nil)
  gnus-completing-read("Group" ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil nil gnus-group-history nil)
  gnus-group-completing-read(nil nil nil nil)
  (list (gnus-group-completing-read nil nil (gnus-read-active-file-p) (if current-prefix-arg ... ...)))
  call-interactively(gnus-group-jump-to-group)


-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 16:04         ` Dave Goldberg
@ 2010-10-04 16:08           ` Julien Danjou
  2010-10-04 16:25           ` Lawrence Mitchell
  1 sibling, 0 replies; 18+ messages in thread
From: Julien Danjou @ 2010-10-04 16:08 UTC (permalink / raw)
  To: Dave Goldberg; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

On Mon, Oct 04 2010, Dave Goldberg wrote:

> Still getting an error, but I have eliminated the use of the old
> function (I had a current git pull, but had not copied it to my local
> packages directory - Doh! - that is now fixed).  I've also commented
> out requires of any external completion related packages in my
> init.el to no avail.  I think.
>
>   completing-read("Group: " ("nnml:emunah" "nnml:mm" "nnml:vv"
>   "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest"
>   "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software"
>   "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns"
>   "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list"
>   "nnml:inbox" "nnml:itac") nil nil nil gnus-group-history nil)

Executing:
(completing-read "Group: " '("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil nil nil 'gnus-group-history nil)

does not fail here. I don't get what's wrong. Maybe there's something
wrong with XEmacs about such a call?

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 16:04         ` Dave Goldberg
  2010-10-04 16:08           ` Julien Danjou
@ 2010-10-04 16:25           ` Lawrence Mitchell
  2010-10-04 16:31             ` Dave Goldberg
  2010-10-04 16:37             ` Julien Danjou
  1 sibling, 2 replies; 18+ messages in thread
From: Lawrence Mitchell @ 2010-10-04 16:25 UTC (permalink / raw)
  To: ding

Dave Goldberg wrote:
>> OK, I'll try a fresh git clone and see if that solves it.

> Still getting an error, but I have eliminated the use of the old
> function (I had a current git pull, but had not copied it to my local
> packages directory - Doh! - that is now fixed).  I've also commented
> out requires of any external completion related packages in my
> init.el to no avail.  I think.

> Debugger entered--Lisp error: (wrong-type-argument listp "nnml:emunah")
>   try-completion("nnml:" ("nnml:emunah" "nnml:mm" "nnml:vv" "nnml:temple" "nnml:spam" "nnml:business" "nnml:bbdb-digest" "nnml:friends" "nnml:personal" "nnml:misc" "nnml:software" "nnml:personal.molly" "nndraft:drafts" "nnml:personal.the_browns" "nnml:inbox.mm" "nndraft:queue" "nnml:family" "nnml:ding-list" "nnml:inbox" "nnml:itac") nil)

[...]

This is almost certainly because old (for some value of old)
versions of Emacs and XEmacs expect the second value of
try-completion to be an alist and the car of each element is
checked for matching.

For example:

$ xemacs --version
XEmacs 21.1 (patch 14)

`try-completion' is a built-in function
(try-completion STRING ALIST &optional PRED)

Documentation:
Return common substring of all completions of STRING in ALIST.
Each car of each element of ALIST is tested to see if it begins with STRING.

(try-completion "foo" '("foo" "bar")) => wrong-type-argument:
listp, "foo"

(try-completion "foo" '(("foo") ("bar"))) => t

No idea /why/ this design decision was made.

I bet the new code doesn't cater for this case and just passes a
list of possible options.  Here's a simple fix (warning,
untested) which you'd probably want to condition on
try-completion being old.


diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el
index 26d6e2c..350cd13 100644
--- a/lisp/gnus-util.el
+++ b/lisp/gnus-util.el
@@ -1596,7 +1596,10 @@ SPEC is a predicate specifier that contains stuff like `or', `and',
            (concat prompt (when def
                             (concat " (default " def ")"))
                    ": ")
-           collection require-match initial-input history def))
+           (if (listp collection)
+               (mapcar (lambda (x) (if (not (consp x)) (cons x nil) x) collection))
+             collection)
+           require-match initial-input history def))
 
 (defun gnus-emacs-completing-read (prompt collection &optional require-match
                                           initial-input history def)



Lawrence
-- 
Lawrence Mitchell <wence@gmx.li>




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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 16:25           ` Lawrence Mitchell
@ 2010-10-04 16:31             ` Dave Goldberg
  2010-10-04 16:35               ` Lawrence Mitchell
  2010-10-04 16:37             ` Julien Danjou
  1 sibling, 1 reply; 18+ messages in thread
From: Dave Goldberg @ 2010-10-04 16:31 UTC (permalink / raw)
  To: ding

> This is almost certainly because old (for some value of old)
> versions of Emacs and XEmacs expect the second value of
> try-completion to be an alist and the car of each element is
> checked for matching.

[...]

I'm running 21.4 (patch 22) "Instant Classic" XEmacs Lucid which I understand is current stable.  The doc string for try-completion says

`try-completion' is a built-in function
(try-completion STRING COLLECTION &optional PREDICATE)

Documentation:
Return common substring of all completions of STRING in COLLECTION.
COLLECTION must be an alist, an obarray, or a function.
Each string in COLLECTION is tested to see if it begins with STRING.
All that match are compared together; the longest initial sequence
common to all matches is returned as a string.  If there is no match
at all, nil is returned.  For an exact match, t is returned.

If COLLECTION is an alist, the cars of the elements of the alist
(which must be strings) form the set of possible completions.

If COLLECTION is an obarray, the names of all symbols in the obarray
are the possible completions.

If COLLECTION is a function, it is called with three arguments: the
values STRING, PREDICATE and nil.  Whatever it returns becomes the
value of `try-completion'.

If optional third argument PREDICATE is non-nil, it is used to test
each possible match.  The match is a candidate only if PREDICATE
returns non-nil.  The argument given to PREDICATE is the alist element
or the symbol from the obarray.

-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 16:31             ` Dave Goldberg
@ 2010-10-04 16:35               ` Lawrence Mitchell
  0 siblings, 0 replies; 18+ messages in thread
From: Lawrence Mitchell @ 2010-10-04 16:35 UTC (permalink / raw)
  To: ding

Dave Goldberg wrote:
>> This is almost certainly because old (for some value of old)
>> versions of Emacs
                    ^,

There was a comma missing here, the old qualifier only applies to
Emacs, all XEmacs versions expect this.

>> and XEmacs expect the second value of try-completion to be an
>> alist and the car of each element is checked for matching.

> [...]

> I'm running 21.4 (patch 22) "Instant Classic" XEmacs Lucid
> which I understand is current stable.  The doc string for
> try-completion says

[...]

> If COLLECTION is an alist, the cars of the elements of the alist
> (which must be strings) form the set of possible completions.

Yep, this is the cause of the problem you're seeing.

Lawrence
-- 
Lawrence Mitchell <wence@gmx.li>




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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 16:25           ` Lawrence Mitchell
  2010-10-04 16:31             ` Dave Goldberg
@ 2010-10-04 16:37             ` Julien Danjou
  2010-10-04 16:54               ` Lawrence Mitchell
  1 sibling, 1 reply; 18+ messages in thread
From: Julien Danjou @ 2010-10-04 16:37 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

On Mon, Oct 04 2010, Lawrence Mitchell wrote:

> This is almost certainly because old (for some value of old)
> versions of Emacs and XEmacs expect the second value of
> try-completion to be an alist and the car of each element is
> checked for matching.

Okay, fix pushed. I hate that XEmacs. :-)

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 16:37             ` Julien Danjou
@ 2010-10-04 16:54               ` Lawrence Mitchell
  2010-10-04 17:47                 ` Julien Danjou
  0 siblings, 1 reply; 18+ messages in thread
From: Lawrence Mitchell @ 2010-10-04 16:54 UTC (permalink / raw)
  To: ding

Julien Danjou wrote:

> On Mon, Oct 04 2010, Lawrence Mitchell wrote:

>> This is almost certainly because old (for some value of old)
>> versions of Emacs and XEmacs expect the second value of
>> try-completion to be an alist and the car of each element is
>> checked for matching.

> Okay, fix pushed. I hate that XEmacs. :-)

That is almost certainly the wrong fix, since it now breaks if
collection is a hash-table or a function.  In addition it does
needless work if collection is an obarray.  Hence why my
suggested fix special-cased on collection being a list.
Additionally, my misleading lack of comma in the paragraph above
has lead to an incorrect comment.

It should be something more like:

;; Old versions of Emacs (21.4 and below) and XEmacs expect that
;; a listp collection is actually an alist, the cars of whose
;; elements are tested for completion candidates

Lawrence
-- 
Lawrence Mitchell <wence@gmx.li>




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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 16:54               ` Lawrence Mitchell
@ 2010-10-04 17:47                 ` Julien Danjou
  2010-10-04 18:28                   ` Dave Goldberg
  2010-10-08 12:14                   ` Andrew Cohen
  0 siblings, 2 replies; 18+ messages in thread
From: Julien Danjou @ 2010-10-04 17:47 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

On Mon, Oct 04 2010, Lawrence Mitchell wrote:

> That is almost certainly the wrong fix, since it now breaks if
> collection is a hash-table or a function.

Collection is always a list.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 17:47                 ` Julien Danjou
@ 2010-10-04 18:28                   ` Dave Goldberg
  2010-10-04 20:18                     ` Julien Danjou
  2010-10-08 12:14                   ` Andrew Cohen
  1 sibling, 1 reply; 18+ messages in thread
From: Dave Goldberg @ 2010-10-04 18:28 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: ding


> On Mon, Oct 04 2010, Lawrence Mitchell wrote:

>> That is almost certainly the wrong fix, since it now breaks if
>> collection is a hash-table or a function.

> Collection is always a list.

It seems to be working for everything except smime-keys now.  If I try to encrypt a message I get this backtrace.

Debugger entered--Lisp error: (wrong-type-argument listp "dsg@mywork.org-20100610-20111202.pem")
  read-from-minibuffer("Sign this part with what signature: " nil #<keymap minibuffer-local-completion-map size 16 0xdb4> nil "dsg@mywork.org-20100610-20111202.pem" nil nil)
  completing-read("Sign this part with what signature: " ((("dsg@mywork.org-20100610-20111202.pem" "/home/dsg/private/certs/dsg@mywork.org-20100610-20111202.pem")) (("dsg@mywork.org-20081217-20100610.pem" "/home/dsg/private/certs/dsg@mywork.org-20081217-20100610.pem")) (("dsg@mywork.org-20070626-20081217.pem" "/home/dsg/private/certs/dsg@mywork.org-20070626-20081217.pem")) (("dsg@mywork.org-20060704-20070626" "/home/dsg/private/certs/dsg@mywork.org-20060704-20070626.pem")) (("dsg@mywork.org-20050123-20060704" "/home/dsg/private/certs/dsg@mywork.org-20050123-20060704.pem")) (("dsg@mywork.org-20030802-20050123" "/home/dsg/private/certs/dsg@mywork.org-20030802-20050123.pem")) (("dsg@mywork.org-20020208-20030802" "/home/dsg/private/certs/dsg@mywork.org-20020208-20030802.pem")) (("dsg@mywork.org-20000817-20020208" "/home/dsg/private/certs/dsg@mywork.org-20000817-20020208.pem")) (("dsg@mywork.org-19990224-20000817" "/home/dsg/private/certs/dsg@mywork.org-19990224-20000817.pem"))) nil nil nil "dsg@mywork.org-20100610-20111202.pem" nil)
  gnus-emacs-completing-read("Sign this part with what signature: " (("dsg@mywork.org-20100610-20111202.pem" "/home/dsg/private/certs/dsg@mywork.org-20100610-20111202.pem") ("dsg@mywork.org-20081217-20100610.pem" "/home/dsg/private/certs/dsg@mywork.org-20081217-20100610.pem") ("dsg@mywork.org-20070626-20081217.pem" "/home/dsg/private/certs/dsg@mywork.org-20070626-20081217.pem") ("dsg@mywork.org-20060704-20070626" "/home/dsg/private/certs/dsg@mywork.org-20060704-20070626.pem") ("dsg@mywork.org-20050123-20060704" "/home/dsg/private/certs/dsg@mywork.org-20050123-20060704.pem") ("dsg@mywork.org-20030802-20050123" "/home/dsg/private/certs/dsg@mywork.org-20030802-20050123.pem") ("dsg@mywork.org-20020208-20030802" "/home/dsg/private/certs/dsg@mywork.org-20020208-20030802.pem") ("dsg@mywork.org-20000817-20020208" "/home/dsg/private/certs/dsg@mywork.org-20000817-20020208.pem") ("dsg@mywork.org-19990224-20000817" "/home/dsg/private/certs/dsg@mywork.org-19990224-20000817.pem")) nil nil "dsg@mywork.org-20100610-20111202.pem" nil)
  gnus-completing-read("Sign this part with what signature" (("dsg@mywork.org-20100610-20111202.pem" "/home/dsg/private/certs/dsg@mywork.org-20100610-20111202.pem") ("dsg@mywork.org-20081217-20100610.pem" "/home/dsg/private/certs/dsg@mywork.org-20081217-20100610.pem") ("dsg@mywork.org-20070626-20081217.pem" "/home/dsg/private/certs/dsg@mywork.org-20070626-20081217.pem") ("dsg@mywork.org-20060704-20070626" "/home/dsg/private/certs/dsg@mywork.org-20060704-20070626.pem") ("dsg@mywork.org-20050123-20060704" "/home/dsg/private/certs/dsg@mywork.org-20050123-20060704.pem") ("dsg@mywork.org-20030802-20050123" "/home/dsg/private/certs/dsg@mywork.org-20030802-20050123.pem") ("dsg@mywork.org-20020208-20030802" "/home/dsg/private/certs/dsg@mywork.org-20020208-20030802.pem") ("dsg@mywork.org-20000817-20020208" "/home/dsg/private/certs/dsg@mywork.org-20000817-20020208.pem") ("dsg@mywork.org-19990224-20000817" "/home/dsg/private/certs/dsg@mywork.org-19990224-20000817.pem")) nil nil "dsg@mywork.org-20100610-20111202.pem")
  mml-smime-openssl-sign-query()
  mml-smime-sign-query()
  mml-secure-message("smime" signencrypt)
  mml-secure-message-encrypt-smime(nil)
  call-interactively(mml-secure-message-encrypt-smime)

-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 18:28                   ` Dave Goldberg
@ 2010-10-04 20:18                     ` Julien Danjou
  2010-10-04 21:55                       ` Dave Goldberg
  0 siblings, 1 reply; 18+ messages in thread
From: Julien Danjou @ 2010-10-04 20:18 UTC (permalink / raw)
  To: Dave Goldberg; +Cc: Lawrence Mitchell, ding

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

On Mon, Oct 04 2010, Dave Goldberg wrote:

> It seems to be working for everything except smime-keys now.  If I try to encrypt a message I get this backtrace.

Thanks, it helped. I pushed a fix.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 20:18                     ` Julien Danjou
@ 2010-10-04 21:55                       ` Dave Goldberg
  0 siblings, 0 replies; 18+ messages in thread
From: Dave Goldberg @ 2010-10-04 21:55 UTC (permalink / raw)
  To: ding


> Thanks, it helped. I pushed a fix.

Confirmed.  Thanks,
-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-04 17:47                 ` Julien Danjou
  2010-10-04 18:28                   ` Dave Goldberg
@ 2010-10-08 12:14                   ` Andrew Cohen
  2010-10-08 14:35                     ` Julien Danjou
  1 sibling, 1 reply; 18+ messages in thread
From: Andrew Cohen @ 2010-10-08 12:14 UTC (permalink / raw)
  To: ding

>>>>> "Julien" == Julien Danjou <julien@danjou.info> writes:

    Julien> On Mon, Oct 04 2010, Lawrence Mitchell wrote:
    >> That is almost certainly the wrong fix, since it now breaks if
    >> collection is a hash-table or a function.

    Julien> Collection is always a list.

In nnir.el collection is an alist. This fix for old Xemacsen breaks nnir
search querying.

I guess we could do one of

1. revert nnir.el to use completing-read.
2. add a test in gnus-emacs-completing-read to see if collection is an
alist.

Regards,
Andy





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

* Re: gnus-completing-read vs XEmacs 21.4
  2010-10-08 12:14                   ` Andrew Cohen
@ 2010-10-08 14:35                     ` Julien Danjou
  0 siblings, 0 replies; 18+ messages in thread
From: Julien Danjou @ 2010-10-08 14:35 UTC (permalink / raw)
  To: Andrew Cohen; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

On Fri, Oct 08 2010, Andrew Cohen wrote:

> 1. revert nnir.el to use completing-read.
> 2. add a test in gnus-emacs-completing-read to see if collection is an
> alist.

3. Convert the alist to a list in nnir.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2010-10-08 14:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-04 14:20 gnus-completing-read vs XEmacs 21.4 Dave Goldberg
2010-10-04 14:32 ` Julien Danjou
2010-10-04 15:20   ` Dave Goldberg
2010-10-04 15:29     ` Julien Danjou
2010-10-04 15:38       ` Dave Goldberg
2010-10-04 16:04         ` Dave Goldberg
2010-10-04 16:08           ` Julien Danjou
2010-10-04 16:25           ` Lawrence Mitchell
2010-10-04 16:31             ` Dave Goldberg
2010-10-04 16:35               ` Lawrence Mitchell
2010-10-04 16:37             ` Julien Danjou
2010-10-04 16:54               ` Lawrence Mitchell
2010-10-04 17:47                 ` Julien Danjou
2010-10-04 18:28                   ` Dave Goldberg
2010-10-04 20:18                     ` Julien Danjou
2010-10-04 21:55                       ` Dave Goldberg
2010-10-08 12:14                   ` Andrew Cohen
2010-10-08 14:35                     ` Julien Danjou

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 NNTP newsgroup(s).