From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: export to ics a specific buffer every X hours Date: Sun, 26 Jun 2016 18:38:57 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113e6600bd304f05363033e3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHC9G-0006jq-Ne for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 11:39:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHC9E-0005km-Jm for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 11:39:01 -0400 Received: from mail-yw0-x22b.google.com ([2607:f8b0:4002:c05::22b]:33755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHC9E-0005ki-EV for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 11:39:00 -0400 Received: by mail-yw0-x22b.google.com with SMTP id v77so137531682ywg.0 for ; Sun, 26 Jun 2016 08:38:59 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: org mode --001a113e6600bd304f05363033e3 Content-Type: text/plain; charset=UTF-8 Hi all so i have pathetic coding skill but managed somehow to come up with this (defun z/save-meeting-to-ics () "If the current file is in '~/.dotfiles', the code blocks are tangled" (when (equal (buffer-file-name) (expand-file-name "/home/zeltak/org/files/agenda/ meetings.org")) (org-icalendar-export-to-ics) (message "exported to ics"))) this does save the org file "meetings.org" to an ICS file in the same folder as the file. but i want to do 2 additional things: 1)save the resulting ICS file to a different directory 2)run this function every X hours (lets say every 2 hours) any clue guys? thx! Z --001a113e6600bd304f05363033e3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all

so i have pathetic coding skill = but managed somehow to come up with this

=C2= =A0(defun z/save-meeting-to-ics ()
=C2=A0 =C2=A0 "If the cur= rent file is in '~/.dotfiles', the code blocks are tangled"
=C2=A0 =C2=A0 (when (equal (buffer-file-name)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(expand-file-name "= ;/home/zeltak/org/files/agenda/meetings.org= "))
=C2=A0 =C2=A0 =C2=A0 (org-icalendar-export-to-ics)
=C2=A0 =C2=A0 =C2=A0 (message "exported to ics")))
=

this does save the org file "meetings.org" to an ICS file in the same folder a= s the file. but i want to do 2 additional things:
1)save the resu= lting ICS file to a different directory
2)run this function every= X hours (lets say every 2 hours)

any clue guys?

thx!

Z
--001a113e6600bd304f05363033e3-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: export to ics a specific buffer every X hours Date: Sun, 26 Jun 2016 13:10:18 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHDZe-0002Oc-Ct for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 13:10:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHDZc-0004if-5v for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 13:10:21 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:33843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHDZc-0004iZ-1f for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 13:10:20 -0400 Received: by mail-qt0-x242.google.com with SMTP id m2so2119554qtd.1 for ; Sun, 26 Jun 2016 10:10:19 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Xebar Saram Cc: org mode Hi, I don't know if this would help, but I export an Org buffer every time it is saved. On OS X, I have a LaunchAgent that watches the file: Label com.kenmankoff.org2ical ProgramArguments /Users/mankoff/bin/org2ical.sh WatchPaths /Users/mankoff/Documents/Org/events.org And then the shell script that is executed: /Applications/Emacs.app/Contents/MacOS/Emacs --batch --directory=~/Documents/Org --visit=~/Documents/Org/events.org --eval '(progn (setq org-agenda-default-appointment-duration 1) (org-icalendar-export-to-ics))' -k. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: export to ics a specific buffer every X hours Date: Wed, 13 Jul 2016 11:41:53 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114d6bec7f85eb0537805bb8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNFjx-0000Hv-40 for emacs-orgmode@gnu.org; Wed, 13 Jul 2016 04:41:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNFju-00073A-RW for emacs-orgmode@gnu.org; Wed, 13 Jul 2016 04:41:56 -0400 Received: from mail-yw0-x229.google.com ([2607:f8b0:4002:c05::229]:33095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNFju-000735-M2 for emacs-orgmode@gnu.org; Wed, 13 Jul 2016 04:41:54 -0400 Received: by mail-yw0-x229.google.com with SMTP id j17so37378306ywg.0 for ; Wed, 13 Jul 2016 01:41:54 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Philip Hudson , org mode --001a114d6bec7f85eb0537805bb8 Content-Type: text/plain; charset=UTF-8 Thx i do have this now (defun z/save-meeting-to-ics () "If the current file is in '~/.dotfiles', the code blocks are tangled" (when (equal (buffer-file-name) (expand-file-name "/home/zeltak/org/files/agenda/ meetings.org")) (rename-file (org-icalendar-export-to-ics) "/home/zeltak/org/files/export/kcal.ics") (message "exported to ics"))) ;;run every 30 minutes (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics) ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it every 600 second ;; (add-hook 'after-save-hook #'z/save-meeting-to-ics) yet i cant get the ics file to be created niether when i save the meeting.org file nor every 600 seconds. what am i missing here? thx Z On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson wrote: > On 26 June 2016 at 16:38, Xebar Saram wrote: > > Hi all > > > > so i have pathetic coding skill but managed somehow to come up with this > > > > (defun z/save-meeting-to-ics () > > "If the current file is in '~/.dotfiles', the code blocks are > tangled" > > (when (equal (buffer-file-name) > > (expand-file-name > > "/home/zeltak/org/files/agenda/meetings.org")) > > (org-icalendar-export-to-ics) > > (message "exported to ics"))) > > > > this does save the org file "meetings.org" to an ICS file in the same > folder > > as the file. but i want to do 2 additional things: > > 1)save the resulting ICS file to a different directory > > 2)run this function every X hours (lets say every 2 hours) > > > > any clue guys? > > > > thx! > > > > Z > > For 1), change: > > (org-icalendar-export-to-ics) > > to something like this: > > (rename-file (org-icalendar-export-to-ics) your-preferred-pathname) > > For 2), evaluate this: > > (info "(elisp) Timers") > > -- > Phil Hudson http://hudson-it.ddns.net > @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 > --001a114d6bec7f85eb0537805bb8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thx

