home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
editor
/
me_cd.arc
/
TWIDDLE.MUT
< prev
next >
Wrap
Text File
|
1988-09-14
|
1KB
|
33 lines
;; twiddle.mut : twiddle characters
;; twiddle-left-of-dot: (C-T in Gosling's or Unipress EMACS)
;; Transpose the 2 characters left of the cursor. Does nothing if the
;; cursor is within a character of left edge.
;; For example: to change "abc" to "bac", put the cursor on the "c" and
;; twiddle.
;; twiddle-about-dot: (C-T in GNU EMACS)
;; Transpose the characters on either side of the dot. At the end of a
;; line, does a twiddle-left-of-dot. Does nothing if the cursor is
;; at the left edge.
;; For example: to change "abc" to "bac", put the cursor on the "b" and
;; twiddle.
(defun
twiddle-left-of-dot
{
(if (< 2 (current-column))
{
(previous-character)(looking-at '.')
(delete-character)
(previous-character)(insert-text (get-matched '&'))
(next-character)
})
}
twiddle-about-dot
{
(if (looking-at '$')
(twiddle-left-of-dot)
(if (next-character) { (twiddle-left-of-dot)(previous-character) })
)
}
)