28 Feb

Open in new tab in running Carbon Emacs

Wednesday February 28th 2007, 12:13 pm
Tags: , , ,

Carbon Emacs acts like emacsclient or gnuserv by itself, i.e. it only runs one instance and opens files in this instance from Finder automatically.

A drawback of this behaviour is that the usual server-window variable of gnuserv has no effect. When using elscreen to get tabs into Emacs the desired behaviour might be to open a new tab in the running Emacs when you open a file from Finder. This can easily be done, using my intelligent-kill command (see my elscreen posting) such that files from Finder are opened in a new tab, and you can close this tab with the usual C-x C-c:

(defun create-new-tab-and-switch-to ()
  (message "New tab")
  (elscreen-create))

(defadvice mac-ae-open-documents (before mac-ae-open-documents-advice activate)
  "Create new tab before" (create-new-tab-and-switch-to))
(ad-activate ‘mac-ae-open-documents)

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Reddit

No Comments »

No comments yet.

 

RSS feed for comments on this post. TrackBack Website

Leave a comment

(required)

(required)

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>