i do have this now

=C2=A0 (defun z/save-meeting-to-ics ()
=C2=A0 =C2= =A0 "If the current file is in '~/.dotfiles', the code blocks = are tangled"
=C2=A0 =C2=A0 (when (equal (buffer-file-name)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(exp= and-file-name "/home/zeltak/org/files/agenda/meetings.org"))
=C2=A0(rename-file (org-icalendar= -export-to-ics) "/home/zeltak/org/files/export/kcal.ics")
=C2=A0 =C2=A0 =C2=A0 (message "exported to ics")))
<= br>
;;run every 30 minutes

(run-with-tim= er 0 (* 30 60) 'z/save-meeting-to-ics)
;;(run-with-idle-timer= 600 t #'org-agenda-redo) ;; to rebuild it every 600 second
;= ; =C2=A0(add-hook 'after-save-hook #'z/save-meeting-to-ics)

yet i cant get the ics file to be created niether w= hen i save the meeting.org file nor ever= y 600 seconds. what am i missing here?

thx

Z

On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson <phil.hud= son@iname.com> wrote:
On 26 June 2016 at 16:38, Xebar Saram &l= t;zeltakc@gmail.com> wrote:
> Hi all
>
> so i have pathetic coding skill but managed somehow to come up with th= is
>
>=C2=A0 (defun z/save-meeting-to-ics ()
>=C2=A0 =C2=A0 =C2=A0"If the current file is in '~/.dotfiles= 9;, the code blocks are tangled"
>=C2=A0 =C2=A0 =C2=A0(when (equal (buffer-file-name)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (expand-= file-name
> "/home/zeltak/org/files/agenda/meetings.org"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(org-icalendar-export-to-ics)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(message "exported to ics")))
>
> this does save the org file "meetings.org" to an ICS file in = the same folder
> as the file. but i want to do 2 additional things:
> 1)save the resulting ICS file to a different directory
> 2)run this function every X hours (lets say every 2 hours)
>
> any clue guys?
>
> thx!
>
> Z

For 1), change:

=C2=A0 =C2=A0 (org-icalendar-export-to-ics)

to something like this:

=C2=A0 =C2=A0 (rename-file (org-icalendar-export-to-ics) your-preferred-pat= hname)

For 2), evaluate this:

=C2=A0 =C2=A0 (info "(elisp) Timers")

--
Phil Hudson=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0http://hudson-it.ddns.net
@UWascalWabbit=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0PGP/GnuPG ID: 0x887DCA63

