all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I get global-grep-and-replace to work?
@ 2003-09-26 10:51 Cinnamon
  2003-09-26 13:07 ` Klaus Berndl
  2003-09-29  9:54 ` Jens Schmidt
  0 siblings, 2 replies; 5+ messages in thread
From: Cinnamon @ 2003-09-26 10:51 UTC (permalink / raw)


Hi,

I've a large number of files that need one line changing.

I tried global-grep-and-replace, which asks me what I want to change,
what I want to change this to, and then asks me which files.

I get a neat buffer with all the offending lines in all the files
listed, then it askes me Do you want to [replace, edit, search, quit]:

When I say replace, it moves to the first buffer onto the line, but
instead of changing those lines for me automagically, it just sits
there.  Also, I'm not sure why its actually going into the file and
showing me -- I already said to just replace this with that in *.c, so
no need to show me the files, just go ahead and do it :)

What is going on?  And is there a way I can just coax Xemacs into
changing the lines in those files without any more work for me?

thanks,

Cinnamon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get global-grep-and-replace to work?
  2003-09-26 10:51 How do I get global-grep-and-replace to work? Cinnamon
@ 2003-09-26 13:07 ` Klaus Berndl
  2003-09-27  1:17   ` Cinnamon
  2003-09-29  9:54 ` Jens Schmidt
  1 sibling, 1 reply; 5+ messages in thread
From: Klaus Berndl @ 2003-09-26 13:07 UTC (permalink / raw)



I do not know any function `global-grep-and-replace' neither in Emacs nor in
XEmacs. In which package is this function located?

Thanks,
Klaus

On 26 Sep 2003, oisin@ukfsn.org wrote:



>  Hi,
>  
>  I've a large number of files that need one line changing.
>  
>  I tried global-grep-and-replace, which asks me what I want to change,
>  what I want to change this to, and then asks me which files.
>  
>  I get a neat buffer with all the offending lines in all the files
>  listed, then it askes me Do you want to [replace, edit, search, quit]:
>  
>  When I say replace, it moves to the first buffer onto the line, but
>  instead of changing those lines for me automagically, it just sits
>  there.  Also, I'm not sure why its actually going into the file and
>  showing me -- I already said to just replace this with that in *.c, so
>  no need to show me the files, just go ahead and do it :)
>  
>  What is going on?  And is there a way I can just coax Xemacs into
>  changing the lines in those files without any more work for me?
>  
>  thanks,
>  
>  Cinnamon

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get global-grep-and-replace to work?
  2003-09-26 13:07 ` Klaus Berndl
@ 2003-09-27  1:17   ` Cinnamon
  0 siblings, 0 replies; 5+ messages in thread
From: Cinnamon @ 2003-09-27  1:17 UTC (permalink / raw)


Klaus Berndl <klaus.berndl@sdm.de> wrote in message news:<u3cej3dgh.fsf@sdm.de>...
> I do not know any function `global-grep-and-replace' neither in Emacs nor in
> XEmacs. In which package is this function located?
> 
> Thanks,
> Klaus
> 

Hi,  

its in a file called globrep.el.  I'm not sure if that is a standard
file or where I picked it up -- someone else used to maintain the
Xemacs here till recently.  I can give you a copy of it if its useful.
 Would be nice if it worked cause I often have to replace stuff in
files like that, life would be much easier this way :)

Cinnamon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get global-grep-and-replace to work?
@ 2003-09-27 17:54 Joe Corneli
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Corneli @ 2003-09-27 17:54 UTC (permalink / raw)


#!/bin/bash

# ;)

# Examples:    

# jed "I have some bad news." "So, how's the weather out there?" *.txt
# jed Cornelli Corneli that_letter.txt

REENTER=`echo "$@"|  sed -e "s/$1 $2 //"`

for FILE in $REENTER
do
  cat $FILE | sed -e "s/$1/$2/g" > p_jed.out
  mv p_jed.out $FILE
done;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I get global-grep-and-replace to work?
  2003-09-26 10:51 How do I get global-grep-and-replace to work? Cinnamon
  2003-09-26 13:07 ` Klaus Berndl
@ 2003-09-29  9:54 ` Jens Schmidt
  1 sibling, 0 replies; 5+ messages in thread
From: Jens Schmidt @ 2003-09-29  9:54 UTC (permalink / raw)


oisin@ukfsn.org (Cinnamon) writes:

> I tried global-grep-and-replace, which asks me what I want to change,
> what I want to change this to, and then asks me which files.

A more standard alternative may be:

1. Use `find-grep-dired' to get a Dired buffer that lists files
   matching a certain regexp.
2. Mark all files in that buffer for replacement (for example,
   using %-m (`dired-mark-files-regexp') to mark by regexp).
3. Still in the Dired buffer, do a Q
   (`dired-do-query-replace-regexp') to process all marked files.
4. Do a C-x s (`save-some-buffers') do save the results.

This works at least for Emacs 21.1, not sure about XEmacs.

Jens

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-09-29  9:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-26 10:51 How do I get global-grep-and-replace to work? Cinnamon
2003-09-26 13:07 ` Klaus Berndl
2003-09-27  1:17   ` Cinnamon
2003-09-29  9:54 ` Jens Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2003-09-27 17:54 Joe Corneli

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.