emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-mode execute functions upon opening and closing
@ 2015-01-07 19:43 Eduardo Mercovich
  2015-01-11 11:01 ` Karl Voit
  0 siblings, 1 reply; 4+ messages in thread
From: Eduardo Mercovich @ 2015-01-07 19:43 UTC (permalink / raw)
  To: emacs-orgmode

Hello everybody.

I'm new to the list, so please forgive me if this is offtopic, but
I've searched with the obviously wrong keywords, since I found no
answer for this yet.

In short: I'd like to know how could Org execute (internal) functions
upon opening and closing.

___ Longer form ___

I'd like Org -upon opening- to:
* check if there is any update in the mobile-org files (something I'd
done when not in the computer)
* update the calendar/agenda (online to local) and write the file.

Upon closing:
* export/stage mobile-org files (to have them synched if I need them
on the move)
* export/update the agenda (local to online) file and it's web
equivalent (BTW, I'd show the local file it over my desktop using
Conky).

___ Why ___

Upon repeated and un-welcomed changes or utter disappearance of
various online services I used before (delicious, springpad, google
reader, google wave, you-name-it, etc.) I decided to continue the path
of sane interdependence that started me on Linux years ago, and have
my own set of tools:
* based on logical standards and a simple format,
* maintainable in the long run,
* being very flexible/adaptable, and
* under the control of a community of real people (not corporations)
with which I share values and work.

This implies to go out of Google, yes, and I'm actually happy thinking
about it. :)

While I'm new to Org-mode (to Emacs, actually), I found it absolutely
fascinating. It fits perfectly with my own mental set and I'm happy
thinking that with time, I will tweak it to do exactly what I need it
to do (the same happened with Dvorak typing and I'm still enjoying
every day of it).

The big plan (rant for another thread) is to eventually integrate all
the information I use into this system, as many already did:
* people (org-contacts, BBDB, google-contacts, other?),
* events (calfw+org-mode?)
* mail (mu4e in my case, but there are other possible tools too).
* documents (org-mode itself)
* references (org-mode itself)
* etc.

Of course, I will have to do quite some tutorials and read a lot about
lisp (I'm no programmer myself), but I have no doubt that in the end
it will pay back.

Thanks a lot for your time and attention. :)

Best...
-- 
Eduardo Mercovich

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

* Re: Org-mode execute functions upon opening and closing
  2015-01-07 19:43 Org-mode execute functions upon opening and closing Eduardo Mercovich
@ 2015-01-11 11:01 ` Karl Voit
  2015-01-11 16:54   ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Voit @ 2015-01-11 11:01 UTC (permalink / raw)
  To: emacs-orgmode

Hello Eduardo!

<shameless plug>

This is not an answer to your original question regarding hooks
where http://www.emacswiki.org/emacs/LocalVariables together with a
bit of Elisp might be a possible solution.

However, we seem to share the same mind-set or motivation to use
Org-mode in order to get independent from any cloud-based or closed
source service.

* Eduardo Mercovich <eduardo.mercovich@gmail.com> wrote:
>
> The big plan (rant for another thread) is to eventually integrate all
> the information I use into this system, as many already did:
> * people (org-contacts, BBDB, google-contacts, other?),
> * events (calfw+org-mode?)
> * mail (mu4e in my case, but there are other possible tools too).
> * documents (org-mode itself)
> * references (org-mode itself)
> * etc.

You might be interested in taking a look at Memacs (URL below) and
http://karl-voit.at/2014/12/03/emacs-chat + other blog posts there.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Org-mode execute functions upon opening and closing
  2015-01-11 11:01 ` Karl Voit
@ 2015-01-11 16:54   ` John Kitchin
  2015-01-11 17:04     ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitchin @ 2015-01-11 16:54 UTC (permalink / raw)
  To: Karl Voit; +Cc: Karl Voit, emacs-orgmode


* Load lisp code on opening an org-file

Put this at the end of your org-file:
#+BEGIN_EXAMPLE
### Local Variables:
### mode: org
### eval: (load-file "my-lib.el")
### End:
#+END_EXAMPLE

Create my-lib.el, e.g.

#+BEGIN_SRC emacs-lisp :tangle my-lisp.el
(message-box "Loaded!")
#+END_SRC

