help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programatically suppress "Async Shell command" buffer


From: Leo Alekseyev
Subject: Re: Programatically suppress "Async Shell command" buffer
Date: Fri, 10 Jul 2009 07:01:55 -0400

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]