all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Fabian Braennstroem <f.braennstroem@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: hippie-expand show possible expansions for files
Date: Wed, 07 Nov 2007 21:19:34 +0000	[thread overview]
Message-ID: <fgt6fd$hl9$1@tamarack.fernuni-hagen.de> (raw)
In-Reply-To: mailman.3095.1194453900.18990.help-gnu-emacs@gnu.org

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

  parent reply	other threads:[~2007-11-07 21:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 15:27 hippie-expand show possible expansions for files Bourgneuf Francois
2007-11-07 16:03 ` Thierry Volpiatto
2007-11-07 16:44 ` Peter Dyballa
2007-11-07 18:30   ` Thierry Volpiatto
     [not found] ` <mailman.3095.1194453900.18990.help-gnu-emacs@gnu.org>
2007-11-07 21:19   ` Fabian Braennstroem [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-11-06 19:52 Fabian Braennstroem
2007-11-06 20:02 ` Thierry Volpiatto
     [not found] ` <mailman.3056.1194379207.18990.help-gnu-emacs@gnu.org>
2007-11-06 21:14   ` Fabian Braennstroem
2007-11-06 22:51     ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='fgt6fd$hl9$1@tamarack.fernuni-hagen.de' \
    --to=f.braennstroem@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.