Dired 7.9 bug: patch for XEmacs efficiency

Darryl Okahata (darrylo@sr.hp.com)
Sun, 24 May 1998 13:12:05 -0700


FYI,

     Under XEmacs, indenting a fontified region is very expensive and
time-consumin.  The included patch indents the dired buffer before
fontifying it.  On the XEmacs MS Windows port, this patch improves the
speed by a factor of 1.5-3X.

     -- Darryl Okahata
	Internet: darrylo@sr.hp.com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Hewlett-Packard, or of the
little green men that have been following him all day.

===============================================================================
Emacs  : XEmacs 21.0 "San Clemente" [Lucid] (hppa1.1-hp-hpux10.20) of Sun May 24 1998 on mina
Package: Dired

current state:
==============
(setq
 dired-version "7.9"
 dired-backup-if-overwrite nil
 dired-chown-program "chown"
 dired-cleanup-alist '(("tex" ".toc" ".log" ".aux" ".dvi")
		       ("latex" ".toc" ".log" ".aux" ".idx" ".lof" ".lot"
			".glo" ".dvi")
		       ("bibtex" ".blg" ".bbl")
		       ("texinfo" ".cp" ".cps" ".fn" ".fns" ".ky" ".kys" ".pg"
			".pgs" ".tp" ".tps" ".vr" ".vrs")
		       ("patch" ".rej" ".orig") ("backups" "~")
		       ("completion-ignored-extensions" ".o" ".elc" "~" ".bin"
			".lbin" ".fasl" ".dvi" ".toc" ".log" ".aux" ".a" ".ln"
			".lof" ".blg" ".bbl" ".glo" ".idx" ".lot" ".fmt"
			".diff" ".oi" ".class")
		       )
 dired-compression-method 'gzip
 dired-compression-method-alist '((gzip ".gz" ("gzip") ("gzip" "-d") "-f")
				  (compress ".Z" ("compress" "-f")
				   ("compress" "-d") "-f")
				  (pack ".z" ("pack" "-f") ("unpack"))
				  (compact ".C" ("compact") ("uncompact")))
 dired-copy-preserve-time t
 dired-dwim-target nil
 dired-failed-marker-shell ?\!
 dired-filename-re-ext "\\..+\\'"
 dired-find-subdir nil
 dired-gnutar-program nil
 dired-keep-marker-compress t
 dired-keep-marker-copy ?C
 dired-keep-marker-hardlink ?H
 dired-keep-marker-kill ?K
 dired-keep-marker-rename t
 dired-keep-marker-symlink ?S
 dired-keep-marker-uucode ?U
 dired-kept-versions 2
 dired-listing-switches "-al"
 dired-local-variables-file ".dired"
 dired-ls-F-marks-symlinks '(hpux silicon-graphics-unix)
 dired-ls-program "ls"
 dired-mail-reader 'vm
 dired-mode-line-modified "-%s%s%s-"
 dired-no-confirm nil
 dired-omit-extensions '(".class" ".oi" ".diff" ".fmt" ".ln" ".a" ".fasl"
			 ".lbin" ".bin" ".elc" ".o" "~" ".orig" ".rej" ".vrs"
			 ".vr" ".tps" ".tp" ".pgs" ".pg" ".kys" ".ky" ".fns"
			 ".fn" ".cps" ".cp" ".bbl" ".blg" ".glo" ".lot" ".lof"
			 ".idx" ".dvi" ".aux" ".log" ".toc")
 dired-omit-files nil
 dired-omit-regexps '("\\`#" "\\`\\.")
 dired-refresh-automatically t
 dired-show-ls-switches nil
 dired-trivial-filenames "\\`\\.\\.?\\'\\|\\`#"
 dired-unshar-program nil
 dired-use-file-transformers t
 dired-verify-modtimes t
 reporter-version "3.35"
 )

===============================================================================
*** dired.el.~1~	Thu Feb 26 15:33:42 1998
--- dired.el	Sun May 24 12:56:38 1998
***************
*** 1773,1779 ****
  	(widen)
  	(erase-buffer)
  	(dired-readin-insert dir-or-list wildcard)
- 	(dired-indent-listing (point-min) (point-max-marker))
  	;; We need this to make the root dir have a header line as all
  	;; other subdirs have:
  	(goto-char (point-min))
--- 1773,1778 ----
***************
*** 1825,1831 ****
    ;; insert all files listed in the cdr -- the car is the passed-in directory
    ;; list.
    (let ((opoint (point))
! 	(insert-directory-program dired-ls-program))
      (if (consp dir-or-list)
  	(mapcar
  	 (function
--- 1824,1830 ----
    ;; insert all files listed in the cdr -- the car is the passed-in directory
    ;; list.
    (let ((opoint (point))
! 	(insert-directory-program dired-ls-program) end)
      (if (consp dir-or-list)
  	(mapcar
  	 (function
***************
*** 1833,1839 ****
  	    (insert-directory x switches wildcard)))
  	 (cdr dir-or-list))
        (insert-directory dir-or-list switches wildcard full-p))
!     (dired-insert-set-properties opoint (point)))
    (setq dired-directory dir-or-list))
  
  (defun dired-frob-dir-list (dir-list)
--- 1832,1840 ----
  	    (insert-directory x switches wildcard)))
  	 (cdr dir-or-list))
        (insert-directory dir-or-list switches wildcard full-p))
!     (setq end (point-marker))
!     (dired-indent-listing opoint end)
!     (dired-insert-set-properties opoint end))
    (setq dired-directory dir-or-list))
  
  (defun dired-frob-dir-list (dir-list)