-Remove registration for NAME if PATH is nil (but not the empty string)."
- (if path
- (let* ((got (assoc name multishell-name-to-path-history)))
- (cond ((or (not path)(string= path ""))
- ;; Remove entry, if present:
- (if got
- (setq multishell-name-to-path-history
- (delete got multishell-name-to-path-history))))
- (got
- ;; Replace the path of the existing entry:
- (setcdr got path))
- ;; Add a new entry:
- (t (setq multishell-name-to-path-history
- (cons (cons name path) multishell-name-to-path-history)))))))
+Remove registration for NAME if PATH is nil (but not the empty string).
+
+Return a list of the prior entry and current one, to indicate
+disposition changes."
+ (let* ((got (assoc name multishell-name-to-path-history))
+ becomes
+ (return (list got becomes)))
+ (cond ((or (not path)(string= path ""))
+ ;; Remove entry, if present:
+ (if got
+ (setq multishell-name-to-path-history
+ (delete got multishell-name-to-path-history))))
+ (got
+ ;; Replace the path of the existing entry, and move to the front:
+ (setq becomes (cons (car got) path)
+ multishell-name-to-path-history
+ (cons becomes (remove got multishell-name-to-path-history)))
+ (setq return (list got becomes)))
+ ;; Add a new entry, at the front:
+ (t (setq becomes (cons name path)
+ return (list got becomes)
+ multishell-name-to-path-history
+ (cons becomes multishell-name-to-path-history))))
+ return))