From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: gnus should accept UTF8 even if UTF-8 is standard Date: Fri, 31 Oct 2008 17:29:32 -0400 Message-ID: References: <87iqruvs19.fsf@jidanni.org> <86od1mj3z2.fsf@lifelogs.com> <86od1lg3xq.fsf@lifelogs.com> <87d4i1iqpq.fsf@marauder.physik.uni-ulm.de> <86k5c9fzm9.fsf@lifelogs.com> <878wsph5xr.fsf@marauder.physik.uni-ulm.de> <87wsg345oo.fsf@marauder.physik.uni-ulm.de> <86wsg2546l.fsf@lifelogs.com> <86abct3o4s.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1225488608 29038 80.91.229.12 (31 Oct 2008 21:30:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2008 21:30:08 +0000 (UTC) Cc: tzz@lifelogs.com, ding@gnus.org, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 31 22:31:10 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kw1aE-00063R-Aa for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2008 22:31:06 +0100 Original-Received: from localhost ([127.0.0.1]:57848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kw1Z7-0002pn-Fx for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2008 17:29:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kw1Yt-0002lQ-P5 for emacs-devel@gnu.org; Fri, 31 Oct 2008 17:29:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kw1Ys-0002kp-AE for emacs-devel@gnu.org; Fri, 31 Oct 2008 17:29:43 -0400 Original-Received: from [199.232.76.173] (port=37824 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kw1Ys-0002km-5D for emacs-devel@gnu.org; Fri, 31 Oct 2008 17:29:42 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51799) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kw1Yr-0000PC-Ez; Fri, 31 Oct 2008 17:29:41 -0400 Original-Received: from ceviche.home (vpn-132-204-232-25.acd.umontreal.ca [132.204.232.25]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id m9VLUAJX024682; Fri, 31 Oct 2008 17:30:10 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 661B5B4087; Fri, 31 Oct 2008 17:29:32 -0400 (EDT) In-Reply-To: (Richard M. Stallman's message of "Sun, 26 Oct 2008 00:10:29 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3138=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105229 gmane.emacs.gnus.general:67729 Archived-At: >> For instance, completing-read could accept a list of alternatives >> that are valid if entered, but should not affect completion. > It's just easier to do a "loose match" than to hardcode a list > of alternatives. > If it works, it's fine. The following patch (to be applied by hand, or to be read) is a proof of concept. It allows the user to do "C-x RET f u8 TAB" and have it complete to utf-8. Stefan === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2008-07-24 03:10:36 +0000 +++ lisp/international/mule.el 2008-10-31 21:08:00 +0000 @@ -1192,6 +1192,10 @@ (widen) (goto-char (point-min)) (set-auto-coding buffer-file-name (buffer-size)))))) + (completion-ignore-case t) + (completion-pcm--delim-wild-regex + (concat completion-pcm--delim-wild-regex + "\\|\\([[:alpha:]]\\)[[:digit:]]")) (cs (completing-read (format "Coding system for saving file (default %s): " auto-cs) (completion-table-in-turn bcss-table combined-table) === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2008-10-30 00:44:07 +0000 +++ lisp/minibuffer.el 2008-10-31 21:11:08 +0000 @@ -1512,6 +1512,13 @@ (p0 p)) (while (setq p (string-match completion-pcm--delim-wild-regex string p)) + ;; Usually, completion-pcm--delim-wild-regex matches a delimiter, + ;; meaning that something can be added *before* it, but it can also + ;; match a prefix and postfix, in which case something can be added + ;; in-between (e.g. match [[:lower:]][[:upper:]]). + ;; This is determined by the presence of a submatch-1 which delimits + ;; the prefix. + (if (match-end 1) (setq p (match-end 1))) (push (substring string p0 p) pattern) (if (eq (aref string p) ?*) (progn