From: Mathias Megyei <mathias@mnet-mail.de>
To: Mathias Dahl <mathias.dahl@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: kill-emacs and returning values
Date: Sat, 14 Feb 2009 22:47:51 +0100 [thread overview]
Message-ID: <1234648071.6514.43.camel@surlej> (raw)
In-Reply-To: <7dbe73ed0902141223w1d2e16d6kc8287caa26c40019@mail.gmail.com>
On Sat, 2009-02-14 at 21:23 +0100, Mathias Dahl wrote:
> > Does it work for your purpose if you change the last line
> > to:
> >
> > (kill-emacs "returnvalue='This is the return value.'")
> >
> >
> > $ emacs -Q -nw -l ke.el
> >
> > returnvalue='This is the return value.'
> >
> > $ echo $returnvalue
>
> I tried that already and it would have - if it worked :( Could this
> depend on which shell you use? I am using bash.
>
Yes, it depends on the shell in question.
The above is for Bash.
It works when Emacs is invoked "by hand" but not if it was
started in a shell script. It seems the command
returnvalue='This is the return value.'
is executed after the script has finished (as the next
"keyboard input").
Within the script you can read in the "next keyboard input"
into a variable.
The following script seems to do what you want:
#!/bin/bash
/opt/emacs/23.0.60/bin/emacs -Q -nw -l ke.el
read myval
echo "myval is set to: '$myval'"
Mathias
next prev parent reply other threads:[~2009-02-14 21:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-14 13:51 kill-emacs and returning values Mathias Dahl
2009-02-14 17:17 ` Mathias Megyei
2009-02-14 20:23 ` Mathias Dahl
2009-02-14 21:47 ` Mathias Megyei [this message]
2009-02-14 22:01 ` Mathias Dahl
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=1234648071.6514.43.camel@surlej \
--to=mathias@mnet-mail.de \
--cc=emacs-devel@gnu.org \
--cc=mathias.dahl@gmail.com \
/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.