aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-11-06 22:05:23 +0000
committerChong Yidong2006-11-06 22:05:23 +0000
commitf3093f777faa77909558923936f13ebdf2ef4656 (patch)
treec4320f8b54654569381a5f0b4bb81fb4f4c94585
parent42132792edeb53e45a26d772e48d51d43e159af1 (diff)
downloademacs-f3093f777faa77909558923936f13ebdf2ef4656.tar.gz
emacs-f3093f777faa77909558923936f13ebdf2ef4656.zip
(custom-mode-map): Move defvar above code using it.
(custom-mode-link-map): New variable. (custom-group-link, custom-manual): Use follow-link.
-rw-r--r--lisp/cus-edit.el54
1 files changed, 35 insertions, 19 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 624b657159a..26d44ee3c3f 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -466,6 +466,37 @@
466 :version "22.1" 466 :version "22.1"
467 :prefix "mac-") 467 :prefix "mac-")
468 468
469;;; Custom mode keymaps
470
471(defvar custom-mode-map
472 ;; This keymap should be dense, but a dense keymap would prevent inheriting
473 ;; "\r" bindings from the parent map.
474 ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
475 (let ((map (make-keymap)))
476 (set-keymap-parent map widget-keymap)
477 (define-key map [remap self-insert-command] 'Custom-no-edit)
478 (define-key map "\^m" 'Custom-newline)
479 (define-key map " " 'scroll-up)
480 (define-key map "\177" 'scroll-down)
481 (define-key map "\C-c\C-c" 'Custom-set)
482 (define-key map "\C-x\C-s" 'Custom-save)
483 (define-key map "q" 'Custom-buffer-done)
484 (define-key map "u" 'Custom-goto-parent)
485 (define-key map "n" 'widget-forward)
486 (define-key map "p" 'widget-backward)
487 map)
488 "Keymap for `custom-mode'.")
489
490(defvar custom-mode-link-map
491 (let ((map (make-keymap)))
492 (set-keymap-parent map custom-mode-map)
493 (define-key map [down-mouse-2] nil)
494 (define-key map [down-mouse-1] 'mouse-drag-region)
495 (define-key map [mouse-2] 'widget-move-and-invoke)
496 map)
497 "Local keymap for links in `custom-mode'.")
498
499
469;;; Utilities. 500;;; Utilities.
470 501
471(defun custom-split-regexp-maybe (regexp) 502(defun custom-split-regexp-maybe (regexp)
@@ -1781,6 +1812,8 @@ item in another window.\n\n"))
1781(define-widget 'custom-manual 'info-link 1812(define-widget 'custom-manual 'info-link
1782 "Link to the manual entry for this customization option." 1813 "Link to the manual entry for this customization option."
1783 :help-echo "Read the manual entry for this option." 1814 :help-echo "Read the manual entry for this option."
1815 :keymap custom-mode-link-map
1816 :follow-link 'mouse-face
1784 :button-face 'custom-link 1817 :button-face 'custom-link
1785 :mouse-face 'highlight 1818 :mouse-face 'highlight
1786 :pressed-face 'highlight 1819 :pressed-face 'highlight
@@ -3673,6 +3706,8 @@ restoring it to the state of a face that has never been customized."
3673 :mouse-face 'highlight 3706 :mouse-face 'highlight
3674 :pressed-face 'highlight 3707 :pressed-face 'highlight
3675 :help-echo "Create customization buffer for this group." 3708 :help-echo "Create customization buffer for this group."
3709 :keymap custom-mode-link-map
3710 :follow-link 'mouse-face
3676 :action 'custom-group-link-action) 3711 :action 'custom-group-link-action)
3677 3712
3678(defun custom-group-link-action (widget &rest ignore) 3713(defun custom-group-link-action (widget &rest ignore)
@@ -4451,25 +4486,6 @@ The format is suitable for use with `easy-menu-define'."
4451 4486
4452;;; The Custom Mode. 4487;;; The Custom Mode.
4453 4488
4454(defvar custom-mode-map
4455 ;; This keymap should be dense, but a dense keymap would prevent inheriting
4456 ;; "\r" bindings from the parent map.
4457 ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
4458 (let ((map (make-keymap)))
4459 (set-keymap-parent map widget-keymap)
4460 (define-key map [remap self-insert-command] 'Custom-no-edit)
4461 (define-key map "\^m" 'Custom-newline)
4462 (define-key map " " 'scroll-up)
4463 (define-key map "\177" 'scroll-down)
4464 (define-key map "\C-c\C-c" 'Custom-set)
4465 (define-key map "\C-x\C-s" 'Custom-save)
4466 (define-key map "q" 'Custom-buffer-done)
4467 (define-key map "u" 'Custom-goto-parent)
4468 (define-key map "n" 'widget-forward)
4469 (define-key map "p" 'widget-backward)
4470 map)
4471 "Keymap for `custom-mode'.")
4472
4473(defun Custom-no-edit (pos &optional event) 4489(defun Custom-no-edit (pos &optional event)
4474 "Invoke button at POS, or refuse to allow editing of Custom buffer." 4490 "Invoke button at POS, or refuse to allow editing of Custom buffer."
4475 (interactive "@d") 4491 (interactive "@d")