ERC autostart into a new instance of emacs

Most of this blog is published into Italian but I think that sharing technical tips should be better done trying to write them into English.

I’m a fun of emacs but I consider my self still a beginner. Every day I found new ways improve the my usage of this programmable editor.

One of the problems I was experiencing was the mess from gnus, ERC and normal buffers. The only solution I found was to run a new instance of emacs but this solution rose a new problem: all instances run after the first complain for emacsserver already running and if I run the gnus instance as first instance all emacsclient will become its clients.

I found the solution to this problem on Edward O’Connor’s blog. Edward use a new emacs for gnus and call a function to invoke gnus at startup and solved the problem with emacsserver, too.

Based on his solution I wrote a function to run ERC:

[cc lang=”lisp” tab_size=”2″]
‘(“erc” . (lambda (&rest ignore)
;; does not start emacs server
(setq ted-server-emacs nil)
(setq frame-title-format ‘(“” “%b @ Emacs IRC” ))
(call-interactively ‘erc-freenode)
(sit-for 1)
(call-interactively ‘erc-oftc)
(sit-for 1)
(call-interactively ‘erc-gnome)
(sit-for 1)
(call-interactively ‘erc-azzurra))))

As you can easily see ERC auto connects to some network.

Please note that as per Edward O’Connor’s post ted-server-emacs is set to nil so no server is run if I use emacs for ERC only.

This solution needs to be improved a little bit because all emacs instances still load all the configuration file even if they do not need them. My configuration is based on Alex Ott one so I have many files, perhaps some variables like the ted-server-emacs one can do the trick.

emacs, gnus e la configurazione

Che uso emacs ormai lo sanno anche le pietre. Il bello di questo editor è che esiste almeno un modo, così si chiamano gli script e file di configurazione, praticamente per tutto. Il problema è che spesso ne esiste più di uno e che per ogniuno esistono molte strade per configurarli secondo le proprie esigenze, insomma la strada per la configurazione ideale è infinita e non si riesce mai a raggiungere una stabilità.
Io, quando ho iniziato a usare emacs, sono partito, per pigrizia e ignoranza, scopiazzando la configurazione che altri utenti hanno messo sul web, in particolare ho trovato interessante quella di Alex Ott, perché Alex separa le varie funzionalità, in vero problema è che ora mi trovo con mille file di configurazione in cui spesso sono ripetute parti di configurazione delle stesse applicazioni. Di questa confusione avevo il sospetto ma da quando oggi ho provato a eseguire dovecot dall’interno di gnus ho avuto la certezza. gnus è configurato in 3 file, ma perché? Nei prossimi giorni cercherò di capirlo e di arrivare a una configurazione sensata, per ora mi accontento di aver scoperto il problema.

emacs, org-mode e mobileOrg Android

As many of you already knows I’m constantly trying to get organized and to remember everything but as I have a bad memory I have always a notebook and a pencil with me. Some times ago I discovered org-mode that is an emacs mode to organize your life starting from the point that the first program I run after logon is emacs I decided to give org-mode a try. I found it is good but I need something in my pocket to write my thoughts when they pop up in my mind and I cannot carry my laptop everywhere, so I started copying notes from the notebook to org-mode but lately I abandoned this habit and left the emacs part aside.
I know own and android based smartphone so I’m trying to use mobile-org.
The start-up was not the best as I the workflow used by this program is not so clear, or perhaps it’s not so clear to me. To use mobileOrg you need to setup a storage area where you are going to store files used to sync you todos and then:

  • push from emacs
  • pull from your android device
  • modify your notes on the go
  • push from your android device
  • pull to emacs
  • push again from emacs
  • and pull again from the smartphone

From my point of view last push and pull operation is not so intuitive but before doing it my notes where not synced at all.
I did not try to create a note on the road on my smartphone but I’m going to do some more tests in the next days.

PS: sorry for my bad English but I hope this post is of help to people looking for info about org-mode and mobileOrg

PS [IT]: questo post è in iglese nella speranza di essere di aiuto a più persone