From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/72507 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-completing-read vs XEmacs 21.4 Date: Mon, 04 Oct 2010 17:25:09 +0100 Message-ID: References: <84bp7aujik.fsf@davestoy.home> <8462xiugqp.fsf@davestoy.home> <84zkuut1bj.fsf@davestoy.home> <84iq1ikkpp.fsf@davestoy.home> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1286209591 3214 80.91.229.12 (4 Oct 2010 16:26:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Oct 2010 16:26:31 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M20879@lists.math.uh.edu Mon Oct 04 18:26:26 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P2nrt-0005jQ-Mc for ding-account@gmane.org; Mon, 04 Oct 2010 18:26:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1P2nrj-0006sJ-Gs; Mon, 04 Oct 2010 11:26:15 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1P2nri-0006rz-11 for ding@lists.math.uh.edu; Mon, 04 Oct 2010 11:26:14 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P2nrf-0003Bn-5s for ding@lists.math.uh.edu; Mon, 04 Oct 2010 11:26:13 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P2nre-0006pa-00 for ; Mon, 04 Oct 2010 18:26:10 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P2nre-0005cw-0U for ding@gnus.org; Mon, 04 Oct 2010 18:26:10 +0200 Original-Received: from garnet.epcc.ed.ac.uk ([129.215.56.222]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Oct 2010 18:26:10 +0200 Original-Received: from wence by garnet.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Oct 2010 18:26:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 66 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: garnet.epcc.ed.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (usg-unix-v) Cancel-Lock: sha1:8RThDy+zoUdKW8NVjZpswoG3QLk= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:72507 Archived-At: 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