Emacs · Emacs Tips

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 +. And some contains / or . as separators, or some other variations (spaces) so as the number is easy to read for human eyes. Twinkle will not like this.

The Art of PostgreSQL

Second Edition, Updated (2026)

PostgreSQL 10 through 18, a new pgvector chapter, 56 new figures, and a free practice lab.

See what's new →
Dimitri Fontaine
Dimitri Fontaine
PostgreSQL Major Contributor & author of The Art of PostgreSQL