Function: vi-transpose-objects

vi-transpose-objects is an interactive and byte-compiled function defined in vi.el.gz.

Signature

(vi-transpose-objects ARG UNIT)

Documentation

Transpose objects.

The following char specifies unit of objects to be transposed -- "c" for chars, "l" for lines, "w" for words, "s" for
 sexp, "p" for paragraph.
For the use of the prefix-arg, refer to individual functions called.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/vi.el.gz
(defun vi-transpose-objects (arg unit)
  "Transpose objects.
The following char specifies unit of objects to be
transposed -- \"c\" for chars, \"l\" for lines, \"w\" for words, \"s\" for
 sexp, \"p\" for paragraph.
For the use of the prefix-arg, refer to individual functions called."
  (interactive "*P\nc")
  (if (char-equal unit ??)
      (progn
	(message "Transpose: c(har), l(ine), p(aragraph), s(-exp), w(ord),")
	(setq unit (read-char))))
  (vi-set-last-change-command 'vi-transpose-objects arg unit)
  (cond ((char-equal unit ?c) (transpose-chars arg))
	((char-equal unit ?l) (transpose-lines (vi-prefix-numeric-value arg)))
	((char-equal unit ?p) (transpose-paragraphs (vi-prefix-numeric-value arg)))
	((char-equal unit ?s) (transpose-sexps (vi-prefix-numeric-value arg)))
	((char-equal unit ?w) (transpose-words (vi-prefix-numeric-value arg)))
	(t (vi-transpose-objects arg ??))))