diff options
author | Per Abrahamsen <abraham@dina.kvl.dk> | 1997-04-24 16:53:55 +0000 |
---|---|---|
committer | Per Abrahamsen <abraham@dina.kvl.dk> | 1997-04-24 16:53:55 +0000 |
commit | 6d528fc505f6be1e67f87834bdde19cf4bbe05ff (patch) | |
tree | 10684dfedc376c7ed84936112fd4bb2227c0342c /lisp/wid-browse.el | |
parent | ee82af565d241057341ba3c84505149e2213f416 (diff) | |
download | emacs-6d528fc505f6be1e67f87834bdde19cf4bbe05ff.tar.gz |
Synched with custom 1.90.
Diffstat (limited to 'lisp/wid-browse.el')
-rw-r--r-- | lisp/wid-browse.el | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el index f656a3b9020..984d802f75b 100644 --- a/lisp/wid-browse.el +++ b/lisp/wid-browse.el @@ -4,7 +4,7 @@ ;; ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> ;; Keywords: extensions -;; Version: 1.84 +;; Version: 1.90 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ ;;; Commentary: @@ -16,7 +16,7 @@ (require 'easymenu) (require 'custom) (require 'wid-edit) -(require 'cl) +(eval-when-compile (require 'cl)) (defgroup widget-browse nil "Customization support for browsing widgets." @@ -245,6 +245,37 @@ VALUE is assumed to be a list of widgets." (put :button 'widget-keyword-printer 'widget-browse-widget) (put :args 'widget-keyword-printer 'widget-browse-sexps) +;;; Widget Minor Mode. + +(defvar widget-minor-mode nil + "I non-nil, we are in Widget Minor Mode.") + (make-variable-buffer-local 'widget-minor-mode) + +(defvar widget-minor-mode-map nil + "Keymap used in Widget Minor Mode.") + +(unless widget-minor-mode-map + (setq widget-minor-mode-map (make-sparse-keymap)) + (set-keymap-parent widget-minor-mode-map widget-keymap)) + +;;;###autoload +(defun widget-minor-mode (&optional arg) + "Togle minor mode for traversing widgets. +With arg, turn widget mode on if and only if arg is positive." + (interactive "P") + (cond ((null arg) + (setq widget-minor-mode (not widget-minor-mode))) + ((<= 0 arg) + (setq widget-minor-mode nil)) + (t + (setq widget-minor-mode t))) + (force-mode-line-update)) + +(add-to-list 'minor-mode-alist '(widget-minor-mode " Widget")) + +(add-to-list 'minor-mode-map-alist + (cons 'widget-minor-mode widget-minor-mode-map)) + ;;; The End: (provide 'wid-browse) |