The next time you open this file, you will be prompted whether to eval
the local variable. Type y to approve it once, or ! to approve it
forever. You can put whatever you want in this library.

### Local Variables:
### mode: org
### eval: (load-file "my-lib.el")
### End:



Karl Voit <devnull@Karl-Voit.at> writes:

> Hello Eduardo!
>
> <shameless plug>
>
> This is not an answer to your original question regarding hooks
> where http://www.emacswiki.org/emacs/LocalVariables together with a
> bit of Elisp might be a possible solution.
>
> However, we seem to share the same mind-set or motivation to use
> Org-mode in order to get independent from any cloud-based or closed
> source service.
>
> * Eduardo Mercovich <eduardo.mercovich@gmail.com> wrote:
>>
>> The big plan (rant for another thread) is to eventually integrate all
>> the information I use into this system, as many already did:
>> * people (org-contacts, BBDB, google-contacts, other?),
>> * events (calfw+org-mode?)
>> * mail (mu4e in my case, but there are other possible tools too).
>> * documents (org-mode itself)
>> * references (org-mode itself)
>> * etc.
>
> You might be interested in taking a look at Memacs (URL below) and
> http://karl-voit.at/2014/12/03/emacs-chat + other blog posts there.

--
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

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

* Re: Org-mode execute functions upon opening and closing
  2015-01-11 16:54   ` John Kitchin
@ 2015-01-11 17:04     ` John Kitchin
  0 siblings, 0 replies; 4+ messages in thread
From: John Kitchin @ 2015-01-11 17:04 UTC (permalink / raw)
  To: Karl Voit; +Cc: Karl Voit, emacs-orgmode

John Kitchin <johnrkitchin@gmail.com> writes:

I guess this technically only runs when you open it.

To run something on closing, you might add something to
kill-buffer-hook. That function would need to check if it should run,
e.g. if you are closing an org-buffer that meets some criteria.

You could also look at find-file-hook for an alternative to opening.

> * Load lisp code on opening an org-file
>
> Put this at the end of your org-file:
> #+BEGIN_EXAMPLE
> ### Local Variables:
> ### mode: org
> ### eval: (load-file "my-lib.el")
> ### End:
> #+END_EXAMPLE
>
> Create my-lib.el, e.g.
>
> #+BEGIN_SRC emacs-lisp :tangle my-lisp.el
> (message-box "Loaded!")
> #+END_SRC
>
> The next time you open this file, you will be prompted whether to eval
> the local variable. Type y to approve it once, or ! to approve it
> forever. You can put whatever you want in this library.
>
> ### Local Variables:
> ### mode: org
> ### eval: (load-file "my-lib.el")
> ### End:
>
>
>
> Karl Voit <devnull@Karl-Voit.at> writes:
>
>> Hello Eduardo!
>>
>> <shameless plug>
>>
>> This is not an answer to your original question regarding hooks
>> where http://www.emacswiki.org/emacs/LocalVariables together with a
>> bit of Elisp might be a possible solution.
>>
>> However, we seem to share the same mind-set or motivation to use
>> Org-mode in order to get independent from any cloud-based or closed
>> source service.
>>
>> * Eduardo Mercovich <eduardo.mercovich@gmail.com> wrote:
>>>
>>> The big plan (rant for another thread) is to eventually integrate all
>>> the information I use into this system, as many already did:
>>> * people (org-contacts, BBDB, google-contacts, other?),
>>> * events (calfw+org-mode?)
>>> * mail (mu4e in my case, but there are other possible tools too).
>>> * documents (org-mode itself)
>>> * references (org-mode itself)
>>> * etc.
>>
>> You might be interested in taking a look at Memacs (URL below) and
>> http://karl-voit.at/2014/12/03/emacs-chat + other blog posts there.
>
> --
> -----------------------------------
> John Kitchin
> Professor
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> http://kitchingroup.cheme.cmu.edu
>
>

--
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

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

end of thread, other threads:[~2015-01-11 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07 19:43 Org-mode execute functions upon opening and closing Eduardo Mercovich
2015-01-11 11:01 ` Karl Voit
2015-01-11 16:54   ` John Kitchin
2015-01-11 17:04     ` John Kitchin

Code repositories for project(s) associated with this public inbox

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

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).