emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: insert-directory


From: Luc Teirlinck
Subject: Re: insert-directory
Date: Sun, 23 May 2004 19:00:38 -0500 (CDT)

I have to change my proposed patch to files.el to the new patch
included below.  There was a bug in my prior patch.  The new patch
changes the way empty directories are displayed if the "-a" switch is
not provided, in my opinion for the better.

Prior to my new patch, without -a switch, such directories were listed as:

  /home/teirllm/compdir/goodCVS:

After my new patch that becomes:

  /home/teirllm/compdir/goodCVS:
  total used in directory 0 available 21963572

I personally use the "-A" instead of the "-a" switch and I like the
new behavior a lot better.  It makes empty dired buffers stand out a
lot more clearly as being empty dired buffers.  A dired buffer with just:

  /home/teirllm/compdir/goodCVS:

looks weird and confusing/

The reason for the change is:

[bash2.05b.0 ~ 3 6] ls /home/teirllm/compdir/gogoCVS -Al --dired
  total 0
//DIRED-OPTIONS// --quoting-style=(null)
[bash2.05b.0 ~ 3 7] ls /home/teirllm/compdir/gogoCVS -al --dired
  total 8
  drwxrwxr-x    2 teirllm  teirllm      4096 Apr  5 21:42 .
  drwxrwxr-x    5 teirllm  teirllm      4096 Apr 11 21:13 ..
//DIRED// 68 69 128 130
//DIRED-OPTIONS// --quoting-style=(null)
[bash2.05b.0 ~ 3 8] 

New patch:

===File ~/files-diff-2======================================
*** files.el    22 May 2004 14:29:26 -0500      1.695
--- files.el    23 May 2004 18:11:03 -0500      
***************
*** 4336,4356 ****
              (when (looking-at "//SUBDIRED//")
                (delete-region (point) (progn (forward-line 1) (point)))
                (forward-line -1))
!           (let ((end (line-end-position)))
!             (forward-word 1)
!             (forward-char 3)
!             (while (< (point) end)
!               (let ((start (+ beg (read (current-buffer))))
!                     (end (+ beg (read (current-buffer)))))
!                 (if (= (char-after end) ?\n)
!                     (put-text-property start end 'dired-filename t)
!                   ;; It seems that we can't trust ls's output as to
!                   ;; byte positions of filenames.
!                   (put-text-property beg (point) 'dired-filename nil)
!                   (end-of-line))))
!             (goto-char end)
!             (beginning-of-line)
!             (delete-region (point) (progn (forward-line 2) (point)))))
  
          ;; Now decode what read if necessary.
          (let ((coding (or coding-system-for-read
--- 4336,4361 ----
              (when (looking-at "//SUBDIRED//")
                (delete-region (point) (progn (forward-line 1) (point)))
                (forward-line -1))
!           (if (looking-at "//DIRED//")
!               (let ((end (line-end-position)))
!                 (forward-word 1)
!                 (forward-char 3)
!                 (while (< (point) end)
!                   (let ((start (+ beg (read (current-buffer))))
!                         (end (+ beg (read (current-buffer)))))
!                     (if (= (char-after end) ?\n)
!                         (put-text-property start end 'dired-filename t)
!                       ;; It seems that we can't trust ls's output as to
!                       ;; byte positions of filenames.
!                       (put-text-property beg (point) 'dired-filename nil)
!                       (end-of-line))))
!                 (goto-char end)
!                 (beginning-of-line)
!                 (delete-region (point) (progn (forward-line 2) (point))))
!             (forward-line 1)
!             (if (looking-at "//DIRED-OPTIONS//")
!                 (delete-region (point) (progn (forward-line 1) (point)))      
!               (forward-line 1))))
  
          ;; Now decode what read if necessary.
          (let ((coding (or coding-system-for-read
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]