Category “Emacs Tips” — 15 articles

Emacs is Twinkling here

So you have a rolodex like database in your Emacs, or you have this phone number in a mail and you want to call it. It happens you have VoIP setup and you’re using Twinkle to make your calls. Maybe you’ll then find this function useful: (defun twinkle-call-symbol-or-region () "Call the phone number at point (symbol seems good enough), or in region" (interactive) (shell-command-to-string (format "twinkle --cmd 'call %s'" (replace-regexp-in-string "[^0-9+]" "" (if (use-region-p) (buffer-substring (region-beginning) (region-end)) (thing-at-point 'symbol)))))) It happens that symbol is better than word here because some phone numbers begin with +.



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.


Dimitri Fontaine

PostgreSQL Major Contributor

Open Source Software Engineer

France