--001a114d6bec7f85eb0537805bb8-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philip Hudson Subject: Re: export to ics a specific buffer every X hours Date: Wed, 13 Jul 2016 16:27:36 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNM4s-0007uD-2W for emacs-orgmode@gnu.org; Wed, 13 Jul 2016 11:27:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNM4q-0008LP-NJ for emacs-orgmode@gnu.org; Wed, 13 Jul 2016 11:27:57 -0400 Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:34763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNM4q-0008LJ-If for emacs-orgmode@gnu.org; Wed, 13 Jul 2016 11:27:56 -0400 Received: by mail-vk0-x235.google.com with SMTP id o63so70437220vkg.1 for ; Wed, 13 Jul 2016 08:27:56 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Xebar Saram Cc: org mode You have _two_ concerns here. First is what to do when you save "meetings.org", second is what to do every half hour. Your code handles both of them, essentially correctly, but in the wrong place. On 13 July 2016 at 09:41, Xebar Saram wrote: > Thx > > i do have this now > > (defun z/save-meeting-to-ics () > "If the current file is in '~/.dotfiles', the code blocks are tangled" > (when (equal (buffer-file-name) > (expand-file-name "/home/zeltak/org/files/agenda/meetings.org")) This means the code will only execute if the current buffer is "meetings.org" when it executes. That _is_ what you want when you save meetings.org, but it _is not_ what you want when the timer executes. Break out the body of the `when' form into its own function, and call that function from the timer, instead of `z/save-meeting-to-ics'. > (rename-file (org-icalendar-export-to-ics) > "/home/zeltak/org/files/export/kcal.ics") > (message "exported to ics"))) > > ;;run every 30 minutes > > (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics) > ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it every 600 > second > ;; (add-hook 'after-save-hook #'z/save-meeting-to-ics) > > yet i cant get the ics file to be created niether when i save the > meeting.org file For this, you need to add `z/save-meeting-to-ics' to the Emacs global variable `after-save-hook' using function `add-hook'. > nor every 600 seconds. You mean 1800 seconds, I think. > what am i missing here? > > thx > > Z > > On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson > wrote: >> >> On 26 June 2016 at 16:38, Xebar Saram wrote: >> > Hi all >> > >> > so i have pathetic coding skill but managed somehow to come up with this >> > >> > (defun z/save-meeting-to-ics () >> > "If the current file is in '~/.dotfiles', the code blocks are >> > tangled" >> > (when (equal (buffer-file-name) >> > (expand-file-name >> > "/home/zeltak/org/files/agenda/meetings.org")) >> > (org-icalendar-export-to-ics) >> > (message "exported to ics"))) >> > >> > this does save the org file "meetings.org" to an ICS file in the same >> > folder >> > as the file. but i want to do 2 additional things: >> > 1)save the resulting ICS file to a different directory >> > 2)run this function every X hours (lets say every 2 hours) >> > >> > any clue guys? >> > >> > thx! >> > >> > Z >> >> For 1), change: >> >> (org-icalendar-export-to-ics) >> >> to something like this: >> >> (rename-file (org-icalendar-export-to-ics) your-preferred-pathname) >> >> For 2), evaluate this: >> >> (info "(elisp) Timers") >> >> -- >> Phil Hudson http://hudson-it.ddns.net >> @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 > > -- Phil Hudson http://hudson-it.ddns.net @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: export to ics a specific buffer every X hours Date: Thu, 25 Aug 2016 10:32:54 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c097548f72329053ae067e3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcp9m-0001tm-NG for emacs-orgmode@gnu.org; Thu, 25 Aug 2016 03:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcp9j-0002B3-Lh for emacs-orgmode@gnu.org; Thu, 25 Aug 2016 03:32:57 -0400 Received: from mail-yb0-x232.google.com ([2607:f8b0:4002:c09::232]:33000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcp9j-0002Ap-GE for emacs-orgmode@gnu.org; Thu, 25 Aug 2016 03:32:55 -0400 Received: by mail-yb0-x232.google.com with SMTP id a7so12653081ybi.0 for ; Thu, 25 Aug 2016 00:32:55 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Philip Hudson Cc: org mode --94eb2c097548f72329053ae067e3 Content-Type: text/plain; charset=UTF-8 Hi again all so i have a related question so ill continue in this thread. i have been using this command succesfully in the last few weeks (defun z/export-to-ics () (interactive) (rename-file (org-icalendar-export-to-ics) "/home/zeltak/org/files/export/kcal.ics") (message "exported to ics")) this forces me to first open the file i want (meetings.org) and then launch the above command. is there a way to auto make the above function to auto export meeting.org each time without opening it first? thx Z On Wed, Jul 13, 2016 at 6:27 PM, Philip Hudson wrote: > You have _two_ concerns here. First is what to do when you save > "meetings.org", second is what to do every half hour. Your code > handles both of them, essentially correctly, but in the wrong place. > > On 13 July 2016 at 09:41, Xebar Saram wrote: > > Thx > > > > i do have this now > > > > (defun z/save-meeting-to-ics () > > "If the current file is in '~/.dotfiles', the code blocks are > tangled" > > (when (equal (buffer-file-name) > > (expand-file-name "/home/zeltak/org/files/agenda/ > meetings.org")) > > This means the code will only execute if the current buffer is > "meetings.org" when it executes. That _is_ what you want when you save > meetings.org, but it _is not_ what you want when the timer executes. > > Break out the body of the `when' form into its own function, and call > that function from the timer, instead of `z/save-meeting-to-ics'. > > > (rename-file (org-icalendar-export-to-ics) > > "/home/zeltak/org/files/export/kcal.ics") > > (message "exported to ics"))) > > > > ;;run every 30 minutes > > > > (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics) > > ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it every > 600 > > second > > ;; (add-hook 'after-save-hook #'z/save-meeting-to-ics) > > > > yet i cant get the ics file to be created niether when i save the > > meeting.org file > > For this, you need to add `z/save-meeting-to-ics' to the Emacs global > variable `after-save-hook' using function `add-hook'. > > > nor every 600 seconds. > > You mean 1800 seconds, I think. > > > what am i missing here? > > > > thx > > > > Z > > > > On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson > > wrote: > >> > >> On 26 June 2016 at 16:38, Xebar Saram wrote: > >> > Hi all > >> > > >> > so i have pathetic coding skill but managed somehow to come up with > this > >> > > >> > (defun z/save-meeting-to-ics () > >> > "If the current file is in '~/.dotfiles', the code blocks are > >> > tangled" > >> > (when (equal (buffer-file-name) > >> > (expand-file-name > >> > "/home/zeltak/org/files/agenda/meetings.org")) > >> > (org-icalendar-export-to-ics) > >> > (message "exported to ics"))) > >> > > >> > this does save the org file "meetings.org" to an ICS file in the same > >> > folder > >> > as the file. but i want to do 2 additional things: > >> > 1)save the resulting ICS file to a different directory > >> > 2)run this function every X hours (lets say every 2 hours) > >> > > >> > any clue guys? > >> > > >> > thx! > >> > > >> > Z > >> > >> For 1), change: > >> > >> (org-icalendar-export-to-ics) > >> > >> to something like this: > >> > >> (rename-file (org-icalendar-export-to-ics) your-preferred-pathname) > >> > >> For 2), evaluate this: > >> > >> (info "(elisp) Timers") > >> > >> -- > >> Phil Hudson http://hudson-it.ddns.net > >> @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 > > > > > > > > -- > Phil Hudson http://hudson-it.ddns.net > @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 > --94eb2c097548f72329053ae067e3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi again all

so i have a related questi= on so ill continue in this thread. i have been using this command succesful= ly in the last few weeks

(defun z/export-to-i= cs ()
(interactive)
(rename-file (org-icalendar-export-= to-ics)
"/home/zeltak/org/files/export/kcal.ics")
=
(message "exported to ics"))

=
this forces me to first open the file i want (meetings.org) and then launch the above command. is t= here a way to auto make the above function to auto export meeting.org each time without opening it first?

thx

Z

On Wed, Jul 13, 2016 at 6:27 PM, P= hilip Hudson <phil.hudson@iname.com> wrote:
You have _two_ concerns here. First is what to do whe= n you save
"= meetings.org", second is what to do every half hour. Your code
handles both of them, essentially correctly, but in the wrong place.

On 13 July 2016 at 09:41, Xebar Saram <zeltakc@gmail.com> wrote:
> Thx
>
> i do have this now
>
>=C2=A0 =C2=A0(defun z/save-meeting-to-ics ()
>=C2=A0 =C2=A0 =C2=A0"If the current file is in '~/.dotfiles= 9;, the code blocks are tangled"
>=C2=A0 =C2=A0 =C2=A0(when (equal (buffer-file-name)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (expand-= file-name "/home/zeltak/org/files/agenda/meetings.org"))

This means the code will only execute if the current buffer is
"= meetings.org" when it executes. That _is_ what you want when you s= ave
meetin= gs.org, but it _is not_ what you want when the timer executes.

Break out the body of the `when' form into its own function, and call that function from the timer, instead of `z/save-meeting-to-ics'.

>=C2=A0 (rename-file (org-icalendar-export-to-ics)
> "/home/zeltak/org/files/export/kcal.ics")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(message "exported to ics")))
>
> ;;run every 30 minutes
>
> (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics)
> ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it e= very 600
> second
> ;;=C2=A0 (add-hook 'after-save-hook #'z/save-meeting-to-ics) >
> yet i cant get the ics file to be created niether when i save the
> me= eting.org file

For this, you need to add `z/save-meeting-to-ics' to the Emacs g= lobal
variable `after-save-hook' using function `add-hook'.

> nor every 600 seconds.

You mean 1800 seconds, I think.

> what am i missing here?
>
> thx
>
> Z
>
> On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson <phil.hudson@iname.com>
> wrote:
>>
>> On 26 June 2016 at 16:38, Xebar Saram <zeltakc@gmail.com> wrote:
>> > Hi all
>> >
>> > so i have pathetic coding skill but managed somehow to come u= p with this
>> >
>> >=C2=A0 (defun z/save-meeting-to-ics ()
>> >=C2=A0 =C2=A0 =C2=A0"If the current file is in '~/.do= tfiles', the code blocks are
>> > tangled"
>> >=C2=A0 =C2=A0 =C2=A0(when (equal (buffer-file-name)
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (expand-file-name
>> > "/home/zeltak/org/files/agenda/meetings.org")) >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0(org-icalendar-export-to-ics)
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0(message "exported to ics"= ;)))
>> >
>> > this does save the org file "meetings.org" to an ICS = file in the same
>> > folder
>> > as the file. but i want to do 2 additional things:
>> > 1)save the resulting ICS file to a different directory
>> > 2)run this function every X hours (lets say every 2 hours) >> >
>> > any clue guys?
>> >
>> > thx!
>> >
>> > Z
>>
>> For 1), change:
>>
>>=C2=A0 =C2=A0 =C2=A0(org-icalendar-export-to-ics)
>>
>> to something like this:
>>
>>=C2=A0 =C2=A0 =C2=A0(rename-file (org-icalendar-export-to-ics) your= -preferred-pathname)
>>
>> For 2), evaluate this:
>>
>>=C2=A0 =C2=A0 =C2=A0(info "(elisp) Timers")
>>
>> --
>> Phil Hudson=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0http://hudson-it.ddns.net
>> @UWascalWabbit=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PGP/GnuPG ID: 0x887DCA63
>
>



