Function: vi-switch-mode
vi-switch-mode is an interactive and byte-compiled function defined in
vi.el.gz.
Signature
(vi-switch-mode ARG MODE-CHAR)
Documentation
Switch the major mode of current buffer as specified by the following char O outline-mode
P picture-mode
a abbrev-mode(var)/abbrev-mode(fun)
c c-mode
d vi-debugging
e emacs-lisp-mode
f auto-fill-mode
g prolog-mode
h hanoi
l lisp-mode
n nroff-mode
o overwrite-mode(var)/overwrite-mode(fun)
r vi-readonly-mode
t text-mode
v vi-mode
x tex-mode
~ vi-back-to-old-mode
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/vi.el.gz
(defun vi-switch-mode (arg mode-char)
"Switch the major mode of current buffer as specified by the following char \\{vi-tilde-map}"
(interactive "P\nc")
(let ((mode-cmd (lookup-key vi-tilde-map (char-to-string mode-char))))
(if (null mode-cmd)
(with-output-to-temp-buffer "*Help*"
(princ (substitute-command-keys "Possible major modes to switch to: \\{vi-tilde-map}"))
(with-current-buffer standard-output
(help-mode)))
(setq prefix-arg arg) ; prefix arg will be passed down
(command-execute mode-cmd nil) ; may need to save mode-line-format etc
(force-mode-line-update)))) ; just in case