From: kamo <kamo@free.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: how to do it a command automatically
Date: Thu, 08 Feb 2007 20:41:28 +0100 [thread overview]
Message-ID: <45cb7ce7$0$451$426a74cc@news.free.fr> (raw)
In-Reply-To: <mailman.4005.1170618753.2155.help-gnu-emacs@gnu.org>
Kevin Rodgers a écrit :
> collger wrote:
>> define this new command, and then ......
>>
>> (defun print-chinese-date-sh ()
>> "A silly way to print current chinese date.\nYou Can add other
>> outputs after the 'set-buffer call"
>> (interactive) ;become a command
>> (save-excursion)
>> (calendar)
>> (set-buffer (get-buffer "*Calendar*"))
>> (calendar-print-chinese-date)
>> (kill-buffer-and-window) ;close the calendar, remove it if you want
>> )
>
> I think you meant
>
> (save-excursion
> (save-window-excursion
> (calendar)
> ...
> ))
>
> But since OP wants something to run from the shell:
>
> emacs --batch --funcall calendar other-buffer --funcall
> calendar-print-chinese-date
>
>
Hi !
this command doesn't work
#bash $ emacs --batch --funcall calendar other-buffer --funcall
calendar-print-chinese-date
Loading 00debian-vars...
Loading 50autoconf (source)...
Loading 50dictionaries-common (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Computing Chinese date...
Symbol's value as variable is void: displayed-month
but if I strip "other-buffer", it works perfect
Today for instance
#bash $ emacs --batch --funcall calendar --funcall
calendar-print-chinese-date
Loading 00debian-vars...
Loading 50autoconf (source)...
Loading 50dictionaries-common (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Computing Chinese date...
Chinese date: Cycle 78, year 23 (Bing-Xu), month 12 (Xin-Chou), day 21
(Gui-You)
Thank you a lot Kevin!
Kamo
prev parent reply other threads:[~2007-02-08 19:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-03 13:57 how to do it a command automatically kamo
2007-02-03 15:28 ` collger
2007-02-04 19:52 ` Kevin Rodgers
[not found] ` <mailman.4005.1170618753.2155.help-gnu-emacs@gnu.org>
2007-02-05 15:52 ` collger
2007-02-08 19:41 ` kamo [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='45cb7ce7$0$451$426a74cc@news.free.fr' \
--to=kamo@free.fr \
--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.
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).