summaryrefslogtreecommitdiff
path: root/lisp/speedbar.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-04-28 17:59:08 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-04-28 17:59:08 -0400
commit8b6c19f4c23e69f2133a8432d614abdc03bdadc6 (patch)
tree50b1ab560ca298e2cf06898ee11b1ed1df1bb000 /lisp/speedbar.el
parent461ef3c5186ce4df67039615b30b84b0c86d7da4 (diff)
downloademacs-8b6c19f4c23e69f2133a8432d614abdc03bdadc6.tar.gz
Avoid the obsolete `assoc' package.
* lisp/speedbar.el (speedbar-refresh): Avoid adelete. (speedbar-file-lists): Simplify and avoid aput. * lisp/man.el (Man--sections, Man--refpages): New vars, replacing Man-sections-alist and Man-refpages-alist. (Man-build-section-alist, Man-build-references-alist): Use them; avoid aput. (Man--last-section, Man--last-refpage): New vars. (Man-follow-manual-reference): Use them. Use the `default' arg of completing-read. (Man-goto-section): Idem. Move prompt to the `interactive' spec. * lisp/gnus/auth-source.el (auth-source--aput-1, auth-source--aput) (auth-source--aget): New functions and macros. Use them instead of aput/aget.
Diffstat (limited to 'lisp/speedbar.el')
-rw-r--r--lisp/speedbar.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 9065d9ed131..c1e86e17e37 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -125,7 +125,6 @@ this version is not backward compatible to 0.14 or earlier.")
;;; TODO:
;; - Timeout directories we haven't visited in a while.
-(require 'assoc)
(require 'easymenu)
(require 'dframe)
(require 'sb-image)
@@ -1413,9 +1412,10 @@ Argument ARG represents to force a refresh past any caches that may exist."
(dframe-power-click arg)
deactivate-mark)
;; We need to hack something so this works in detached frames.
- (while dl
- (adelete 'speedbar-directory-contents-alist (car dl))
- (setq dl (cdr dl)))
+ (dolist (d dl)
+ (setq speedbar-directory-contents-alist
+ (delq (assoc d speedbar-directory-contents-alist)
+ speedbar-directory-contents-alist)))
(if (<= 1 speedbar-verbosity-level)
(speedbar-message "Refreshing speedbar..."))
(speedbar-update-contents)
@@ -1898,12 +1898,9 @@ matching ignored headers. Cache any directory files found in
`speedbar-directory-contents-alist' and use that cache before scanning
the file-system."
(setq directory (expand-file-name directory))
- ;; If in powerclick mode, then the directory we are getting
- ;; should be rescanned.
- (if dframe-power-click
- (adelete 'speedbar-directory-contents-alist directory))
;; find the directory, either in the cache, or build it.
- (or (cdr-safe (assoc directory speedbar-directory-contents-alist))
+ (or (and (not dframe-power-click) ;; In powerclick mode, always rescan.
+ (cdr-safe (assoc directory speedbar-directory-contents-alist)))
(let ((default-directory directory)
(dir (directory-files directory nil))
(dirs nil)
@@ -1917,8 +1914,11 @@ the file-system."
(setq dirs (cons (car dir) dirs))
(setq files (cons (car dir) files))))
(setq dir (cdr dir)))
- (let ((nl (cons (nreverse dirs) (list (nreverse files)))))
- (aput 'speedbar-directory-contents-alist directory nl)
+ (let ((nl (cons (nreverse dirs) (list (nreverse files))))
+ (ae (assoc directory speedbar-directory-contents-alist)))
+ (if ae (setcdr ae nl)
+ (push (cons directory nl)
+ speedbar-directory-contents-alist))
nl))
))