all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to do it a command automatically
@ 2007-02-03 13:57 kamo
  2007-02-03 15:28 ` collger
  0 siblings, 1 reply; 5+ messages in thread
From: kamo @ 2007-02-03 13:57 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Everyday I print the equivalent date in other calendar and particularly 
the current date in chinese calendar using emacs

I do in my bash shell
$emacs
then
M-x calendar
and
M-x calendar-print-chinese-date

I would to put this in my .bashr_profile
so I tried like putting in my .emacs ,  calendar-print-chinese-date


My aim is to automate this 3 commands I tape everyday. One logged in my 
account, I could print the date in gregorian calendar and chinese calendar

thank for your help


Kamo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to do it a command automatically
  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>
  0 siblings, 2 replies; 5+ messages in thread
From: collger @ 2007-02-03 15:28 UTC (permalink / raw)
  To: help-gnu-emacs

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
  )

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to do it a command automatically
  2007-02-03 15:28 ` collger
@ 2007-02-04 19:52   ` Kevin Rodgers
       [not found]   ` <mailman.4005.1170618753.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2007-02-04 19:52 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to do it a command automatically
       [not found]   ` <mailman.4005.1170618753.2155.help-gnu-emacs@gnu.org>
@ 2007-02-05 15:52     ` collger
  2007-02-08 19:41     ` kamo
  1 sibling, 0 replies; 5+ messages in thread
From: collger @ 2007-02-05 15:52 UTC (permalink / raw)
  To: help-gnu-emacs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to do it a command automatically
       [not found]   ` <mailman.4005.1170618753.2155.help-gnu-emacs@gnu.org>
  2007-02-05 15:52     ` collger
@ 2007-02-08 19:41     ` kamo
  1 sibling, 0 replies; 5+ messages in thread
From: kamo @ 2007-02-08 19:41 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-08 19:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2007-02-08 19:41     ` kamo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.