xref: /386bsd/usr/local/lib/emacs/19.25/lisp/dired.todo (revision a2142627)
1# file dired.todo					-*-Outline-*-
2
3* Sandy's (sandy@itp.ethz.ch) main point is slowness when omitting
4  (which I use only on demand, and simply don't use if it'd be too
5  slow), so a transaction-free, reversible way of omitting by stashing
6  away the filenames would be good.
7
8  Hiding could be used, but probably selective-display-ellipses should
9  be nil for omitting files, but t for hiding subdirectories, excluding
10  simultaneous use of hiding and omitting.  This would not be a problem
11  if all subdirs had to be hidden together, but one subdir may be hidden
12  while in another the are files to be omitted.
13
14* REALLY have to split large shell commands.
15
16* Try to cope with ls -lF format like this:
17
18  lrwxrwxrwx  1 dsmith          0 Mar 30 16:44 root@
19
20  Note the missing " -> ".
21
22* In dired shell command, provide a way to pass a `*' to the shell,
23  e.g., for grep.
24
25*   kpc> well, here's an example.  i'll have done a recursive find and grep, so
26    kpc> i'll have, say, 61 files out of 450 possible files in the buffer.  if
27    kpc> i want to get them in time order and they are in size or name order,
28    kpc> what do i do?  if i use s, i'll get 450 files!  so much for the
29    kpc> grep....  on the other hand i can't see hitting l or c-u l 61
30    kpc> times....
31
32    I see why you need this.  And `l' or `C-u l' would be no good since it
33    always relists a complete subdirectory.
34
35    kpc> redoing the ls with just the displayed files, if it works, would seem
36    kpc> to be the best.  though i don't know if anytuhing can be done about
37    kpc> the consing.
38
39    Well, if it only happens on demand, it's up to the user to decide
40    whether it's worth an additional garbarge collection or two.  And for
41    your application of find-dired buffers, the list would not be very
42    big.
43
44*    >>> On Tue, 24 Mar 92 09:37:17 EST,
45    >>> pinard%icule.UUCP@Larry.McRCIM.McGill.EDU (Francois Pinard) said:
46
47    F> All the lines but the last have been hidden by dired-hide-all, while
48    F> the last was first added by dired-maybe-insert-subdir, then hidden by
49    F> dired-hide-subdir.  It seems that dired-hide-all properly removes and
50    F> reinserts white lines when it hides or unhide directories, while
51    F> dired-hide-subdir does nothing about them.  So, let me suggest that
52    F> dired-hide-subdir removes white lines which preceedes a directory
53    F> while hiding it, and that dired-hide-subdir insures one white line
54    F> before any hidden directory it expands.
55
56    I think the problem rather lies with the insertion than the hiding.  A
57    subdirectory extends from column zero of its headerline to just before
58    the next headerline or end-of-buffer*.  This is the region where \r to
59    \n conversion must be done for hiding/unhiding**.  The problem is that
60    when `i' appends something (call it DIR-NEW) after a hidden dir (call
61    it DIR-OLD) at the end of the buffer, that old dir does not end in a
62    blank line like all others do.  So in the process of inserting the
63    contents of DIR-NEW it inserts an additional \n actually belonging to
64    DIR-OLD (that would have been converted to a \r had it been present
65    already when DIR-OLD was hidden).
66
67    So a better fix is to have inserted dirs always end in a blank line,
68    even the one at the end of the buffer.  This will perhaps also fix
69    some problems with nested dired format.  Thank you for bringing this
70    to my attention.  I would appreciate any further comments you have on
71    this.
72
73    -Sebastian
74
75    ----
76    *  This is an axiom.  I programmed dired so that it would be that way,
77       so that the whole buffer would be a disjoint partition of
78       subdirectories.
79
80    ** Minus the last character (a newline) --- or several hidden subdir
81       headerlines would all be in one hidden line.
82
83
84* dired-visit-hooks each time when a dired buffer is visited.  Could
85  be used to revert buffer each time if so desired.
86
87* let shell-command guessing based on regexps just be a special case
88  of classes of files.  Classes would in general be defined by lisp
89  predicates evaluated on the file line in the dired buffer.  Probably
90  they will call dired-get-filename, but they need not.  A class
91  `directory' would be easy, for example.
92
93  With a file class, not only a predicate (for deciding whether this
94  file line belongs to the class) but perhaps also a finder method (to
95  find all files of the class in this buffer) should be associated.
96
97  File classes could be symbols (=names of boolean functions, or
98  rather objects with predicate as one associated method of the
99  object) or strings (regexps).  Symbols should probably be of the
100  form `dired-file-class-*'.
101
102  `File Classes' should perhaps also work in non-dired buffers
103  (->hyperbole!).
104
105  `File Classes' could be a concept unifying omitting, shell command
106  guessing and coloring/highlighting of file names under X11.
107
108* let C-u C-u i prompt for the dir to be inserted (?)
109
110* let `0 ESC (' simply run PREDICATE witout parsing each marked line,
111  in case PREDICATE doesn't need this kind of extra information.
112
113* dired-between-files is not really safe, especially since it doesn't
114  know about find-dired.el's `find' line.
115
116* From: eggert@twinsun.com (Paul Eggert)
117Subject: vc errors and nulldiff
118Date: Tue, 14 Jan 92 15:00:54 PST
119To: vc-friends@snark.thyrsus.com
120
121   There are two questions attached to this topic.  (1) Has anybody come up
122   with a simple robust way to retrieve the status of an Emacs 18 subprocess?
123
124Instead of invoking a command FOO ARG1 ... ARGn, you could invoke the command
125
126/bin/sh -c '"$0" ${1+"$@"}; echo \
127$?' FOO ARG1 ... ARGn
128
129This behaves just like FOO ARG1 ... ARGn, except instead of exiting with the
130true exit status, it appends the exit status as text to the standard output.
131The backslash-newline covers the case when the command's output does not end
132in newline.
133
134* dired*.texi: use `selected files' for marked or next N files
135
136* get rid of rcs in dired-x, dired-rcs is much faster.
137
138* let dired-current-directory return default-directory if
139  dired-subdir-alist is nil (e.g. outside dired buffers, or in a not
140  yet completed find-dired buffer).
141
142* wildcards are not well integrated with dired, e.g. entries are added
143  to inappropriate buffers.
144
145* Use zero arg to `!' to just toggle a new dired-shell-command-on-each
146  variable for consistency?
147
148* [rms] Put everything for copying, renaming, etc. into a separate file again.
149
150Put just autoloads in this file for that stuff.
151
152Likewise, put everything concerned with inserting, killing, and
153hiding subdirs into a separate file.  For example, dired-tree-lessp
154and dired-split can go there.
155
156These separate files are to make plain dired smaller for most people.
157
158* use map-ynp instead of dired-query.
159
160*
161 (defun dired-advertise ()
162   ;;"Advertise in variable `dired-buffers' what directory we dired."
163   ;; With wildcards we actually advertise too much.
164+;; @@ There is no need to do this.
165+;; @@ Just check the subdir alist of the current buffer,
166+;; @@ and verify the current buffer is in dired-buffers.
167   (if (memq (current-buffer) (dired-buffers-for-dir default-directory))
168
169* [rms] I have an idea that might simplify dired.
170
171Suppose all nonempty non-file lines start with a particular character.
172A character one would never use as a mark.
173Then it would be very fast and simple to check for file lines.
174No need for the slowness of looking for the filename.
175
176I suggest the character * or > or #.
177
178Thus, inserting a subdir would install this marker on the non-file
179lines created.
180
181* shell command on several sets of markers: "diff A Z"  Need quoting
182  then, and better recognize marker only when embedded in space?
183
184  Separate from `!'?
185
186* let `[' enter a mode where the permission bits can be edited, and
187  let `]' exit that mode.  Recursive edit?  Keep list of filenames
188  where perms were edited?  Or just one file at a time?
189
190* dired-tree-lessp should use file-newer-than-file-p instead of
191  string-lessp if sort on time?
192
193* dired-x: dired-mark-sexp (predicate &optional unflag-p)
194
195  ;; As PREDICATE usually refers to only one or two fields, compiling
196  ;; it instead of computing all fields could be worth while.
197
198* dired-ls should perhaps do file-name-nondirectory by itself, as in
199  the only place where it lists a single file (in dired-add-entry) the
200  basename is constructed afterwards.
201
202* dired-string-replace-match should have a GLOBAL replace flag.
203
204* dired-view-file-other-window? dired-find-file-read-only ?
205
206* Use diff-backup from emacs-19.  Move latest-backup-file into
207  emacs-19.
208
209* emacs-19.el's mkdir/rmdir commands should optionally accept a
210  log-buffer argument.
211
212* [davida%puma@sunic.sunet.se (David Axmark)]
213
214    The things I want most in dired is a way to skip selective parts of
215    the -l listing (I use *long* filenames) from the listing swiches. As
216    think this would require a special 'ls' (a hotted up GNU ls?) and some
217    hacking of the buffer parsing code. It would be very nice to be able
218    to have a format with just date or size or ...
219
220  Yes, I'd like that too (I use **very long** filenames).  Accepting
221  ls switches without -l should not be too hard to implement.  Hmm, no
222  permission bits at the beginning of each line might break some parts
223  of the code...  But "just date" etc. would mean to prefobnicate ls
224  output each time it is inserted...though that might me done
225  efficiently if based on columns instead of regexps.  I'll think
226  about it..
227
228
229* ls switches without -l shouldn't be that hard, though with loss of certain
230  features (like *@/ marking).
231
232  It would clean the screen tremendously.
233
234  [This is possible now, but not documented since not everything works
235  without -l, sk 14-May-1992 14:10]
236
237* move VM and RMAIL back into dired.el
238
239* `^' fails to find hidden parent dirlines.  Other cmds too, probably.
240  Perhaps the goto cmds should optionally unhide their targets.
241
242* M-DEL should mention in the prompt if there are no flags to remove,
243  so it can be used for testing, too.
244
245
246Musings
247=======
248
249*
250From: jbw@maverick.uswest.com (Joe Wells)
251Newsgroups: gnu.emacs.help,comp.emacs
252Subject: Re: stupid (probably) elisp question
253Date: 2 Aug 91 01:38:08 GMT
254Organization: U S West Advanced Technologies
255In-Reply-To: acevedo@athena.mit.edu's message of Wed, 31 Jul 91 14: 46:22 GMT
256
257(Gabriel) writes:
258
259	 | > [I would like to perform a regexp replacement on a string.
260	 | >  How is this possible short of using an intermediate buffer?]
261	 |
262	 | It's not.  Silly, ain't it?  After all, buffers are just big
263	 | strings, albeit with a lot of state information attached.
264
265	 You could use string-match and concat to do the same thing,
266	 without using buffers:
267
268      Don't do this.  Using a scratch buffer is much more efficient, and
269      results in less garbage collection later.
270
271   Really?  Why is this?
272
2731.  Replacing a substring in the middle of a string involves generating at
274least three strings, possibly more if you're doing something really fancy
275with regexps.  Generating strings is expensive, both at the time they are
276generated and later when they're garbage collected.  Since these strings
277are temporary, they are destined to be garbage collected.
278
2792.  Buffers are really fast.  Once the gap is moved to the correct
280location in the buffer, the replacement involves simply writing the new
281bytes on top of the old bytes, even if the number of bytes changes.
282Moving the gap is actually pretty cheap, especially if the contents of the
283buffer are pretty small, like in this case.
284
285Just don't kill the buffer after you're done with it.  Erase its contents
286instead and leave it around for the next time your function is called.
287
288--
289Enjoy,
290
291Joe Wells <jbw@uswest.com>
292
293
294
295
296* [jwz] One thing I miss about Lispms is a function called
297  BALANCE-DIRECTORIES.  What this would do is get a listing of two
298  directories (possibly on different machines) and compare
299  directories' contents and the files' write-dates, and copy files
300  around until both directories were in synch.  There was also an
301  option to tell it to only copy in one direction instead of both, and
302  you could run it on one file (a trivial case) that would copy that
303  file if and only if the destination was not the same or newer.
304
305  I think this would be a terribly useful feature, though you'd have
306  to do it by comparing the textual representation of the date, since
307  ange-ftp doesn't return correct numeric dates.
308
309  [A subset of this is possible with copy-dir.el, sk 14-May-1992 14:11]
310
311* Actually, there are different meaning of prefix args:
312
313  - with m, u and M-m, F: include even directories
314  - with *@/~# : unmark instead mark
315  - with mark-using (instead mark-setting) commands: use current file
316    instead of marked files
317  - with diff commands, it lets you edit the commandline
318
319*
320Perhaps the failed files should be given another mark, e.g. `!'.  Then
321I would have to include the code from dired-x.el (just 40 lines)
322into dired.el to make it possible to switch the current marker
323character.  One could then switch to `!', do something on the `!'
324files, and pop the old marker character off the stack.
325
326* dired-marker-regexp could use "\n" instead "^", is it used in
327  re-search only, never in looking-at.  But the speedup is not
328  measurable (below 5%).
329
330* < and > should skip "." and "..". [No, use -A in switches instead!]
331