comparison lisp/cus-edit.el @ 5645:5d3bb1100832

Remove some utility functions from the global namespace, lisp/ lisp/ChangeLog addition: 2012-04-07 Aidan Kehoe <kehoea@parhasard.net> Remove some utility functions from the global namespace, it's more appropriate to have them as labels (that is, lexically-visible functions.) * behavior.el: * behavior.el (behavior-menu-filter-1): Moved to being a label. * behavior.el (behavior-menu-filter): Use the label. * cus-edit.el (custom-load-symbol-1): Moved to being a label. * cus-edit.el (custom-load-symbol): Use the label. * menubar.el (find-menu-item-1): Moved to being a label. * menubar.el (find-menu-item): Use the label. * window-xemacs.el: * window-xemacs.el (display-buffer-1): Moved to being a label. * window-xemacs.el (display-buffer): Use the label; use (block ...) instead of (catch ...), use prog1 instead of needlessly binding a variable.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 07 Apr 2012 21:57:31 +0100
parents 4dee0387b9de
children cc6f0266bc36
comparison
equal deleted inserted replaced
5644:0df3cedee9ac 5645:5d3bb1100832
1682 (defvar custom-load-recursion nil 1682 (defvar custom-load-recursion nil
1683 "Hack to avoid recursive dependencies.") 1683 "Hack to avoid recursive dependencies.")
1684 1684
1685 (defun custom-load-symbol (symbol) 1685 (defun custom-load-symbol (symbol)
1686 "Load all dependencies for SYMBOL." 1686 "Load all dependencies for SYMBOL."
1687 (unless custom-load-recursion 1687 (labels
1688 (let ((custom-load-recursion t) 1688 ((custom-load-symbol-1 (load)
1689 (loads (get symbol 'custom-loads)) 1689 (cond ((symbolp load)
1690 load) 1690 (condition-case nil
1691 (while loads 1691 (require load)
1692 (setq load (car loads) 1692 (error nil)))
1693 loads (cdr loads)) 1693 ;; Don't reload a file already loaded.
1694 (custom-load-symbol-1 load))))) 1694 ((and (boundp 'preloaded-file-list)
1695 1695 (member load preloaded-file-list)))
1696 (defun custom-load-symbol-1 (load) 1696 ((assoc load load-history))
1697 (cond ((symbolp load) 1697 ((assoc (locate-library load) load-history))
1698 (condition-case nil 1698 (t
1699 (require load) 1699 (condition-case nil
1700 (error nil))) 1700 ;; Without this, we would load cus-edit recursively.
1701 ;; Don't reload a file already loaded. 1701 ;; We are still loading it when we call this,
1702 ((and (boundp 'preloaded-file-list) 1702 ;; and it is not in load-history yet.
1703 (member load preloaded-file-list))) 1703 (or (equal load "cus-edit")
1704 ((assoc load load-history)) 1704 (load-library load))
1705 ((assoc (locate-library load) load-history)) 1705 (error nil))))))
1706 (t 1706 (unless custom-load-recursion
1707 (condition-case nil 1707 (let ((custom-load-recursion t))
1708 ;; Without this, we would load cus-edit recursively. 1708 (map nil #'custom-load-symbol-1 (get symbol 'custom-loads))))))
1709 ;; We are still loading it when we call this,
1710 ;; and it is not in load-history yet.
1711 (or (equal load "cus-edit")
1712 (load-library load))
1713 (error nil)))))
1714 1709
1715 (defvar custom-already-loaded-custom-defines nil 1710 (defvar custom-already-loaded-custom-defines nil
1716 "List of already-loaded `custom-defines' files.") 1711 "List of already-loaded `custom-defines' files.")
1717 (defvar custom-define-current-source-file nil) 1712 (defvar custom-define-current-source-file nil)
1718 (defvar custom-warn-when-reloading-necessary nil 1713 (defvar custom-warn-when-reloading-necessary nil