unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Regexp for marking source code
@ 2006-08-07 17:28 Ken Goldman
  2006-08-07 17:34 ` David Kastrup
  2006-09-06  4:06 ` David Combs
  0 siblings, 2 replies; 13+ messages in thread
From: Ken Goldman @ 2006-08-07 17:28 UTC (permalink / raw)


The dired Q command seems quite useful, but
regexp syntax is obscure enough that I can't quite
get what I want.

What would be a regexp for all .c and .h files.
In a Unix shell, it would be *.[ch],  What's the
regexp equivalent?

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

* Re: Regexp for marking source code
  2006-08-07 17:28 Regexp for marking source code Ken Goldman
@ 2006-08-07 17:34 ` David Kastrup
  2006-08-07 20:59   ` Org mode modifies files Sébastien Vauban
                     ` (2 more replies)
  2006-09-06  4:06 ` David Combs
  1 sibling, 3 replies; 13+ messages in thread
From: David Kastrup @ 2006-08-07 17:34 UTC (permalink / raw)


Ken Goldman <kgold@watson.ibm.com> writes:

> The dired Q command seems quite useful, but
> regexp syntax is obscure enough that I can't quite
> get what I want.
>
> What would be a regexp for all .c and .h files.
> In a Unix shell, it would be *.[ch],  What's the
> regexp equivalent?

.*\.[ch]\'

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Org mode modifies files
  2006-08-07 17:34 ` David Kastrup
@ 2006-08-07 20:59   ` Sébastien Vauban
  2006-08-10  5:33     ` claudine
  2006-08-08 21:12   ` Regexp for marking source code Dieter Wilhelm
       [not found]   ` <mailman.5022.1155124251.9609.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 13+ messages in thread
From: Sébastien Vauban @ 2006-08-07 20:59 UTC (permalink / raw)


Hello,

I am using the fantastically easy Org-Mode since a couple of
weeks, but encounters systematically an annoying problem: Emacs
always tells me my .org files have been modified (when I wanna
quit Emacs, or run CVS commands, ...) while they weren't changed
at all!

The only thing I did was listing my task entries with C-c a a,
that's all.

Any idea why it says they are modified?

Thanks for your help,
  Seb

-- 
Sébastien Vauban

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

* Re: Regexp for marking source code
  2006-08-07 17:34 ` David Kastrup
  2006-08-07 20:59   ` Org mode modifies files Sébastien Vauban
@ 2006-08-08 21:12   ` Dieter Wilhelm
       [not found]   ` <mailman.5022.1155124251.9609.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Dieter Wilhelm @ 2006-08-08 21:12 UTC (permalink / raw)
  Cc: help-gnu-emacs

David Kastrup <dak@gnu.org> writes:

> Ken Goldman <kgold@watson.ibm.com> writes:
>
>> The dired Q command seems quite useful, but
>> regexp syntax is obscure enough that I can't quite
>> get what I want.
>>
>> What would be a regexp for all .c and .h files.
>> In a Unix shell, it would be *.[ch],  What's the
>> regexp equivalent?
>
> .*\.[ch]\'

quick and dirty

\.[ch]$

since the likely hood of existing hidden files `.h' and `.c' is too
small for the hassle of typing .*

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: Regexp for marking source code
       [not found]   ` <mailman.5022.1155124251.9609.help-gnu-emacs@gnu.org>
@ 2006-08-09 12:08     ` David Kastrup
  2006-08-14 21:13       ` Dieter Wilhelm
  0 siblings, 1 reply; 13+ messages in thread
From: David Kastrup @ 2006-08-09 12:08 UTC (permalink / raw)


Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> David Kastrup <dak@gnu.org> writes:
>
>> Ken Goldman <kgold@watson.ibm.com> writes:
>>
>>> The dired Q command seems quite useful, but
>>> regexp syntax is obscure enough that I can't quite
>>> get what I want.
>>>
>>> What would be a regexp for all .c and .h files.
>>> In a Unix shell, it would be *.[ch],  What's the
>>> regexp equivalent?
>>
>> .*\.[ch]\'
>
> quick and dirty
>
> \.[ch]$
>
> since the likely hood of existing hidden files `.h' and `.c' is too
> small for the hassle of typing .*

That's not it.  For matching, .* at the beginning is entirely
useless.  If you want to avoid files .c and .h,
.\.[ch]\'
will do the trick.  Replacing \' with $ means that you'll also match
multiline file names like
'x.h
whatever'