--
Phil Hudson=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0http://hudson-it.ddns.net
@UWascalWabbit=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0PGP/GnuPG ID: 0x887DCA63

--94eb2c097548f72329053ae067e3-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: export to ics a specific buffer every X hours Date: Tue, 30 Aug 2016 16:39:41 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c064ac0e7498c053b4a1c81 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bejGT-0000fF-Us for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 09:39:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bejGQ-0007zJ-Ui for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 09:39:44 -0400 Received: from mail-yw0-x22f.google.com ([2607:f8b0:4002:c05::22f]:33445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bejGQ-0007z2-Oj for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 09:39:42 -0400 Received: by mail-yw0-x22f.google.com with SMTP id r9so11306490ywg.0 for ; Tue, 30 Aug 2016 06:39:42 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Philip Hudson Cc: org mode --94eb2c064ac0e7498c053b4a1c81 Content-Type: text/plain; charset=UTF-8 anyone? kinda stuck here :) thx! z On Thu, Aug 25, 2016 at 10:32 AM, Xebar Saram wrote: > Hi again all > > so i have a related question so ill continue in this thread. i have been > using this command succesfully in the last few weeks > > (defun z/export-to-ics () > (interactive) > (rename-file (org-icalendar-export-to-ics) > "/home/zeltak/org/files/export/kcal.ics") > (message "exported to ics")) > > > this forces me to first open the file i want (meetings.org) and then > launch the above command. is there a way to auto make the above function to > auto export meeting.org each time without opening it first? > > thx > > Z > > On Wed, Jul 13, 2016 at 6:27 PM, Philip Hudson > wrote: > >> You have _two_ concerns here. First is what to do when you save >> "meetings.org", second is what to do every half hour. Your code >> handles both of them, essentially correctly, but in the wrong place. >> >> On 13 July 2016 at 09:41, Xebar Saram wrote: >> > Thx >> > >> > i do have this now >> > >> > (defun z/save-meeting-to-ics () >> > "If the current file is in '~/.dotfiles', the code blocks are >> tangled" >> > (when (equal (buffer-file-name) >> > (expand-file-name "/home/zeltak/org/files/agenda/ >> meetings.org")) >> >> This means the code will only execute if the current buffer is >> "meetings.org" when it executes. That _is_ what you want when you save >> meetings.org, but it _is not_ what you want when the timer executes. >> >> Break out the body of the `when' form into its own function, and call >> that function from the timer, instead of `z/save-meeting-to-ics'. >> >> > (rename-file (org-icalendar-export-to-ics) >> > "/home/zeltak/org/files/export/kcal.ics") >> > (message "exported to ics"))) >> > >> > ;;run every 30 minutes >> > >> > (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics) >> > ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it every >> 600 >> > second >> > ;; (add-hook 'after-save-hook #'z/save-meeting-to-ics) >> > >> > yet i cant get the ics file to be created niether when i save the >> > meeting.org file >> >> For this, you need to add `z/save-meeting-to-ics' to the Emacs global >> variable `after-save-hook' using function `add-hook'. >> >> > nor every 600 seconds. >> >> You mean 1800 seconds, I think. >> >> > what am i missing here? >> > >> > thx >> > >> > Z >> > >> > On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson >> > wrote: >> >> >> >> On 26 June 2016 at 16:38, Xebar Saram wrote: >> >> > Hi all >> >> > >> >> > so i have pathetic coding skill but managed somehow to come up with >> this >> >> > >> >> > (defun z/save-meeting-to-ics () >> >> > "If the current file is in '~/.dotfiles', the code blocks are >> >> > tangled" >> >> > (when (equal (buffer-file-name) >> >> > (expand-file-name >> >> > "/home/zeltak/org/files/agenda/meetings.org")) >> >> > (org-icalendar-export-to-ics) >> >> > (message "exported to ics"))) >> >> > >> >> > this does save the org file "meetings.org" to an ICS file in the >> same >> >> > folder >> >> > as the file. but i want to do 2 additional things: >> >> > 1)save the resulting ICS file to a different directory >> >> > 2)run this function every X hours (lets say every 2 hours) >> >> > >> >> > any clue guys? >> >> > >> >> > thx! >> >> > >> >> > Z >> >> >> >> For 1), change: >> >> >> >> (org-icalendar-export-to-ics) >> >> >> >> to something like this: >> >> >> >> (rename-file (org-icalendar-export-to-ics) your-preferred-pathname) >> >> >> >> For 2), evaluate this: >> >> >> >> (info "(elisp) Timers") >> >> >> >> -- >> >> Phil Hudson http://hudson-it.ddns.net >> >> @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 >> > >> > >> >> >> >> -- >> Phil Hudson http://hudson-it.ddns.net >> @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 >> > > --94eb2c064ac0e7498c053b4a1c81 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
anyone? kinda stuck here :)

thx!
<= div>

z
<= br>
On Thu, Aug 25, 2016 at 10:32 AM, Xebar Saram= <zeltakc@gmail.com> wrote:
Hi again all

so i have a related ques= tion so ill continue in this thread. i have been using this command succesf= ully in the last few weeks

(defun z/export-to= -ics ()
(interactive)
(rename-file (or= g-icalendar-export-to-ics)
"/home/zeltak/org/files/expo= rt/kcal.ics")
(message "exported to ics"))


this forces me to first open = the file i want (meetings= .org) and then launch the above command. is there a way to auto make th= e above function to auto export meeting.org each time without opening it first?

thx

Z

On= Wed, Jul 13, 2016 at 6:27 PM, Philip Hudson <phil.hudson@iname.com> wrote:
You have _two_ conce= rns here. First is what to do when you save
"
= meetings.org", second is what to do every half hour. Your code
handles both of them, essentially correctly, but in the wrong place.

On 13 July 2016 at 09:41, Xebar Saram <zeltakc@gmail.com> wrote:
> Thx
>
> i do have this now
>
>=C2=A0 =C2=A0(defun z/save-meeting-to-ics ()
>=C2=A0 =C2=A0 =C2=A0"If the current file is in '~/.dotfiles= 9;, the code blocks are tangled"
>=C2=A0 =C2=A0 =C2=A0(when (equal (buffer-file-name)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (expand-= file-name "/home/zeltak/org/files/agenda/meetings.org"))

This means the code will only execute if the current buffer is
"= meetings.org" when it executes. That _is_ what you want when you s= ave
meetin= gs.org, but it _is not_ what you want when the timer executes.

Break out the body of the `when' form into its own function, and call that function from the timer, instead of `z/save-meeting-to-ics'.

>=C2=A0 (rename-file (org-icalendar-export-to-ics)
> "/home/zeltak/org/files/export/kcal.ics")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(message "exported to ics")))
>
> ;;run every 30 minutes
>
> (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics)
> ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it e= very 600
> second
> ;;=C2=A0 (add-hook 'after-save-hook #'z/save-meeting-to-ics) >
> yet i cant get the ics file to be created niether when i save the
> me= eting.org file

For this, you need to add `z/save-meeting-to-ics' to the Emacs g= lobal
variable `after-save-hook' using function `add-hook'.

> nor every 600 seconds.

You mean 1800 seconds, I think.

> what am i missing here?
>
> thx
>
> Z
>
> On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson <phil.hudson@iname.com>
> wrote:
>>
>> On 26 June 2016 at 16:38, Xebar Saram <zeltakc@gmail.com> wrote:
>> > Hi all
>> >
>> > so i have pathetic coding skill but managed somehow to come u= p with this
>> >
>> >=C2=A0 (defun z/save-meeting-to-ics ()
>> >=C2=A0 =C2=A0 =C2=A0"If the current file is in '~/.do= tfiles', the code blocks are
>> > tangled"
>> >=C2=A0 =C2=A0 =C2=A0(when (equal (buffer-file-name)
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (expand-file-name
>> > "/home/zeltak/org/files/agenda/meetings.org")) >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0(org-icalendar-export-to-ics)
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0(message "exported to ics"= ;)))
>> >
>> > this does save the org file "meetings.org" to an ICS = file in the same
>> > folder
>> > as the file. but i want to do 2 additional things:
>> > 1)save the resulting ICS file to a different directory
>> > 2)run this function every X hours (lets say every 2 hours) >> >
>> > any clue guys?
>> >
>> > thx!
>> >
>> > Z
>>
>> For 1), change:
>>
>>=C2=A0 =C2=A0 =C2=A0(org-icalendar-export-to-ics)
>>
>> to something like this:
>>
>>=C2=A0 =C2=A0 =C2=A0(rename-file (org-icalendar-export-to-ics) your= -preferred-pathname)
>>
>> For 2), evaluate this:
>>
>>=C2=A0 =C2=A0 =C2=A0(info "(elisp) Timers")
>>
>> --
>> Phil Hudson=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0http://hudson-it.ddns.net
>> @UWascalWabbit=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PGP/GnuPG ID: 0x887DCA63
>
>



