Mercurial > hg > xemacs-beta
comparison lisp/custom/cus-edit.el @ 34:d620409f5eb8 r19-15b100
Import from CVS: tag r19-15b100
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:53:20 +0200 |
parents | e04119814345 |
children | c53a95d3c46d |
comparison
equal
deleted
inserted
replaced
33:9ee3cade837d | 34:d620409f5eb8 |
---|---|
2 ;; | 2 ;; |
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. |
4 ;; | 4 ;; |
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | 5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> |
6 ;; Keywords: help, faces | 6 ;; Keywords: help, faces |
7 ;; Version: 1.63 | 7 ;; Version: 1.64 |
8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ | 8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ |
9 | 9 |
10 ;;; Commentary: | 10 ;;; Commentary: |
11 ;; | 11 ;; |
12 ;; See `custom.el'. | 12 ;; See `custom.el'. |
1801 `(custom-buffer-create | 1801 `(custom-buffer-create |
1802 '((,symbol custom-variable))) | 1802 '((,symbol custom-variable))) |
1803 ':style 'toggle | 1803 ':style 'toggle |
1804 ':selected symbol))) | 1804 ':selected symbol))) |
1805 | 1805 |
1806 (defun custom-group-menu-create (widget symbol) | 1806 (if (string-match "XEmacs" emacs-version) |
1807 "Ignoring WIDGET, create a menu entry for customization group SYMBOL." | 1807 ;; XEmacs can create menus dynamically. |
1808 (custom-menu-create symbol)) | 1808 (defun custom-group-menu-create (widget symbol) |
1809 "Ignoring WIDGET, create a menu entry for customization group SYMBOL." | |
1810 `( ,(custom-unlispify-menu-entry symbol t) | |
1811 :filter (lambda (&rest junk) | |
1812 (cdr (custom-menu-create ',symbol))))) | |
1813 ;; But emacs can't. | |
1814 (defun custom-group-menu-create (widget symbol) | |
1815 "Ignoring WIDGET, create a menu entry for customization group SYMBOL." | |
1816 ;; Limit the nesting. | |
1817 (let ((custom-menu-nesting (1- custom-menu-nesting))) | |
1818 (custom-menu-create symbol)))) | |
1809 | 1819 |
1810 (defun custom-menu-create (symbol &optional name) | 1820 (defun custom-menu-create (symbol &optional name) |
1811 "Create menu for customization group SYMBOL. | 1821 "Create menu for customization group SYMBOL. |
1812 If optional NAME is given, use that as the name of the menu. | 1822 If optional NAME is given, use that as the name of the menu. |
1813 Otherwise make up a name from SYMBOL. | 1823 Otherwise make up a name from SYMBOL. |
1815 (unless name | 1825 (unless name |
1816 (setq name (custom-unlispify-menu-entry symbol))) | 1826 (setq name (custom-unlispify-menu-entry symbol))) |
1817 (let ((item (vector name | 1827 (let ((item (vector name |
1818 `(custom-buffer-create '((,symbol custom-group))) | 1828 `(custom-buffer-create '((,symbol custom-group))) |
1819 t))) | 1829 t))) |
1820 (if (and (> custom-menu-nesting 0) | 1830 (if (and (>= custom-menu-nesting 0) |
1821 (< (length (get symbol 'custom-group)) widget-menu-max-size)) | 1831 (< (length (get symbol 'custom-group)) widget-menu-max-size)) |
1822 (let ((custom-menu-nesting (1- custom-menu-nesting)) | 1832 (let ((custom-prefix-list (custom-prefix-add symbol |
1823 (custom-prefix-list (custom-prefix-add symbol | |
1824 custom-prefix-list))) | 1833 custom-prefix-list))) |
1825 (custom-load-symbol symbol) | 1834 (custom-load-symbol symbol) |
1826 `(,(custom-unlispify-menu-entry symbol t) | 1835 `(,(custom-unlispify-menu-entry symbol t) |
1827 ,item | 1836 ,item |
1828 "--" | 1837 "--" |
1839 "Update customize menu." | 1848 "Update customize menu." |
1840 (interactive "e") | 1849 (interactive "e") |
1841 (add-hook 'custom-define-hook 'custom-menu-reset) | 1850 (add-hook 'custom-define-hook 'custom-menu-reset) |
1842 (let* ((emacs (widget-apply '(custom-group) :custom-menu 'emacs)) | 1851 (let* ((emacs (widget-apply '(custom-group) :custom-menu 'emacs)) |
1843 (menu `(,(car custom-help-menu) | 1852 (menu `(,(car custom-help-menu) |
1844 ,emacs | 1853 ,emacs |
1845 ,@(cdr (cdr custom-help-menu))))) | 1854 ,@(cdr (cdr custom-help-menu))))) |
1846 (if (fboundp 'add-submenu) | 1855 (let ((map (easy-menu-create-keymaps (car menu) (cdr menu)))) |
1847 (progn | 1856 (define-key global-map [menu-bar help-menu customize-menu] |
1848 (add-submenu '("Options") menu) | 1857 (cons (car menu) map))))) |
1849 (cdr emacs)) | |
1850 (let ((map (easy-menu-create-keymaps (car menu) (cdr menu)))) | |
1851 (define-key global-map [menu-bar help-menu customize-menu] | |
1852 (cons (car menu) map)) | |
1853 (when (fboundp 'x-popup-menu) | |
1854 (x-popup-menu event map)))))) | |
1855 | 1858 |
1856 ;;; Dependencies. | 1859 ;;; Dependencies. |
1857 | 1860 |
1858 ;;;###autoload | 1861 ;;;###autoload |
1859 (defun custom-make-dependencies () | 1862 (defun custom-make-dependencies () |