help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: One more time: binding overwrite-mode to Apple kbd


From: Kevin Rodgers
Subject: Re: One more time: binding overwrite-mode to Apple kbd
Date: Thu, 20 Jul 2006 16:31:21 -0600
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

Slawomir Nowaczyk wrote:
On Mon, 17 Jul 2006 15:56:32 +0200
David Kastrup <dak@gnu.org> wrote:

#> M-x picture-mode RET

It there some reason why there is no picture-mode-toggle command?

Try this:

(defvar toggle-picture-mode nil
  "The previous major mode, before Picture mode.")

(defadvice picture-mode (before toggle-major-mode activate)
  "Set `toggle-picture-mode'."
  (set (make-local-variable 'toggle-picture-mode) major-mode)
  (put 'toggle-picture-mode 'permanent-local t))

(defun toggle-picture-mode ()
  "Select the previous major mode."
  (if toggle-picture-mode
      (progn
        (setq toggle-picture-mode nil)
        (funcall toggle-picture-mode))
    (error "No previous major mode")))

--
Kevin Rodgers
Sr. Software Engineer, IHS





reply via email to

[Prev in Thread] Current Thread [Next in Thread]