From: Leo Alekseyev <dnquark@gmail.com>
To: Peter Dyballa <Peter_Dyballa@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Programatically suppress "Async Shell command" buffer
Date: Fri, 10 Jul 2009 07:01:55 -0400 [thread overview]
Message-ID: <14cd9a5d0907100401n7e388abcq34e72dc4be6666a3@mail.gmail.com> (raw)
In-Reply-To: <DF207F24-B1C8-44ED-AC31-F1F01CDFFFE4@Web.DE>
I already solved the problem by simply turning off the read-only
property of the dired buffer. I am interested to see if there is a
better fix though:
(defun terminal-here ()
"Launch external terminal in the current buffer's directory or current dired
directory. (Works by grabbing the directory name and passing as an argument to
a batch file. Note the (toggle-read-only) workaround; the command will not run
in dired mode without it."
(interactive)
(let ((dir "") (diredp nil))
(cond
((and (local-variable-p 'dired-directory) dired-directory)
(setq dir dired-directory)
(setq diredp t)
(toggle-read-only)
)
((stringp (buffer-file-name))
(setq dir (file-name-directory (buffer-file-name))))
)
(shell-command (concat "~/bin/mrxvt_win.bat \""dir"\" 2>/dev/null &")
(universal-argument))
(if diredp (toggle-read-only))
))
On Fri, Jul 10, 2009 at 6:48 AM, Peter Dyballa<Peter_Dyballa@web.de> wrote:
>
> Am 10.07.2009 um 05:30 schrieb dnquark:
>
>> To add: I can redirect the command output to /dev/dull, but the
>> problem is that I cannot run the command in a dired buffer since it is
>> read-only. Is there a way to specify that the command produces no
>> output so that it could be possible to run in a read-only buffer,e.g.
>> dired?
>
>
> I don't understand what you are trying to express. Can you give a detailed
> example? With actual shell commands? A picture (ASCII) of the dired buffer
> before and afterwards? And another example when you launched GNU Emacs with
> -Q and applied the same example?
>
> --
> Greetings
>
> Pete
>
> You can learn many things from children. How much patience you have, for
> instance.
> – Franklin P. Jones
>
>
next prev parent reply other threads:[~2009-07-10 11:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 13:43 Programatically suppress "Async Shell command" buffer gearheart
2009-07-07 9:32 ` Peter Dyballa
2009-07-07 18:00 ` gearheart
[not found] ` <mailman.2021.1247001256.2239.help-gnu-emacs@gnu.org>
2009-07-10 2:17 ` dnquark
2009-07-10 3:30 ` dnquark
2009-07-10 10:48 ` Peter Dyballa
2009-07-10 11:01 ` Leo Alekseyev [this message]
2009-07-10 10:43 ` Peter Dyballa
2009-07-10 11:02 ` Johan Bockgård
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=14cd9a5d0907100401n7e388abcq34e72dc4be6666a3@mail.gmail.com \
--to=dnquark@gmail.com \
--cc=Peter_Dyballa@web.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.