|
From: | John Williams |
Subject: | Re: patches for etags and shell-command |
Date: | Sat, 21 Jan 2006 16:17:46 -0600 |
User-agent: | Thunderbird 1.5 (X11/20051201) |
Richard M. Stallman wrote:
I have two patches today; the first one changes shell-command so that the default interactive argument is the current buffer's filename.Is the idea that you type M-n to bring the current buffer's filename into the minibuffer, and then you type the rest of the command around it? Access to that file name would be useful, but at the same time, this interface would be rather inconvenient to use. This patch corrects a bug in etags that causes completion to only consider the tags in a single TAGS buffer. With the match tag completion will consider tags from all the active TAGS buffers. That seems like a clean extension. I will forward it to the etags maintainer.
It takes a little getting used to, but it's quite natural to use once you get used to M-! M-n meaning "run a shell command on the current file."
Most of the commands you'd use in conjunction with the current file name accept the file name as their last argument, so running a command usually involves this key sequence:
M-! M-n <my-command> SPC RET(If I'd though of it before now I would have added a space at the beginning of the default argument since it's probably needed anyway 99% of the time.)
Not being able to insert the current filename in the minibuffer seemed like a glaring omission when I started using Emacs after years of using Vim, so I would really like to see some way of achieving that functionality became part of Emacs.
Before I came up with the idea to use M-n, I also considered expanding "%" the way Vim does, but I think that's too likely to cause surprises to users unfamiliar with the feature. I also tried adding a special key binding to insert the current file name, but I don't think the added flexibility is worth the cost of having to remember yet another key combination.
--jw
[Prev in Thread] | Current Thread | [Next in Thread] |