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: kamo
Subject: Re: how to do it a command automatically
Date: Thu, 08 Feb 2007 20:41:28 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

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


reply via email to

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