unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* complete file at point in buffer - solution and questions
@ 2010-05-18 19:37 Dirk80
  2010-05-19  4:48 ` Kevin Rodgers
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Dirk80 @ 2010-05-18 19:37 UTC (permalink / raw)
  To: Help-gnu-emacs


Hello,

in minibuffer it is easy to complete a file at point. Just press tab if you
don't know how to continue. But when I was looking in internet if this
feature is also available for a normal buffer I did not find a solution. So
I decided to write one on my own.

Because I am an emacs lisp newbie I am happy that the implementation is
working.

You need these 2 files:
http://www.dirkundsari.de/emacs/my/my-cfap.el
http://www.dirkundsari.de/emacs/my/my-cfap.el 
http://www.dirkundsari.de/emacs/my/my-utils.el
http://www.dirkundsari.de/emacs/my/my-utils.el 

Bind the function my-cfap-complete to a key (e.g. f3) and then you can use
it in a normal buffer to complete files. 

But now I also have some questions:
1.) Please give me feedback to my code. So I can learn.

2.) File completion in minibuffer shows the completion-buffer with bold
letters at the first difference. How could I integrate that feature in my
code when calling display-completion-list? I've looked a bit into the code
of minibuffer.el. It seems that "defface completions-first-difference" is
what I need. But I do not understand how to use it. The function
display-completion-list has an optional parameter common-substring. But this
is described obsolete.

3.) In unix the file system is case sensitive. In windows OS the file system
is not case sensitive. But my function is always case sensitive. How can I
say that when emacs is running in windows that case does not matter. I think
that I have to say to the C-Source functions "file-name-completion" and
"file-name-all-completions" that they should be not case sensitive when
emacs is running in windows. But I do not know how to do it.

4.) I would like to change the behaviour of the self-insert-command if a
completion window is available. So I tried to use defadvice with
self-insert-command. But it was not working. And I have also read that
defadvice is more a debugging feature and should not be used in productive
code. So what would be an alternative? I'd like to have the following
behaviour for self-insert-command:
If completion-window available then insert character and update
completion-window.

Thank you very much for your help
Dirk
-- 
View this message in context: http://old.nabble.com/complete-file-at-point-in-buffer---solution-and-questions-tp28599706p28599706.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-19 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18 19:37 complete file at point in buffer - solution and questions Dirk80
2010-05-19  4:48 ` Kevin Rodgers
2010-05-19 11:30 ` Dirk80
2010-05-19 12:53   ` Gary .
2010-05-19 11:46 ` Dirk80
     [not found] ` <mailman.2.1274268970.19035.help-gnu-emacs@gnu.org>
2010-05-19 19:07   ` Ilya Zakharevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).