--
Phil Hudson=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0http://hudson-it.ddns.net
@UWascalWabbit=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0PGP/GnuPG ID: 0x887DCA63


--94eb2c064ac0e7498c053b4a1c81-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: export to ics a specific buffer every X hours Date: Tue, 30 Aug 2016 09:50:04 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e011764950ea540053b4a42cd Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bejQX-0007B9-Qb for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 09:50:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bejQU-0002pi-U4 for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 09:50:08 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:36569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bejQU-0002o5-JS for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 09:50:06 -0400 Received: by mail-wm0-x22e.google.com with SMTP id q128so121976029wma.1 for ; Tue, 30 Aug 2016 06:50:06 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Xebar Saram Cc: org mode , Philip Hudson --089e011764950ea540053b4a42cd Content-Type: text/plain; charset=UTF-8 I can't tell exactly what you have in mind. Can't you just add (find-file " meetings.org") to the function? or wrap the whole thing like this: (defun z/export-to-ics () (interactive) (with-current-buffer (find-file-noselect "meetings.org") (rename-file (org-icalendar-export-to-ics) "/home/zeltak/org/files/export/kcal.ics") (message "exported to ics"))) John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Tue, Aug 30, 2016 at 9:39 AM, Xebar Saram wrote: > anyone? kinda stuck here :) > > thx! > > > z > > On Thu, Aug 25, 2016 at 10:32 AM, Xebar Saram wrote: > >> Hi again all >> >> so i have a related question so ill continue in this thread. i have been >> using this command succesfully in the last few weeks >> >> (defun z/export-to-ics () >> (interactive) >> (rename-file (org-icalendar-export-to-ics) >> "/home/zeltak/org/files/export/kcal.ics") >> (message "exported to ics")) >> >> >> this forces me to first open the file i want (meetings.org) and then >> launch the above command. is there a way to auto make the above function to >> auto export meeting.org each time without opening it first? >> >> thx >> >> Z >> >> On Wed, Jul 13, 2016 at 6:27 PM, Philip Hudson >> wrote: >> >>> You have _two_ concerns here. First is what to do when you save >>> "meetings.org", second is what to do every half hour. Your code >>> handles both of them, essentially correctly, but in the wrong place. >>> >>> On 13 July 2016 at 09:41, Xebar Saram wrote: >>> > Thx >>> > >>> > i do have this now >>> > >>> > (defun z/save-meeting-to-ics () >>> > "If the current file is in '~/.dotfiles', the code blocks are >>> tangled" >>> > (when (equal (buffer-file-name) >>> > (expand-file-name "/home/zeltak/org/files/agenda/ >>> meetings.org")) >>> >>> This means the code will only execute if the current buffer is >>> "meetings.org" when it executes. That _is_ what you want when you save >>> meetings.org, but it _is not_ what you want when the timer executes. >>> >>> Break out the body of the `when' form into its own function, and call >>> that function from the timer, instead of `z/save-meeting-to-ics'. >>> >>> > (rename-file (org-icalendar-export-to-ics) >>> > "/home/zeltak/org/files/export/kcal.ics") >>> > (message "exported to ics"))) >>> > >>> > ;;run every 30 minutes >>> > >>> > (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics) >>> > ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it every >>> 600 >>> > second >>> > ;; (add-hook 'after-save-hook #'z/save-meeting-to-ics) >>> > >>> > yet i cant get the ics file to be created niether when i save the >>> > meeting.org file >>> >>> For this, you need to add `z/save-meeting-to-ics' to the Emacs global >>> variable `after-save-hook' using function `add-hook'. >>> >>> > nor every 600 seconds. >>> >>> You mean 1800 seconds, I think. >>> >>> > what am i missing here? >>> > >>> > thx >>> > >>> > Z >>> > >>> > On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson >>> > wrote: >>> >> >>> >> On 26 June 2016 at 16:38, Xebar Saram wrote: >>> >> > Hi all >>> >> > >>> >> > so i have pathetic coding skill but managed somehow to come up with >>> this >>> >> > >>> >> > (defun z/save-meeting-to-ics () >>> >> > "If the current file is in '~/.dotfiles', the code blocks are >>> >> > tangled" >>> >> > (when (equal (buffer-file-name) >>> >> > (expand-file-name >>> >> > "/home/zeltak/org/files/agenda/meetings.org")) >>> >> > (org-icalendar-export-to-ics) >>> >> > (message "exported to ics"))) >>> >> > >>> >> > this does save the org file "meetings.org" to an ICS file in the >>> same >>> >> > folder >>> >> > as the file. but i want to do 2 additional things: >>> >> > 1)save the resulting ICS file to a different directory >>> >> > 2)run this function every X hours (lets say every 2 hours) >>> >> > >>> >> > any clue guys? >>> >> > >>> >> > thx! >>> >> > >>> >> > Z >>> >> >>> >> For 1), change: >>> >> >>> >> (org-icalendar-export-to-ics) >>> >> >>> >> to something like this: >>> >> >>> >> (rename-file (org-icalendar-export-to-ics) >>> your-preferred-pathname) >>> >> >>> >> For 2), evaluate this: >>> >> >>> >> (info "(elisp) Timers") >>> >> >>> >> -- >>> >> Phil Hudson http://hudson-it.ddns.net >>> >> @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 >>> > >>> > >>> >>> >>> >>> -- >>> Phil Hudson http://hudson-it.ddns.net >>> @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 >>> >> >> > --089e011764950ea540053b4a42cd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I can't tell exactly what you have in mind. Can't = you just add (find-file "meetings.org<= /a>") to the function?

or wrap the whole thing like= this:


(defun z/export-to-ics ()
(interactive= )
(rename= -file (org-icalendar-export-to-ics)
&quo= t;/home/zeltak/org/files/export/kcal.ics")
(message "exported to ics")))


John

-----------------------------------
Professor= John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical Enginee= ring
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803<= /div>

On Tue, Aug 30, 2016 at 9:39 AM, Xebar Saram= <zeltakc@gmail.com> wrote:
anyone? kinda stuck here :)

thx!


z

On = Thu, Aug 25, 2016 at 10:32 AM, Xebar Saram <zeltakc@gmail.com> wrote:
Hi again all
so i have a related question so ill continue in this thre= ad. i have been using this command succesfully in the last few weeks
<= div>
(defun z/export-to-ics ()
(interactive)
(rename-file (org-icalendar-export-to-ics)
"/= home/zeltak/org/files/export/kcal.ics")
(message "= exported to ics"))


this forces me to first open the file i want (meetings.org) and then launch the above command.= is there a way to auto make the above function to auto export meeting.org each time without open= ing it first?

thx

Z
=

O= n Wed, Jul 13, 2016 at 6:27 PM, Philip Hudson <phil.hudson@iname.com> wrote:
You have _two_ conce= rns here. First is what to do when you save
"
= meetings.org", second is what to do every half hour. Your code
handles both of them, essentially correctly, but in the wrong place.

On 13 July 2016 at 09:41, Xebar Saram <zeltakc@gmail.com> wrote:
> Thx
>
> i do have this now
>
>=C2=A0 =C2=A0(defun z/save-meeting-to-ics ()
>=C2=A0 =C2=A0 =C2=A0"If the current file is in '~/.dotfiles= 9;, the code blocks are tangled"
>=C2=A0 =C2=A0 =C2=A0(when (equal (buffer-file-name)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (expand-= file-name "/home/zeltak/org/files/agenda/meetings.org"))

This means the code will only execute if the current buffer is
"= meetings.org" when it executes. That _is_ what you want when you s= ave
meetin= gs.org, but it _is not_ what you want when the timer executes.

Break out the body of the `when' form into its own function, and call that function from the timer, instead of `z/save-meeting-to-ics'.

>=C2=A0 (rename-file (org-icalendar-export-to-ics)
> "/home/zeltak/org/files/export/kcal.ics")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(message "exported to ics")))
>
> ;;run every 30 minutes
>
> (run-with-timer 0 (* 30 60) 'z/save-meeting-to-ics)
> ;;(run-with-idle-timer 600 t #'org-agenda-redo) ;; to rebuild it e= very 600
> second
> ;;=C2=A0 (add-hook 'after-save-hook #'z/save-meeting-to-ics) >
> yet i cant get the ics file to be created niether when i save the
> me= eting.org file

For this, you need to add `z/save-meeting-to-ics' to the Emacs g= lobal
variable `after-save-hook' using function `add-hook'.

> nor every 600 seconds.

You mean 1800 seconds, I think.

> what am i missing here?
>
> thx
>
> Z
>
> On Sun, Jun 26, 2016 at 9:49 PM, Philip Hudson <phil.hudson@iname.com>
> wrote:
>>
>> On 26 June 2016 at 16:38, Xebar Saram <zeltakc@gmail.com> wrote:
>> > Hi all
>> >
>> > so i have pathetic coding skill but managed somehow to come u= p with this
>> >
>> >=C2=A0 (defun z/save-meeting-to-ics ()
>> >=C2=A0 =C2=A0 =C2=A0"If the current file is in '~/.do= tfiles', the code blocks are
>> > tangled"
>> >=C2=A0 =C2=A0 =C2=A0(when (equal (buffer-file-name)
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (expand-file-name
>> > "/home/zeltak/org/files/agenda/meetings.org")) >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0(org-icalendar-export-to-ics)
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0(message "exported to ics"= ;)))
>> >
>> > this does save the org file "meetings.org" to an ICS = file in the same
>> > folder
>> > as the file. but i want to do 2 additional things:
>> > 1)save the resulting ICS file to a different directory
>> > 2)run this function every X hours (lets say every 2 hours) >> >
>> > any clue guys?
>> >
>> > thx!
>> >
>> > Z
>>
>> For 1), change:
>>
>>=C2=A0 =C2=A0 =C2=A0(org-icalendar-export-to-ics)
>>
>> to something like this:
>>
>>=C2=A0 =C2=A0 =C2=A0(rename-file (org-icalendar-export-to-ics) your= -preferred-pathname)
>>
>> For 2), evaluate this:
>>
>>=C2=A0 =C2=A0 =C2=A0(info "(elisp) Timers")
>>
>> --
>> Phil Hudson=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0http://hudson-it.ddns.net
>> @UWascalWabbit=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PGP/GnuPG ID: 0x887DCA63
>
>



