From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: comint-filename-completion and :exclusive completion bugs Date: Wed, 14 Mar 2012 22:51:06 +0100 Organization: EUR Message-ID: <87pqce97hx.fsf@gmail.com> References: <87ehsvh0fv.fsf@gmail.com> <87obrzb5dh.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1331783378 13339 80.91.229.3 (15 Mar 2012 03:49:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 03:49:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 15 04:49:37 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S81h2-0005WM-GV for ged-emacs-devel@m.gmane.org; Thu, 15 Mar 2012 04:49:36 +0100 Original-Received: from localhost ([::1]:50788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S81h1-0004Li-I7 for ged-emacs-devel@m.gmane.org; Wed, 14 Mar 2012 23:49:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7w6E-0005CN-GY for emacs-devel@gnu.org; Wed, 14 Mar 2012 17:51:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7w6C-0007n8-Mx for emacs-devel@gnu.org; Wed, 14 Mar 2012 17:51:14 -0400 Original-Received: from mail-ee0-f41.google.com ([74.125.83.41]:62226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7w6C-0007md-ES for emacs-devel@gnu.org; Wed, 14 Mar 2012 17:51:12 -0400 Original-Received: by eeke53 with SMTP id e53so1489334eek.0 for ; Wed, 14 Mar 2012 14:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=8hUNfnpXUBZu/fp5m8nQyQfiwNimPf83WkMjBrglsYs=; b=D25O/hm65fTEF/r4MVAvLcNMLxicSJLx1l6dU8zNfs9wqmyEvzEK6T5OcGme8lPenO qXW/2yRJHJqRUbRlPzTPk3qTDv7XP330uOUkAshSI9Lm3I7BZqavN12kwdTSRSJYQ9Zi H2OgrjhL4QAUJR77DV5ODOvtZEnDFWpZ4ELrWRvSf6ke7nEmX8DAQ/gIdw71uPTdqG2/ vvJoXHrEINRUe9zgIx5jM3G0dPNQAz4exBilLKi9vH4FikDEUexv5G7Lr94g4GrIp0eF Vkmn4z5NYOHdbFunVFFQd2Gz33JK3X0r60K4TsmIQnyePqgADcsGPbeZ656GgJWbRNeg t+vA== Original-Received: by 10.14.204.70 with SMTP id g46mr614161eeo.117.1331761869568; Wed, 14 Mar 2012 14:51:09 -0700 (PDT) Original-Received: from localhost (ma-177-76.edu.eur.nl. [130.115.177.76]) by mx.google.com with ESMTPS id q45sm9375690eem.7.2012.03.14.14.51.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 14:51:08 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 14 Mar 2012 11:45:59 -0400") User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.94 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.41 X-Mailman-Approved-At: Wed, 14 Mar 2012 23:49:34 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149067 Archived-At: >>>> Stefan Monnier >>>> on Wed, 14 Mar 2012 11:45:59 -0400 wrote: > If you need to modify the return value of comint-filename-completion in > non-trivial ways, I recommend > (pcase (comint-filename-completion) > (`(,beg ,end ,table . ,props) > )) This stuff is amazing. But it took me a while to figure out the docs. Would be nice to have an info with a small example for each type of pattern in the docs. Thanks a bunch for the package! >> Comint-filename-completion returns a list of length 2 or 3 depending on >> filesuffix. > Hmm... AFAICT, it's either 0, 3, or 5. >> So to tweak it, I have to check for the length, if 2, append, if >> 3 insert :exclusive into the last list. Ugly as far as I am concerned. > If you only want to add :exclusive, (append '(:exclusive no)) > should work (except for the case where is nil). Oh, yes you are right. I was confused with the help of completion-at-point-functions. PROPS is a tail not a list by itself:) Thanks, that definitely solves the problem, no need for another version of completion function. Vitalie.