aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/custom.el40
1 files changed, 20 insertions, 20 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 664ffb5405f..2632d8a6ac3 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -231,7 +231,7 @@ The following keywords are meaningful:
231 in customization menus and buffers. 231 in customization menus and buffers.
232:load FILE 232:load FILE
233 Load file FILE (a string) before displaying this customization 233 Load file FILE (a string) before displaying this customization
234 item. Loading is done with `load-library', and only if the file is 234 item. Loading is done with `load', and only if the file is
235 not already loaded. 235 not already loaded.
236:set-after VARIABLE 236:set-after VARIABLE
237 Specifies that SYMBOL should be set after VARIABLE when 237 Specifies that SYMBOL should be set after VARIABLE when
@@ -379,6 +379,17 @@ If there already is an entry for OPTION and WIDGET, nothing is done."
379 (unless (member entry members) 379 (unless (member entry members)
380 (put group 'custom-group (nconc members (list entry)))))) 380 (put group 'custom-group (nconc members (list entry))))))
381 381
382(defun custom-group-of-mode (mode)
383 "Return the custom group corresponding to the major or minor MODE.
384If no such group is found, return nil."
385 (or (get mode 'custom-mode-group)
386 (if (or (get mode 'custom-group)
387 (and (string-match "-mode\\'" (symbol-name mode))
388 (get (setq mode (intern (substring (symbol-name mode)
389 0 (match-beginning 0))))
390 'custom-group)))
391 mode)))
392
382;;; Properties. 393;;; Properties.
383 394
384(defun custom-handle-all-keywords (symbol args type) 395(defun custom-handle-all-keywords (symbol args type)
@@ -472,38 +483,27 @@ LOAD should be either a library file name, or a feature name."
472(defun custom-load-symbol (symbol) 483(defun custom-load-symbol (symbol)
473 "Load all dependencies for SYMBOL." 484 "Load all dependencies for SYMBOL."
474 (unless custom-load-recursion 485 (unless custom-load-recursion
475 (let ((custom-load-recursion t) 486 (let ((custom-load-recursion t))
476 (loads (get symbol 'custom-loads)) 487 (dolist (load (get symbol 'custom-loads))
477 load) 488 (cond ((symbolp load) (condition-case nil (require load) (error nil)))
478 (while loads 489 ;; This is subsumed by the test below, but it's much faster.
479 (setq load (car loads)
480 loads (cdr loads))
481 (cond ((symbolp load)
482 (condition-case nil
483 (require load)
484 (error nil)))
485 ;; Don't reload a file already loaded.
486 ((and (boundp 'preloaded-file-list)
487 (member load preloaded-file-list)))
488 ((assoc load load-history)) 490 ((assoc load load-history))
489 ;; This was just (assoc (locate-library load) load-history) 491 ;; This was just (assoc (locate-library load) load-history)
490 ;; but has been optimized not to load locate-library 492 ;; but has been optimized not to load locate-library
491 ;; if not necessary. 493 ;; if not necessary.
492 ((let (found (regexp (regexp-quote load))) 494 ((let ((regexp (concat "\\(\\`\\|/\\)" (regexp-quote load)
495 "\\(\\'\\|\\.\\)"))
496 (found nil))
493 (dolist (loaded load-history) 497 (dolist (loaded load-history)
494 (and (stringp (car loaded)) 498 (and (stringp (car loaded))
495 (string-match regexp (car loaded)) 499 (string-match regexp (car loaded))
496 (eq (locate-library load) (car loaded))
497 (setq found t))) 500 (setq found t)))
498 found)) 501 found))
499 ;; Without this, we would load cus-edit recursively. 502 ;; Without this, we would load cus-edit recursively.
500 ;; We are still loading it when we call this, 503 ;; We are still loading it when we call this,
501 ;; and it is not in load-history yet. 504 ;; and it is not in load-history yet.
502 ((equal load "cus-edit")) 505 ((equal load "cus-edit"))
503 (t 506 (t (condition-case nil (load load) (error nil))))))))
504 (condition-case nil
505 (load-library load)
506 (error nil))))))))
507 507
508;;; Initializing. 508;;; Initializing.
509 509