unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: how to do it a command automatically
Date: Sun, 04 Feb 2007 12:52:03 -0700	[thread overview]
Message-ID: <eq5dh4$eqf$1@sea.gmane.org> (raw)
In-Reply-To: <1170516489.691490.18460@p10g2000cwp.googlegroups.com>

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

  reply	other threads:[~2007-02-04 19: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 [this message]
     [not found]   ` <mailman.4005.1170618753.2155.help-gnu-emacs@gnu.org>
2007-02-05 15:52     ` collger
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='eq5dh4$eqf$1@sea.gmane.org' \
    --to=kevin.d.rodgers@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).