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: Kevin Rodgers
Subject: Re: how to do it a command automatically
Date: Sun, 04 Feb 2007 12:52:03 -0700
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

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 via email to

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