emacs equivalent of vi %%
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
emacs equivalent of vi %%         


Author: Rustom Mody
Date: Aug 12, 2008 23:52

In vi one can do, for example,
:!gcc %%
and the current file gets compiled
-- ingeneral :
:!someCommand options %% otherStuff
and the filename gets interpolated.
Is there any way to get the '%%' behavior in emacs?
[Note: I know about compile; I am asking a more general question about
getting the filename]
2 Comments
Re: emacs equivalent of vi %%         


Author: Xah
Date: Aug 13, 2008 08:14

In dired, you can type “!” to run a command on a file.
On Aug 12, 11:52 pm, "Rustom Mody" gmail.com> wrote:
> In vi one can do, for example,
> :!gcc %%
> and the current file gets compiled -- ingeneral :
> :!someCommand options %% otherStuff
> and the filename gets interpolated.
> Is there any way to get the '%%' behavior in emacs?
> [Note: I know about compile; I am asking a more general question about
> getting the filename]

as far as i know there's no similar mechanism. Here's related things i
know:

This code will run the current file:

(defun run-current-file ()
"Execute or compile the current file.
For example, if the current buffer is the file x.pl,
then it'll call “perl x.pl” in a shell.
The file can be php, perl, python, bash,...
Show full article (2.39Kb)
no comments
Re: emacs equivalent of vi %%         


Author: Scott Frazer
Date: Aug 13, 2008 10:24

Rustom Mody wrote:
> In vi one can do, for example,
> :!gcc %%
> and the current file gets compiled -- ingeneral :
> :!someCommand options %% otherStuff
> and the filename gets interpolated.
> Is there any way to get the '%%' behavior in emacs?
> [Note: I know about compile; I am asking a more general question about
> getting the filename]
>
>

How about this:
Show full article (0.92Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Re: .emacs in the Windows version of Emacsgnu.emacs.help ·