unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Name of the active buffer
@ 2007-06-07 18:42 hfleming
  2007-06-13  6:22 ` Kevin Rodgers
  0 siblings, 1 reply; 4+ messages in thread
From: hfleming @ 2007-06-07 18:42 UTC (permalink / raw)
  To: Help-gnu-emacs


Suppose I want to run, from emacs, the program "prog" with the active buffer,
"buffer", say, as argument.
Of course I can do "Meta-! prog buffer". Some editors, however, have a
default name for the active buffer. In vi, for instance, one can do ":! prog
%" . In ultraedit, the buffer is called "%f". How can we do that in emacs?

Thanks!

hfleming

"Doubt, one of the forms of intelligence..."
(J.L. Borges)
-- 
View this message in context: http://www.nabble.com/Name-of-the-active-buffer-tf3885636.html#a11013905
Sent from the Emacs - Help mailing list archive at Nabble.com.

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

* Re: Name of the active buffer
       [not found] <mailman.1772.1181299449.32220.help-gnu-emacs@gnu.org>
@ 2007-06-08 11:09 ` Robert D. Crawford
  2007-06-08 11:33 ` Daniel Jensen
  1 sibling, 0 replies; 4+ messages in thread
From: Robert D. Crawford @ 2007-06-08 11:09 UTC (permalink / raw)
  To: help-gnu-emacs

hfleming <hfleming38@gmail.com> writes:

> Suppose I want to run, from emacs, the program "prog" with the active buffer,
> "buffer", say, as argument.
> Of course I can do "Meta-! prog buffer". Some editors, however, have a
> default name for the active buffer. In vi, for instance, one can do ":! prog
> %" . In ultraedit, the buffer is called "%f". How can we do that in emacs?

Maybe this is what you are looking for:

buffer-name is a built-in function in `C source code'.
(buffer-name &optional BUFFER)

Return the name of BUFFER, as a string.
With no argument or nil as argument, return the name of the current buffer.

rdc
-- 
Robert D. Crawford                                      rdc1x@comcast.net

I never met a piece of chocolate I didn't like.

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

* Re: Name of the active buffer
       [not found] <mailman.1772.1181299449.32220.help-gnu-emacs@gnu.org>
  2007-06-08 11:09 ` Name of the active buffer Robert D. Crawford
@ 2007-06-08 11:33 ` Daniel Jensen
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jensen @ 2007-06-08 11:33 UTC (permalink / raw)
  To: help-gnu-emacs

hfleming <hfleming38@gmail.com> writes:

> Suppose I want to run, from emacs, the program "prog" with the active buffer,
> "buffer", say, as argument.
> Of course I can do "Meta-! prog buffer". Some editors, however, have a
> default name for the active buffer. In vi, for instance, one can do ":! prog
> %" . In ultraedit, the buffer is called "%f". How can we do that in emacs?

I assume you want to pass the buffer /file/ name as an argument to the
program, not the name.

Normally this is what you want for the compile command. It's a good idea
to use that even if the program is not strictly a compiler.

There is no built-in feature for taking the file name and using it with
M-x compile. One way to do it is to have a local variable in the file:

    compile-command: program and arguments...

See <http://www.emacswiki.org/cgi-bin/wiki/CompileCommand> for possible
other ways.

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

* Re: Name of the active buffer
  2007-06-07 18:42 hfleming
@ 2007-06-13  6:22 ` Kevin Rodgers
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2007-06-13  6:22 UTC (permalink / raw)
  To: help-gnu-emacs

hfleming wrote:
> Suppose I want to run, from emacs, the program "prog" with the active buffer,
> "buffer", say, as argument.
> Of course I can do "Meta-! prog buffer". Some editors, however, have a
> default name for the active buffer. In vi, for instance, one can do ":! prog
> %" . In ultraedit, the buffer is called "%f". How can we do that in emacs?

If it is a "normal" command that reads from standard input when no file 
name argument is given: C-x h M-| prog RET


-- 
Kevin Rodgers
Denver, Colorado, USA

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

end of thread, other threads:[~2007-06-13  6:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1772.1181299449.32220.help-gnu-emacs@gnu.org>
2007-06-08 11:09 ` Name of the active buffer Robert D. Crawford
2007-06-08 11:33 ` Daniel Jensen
2007-06-07 18:42 hfleming
2007-06-13  6:22 ` Kevin Rodgers

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).