GNU bug report logs -
#18421
24.4.50; Allow Dired to use unrelated dir trees?
Previous Next
Full log
View this message in rfc822 format
> And we get rid of this `if' condition in `dired-insert-subdir-
> newpos'?
>
> (if (dired-tree-lessp dir new-dir)
> ;; Insert NEW-DIR after DIR
> (setq new-pos (dired-get-subdir-max elt)
> alist nil))
>
> So the code does this unconditionally:
>
> (setq new-pos (dired-get-subdir-max elt)
> alist ())
No, that loses the normal insertion order.
This seems to DTRT, however:
(defun dired-insert-subdir-newpos (new-dir)
;; Find pos for new subdir, according to tree order.
;;(goto-char (point-max))
(let ((alist dired-subdir-alist)
elt dir new-pos)
(while alist
(setq elt (car alist)
alist (cdr alist)
dir (car elt))
(if (dired-tree-lessp dir new-dir)
;; Insert NEW-DIR after DIR
(setq new-pos (dired-get-subdir-max elt)
alist ())
(setq new-pos (point-max))))
(goto-char new-pos))
;; want a separating newline between subdirs
(unless (eobp) (forward-line -1))
(insert "\n")
(point))
This bug report was last modified 10 years and 281 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.