1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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.
This commit is contained in:
Stefan Monnier 2012-04-28 17:59:08 -04:00
parent 461ef3c518
commit 8b6c19f4c2
5 changed files with 135 additions and 96 deletions

View file

@ -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))
))