After having used elscreen for a long time, I’m now a very happy user of escreen, which feels much better integrated and allows to have one ring of recently visited buffers per screen. Which is what you need when using a screen like feature, really.
At first, it seemed so good as not to require any tweaking, but soon enough I had to adapt it to my workflow. After all that’s exactly for being able to do this that I’m using emacs :)
The function didn’t allow for using more than one mailrc file, which isn’t a good idea, so I’ve just added that. Oh and for gnus integration what I need is (add-hook 'message-mode-hook 'mail-abbrevs-setup) it seems… so that if I type the alias it’ll get automatically expanded. And to be real lazy and avoid having to type in the entire alias, mail-abbrev-complete-alias to the rescue, assigned to some easy to reach keys.
So I’ve been adviced to use ~/.mailrc for keeping a basic address book in Emacs, for use within gnus for example. I had to resort to the manual to find out how to use the file aliases when I need them, that is when composing a mail. For the record, here’s what I had to do:
;; mails and aliases (add-hook 'mail-mode-hook 'mail-abbrevs-setup) (global-set-key (kbd "C-c @") 'mail-abbrev-insert-alias) That means I prefer hitting C-c @, then typing the alias in the minibuffer (with completion) and there after see the full mail address in my message-mode buffer.
First, here’s a way to insert at current position the last message printed into the minibuffer… well not exactly, in *Messages* buffer in fact. I was tired of doing it myself after invoking, e.g., M-x emacs-version.
;; print last message ;; current-message is already lost by the time this gets called (defun dim:previous-message (&optional nth) "get last line of *Message* buffer" (with-current-buffer (get-buffer "*Messages*") (save-excursion (goto-char (point-max)) (setq nth (if nth nth 1)) (while (> nth 0) (previous-line) (setq nth (- nth 1))) (buffer-substring (line-beginning-position) (line-end-position))))) (defun dim:insert-previous-message (&optional nth) "insert last message of *Message* to current position" (interactive "p") (insert (format "%s" (dim:previous-message nth)))) (global-set-key (kbd "C-c m") 'dim:insert-previous-message) Now I stumbled accross Planet Emacsen and saw this Emacs Utility Functions post, containing a version of duplicate-current-line that I didn’t like… here’s mine: