Simply type in a keyword (if, for, while, switch, etc...) and the
perens, braces, case, etc would be filed in automatically and the
cursor positioned with the block ready to begin typing.
If anyone remembers how to do this with emacs, I'd appreciate the help.
Thanks,
Jack Reese
;;{{{ Either indent according to mode, or expand the word preceding point.
;; I use the text around point as a cue what it is that I want from the
;; editor. Allowance has to be made for the case that point is at the
;; edge of a buffer.
(defun indent-or-expand ()
"Either indent according to mode, or expand the word preceding point."
(interactive)
(if (and
(= ?w (char-syntax (char-before)))
(not (= ?w (char-syntax (char-after)))))
(dabbrev-expand nil)
(indent-according-to-mode))
)
(global-set-key (kbd "TAB") 'indent-or-expand)
;;}}}________________________________________________
"Jack Reese" <re...@byu.edu> wrote in message
news:txitkub...@intractable.cs.byu.edu...
[...]
> Simply type in a keyword (if, for, while, switch, etc...) and the
> perens, braces, case, etc would be filed in automatically and the
> cursor positioned with the block ready to begin typing.
You may want to use skeletons, they can accomplish this with a little
work. See skeleton.el in your emacs distribution or see
http://fetter.org/emacs/autotype.html.
--
Benjamin