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

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

Re: how to do it a command automatically


From: collger
Subject: Re: how to do it a command automatically
Date: 5 Feb 2007 07:52:27 -0800
User-agent: G2/1.0

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.



reply via email to

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