comparison lisp/custom.el @ 26582:fbd1f4d3000d

(custom-declare-group): Purecopy DOC. (custom-handle-keyword): Purecopy VALUE. (custom-add-link): Purecopy WIDGET. (custom-add-version): Purecopy VERSION. (custom-add-load): Purecopy LOAD.
author Dave Love <fx@gnu.org>
date Wed, 24 Nov 1999 20:29:55 +0000
parents 7144668076c7
children ddaafb816c3e
comparison
equal deleted inserted replaced
26581:b679911f6f28 26582:fbd1f4d3000d
1 ;;; custom.el -- Tools for declaring and initializing options. 1 ;;; custom.el -- Tools for declaring and initializing options.
2 ;; 2 ;;
3 ;; Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. 3 ;; Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
4 ;; 4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Maintainer: FSF
6 ;; Keywords: help, faces 7 ;; Keywords: help, faces
7 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ (probably obsolete) 8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ (probably obsolete)
8 9
9 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
10 11
262 (while members 263 (while members
263 (apply 'custom-add-to-group symbol (car members)) 264 (apply 'custom-add-to-group symbol (car members))
264 (setq members (cdr members))) 265 (setq members (cdr members)))
265 (put symbol 'custom-group (nconc members (get symbol 'custom-group))) 266 (put symbol 'custom-group (nconc members (get symbol 'custom-group)))
266 (when doc 267 (when doc
267 (put symbol 'group-documentation doc)) 268 ;; This text doesn't get into DOC.
269 (put symbol 'group-documentation (purecopy doc)))
268 (while args 270 (while args
269 (let ((arg (car args))) 271 (let ((arg (car args)))
270 (setq args (cdr args)) 272 (setq args (cdr args))
271 (unless (symbolp arg) 273 (unless (symbolp arg)
272 (error "Junk in args %S" args)) 274 (error "Junk in args %S" args))
337 (custom-handle-keyword symbol keyword value type))))) 339 (custom-handle-keyword symbol keyword value type)))))
338 340
339 (defun custom-handle-keyword (symbol keyword value type) 341 (defun custom-handle-keyword (symbol keyword value type)
340 "For customization option SYMBOL, handle KEYWORD with VALUE. 342 "For customization option SYMBOL, handle KEYWORD with VALUE.
341 Fourth argument TYPE is the custom option type." 343 Fourth argument TYPE is the custom option type."
344 (if purify-flag
345 (setq value (purecopy value)))
342 (cond ((eq keyword :group) 346 (cond ((eq keyword :group)
343 (custom-add-to-group value symbol type)) 347 (custom-add-to-group value symbol type))
344 ((eq keyword :version) 348 ((eq keyword :version)
345 (custom-add-version symbol value)) 349 (custom-add-version symbol value))
346 ((eq keyword :link) 350 ((eq keyword :link)
363 367
364 (defun custom-add-link (symbol widget) 368 (defun custom-add-link (symbol widget)
365 "To the custom option SYMBOL add the link WIDGET." 369 "To the custom option SYMBOL add the link WIDGET."
366 (let ((links (get symbol 'custom-links))) 370 (let ((links (get symbol 'custom-links)))
367 (unless (member widget links) 371 (unless (member widget links)
368 (put symbol 'custom-links (cons widget links))))) 372 (put symbol 'custom-links (cons (purecopy widget) links)))))
369 373
370 (defun custom-add-version (symbol version) 374 (defun custom-add-version (symbol version)
371 "To the custom option SYMBOL add the version VERSION." 375 "To the custom option SYMBOL add the version VERSION."
372 (put symbol 'custom-version version)) 376 (put symbol 'custom-version (purecopy version)))
373 377
374 (defun custom-add-load (symbol load) 378 (defun custom-add-load (symbol load)
375 "To the custom option SYMBOL add the dependency LOAD. 379 "To the custom option SYMBOL add the dependency LOAD.
376 LOAD should be either a library file name, or a feature name." 380 LOAD should be either a library file name, or a feature name."
377 (let ((loads (get symbol 'custom-loads))) 381 (let ((loads (get symbol 'custom-loads)))
378 (unless (member load loads) 382 (unless (member load loads)
379 (put symbol 'custom-loads (cons load loads))))) 383 (put symbol 'custom-loads (cons (purecopy load) loads)))))
380 384
381 ;;; Initializing. 385 ;;; Initializing.
382 386
383 (defvar custom-local-buffer nil 387 (defvar custom-local-buffer nil
384 "Non-nil, in a Customization buffer, means customize a specific buffer. 388 "Non-nil, in a Customization buffer, means customize a specific buffer.