Function: edt-duplicate-word
edt-duplicate-word is an interactive and byte-compiled function
defined in edt.el.gz.
Signature
(edt-duplicate-word)
Documentation
Duplicate word (or rest of word) found directly above cursor, if any.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/emulation/edt.el.gz
;;;
;;; DUPLICATE WORD
;;;
(defun edt-duplicate-word()
"Duplicate word (or rest of word) found directly above cursor, if any."
(interactive "*")
(let ((start (point))
(start-column (current-column)))
(forward-line -1)
(move-to-column start-column)
(if (and (not (equal start (point)))
(not (eolp)))
(progn
(if (and (equal ?\t (preceding-char))
(< start-column (current-column)))
(backward-char))
(let ((beg (point)))
(edt-one-word-forward)
(setq edt-last-copied-word (buffer-substring beg (point))))
(forward-line)
(move-to-column start-column)
(insert edt-last-copied-word))
(progn
(if (not (equal start (point)))
(forward-line))
(move-to-column start-column)
(error "Nothing to duplicate!")))))