Probably not important in dired, but I have some healthy matching
paranoia.  For example, if some joker creates a file (and its
containing directory) named
'-rf
/
guffaw'
which is infrequently cleaned up by a sysadmin script, things can get
ugly if the script has not been written carefully.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Org mode modifies files
  2006-08-07 20:59   ` Org mode modifies files Sébastien Vauban
@ 2006-08-10  5:33     ` claudine
  2006-08-13 12:34       ` Sébastien Vauban
  0 siblings, 1 reply; 13+ messages in thread
From: claudine @ 2006-08-10  5:33 UTC (permalink / raw)


Sébastien Vauban wrote:
> Hello,
>
> I am using the fantastically easy Org-Mode since a couple of
> weeks, but encounters systematically an annoying problem: Emacs
> always tells me my .org files have been modified (when I wanna
> quit Emacs, or run CVS commands, ...) while they weren't changed
> at all!
>
> The only thing I did was listing my task entries with C-c a a,
> that's all.

What version of org mode are you using? I think this problem was
introduced in version 4.41 or .42 and fixed in 4.43.

Claudine

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

* Re: Org mode modifies files
  2006-08-10  5:33     ` claudine
@ 2006-08-13 12:34       ` Sébastien Vauban
  0 siblings, 0 replies; 13+ messages in thread
From: Sébastien Vauban @ 2006-08-13 12:34 UTC (permalink / raw)


Hi,

>> Emacs always tells me my .org files have been modified
>> ... while they weren't changed at all!
>
> What version of org mode are you using? I think this problem was
> introduced in version 4.41 or .42 and fixed in 4.43.

Yes, you're right, the problem disappeared by upgrading to
version 4.43.

Thanks,
  Seb

-- 
Sébastien Vauban

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

* Re: Regexp for marking source code
  2006-08-09 12:08     ` David Kastrup
@ 2006-08-14 21:13       ` Dieter Wilhelm
  2006-08-15 20:58         ` David Kastrup
  0 siblings, 1 reply; 13+ messages in thread
From: Dieter Wilhelm @ 2006-08-14 21:13 UTC (permalink / raw)
  Cc: help-gnu-emacs

David Kastrup <dak@gnu.org> writes:

> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>
>> David Kastrup <dak@gnu.org> writes:
>>
>>> Ken Goldman <kgold@watson.ibm.com> writes:
>>>
>>>> The dired Q command seems quite useful, but
>>>> regexp syntax is obscure enough that I can't quite
>>>> get what I want.
>>>>
>>>> What would be a regexp for all .c and .h files.
>>>> In a Unix shell, it would be *.[ch],  What's the
>>>> regexp equivalent?
>>>
>>> .*\.[ch]\'
>>
>> quick and dirty
>>
>> \.[ch]$
>>
>> since the likely hood of existing hidden files `.h' and `.c' is too
>> small for the hassle of typing .*
>
> That's not it.  For matching, .* at the beginning is entirely
> useless.  If you want to avoid files .c and .h,
> .\.[ch]\'

You're right, I contradicted myself.  

> will do the trick.  Replacing \' with $ means that you'll also match
> multiline file names like
> 'x.h
> whatever'

Never heard of multiline file names, are they really in use?  But
anyway, this is an instructing example for the `\'' regexp, thanks.

>
> Probably not important in dired, but I have some healthy matching
> paranoia.  For example, if some joker creates a file (and its
> containing directory) named
> '-rf
> /
> guffaw'
> which is infrequently cleaned up by a sysadmin script, things can get
> ugly if the script has not been written carefully.

hmmm ...

rm -rf / guffaw

do you mean that rm then erases the root directory
recursively?  But what is guffaw for?

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: Regexp for marking source code
  2006-08-14 21:13       ` Dieter Wilhelm
@ 2006-08-15 20:58         ` David Kastrup
  0 siblings, 0 replies; 13+ messages in thread
From: David Kastrup @ 2006-08-15 20:58 UTC (permalink / raw)
  Cc: help-gnu-emacs

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> Never heard of multiline file names, are they really in use?

If people use a file system as a sort of key-lookup system, this can
happen.

>> Probably not important in dired, but I have some healthy matching
>> paranoia.  For example, if some joker creates a file (and its
>> containing directory) named
>> '-rf
>> /
>> guffaw'
>> which is infrequently cleaned up by a sysadmin script, things can get
>> ugly if the script has not been written carefully.
>
> hmmm ...
>
> rm -rf / guffaw
>
> do you mean that rm then erases the root directory
> recursively?  But what is guffaw for?

Just something to put behind '/'.  You can actually write
'-rf
/
'

too, and then the file in the directory "-rf\n" has a file "\n".  Note
that this, in contrast to just spaces in file names, causes damage
even when doing

find /tmp -type f|xargs rm -rf

because then you'll get calls

rm -rf -rf
rm -rf /
rm -rf

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Regexp for marking source code
  2006-08-07 17:28 Regexp for marking source code Ken Goldman
  2006-08-07 17:34 ` David Kastrup