--
Phil Hudson=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0http://hudson-it.ddns.net
@UWascalWabbit=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0PGP/GnuPG ID: 0x887DCA63



--089e011764950ea540053b4a42cd-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: export to ics a specific buffer every X hours Date: Tue, 30 Aug 2016 16:59:56 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11416240561a5e053b4a6565 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beja4-0001wN-Vz for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 10:00:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beja2-0004tT-Tk for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 10:00:00 -0400 Received: from mail-yw0-x236.google.com ([2607:f8b0:4002:c05::236]:34276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beja2-0004tO-OA for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 09:59:58 -0400 Received: by mail-yw0-x236.google.com with SMTP id z8so11688352ywa.1 for ; Tue, 30 Aug 2016 06:59:58 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: John Kitchin Cc: org mode , Philip Hudson --001a11416240561a5e053b4a6565 Content-Type: text/plain; charset=UTF-8 Thx John, this is *exactly* what i wanted...its just as always my wishes and code skills dont align thx so much again Z On Tue, Aug 30, 2016 at 4:50 PM, John Kitchin wrote: > > (defun z/export-to-ics () > (interactive) > (with-current-buffer (find-file-noselect "meetings.org") > (rename-file (org-icalendar-export-to-ics) > "/home/zeltak/org/files/export/kcal.ics") > (message "exported to ics"))) > --001a11416240561a5e053b4a6565 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thx John, this is *exactly* wha= t i wanted...its just as always my wishes and code skills dont align
<= div class=3D"gmail_extra">
thx so much = again

= Z


=
On Tue, Aug 30, 2016 at 4:50 PM, John Kitchin <jkitchin@andrew.cmu.edu> wrote:

(defun z/expor= t-to-ics ()
(interactive)
(with-current-buffer (= find-file-noselect "= meetings.org")
(rename-file (org-icalendar-export-to-ics)
"/home/zeltak/org/files/export/kcal.ics")
(message "exported to ics")))


--001a11416240561a5e053b4a6565--