|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Now that the debate has died down slightly, here's an idea...
Suppose I have a bunch of files. I edit one of them, and then I want to
edit all of the others in the same way. Is there an easy way to make
Emacs do that? Because, if there is, that would be Actually Useful for
something.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v8 <voi### [at] devnull> wrote:
> Suppose I have a bunch of files. I edit one of them, and then I want to
> edit all of the others in the same way. Is there an easy way to make
> Emacs do that? Because, if there is, that would be Actually Useful for
> something.
Your question can be reduced to "can elisp be used to do that?"
Since elisp is a programming language with basically all the same
expressiveness as lisp, the answer should be obvious.
The more relevant question would be, however, whether that's the
*easiest* way of doing that. Probably not, unless you are an elisp guru.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 25/08/2011 04:36 PM, Warp wrote:
> Orchid XP v8<voi### [at] devnull> wrote:
>> Suppose I have a bunch of files. I edit one of them, and then I want to
>> edit all of the others in the same way. Is there an easy way to make
>> Emacs do that? Because, if there is, that would be Actually Useful for
>> something.
>
> Your question can be reduced to "can elisp be used to do that?"
> Since elisp is a programming language with basically all the same
> expressiveness as lisp, the answer should be obvious.
>
> The more relevant question would be, however, whether that's the
> *easiest* way of doing that. Probably not, unless you are an elisp guru.
The question was more "is there already a button that does that?" I
could implement such a feature in any language. The question was whether
one is already present.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible <voi### [at] devnull> wrote:
> The question was more "is there already a button that does that?" I
> could implement such a feature in any language. The question was whether
> one is already present.
"I want to edit all of the others in the same way" is quite a vague
description. I don't even know what exactly you mean by that.
There's probably no "button" to do that (although it wouldn't surprise
me if there was). It doesn't sound like an extremely common task.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 25/08/2011 05:14 PM, Warp wrote:
> Invisible<voi### [at] devnull> wrote:
>> The question was more "is there already a button that does that?" I
>> could implement such a feature in any language. The question was whether
>> one is already present.
>
> "I want to edit all of the others in the same way" is quite a vague
> description. I don't even know what exactly you mean by that.
>
> There's probably no "button" to do that (although it wouldn't surprise
> me if there was). It doesn't sound like an extremely common task.
As best as I can tell, it's a line-based file format, where each line
contains a key/value pair. Basically if I use the tool and it changes
the line that says "mode=7" to read "mode=9", then I want to make that
change to all the files in the set. Similarly if it adds a new line or
removes an existing one.
I imagine you can probably do it somehow using diff and patch. But those
aren't usually present on Windows. (I gather Emacs has a special mode
for viewing the output from diff or something like that... Presumably
that only works on Unix though.)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v8 <voi### [at] devnull> wrote:
> As best as I can tell, it's a line-based file format, where each line
> contains a key/value pair. Basically if I use the tool and it changes
> the line that says "mode=7" to read "mode=9", then I want to make that
> change to all the files in the set. Similarly if it adds a new line or
> removes an existing one.
Usually you'd do a search&replace on multiple files to do that. I don't
know offhand if emacs has readymade support for search&replace on multiple
files, but it sounds like something that could be done with just a bit of
elisp. (Normally you would do this on the command line using 'sed' or other
similar tools, unless the changes are very complex, in which case it becomes
more difficult.)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v8 escreveu:
> On 25/08/2011 05:14 PM, Warp wrote:
>> Invisible<voi### [at] devnull> wrote:
>>> The question was more "is there already a button that does that?" I
>>> could implement such a feature in any language. The question was whether
>>> one is already present.
>>
>> "I want to edit all of the others in the same way" is quite a vague
>> description. I don't even know what exactly you mean by that.
>>
>> There's probably no "button" to do that (although it wouldn't surprise
>> me if there was). It doesn't sound like an extremely common task.
>
> As best as I can tell, it's a line-based file format, where each line
> contains a key/value pair. Basically if I use the tool and it changes
> the line that says "mode=7" to read "mode=9", then I want to make that
> change to all the files in the set. Similarly if it adds a new line or
> removes an existing one.
>
> I imagine you can probably do it somehow using diff and patch. But those
> aren't usually present on Windows. (I gather Emacs has a special mode
> for viewing the output from diff or something like that... Presumably
> that only works on Unix though.)
Install perl. I don't remember perl at all, but it's probably a simple
one-liner. A few switches on the command line and a simple regex
substitution should do the trick. The right tool for the job, plain and
simple. And yes, it's available for windows in a standard windows
install package.
--
a game sig: http://tinyurl.com/d3rxz9
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> As best as I can tell, it's a line-based file format, where each line
>> contains a key/value pair. Basically if I use the tool and it changes
>> the line that says "mode=7" to read "mode=9", then I want to make that
>> change to all the files in the set. Similarly if it adds a new line or
>> removes an existing one.
>>
>> I imagine you can probably do it somehow using diff and patch. But
>> those aren't usually present on Windows. (I gather Emacs has a special
>> mode for viewing the output from diff or something like that...
>> Presumably that only works on Unix though.)
>
> Install perl. I don't remember perl at all, but it's probably a simple
> one-liner. A few switches on the command line and a simple regex
> substitution should do the trick. The right tool for the job, plain and
> simple. And yes, it's available for windows in a standard windows
> install package.
The right tool for the job would obviously be some sort of file
comparison tool - which Perl isn't.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>>> As best as I can tell, it's a line-based file format, where each line
>>> contains a key/value pair. Basically if I use the tool and it changes
>>> the line that says "mode=7" to read "mode=9", then I want to make that
>>> change to all the files in the set. Similarly if it adds a new line or
>>> removes an existing one.
>>>
>>> I imagine you can probably do it somehow using diff and patch. But
>>> those aren't usually present on Windows. (I gather Emacs has a special
>>> mode for viewing the output from diff or something like that...
>>> Presumably that only works on Unix though.)
>>
>> Install perl. I don't remember perl at all, but it's probably a simple
>> one-liner. A few switches on the command line and a simple regex
>> substitution should do the trick. The right tool for the job, plain and
>> simple. And yes, it's available for windows in a standard windows
>> install package.
>
> The right tool for the job would obviously be some sort of file
> comparison tool - which Perl isn't.
Do you need to make the same change in each file? If so, Perl or sed,
or awk are perfect tools for the job.
I don't see where diff comes into play...
--
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/* flabreque */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/* @ */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/* gmail.com */}camera{orthographic location<6,1.25,-6>look_at a }
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Francois Labreque <fla### [at] videotronca> wrote:
> > The right tool for the job would obviously be some sort of file
> > comparison tool - which Perl isn't.
> Do you need to make the same change in each file? If so, Perl or sed,
> or awk are perfect tools for the job.
> I don't see where diff comes into play...
The problem sounds indeed like a simple search&replace task, which
tools like sed or perl are designed for.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |