Mercurial > emacs
comparison lisp/wid-browse.el @ 91040:14c4a6aac623
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 866-879)
- Merge multi-tty branch
- Update from CVS
- Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 11 Oct 2007 16:14:00 +0000 |
parents | f55f9811f5d7 05009eb6121a |
children | 606f2d163a64 |
comparison
equal
deleted
inserted
replaced
91039:eefadc1e1d5e | 91040:14c4a6aac623 |
---|---|
38 "Customization support for browsing widgets." | 38 "Customization support for browsing widgets." |
39 :group 'widgets) | 39 :group 'widgets) |
40 | 40 |
41 ;;; The Mode. | 41 ;;; The Mode. |
42 | 42 |
43 (defvar widget-browse-mode-map nil | 43 (defvar widget-browse-mode-map |
44 (let ((map (make-sparse-keymap))) | |
45 (set-keymap-parent map widget-keymap) | |
46 (define-key map "q" 'bury-buffer) | |
47 map) | |
44 "Keymap for `widget-browse-mode'.") | 48 "Keymap for `widget-browse-mode'.") |
45 | |
46 (unless widget-browse-mode-map | |
47 (setq widget-browse-mode-map (make-sparse-keymap)) | |
48 (set-keymap-parent widget-browse-mode-map widget-keymap) | |
49 (define-key widget-browse-mode-map "q" 'bury-buffer)) | |
50 | 49 |
51 (easy-menu-define widget-browse-mode-customize-menu | 50 (easy-menu-define widget-browse-mode-customize-menu |
52 widget-browse-mode-map | 51 widget-browse-mode-map |
53 "Menu used in widget browser buffers." | 52 "Menu used in widget browser buffers." |
54 (customize-menu-create 'widgets)) | 53 (customize-menu-create 'widgets)) |
263 (put :button 'widget-keyword-printer 'widget-browse-widget) | 262 (put :button 'widget-keyword-printer 'widget-browse-widget) |
264 (put :args 'widget-keyword-printer 'widget-browse-sexps) | 263 (put :args 'widget-keyword-printer 'widget-browse-sexps) |
265 | 264 |
266 ;;; Widget Minor Mode. | 265 ;;; Widget Minor Mode. |
267 | 266 |
268 (defvar widget-minor-mode nil | 267 (defvar widget-minor-mode-map |
269 "If non-nil, we are in Widget Minor Mode.") | 268 (let ((map (make-sparse-keymap))) |
270 (make-variable-buffer-local 'widget-minor-mode) | 269 (set-keymap-parent map widget-keymap) |
271 | 270 map) |
272 (defvar widget-minor-mode-map nil | |
273 "Keymap used in Widget Minor Mode.") | 271 "Keymap used in Widget Minor Mode.") |
274 | 272 |
275 (unless widget-minor-mode-map | 273 ;;;###autoload |
276 (setq widget-minor-mode-map (make-sparse-keymap)) | 274 (define-minor-mode widget-minor-mode |
277 (set-keymap-parent widget-minor-mode-map widget-keymap)) | |
278 | |
279 ;;;###autoload | |
280 (defun widget-minor-mode (&optional arg) | |
281 "Togle minor mode for traversing widgets. | 275 "Togle minor mode for traversing widgets. |
282 With arg, turn widget mode on if and only if arg is positive." | 276 With arg, turn widget mode on if and only if arg is positive." |
283 (interactive "P") | 277 :lighter " Widget") |
284 (cond ((null arg) | |
285 (setq widget-minor-mode (not widget-minor-mode))) | |
286 ((<= arg 0) | |
287 (setq widget-minor-mode nil)) | |
288 (t | |
289 (setq widget-minor-mode t))) | |
290 (force-mode-line-update)) | |
291 | |
292 (add-to-list 'minor-mode-alist '(widget-minor-mode " Widget")) | |
293 | |
294 (add-to-list 'minor-mode-map-alist | |
295 (cons 'widget-minor-mode widget-minor-mode-map)) | |
296 | 278 |
297 ;;; The End: | 279 ;;; The End: |
298 | 280 |
299 (provide 'wid-browse) | 281 (provide 'wid-browse) |
300 | 282 |
301 ;;; arch-tag: d5ffb18f-8984-4735-8502-edf70456db21 | 283 ;; arch-tag: d5ffb18f-8984-4735-8502-edf70456db21 |
302 ;;; wid-browse.el ends here | 284 ;;; wid-browse.el ends here |