help-emacs-windows
[Top][All Lists]
Advanced

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

[h-e-w] Re: calling macros on several files


From: Raymond Zeitler
Subject: [h-e-w] Re: calling macros on several files
Date: Tue, 9 Oct 2001 12:55:19 -0400

Frames/Buffers:
Well, if I open two instances of Emacs, I have two frames.  The first
instance knows nothing the buffers in the second instance.  I never use
Emacs in a single-instance, multi-frame mode, so maybe you're correct.  I
wanted to stress that there should be only one window open (C-x 1) because
the behavior of switching buffers is changed somewhat with split windows.

Macro Recording
When I write, "record my macro in one buffer", I mean, invoke C-x (, press
some keys to alter the contents of the buffer, and then invoke C-x ).  You
see, I'm setting up for the idea that the OP will switch to the next buffer
at the very end of the macro.

I disagree that extra precision is gained by having an additional buffer
with the names of the files in it.  I'm merely suggesting a simple macro,
not an elaborate programming exercise.  After all, how is the macro to know
that a given buffer contains a list of files or an actual file?

Dired:
Maybe this can be done with dired.  I don't know - I don't use dired except
maybe when I want to do a search/replace on many files at once.  Note that I
began my reply with, "The way I do this..."  I'm not saying it's the best
way.  But in any case, nothing that we're discussing here is specific to
NTEmacs.  Why not post your question/complaint about dired in the newsgroup
gnu.emacs.help so as to get much more exposure?  You might find that
dired-x.el (or some other package) does everything you want.

 -----Original Message-----
To: address@hidden
Subject: Re: [h-e-w]  calling macros on several files
From: David Vanderschel <address@hidden>
Date: 08 Oct 2001 18:19:23 -0500

On Monday, October 08, "Raymond Zeitler" <address@hidden> wrote:
>The way I do this is to load all the files I want to
>operate on into a single window/frame.  

I don't understand this because, as far as I can tell,
there is no association between frames and buffers
aside from the set of buffers which are currently
_displayed_ in a given frame.  (Generally speaking, I
think that all buffers are accessible in all frames.)

>I record my macro in one buffer, 

I don't understand this because macros are not
recorded "in" buffers.  Perhaps "while visiting". 

>and before ending the macro, switch buffers using my
>own "switch buffers" routine, which merely buries
>buffers until one comes up whose name does not begin
>with an asterisk.  

The technique could be made more precise with yet
another buffer which contains the names of the files
to be treated. 


Nevertheless, I find it surprising that there is no
command in dired to "invoke this function in all the
marked buffers".  Such an option should be easy to
implement and is more powerful than just executing a
macro (noting that you can have a function which
invokes the last or a named keyboard macro).  It is
also potentially more powerful than doing a
query-replace on the marked buffers.  (With a macro,
you might wish to repeat it successively until hitting
the end of the buffer as with a zero argument to
call-last-kbd-macro.)

While I am 'complaining' about related dired 
features:  I have suffered from the fact that
dired-do-query-replace command insists on a regexp
instead of allowing an exact match.  I have
encountered problems when the string I wished to
replace contained characters special to regexp search.
The function (the name of which escapes me at the
moment - Help!) which constructs a regexp which is
supposed to match a specific string did not solve this
problem for me.  (Eventually, _I_ have been able to
construct appropriate regexps, but it seemed to be an
unnecessary hassle.)

If I am missing something, please clue me in.

Regards,
  David V.




--__--__--

_______________________________________________
help-emacs-windows mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-emacs-windows


End of help-emacs-windows Digest



reply via email to

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