aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-06-21 04:54:54 +0000
committerRichard M. Stallman1997-06-21 04:54:54 +0000
commit241d3080a12c7aafec6093feb7fd27c3dd7f1d03 (patch)
treec4a4472c63be23c3db48b2bdd3cadf8dcc2719bd
parent7baf84a2e11688c41c38ba7d0e1bceb65821e932 (diff)
downloademacs-241d3080a12c7aafec6093feb7fd27c3dd7f1d03.tar.gz
emacs-241d3080a12c7aafec6093feb7fd27c3dd7f1d03.zip
(custom-nest-groups): New variable.
(custom-group): Don't insert a space before the group name here. (customize-group): If buffer exists, use it unchanged. (custom-format-handler) <L>: Maybe make a group-link widget instead of a group-visibility widget. custom-nest-groups controls this. <l, i, e>: Indent differently if custom-nest-groups.
-rw-r--r--lisp/cus-edit.el59
1 files changed, 42 insertions, 17 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index aff22f88302..16149ec680c 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -748,9 +748,12 @@ are shown; the contents of those subgroups are initially hidden."
748 (if (string-equal "" group) 748 (if (string-equal "" group)
749 (setq group 'emacs) 749 (setq group 'emacs)
750 (setq group (intern group)))) 750 (setq group (intern group))))
751 (custom-buffer-create (list (list group 'custom-group)) 751 (let ((name (format "*Customize Group: %s*"
752 (format "*Customize Group: %s*" 752 (custom-unlispify-tag-name group))))
753 (custom-unlispify-tag-name group)))) 753 (if (get-buffer name)
754 (switch-to-buffer name)
755 (custom-buffer-create (list (list group 'custom-group))
756 name))))
754 757
755;;;###autoload 758;;;###autoload
756(defun customize-group-other-window (symbol) 759(defun customize-group-other-window (symbol)
@@ -1324,6 +1327,13 @@ and `face'."
1324 :validate 'widget-children-validate 1327 :validate 'widget-children-validate
1325 :match (lambda (widget value) (symbolp value))) 1328 :match (lambda (widget value) (symbolp value)))
1326 1329
1330(defcustom custom-nest-groups nil
1331 "*Non-nil means display nested groups in one customization buffer.
1332A valoe of nil means show a subgroup in its own buffer
1333rather than including it within its parent's customization buffer."
1334 :type 'boolean
1335 :group 'custom-buffer)
1336
1327(defun custom-convert-widget (widget) 1337(defun custom-convert-widget (widget)
1328 ;; Initialize :value and :tag from :args in WIDGET. 1338 ;; Initialize :value and :tag from :args in WIDGET.
1329 (let ((args (widget-get widget :args))) 1339 (let ((args (widget-get widget :args)))
@@ -1341,15 +1351,19 @@ and `face'."
1341 (level (widget-get widget :custom-level)) 1351 (level (widget-get widget :custom-level))
1342 (category (widget-get widget :custom-category))) 1352 (category (widget-get widget :custom-category)))
1343 (cond ((eq escape ?l) 1353 (cond ((eq escape ?l)
1344 (when level 1354 (if custom-nest-groups
1345 (insert-char ?\ (* 3 (1- level))) 1355 (when level
1346 (if (eq state 'hidden) 1356 (insert-char ?\ (* 3 (1- level)))
1347 (insert "--") 1357 (if (eq state 'hidden)
1348 (insert "/-")))) 1358 (insert "-- ")
1359 (insert "/- ")))
1360 (unless (and level (> level 1))
1361 (insert "/- "))))
1349 ((eq escape ?e) 1362 ((eq escape ?e)
1350 (when (and level (not (eq state 'hidden))) 1363 (when (and level (not (eq state 'hidden)))
1351 (insert "\n") 1364 (insert "\n")
1352 (insert-char ?\ (* 3 (1- level))) 1365 (if custom-nest-groups
1366 (insert-char ?\ (* 3 (1- level))))
1353 (insert "\\-") 1367 (insert "\\-")
1354 (insert " " (widget-get widget :tag) " group end ") 1368 (insert " " (widget-get widget :tag) " group end ")
1355 (insert-char ?- (- 75 (current-column) level)) 1369 (insert-char ?- (- 75 (current-column) level))
@@ -1361,14 +1375,25 @@ and `face'."
1361 (insert-char ?- (- (+ 75 1) (current-column) level)) 1375 (insert-char ?- (- (+ 75 1) (current-column) level))
1362 (insert "\\"))) 1376 (insert "\\")))
1363 ((eq escape ?i) 1377 ((eq escape ?i)
1364 (insert-char ?\ (* 3 level))) 1378 (if custom-nest-groups
1379 (insert-char ?\ (* 3 level))
1380 (unless (and level (> level 1))
1381 (insert " "))))
1365 ((eq escape ?L) 1382 ((eq escape ?L)
1366 (push (widget-create-child-and-convert 1383 (if custom-nest-groups
1367 widget 'group-visibility 1384 (push (widget-create-child-and-convert
1368 :help-echo "Show or hide this group." 1385 widget 'group-visibility
1369 :action 'custom-toggle-parent 1386 :help-echo "Show or hide this group."
1370 (not (eq state 'hidden))) 1387 :action 'custom-toggle-parent
1371 buttons)) 1388 (not (eq state 'hidden)))
1389 buttons)
1390 (push (widget-create-child-and-convert
1391 widget 'group-link
1392 :help-echo "Select the contents of this group."
1393 :value (widget-get widget :value)
1394 :tag "Switch to Group"
1395 (not (eq state 'hidden)))
1396 buttons)))
1372 ((eq escape ?m) 1397 ((eq escape ?m)
1373 (and (eq (preceding-char) ?\n) 1398 (and (eq (preceding-char) ?\n)
1374 (widget-get widget :indent) 1399 (widget-get widget :indent)
@@ -2255,7 +2280,7 @@ and so forth. The remaining group tags are shown with
2255 2280
2256(define-widget 'custom-group 'custom 2281(define-widget 'custom-group 'custom
2257 "Customize group." 2282 "Customize group."
2258 :format "%l %{%t%} group: %L %-\n%m%i%h%a%v%e" 2283 :format "%l%{%t%} group: %L %-\n%m%i%h%a%v%e"
2259 :sample-face-get 'custom-group-sample-face-get 2284 :sample-face-get 'custom-group-sample-face-get
2260 :documentation-property 'group-documentation 2285 :documentation-property 'group-documentation
2261 :help-echo "Set or reset all members of this group." 2286 :help-echo "Set or reset all members of this group."