all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: Re: playing sounds from Emacs
Date: Mon, 14 Aug 2017 23:49:50 +0200	[thread overview]
Message-ID: <86shgtrf9d.fsf@zoho.com> (raw)
In-Reply-To: 86bmnjt34h.fsf@zoho.com

> (shell-command "omx-play-sound ~/bo/up.mp3")

To use `shell-command' like that means
everything halts until the command has been
executed, which we can't have, but simply
putting an "&" after - to make it
"asynchronous" which is a nice way of saying
the command will be executed in yet another
shell, a subshell - that won't work. I get ugly
output in buffer "*Async Shell Command*".
and an error message:

    exited abnormally with code 1.

Perhaps some shell color codes are, well,
"async"! (So yes, in principle it should work.)

Anyway without digging into that, I have
another function that will do the job if an
ampersand (&) is appended the command. Here it
is:

    (defun shell-command-silent (command)
      "Execute a shell COMMAND.
    Use & after the command to execute it in the background,
    without output to the echo area."
      (process-file shell-file-name
                    nil ; INFILE
                    nil ; BUFFER
                    nil ; DISPLAY
                    shell-command-switch command) )

-- 
underground experts united
http://user.it.uu.se/~embe8573




  reply	other threads:[~2017-08-14 21:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14  0:16 playing sounds from Emacs Emanuel Berg
2017-08-14 21:49 ` Emanuel Berg [this message]
2017-08-15 10:29   ` Marcin Borkowski

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=86shgtrf9d.fsf@zoho.com \
    --to=moasen@zoho.com \
    --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.