Category Archives: Emacs

Improving Database Column Insertion With Thing At Point

I can make ido-insert-database-column even more useful by having it complete some text that I have already typed into the buffer. This is trivial using thing-at-point. The closest thing that matches a database column name is a filename. (defun ido-insert-database-column () (interactive) (let ((bounds (bounds-of-thing-at-point ‘filename)) (input (thing-at-point ‘filename)) selection) (setq selection (ido-completing-read “DB Column: [...]

Posted in Emacs | Leave a comment

Choosing Database Columns Using Ido Mode

For my final riff on extracting the data dictionary using Perl DBI, I’ll demonstrate using ido mode to quickly choose and insert a database column. This was inspired by a Stuart Halloway video which shows that ido mode is useful whenever you need to choose between a list of things. ido mode provides a mechanism [...]

Also posted in Perl | Tagged , | 2 Comments

Emacs String Functions

Characters and Strings Strings are a sequence of characters. Unlike many languages emacs lisp doesn’t differentiate between characters and integers. Evaluating ?A returns 65. Therefore you don’t need an ord or char function. To convert a character (or integer) into a string use (string …). (string 65) ;; “A” is the same as (string ?A) [...]

Posted in Emacs | Leave a comment