@ 2006-09-06  4:06 ` David Combs
  2006-09-06 17:51   ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: David Combs @ 2006-09-06  4:06 UTC (permalink / raw)


In article <44d8c969$1@news.greennet.net>,
Ken Goldman  <kgold@watson.ibm.com> wrote:
>The dired Q command seems quite useful, but
>regexp syntax is obscure enough that I can't quite
>get what I want.
>


What *is* this dired "Q" command?

I got into a dired-buf, did C-h k, and typed in Q,
and got this:



q runs the command quit-window
   which is an interactive compiled Lisp function in `window'.
It is bound to q.
(quit-window &optional KILL WINDOW)

Quit the current buffer.  Bury it, and maybe delete the selected frame.
(The frame is deleted if it is contains a dedicated window for the buffer.)
With a prefix argument, kill the buffer instead.

Noninteractively, if KILL is non-nil, then kill the current buffer,
otherwise bury it.

If WINDOW is non-nil, it specifies a window; we delete that window,
and the buffer that is killed or buried is the one in that window.




What am I doing wrong?


Thanks,

David

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

* Re: Regexp for marking source code
  2006-09-06  4:06 ` David Combs
@ 2006-09-06 17:51   ` Eli Zaretskii
  2006-09-06 18:10     ` Arnaldo Mandel
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2006-09-06 17:51 UTC (permalink / raw)


> From: dkcombs@panix.com (David Combs)
> Date: Wed, 6 Sep 2006 04:06:28 +0000 (UTC)
> 
> In article <44d8c969$1@news.greennet.net>,
> Ken Goldman  <kgold@watson.ibm.com> wrote:
> >The dired Q command seems quite useful, but
> >regexp syntax is obscure enough that I can't quite
> >get what I want.
> >
> 
> What *is* this dired "Q" command?
> 
> I got into a dired-buf, did C-h k, and typed in Q,
> and got this:
> 
> q runs the command quit-window
> [...]
> What am I doing wrong?

I don't know, but one thing to try is "emacs -q --no-site-file".

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

* Re: Regexp for marking source code
  2006-09-06 17:51   ` Eli Zaretskii
@ 2006-09-06 18:10     ` Arnaldo Mandel
  2006-09-06 18:28       ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Arnaldo Mandel @ 2006-09-06 18:10 UTC (permalink / raw)


Eli Zaretskii wrote (on Sep 6, 2006):
 > > From: dkcombs@panix.com (David Combs)
 > > Date: Wed, 6 Sep 2006 04:06:28 +0000 (UTC)
 > > 
 > > In article <44d8c969$1@news.greennet.net>,
 > > Ken Goldman  <kgold@watson.ibm.com> wrote:
 > > >The dired Q command seems quite useful, but
 > > >regexp syntax is obscure enough that I can't quite
 > > >get what I want.
 > > >
 > > 
 > > What *is* this dired "Q" command?
 > > 
 > > I got into a dired-buf, did C-h k, and typed in Q,
 > > and got this:
 > > 
 > > q runs the command quit-window
 > > [...]
 > > What am I doing wrong?
 > 
 > I don't know, but one thing to try is "emacs -q --no-site-file".

On the other hand, typing a "Q" instead of a "q" may be more
effective.

-- 
Arnaldo Mandel                        
am@ime.usp.br
Talvez você seja um Bright http://the-brights.net Maybe you are a Bright.

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

* Re: Regexp for marking source code
  2006-09-06 18:10     ` Arnaldo Mandel
@ 2006-09-06 18:28       ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2006-09-06 18:28 UTC (permalink / raw)


> From: Arnaldo Mandel <am@ime.usp.br>
> Date: Wed, 6 Sep 2006 15:10:28 -0300
> 
>  > > I got into a dired-buf, did C-h k, and typed in Q,
>  > > and got this:
>  > > 
>  > > q runs the command quit-window
>  > > [...]
>  > > What am I doing wrong?
>  > 
>  > I don't know, but one thing to try is "emacs -q --no-site-file".
> 
> On the other hand, typing a "Q" instead of a "q" may be more
> effective.

??? He did type "Q", see above.  The fact that Emacs replied with a
lower-case "q" probably means that the upper-case "Q" is unbound
(that's a standard Emacs feature).

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

end of thread, other threads:[~2006-09-06 18:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07 17:28 Regexp for marking source code Ken Goldman
2006-08-07 17:34 ` David Kastrup
2006-08-07 20:59   ` Org mode modifies files Sébastien Vauban
2006-08-10  5:33     ` claudine
2006-08-13 12:34       ` Sébastien Vauban
2006-08-08 21:12   ` Regexp for marking source code Dieter Wilhelm
     [not found]   ` <mailman.5022.1155124251.9609.help-gnu-emacs@gnu.org>
2006-08-09 12:08     ` David Kastrup
2006-08-14 21:13       ` Dieter Wilhelm
2006-08-15 20:58         ` David Kastrup
2006-09-06  4:06 ` David Combs
2006-09-06 17:51   ` Eli Zaretskii
2006-09-06 18:10     ` Arnaldo Mandel
2006-09-06 18:28       ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).