From: "collger" <collger@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: how to do it a command automatically
Date: 5 Feb 2007 07:52:27 -0800 [thread overview]
Message-ID: <1170690746.976534.307620@s48g2000cws.googlegroups.com> (raw)
In-Reply-To: <mailman.4005.1170618753.2155.help-gnu-emacs@gnu.org>
On Feb 5, 3:52 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> 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
>
> --
> Kevin Rodgers
> Denver, Colorado, USA
I'm green on emacs too. Thanks, it works.
next prev parent reply other threads:[~2007-02-05 15:52 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 [this message]
2007-02-08 19:41 ` kamo
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=1170690746.976534.307620@s48g2000cws.googlegroups.com \
--to=collger@gmail.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.
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).