From 451de77a8acf4e9d12e832fe16afe0716e820569 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 21 Jun 1997 05:02:47 +0000 Subject: [PATCH] (customize-menu-create): Return nil if Emacs. (custom-mode): Handle custom-mode-customize-menu being nil. (custom-mode-customize-menu): Don't initialize if customize-menu-create returns nil. --- lisp/cus-edit.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 16149ec680c..4f81e74d287 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2682,9 +2682,7 @@ The format is suitable for use with `easy-menu-define'." ;; We can delay it under XEmacs. `(,name :filter (lambda (&rest junk) - (cdr (custom-menu-create ',symbol)))) - ;; But we must create it now under Emacs. - (cons name (cdr (custom-menu-create symbol))))) + (cdr (custom-menu-create ',symbol)))))) ;;; The Custom Mode. @@ -2697,10 +2695,15 @@ The format is suitable for use with `easy-menu-define'." (suppress-keymap custom-mode-map) (define-key custom-mode-map "q" 'bury-buffer)) -(easy-menu-define custom-mode-customize-menu - custom-mode-map - "Menu used to customize customization buffers." - (customize-menu-create 'customize)) +(defvar custom-mode-customize-menu) +(let ((menu (customize-menu-create 'customize))) + ;; In Emacs, this returns nil, so don't make this menu. + (if menu + (easy-menu-define custom-mode-customize-menu + custom-mode-map + "Menu used to customize customization buffers." + menu) + (setq custom-mode-customize-menu nil))) (easy-menu-define custom-mode-menu custom-mode-map @@ -2739,7 +2742,8 @@ if that value is non-nil." (setq major-mode 'custom-mode mode-name "Custom") (use-local-map custom-mode-map) - (easy-menu-add custom-mode-customize-menu) + (if custom-mode-customize-menu + (easy-menu-add custom-mode-customize-menu)) (easy-menu-add custom-mode-menu) (make-local-variable 'custom-options) (run-hooks 'custom-mode-hook)) -- 2.39.2