From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabian Braennstroem Newsgroups: gmane.emacs.help Subject: Re: hippie-expand show possible expansions for files Date: Wed, 07 Nov 2007 21:19:34 +0000 Organization: FernUni Hagen Message-ID: References: <8A921A5AACA1A64F936C730FC1F8172101185F92@zw67246c.societe.mma.fr> Reply-To: f.braennstroem@gmx.de NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit X-Trace: ger.gmane.org 1194468079 23221 80.91.229.12 (7 Nov 2007 20:41:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Nov 2007 20:41:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 07 21:41:22 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IprhZ-0004Il-RW for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Nov 2007 21:40:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IprhO-0004IF-J4 for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Nov 2007 15:40:30 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news-koe1.dfn.de!tamarack.fernuni-hagen.de!news.fernuni-hagen.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: pd9e485e4.dip0.t-ipconnect.de Original-X-Trace: tamarack.fernuni-hagen.de 1194466605 18089 217.228.133.228 (7 Nov 2007 20:16:45 GMT) Original-X-Complaints-To: newsadmin@fernuni-hagen.de Original-NNTP-Posting-Date: Wed, 7 Nov 2007 20:16:45 +0000 (UTC) User-Agent: KNode/0.8.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:153607 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49073 Archived-At: Hi to all, Peter Dyballa wrote: > > Am 07.11.2007 um 16:27 schrieb Bourgneuf Francois: > >> I work under Windows and neither hippie-expand nor comint-dynamic- >> complete could expand anything after c:\program Files > > I am not working under Losedows and I am not writing a path with ``\ > ´´ (except I want to "escape" SPC or such in the path name) – and the > latter makes an important difference! When you start with ``c:/program > ´´ comint-dynamic-complete will work and probably expand to ``C:/ > Program\ Files/´´ ... > > The reason is that backslash is used as a metacharacter that cannot > stand for itself but gives other characters a particular meaning. So, > when you write ``\p´´ it's not a sequence of ``\´´ and ``p´´ but a > ``backslashed p´´, some new entity. It has nothing to do with the windows problem, I am on Linux too :-), but I just found a different idea to combine the mentioned 'hippie-expand' and 'comint...' (sorry Thierry, I still did not get your setup). I use these lines,which I found in the net, to complete the words using the 'tab' key: (defun indent-or-expand (arg) "Either indent according to mode, or expand the word preceding point." (interactive "*P") (if (and (or (bobp) (= ?w (char-syntax (char-before)))) (or (eobp) (not (= ?w (char-syntax (char-after)))))) ; (dabbrev-expand arg) (hippie-expand arg) (indent-according-to-mode))) (defun my-tab-fix () (local-set-key [tab] 'indent-or-expand)) (add-hook 'python-mode-hook 'my-tab-fix) The completion just works, if the cursor is behind the word. Now, a good combination would be to insert a second if-statement, which looks, if the word to complete starts with "/" or "../"; then use 'comint...' otherwise use 'hippie...'. My problem now is to check for the starting "/" or "../". Does anyone have an idea, how to do it? Fabian