1993-04-16 23:43:57 +00:00
|
|
|
;;; loadhist.el --- lisp functions for working with feature groups
|
1996-01-14 07:34:30 +00:00
|
|
|
|
2016-01-01 09:16:19 +00:00
|
|
|
;; Copyright (C) 1995, 1998, 2000-2016 Free Software Foundation, Inc.
|
1993-04-16 23:43:57 +00:00
|
|
|
|
|
|
|
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
|
2014-02-10 01:34:22 +00:00
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
1993-04-16 23:43:57 +00:00
|
|
|
;; Keywords: internal
|
|
|
|
|
1995-04-08 02:24:20 +00:00
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1995-04-08 02:24:20 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 08:06:51 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
1995-04-08 02:24:20 +00:00
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2008-05-06 08:06:51 +00:00
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
1995-04-08 02:24:20 +00:00
|
|
|
|
1993-04-16 23:43:57 +00:00
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; These functions exploit the load-history system variable.
|
1998-06-13 01:38:33 +00:00
|
|
|
;; Entry points include `unload-feature', `symbol-file', and
|
|
|
|
;; `feature-file', documented in the Emacs Lisp manual.
|
1993-04-16 23:43:57 +00:00
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(defun feature-symbols (feature)
|
2002-08-24 03:00:29 +00:00
|
|
|
"Return the file and list of definitions associated with FEATURE.
|
|
|
|
The value is actually the element of `load-history'
|
|
|
|
for the file that did (provide FEATURE)."
|
2007-10-17 23:05:54 +00:00
|
|
|
(catch 'foundit
|
|
|
|
(let ((element (cons 'provide feature)))
|
|
|
|
(dolist (x load-history nil)
|
|
|
|
(when (member element (cdr x))
|
|
|
|
(throw 'foundit x))))))
|
1993-04-16 23:43:57 +00:00
|
|
|
|
|
|
|
(defun feature-file (feature)
|
|
|
|
"Return the file name from which a given FEATURE was loaded.
|
|
|
|
Actually, return the load argument, if any; this is sometimes the name of a
|
2000-05-22 19:35:34 +00:00
|
|
|
Lisp file without an extension. If the feature came from an `eval-buffer' on
|
|
|
|
a buffer with no associated file, or an `eval-region', return nil."
|
1993-04-16 23:43:57 +00:00
|
|
|
(if (not (featurep feature))
|
2000-05-22 19:35:34 +00:00
|
|
|
(error "%S is not a currently loaded feature" feature)
|
1993-04-16 23:43:57 +00:00
|
|
|
(car (feature-symbols feature))))
|
|
|
|
|
2005-01-02 23:43:51 +00:00
|
|
|
(defun file-loadhist-lookup (file)
|
2005-10-21 17:19:10 +00:00
|
|
|
"Return the `load-history' element for FILE.
|
|
|
|
FILE can be a file name, or a library name.
|
|
|
|
A library name is equivalent to the file name that `load-library' would load."
|
2005-01-02 23:43:51 +00:00
|
|
|
;; First look for FILE as given.
|
|
|
|
(let ((symbols (assoc file load-history)))
|
|
|
|
;; Try converting a library name to an absolute file name.
|
|
|
|
(and (null symbols)
|
2006-02-27 01:54:42 +00:00
|
|
|
(let ((absname
|
|
|
|
(locate-file file load-path (get-load-suffixes))))
|
2005-10-21 17:19:10 +00:00
|
|
|
(and absname (not (equal absname file))
|
|
|
|
(setq symbols (cdr (assoc absname load-history))))))
|
2005-01-02 23:43:51 +00:00
|
|
|
symbols))
|
|
|
|
|
1993-04-16 23:43:57 +00:00
|
|
|
(defun file-provides (file)
|
2005-10-21 17:19:10 +00:00
|
|
|
"Return the list of features provided by FILE as it was loaded.
|
|
|
|
FILE can be a file name, or a library name.
|
|
|
|
A library name is equivalent to the file name that `load-library' would load."
|
2007-10-17 23:05:54 +00:00
|
|
|
(let (provides)
|
|
|
|
(dolist (x (file-loadhist-lookup file) provides)
|
|
|
|
(when (eq (car-safe x) 'provide)
|
2008-01-25 22:50:33 +00:00
|
|
|
(push (cdr x) provides)))))
|
1993-04-16 23:43:57 +00:00
|
|
|
|
|
|
|
(defun file-requires (file)
|
2005-10-21 17:19:10 +00:00
|
|
|
"Return the list of features required by FILE as it was loaded.
|
|
|
|
FILE can be a file name, or a library name.
|
|
|
|
A library name is equivalent to the file name that `load-library' would load."
|
2007-10-17 23:05:54 +00:00
|
|
|
(let (requires)
|
|
|
|
(dolist (x (file-loadhist-lookup file) requires)
|
|
|
|
(when (eq (car-safe x) 'require)
|
2008-01-25 22:50:33 +00:00
|
|
|
(push (cdr x) requires)))))
|
2000-05-22 19:35:34 +00:00
|
|
|
|
|
|
|
(defsubst file-set-intersect (p q)
|
|
|
|
"Return the set intersection of two lists."
|
2007-10-17 23:05:54 +00:00
|
|
|
(let (ret)
|
2000-05-22 19:35:34 +00:00
|
|
|
(dolist (x p ret)
|
2007-10-17 23:05:54 +00:00
|
|
|
(when (memq x q) (push x ret)))))
|
1993-04-16 23:43:57 +00:00
|
|
|
|
|
|
|
(defun file-dependents (file)
|
1995-01-20 23:13:51 +00:00
|
|
|
"Return the list of loaded libraries that depend on FILE.
|
2005-10-21 17:19:10 +00:00
|
|
|
This can include FILE itself.
|
|
|
|
FILE can be a file name, or a library name.
|
|
|
|
A library name is equivalent to the file name that `load-library' would load."
|
2000-05-22 19:35:34 +00:00
|
|
|
(let ((provides (file-provides file))
|
|
|
|
(dependents nil))
|
|
|
|
(dolist (x load-history dependents)
|
2007-10-17 23:05:54 +00:00
|
|
|
(when (file-set-intersect provides (file-requires (car x)))
|
|
|
|
(push (car x) dependents)))))
|
1993-04-16 23:43:57 +00:00
|
|
|
|
2007-04-06 17:03:19 +00:00
|
|
|
(defun read-feature (prompt &optional loaded-p)
|
|
|
|
"Read feature name from the minibuffer, prompting with string PROMPT.
|
|
|
|
If optional second arg LOADED-P is non-nil, the feature must be loaded
|
|
|
|
from a file."
|
2015-08-12 18:12:14 +00:00
|
|
|
(intern (completing-read
|
|
|
|
prompt
|
|
|
|
(mapcar #'symbol-name
|
|
|
|
(if loaded-p
|
|
|
|
(delq nil
|
|
|
|
(mapcar
|
|
|
|
(lambda (x) (and (feature-file x) x))
|
|
|
|
features))
|
|
|
|
features)))))
|
1996-09-12 18:31:16 +00:00
|
|
|
|
2003-10-05 13:50:18 +00:00
|
|
|
(defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)
|
|
|
|
(defvar unload-feature-special-hooks
|
2007-10-17 23:05:54 +00:00
|
|
|
'(after-change-functions after-insert-file-functions
|
2011-07-11 16:31:09 +00:00
|
|
|
after-make-frame-functions auto-coding-functions
|
|
|
|
auto-fill-function before-change-functions
|
2008-09-07 20:33:49 +00:00
|
|
|
blink-paren-function buffer-access-fontify-functions
|
2011-07-11 16:31:09 +00:00
|
|
|
choose-completion-string-functions
|
|
|
|
comint-output-filter-functions command-line-functions
|
|
|
|
comment-indent-function compilation-finish-functions
|
2011-06-08 07:17:26 +00:00
|
|
|
delete-frame-functions disabled-command-function
|
2011-07-11 16:31:09 +00:00
|
|
|
fill-nobreak-predicate find-directory-functions
|
|
|
|
find-file-not-found-functions
|
|
|
|
font-lock-fontify-buffer-function
|
|
|
|
font-lock-fontify-region-function
|
|
|
|
font-lock-mark-block-function
|
|
|
|
font-lock-syntactic-face-function
|
|
|
|
font-lock-unfontify-buffer-function
|
|
|
|
font-lock-unfontify-region-function
|
|
|
|
kill-buffer-query-functions kill-emacs-query-functions
|
|
|
|
lisp-indent-function mouse-position-function
|
2011-11-20 07:30:16 +00:00
|
|
|
redisplay-end-trigger-functions suspend-tty-functions
|
2011-07-11 16:31:09 +00:00
|
|
|
temp-buffer-show-function window-scroll-functions
|
|
|
|
window-size-change-functions write-contents-functions
|
|
|
|
write-file-functions write-region-annotate-functions)
|
2000-10-31 12:02:51 +00:00
|
|
|
"A list of special hooks from Info node `(elisp)Standard Hooks'.
|
1998-06-13 01:38:33 +00:00
|
|
|
|
2007-10-24 08:12:40 +00:00
|
|
|
These are symbols with hooklike values whose names don't end in
|
|
|
|
`-hook' or `-hooks', from which `unload-feature' should try to remove
|
1998-06-13 01:38:33 +00:00
|
|
|
pertinent symbols.")
|
|
|
|
|
2012-05-13 03:05:06 +00:00
|
|
|
(define-obsolete-variable-alias 'unload-hook-features-list
|
|
|
|
'unload-function-defs-list "22.2")
|
2007-10-24 08:12:40 +00:00
|
|
|
(defvar unload-function-defs-list nil
|
2011-11-17 09:09:20 +00:00
|
|
|
"List of definitions in the Lisp library being unloaded.
|
2004-02-16 17:50:32 +00:00
|
|
|
|
2007-10-24 08:12:40 +00:00
|
|
|
This is meant to be used by `FEATURE-unload-function'; see the
|
2004-02-16 17:50:32 +00:00
|
|
|
documentation of `unload-feature' for details.")
|
|
|
|
|
2011-06-25 17:42:18 +00:00
|
|
|
(defun unload--set-major-mode ()
|
|
|
|
(save-current-buffer
|
|
|
|
(dolist (buffer (buffer-list))
|
|
|
|
(set-buffer buffer)
|
|
|
|
(let ((proposed major-mode))
|
2011-12-15 22:14:12 +00:00
|
|
|
;; Look for a predecessor mode not defined in the feature we're processing
|
2011-06-25 17:42:18 +00:00
|
|
|
(while (and proposed (rassq proposed unload-function-defs-list))
|
|
|
|
(setq proposed (get proposed 'derived-mode-parent)))
|
|
|
|
(unless (eq proposed major-mode)
|
|
|
|
;; Two cases: either proposed is nil, and we want to switch to fundamental
|
|
|
|
;; mode, or proposed is not nil and not major-mode, and so we use it.
|
|
|
|
(funcall (or proposed 'fundamental-mode)))))))
|
|
|
|
|
1993-04-16 23:43:57 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun unload-feature (feature &optional force)
|
2007-10-24 08:12:40 +00:00
|
|
|
"Unload the library that provided FEATURE.
|
2000-05-26 11:06:05 +00:00
|
|
|
If the feature is required by any other loaded code, and prefix arg FORCE
|
2004-02-16 17:39:38 +00:00
|
|
|
is nil, raise an error.
|
|
|
|
|
2007-10-24 08:12:40 +00:00
|
|
|
Standard unloading activities include restoring old autoloads for
|
|
|
|
functions defined by the library, undoing any additions that the
|
|
|
|
library has made to hook variables or to `auto-mode-alist', undoing
|
|
|
|
ELP profiling of functions in that library, unproviding any features
|
|
|
|
provided by the library, and canceling timers held in variables
|
|
|
|
defined by the library.
|
|
|
|
|
|
|
|
If a function `FEATURE-unload-function' is defined, this function
|
|
|
|
calls it with no arguments, before doing anything else. That function
|
|
|
|
can do whatever is appropriate to undo the loading of the library. If
|
|
|
|
`FEATURE-unload-function' returns non-nil, that suppresses the
|
|
|
|
standard unloading of the library. Otherwise the standard unloading
|
|
|
|
proceeds.
|
|
|
|
|
|
|
|
`FEATURE-unload-function' has access to the package's list of
|
|
|
|
definitions in the variable `unload-function-defs-list' and could
|
|
|
|
remove symbols from it in the event that the package has done
|
|
|
|
something strange, such as redefining an Emacs function."
|
2007-04-06 17:03:19 +00:00
|
|
|
(interactive
|
|
|
|
(list
|
2007-04-06 17:05:39 +00:00
|
|
|
(read-feature "Unload feature: " t)
|
|
|
|
current-prefix-arg))
|
2005-04-19 15:09:05 +00:00
|
|
|
(unless (featurep feature)
|
|
|
|
(error "%s is not a currently loaded feature" (symbol-name feature)))
|
|
|
|
(unless force
|
|
|
|
(let* ((file (feature-file feature))
|
|
|
|
(dependents (delete file (copy-sequence (file-dependents file)))))
|
|
|
|
(when dependents
|
|
|
|
(error "Loaded libraries %s depend on %s"
|
|
|
|
(prin1-to-string dependents) file))))
|
2007-10-24 08:12:40 +00:00
|
|
|
(let* ((unload-function-defs-list (feature-symbols feature))
|
|
|
|
(file (pop unload-function-defs-list))
|
2007-02-11 11:11:09 +00:00
|
|
|
;; If non-nil, this is a symbol for which we should
|
|
|
|
;; restore a previous autoload if possible.
|
|
|
|
restore-autoload
|
2007-10-19 09:05:52 +00:00
|
|
|
(name (symbol-name feature))
|
|
|
|
(unload-hook (intern-soft (concat name "-unload-hook")))
|
|
|
|
(unload-func (intern-soft (concat name "-unload-function"))))
|
|
|
|
;; If FEATURE-unload-function is defined and returns non-nil,
|
|
|
|
;; don't try to do anything more; otherwise proceed normally.
|
2007-10-30 09:44:17 +00:00
|
|
|
(unless (and (fboundp unload-func)
|
2007-10-19 09:05:52 +00:00
|
|
|
(funcall unload-func))
|
|
|
|
;; Try to avoid losing badly when hooks installed in critical
|
|
|
|
;; places go away. (Some packages install things on
|
|
|
|
;; `kill-buffer-hook', `activate-menubar-hook' and the like.)
|
|
|
|
(if unload-hook
|
|
|
|
;; First off, provide a clean way for package FOO to arrange
|
|
|
|
;; this by adding hooks on the variable `FOO-unload-hook'.
|
|
|
|
;; This is obsolete; FEATURE-unload-function should be used now.
|
|
|
|
(run-hooks unload-hook)
|
|
|
|
;; Otherwise, do our best. Look through the obarray for symbols
|
|
|
|
;; which seem to be hook variables or special hook functions and
|
|
|
|
;; remove anything from them which matches the feature-symbols
|
|
|
|
;; about to get zapped. Obviously this won't get anonymous
|
|
|
|
;; functions which the package might just have installed, and
|
|
|
|
;; there might be other important state, but this tactic
|
|
|
|
;; normally works.
|
|
|
|
(mapatoms
|
|
|
|
(lambda (x)
|
|
|
|
(when (and (boundp x)
|
|
|
|
(or (and (consp (symbol-value x)) ; Random hooks.
|
|
|
|
(string-match "-hooks?\\'" (symbol-name x)))
|
|
|
|
(memq x unload-feature-special-hooks))) ; Known abnormal hooks etc.
|
2007-10-24 08:12:40 +00:00
|
|
|
(dolist (y unload-function-defs-list)
|
2007-10-19 09:05:52 +00:00
|
|
|
(when (and (eq (car-safe y) 'defun)
|
|
|
|
(not (get (cdr y) 'autoload)))
|
|
|
|
(remove-hook x (cdr y)))))))
|
|
|
|
;; Remove any feature-symbols from auto-mode-alist as well.
|
2007-10-24 08:12:40 +00:00
|
|
|
(dolist (y unload-function-defs-list)
|
2007-10-19 09:05:52 +00:00
|
|
|
(when (and (eq (car-safe y) 'defun)
|
|
|
|
(not (get (cdr y) 'autoload)))
|
|
|
|
(setq auto-mode-alist
|
|
|
|
(rassq-delete-all (cdr y) auto-mode-alist)))))
|
2011-06-25 17:42:18 +00:00
|
|
|
|
|
|
|
;; Change major mode in all buffers using one defined in the feature being unloaded.
|
|
|
|
(unload--set-major-mode)
|
|
|
|
|
2007-10-19 09:05:52 +00:00
|
|
|
(when (fboundp 'elp-restore-function) ; remove ELP stuff first
|
2007-10-24 08:12:40 +00:00
|
|
|
(dolist (elt unload-function-defs-list)
|
2007-10-19 09:05:52 +00:00
|
|
|
(when (symbolp elt)
|
|
|
|
(elp-restore-function elt))))
|
2007-02-11 11:11:09 +00:00
|
|
|
|
2007-10-24 08:12:40 +00:00
|
|
|
(dolist (x unload-function-defs-list)
|
2007-10-19 09:05:52 +00:00
|
|
|
(if (consp x)
|
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
2012-07-10 11:51:54 +00:00
|
|
|
(pcase (car x)
|
2007-10-19 09:05:52 +00:00
|
|
|
;; Remove any feature names that this file provided.
|
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
2012-07-10 11:51:54 +00:00
|
|
|
(`provide
|
2007-10-19 09:05:52 +00:00
|
|
|
(setq features (delq (cdr x) features)))
|
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
2012-07-10 11:51:54 +00:00
|
|
|
((or `defun `autoload)
|
2007-10-19 09:05:52 +00:00
|
|
|
(let ((fun (cdr x)))
|
|
|
|
(when (fboundp fun)
|
|
|
|
(when (fboundp 'ad-unadvise)
|
|
|
|
(ad-unadvise fun))
|
|
|
|
(let ((aload (get fun 'autoload)))
|
|
|
|
(if (and aload (eq fun restore-autoload))
|
|
|
|
(fset fun (cons 'autoload aload))
|
|
|
|
(fmakunbound fun))))))
|
|
|
|
;; (t . SYMBOL) comes before (defun . SYMBOL)
|
|
|
|
;; and says we should restore SYMBOL's autoload
|
|
|
|
;; when we undefine it.
|
Reduce use of (require 'cl).
* admin/bzrmerge.el: Use cl-lib.
* leim/quail/hangul.el: Don't require CL.
* leim/quail/ipa.el: Use cl-lib.
* vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el:
* vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el:
* register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el:
* msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el:
* international/quail.el, info-xref.el, imenu.el, image-mode.el:
* font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el:
* battery.el, avoid.el, abbrev.el: Use cl-lib.
* vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el:
* vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el:
* jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el:
* emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el:
* calculator.el, autorevert.el, apropos.el: Don't require CL.
* emacs-bytecomp.el (byte-recompile-directory, display-call-tree)
(byte-compile-unfold-bcf, byte-compile-check-variable):
* emacs-byte-opt.el (byte-compile-trueconstp)
(byte-compile-nilconstp):
* emacs-autoload.el (make-autoload): Use pcase.
* face-remap.el (text-scale-adjust): Simplify pcase patterns.
2012-07-10 11:51:54 +00:00
|
|
|
(`t (setq restore-autoload (cdr x)))
|
|
|
|
((or `require `defface) nil)
|
|
|
|
(_ (message "Unexpected element %s in load-history" x)))
|
2007-10-19 09:05:52 +00:00
|
|
|
;; Kill local values as much as possible.
|
|
|
|
(dolist (buf (buffer-list))
|
|
|
|
(with-current-buffer buf
|
|
|
|
(if (and (boundp x) (timerp (symbol-value x)))
|
|
|
|
(cancel-timer (symbol-value x)))
|
|
|
|
(kill-local-variable x)))
|
|
|
|
(if (and (boundp x) (timerp (symbol-value x)))
|
|
|
|
(cancel-timer (symbol-value x)))
|
|
|
|
;; Get rid of the default binding if we can.
|
|
|
|
(unless (local-variable-if-set-p x)
|
|
|
|
(makunbound x))))
|
|
|
|
;; Delete the load-history element for this file.
|
|
|
|
(setq load-history (delq (assoc file load-history) load-history))))
|
2007-02-05 23:45:31 +00:00
|
|
|
;; Don't return load-history, it is not useful.
|
|
|
|
nil)
|
1993-04-16 23:43:57 +00:00
|
|
|
|
|
|
|
(provide 'loadhist)
|
|
|
|
|
|
|
|
;;; loadhist.el ends here
|