unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* recentf exclude question
@ 2009-09-09 21:19 B. T. Raven
  2009-09-09 23:43 ` Andreas Politz
       [not found] ` <mailman.6340.1252539848.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: B. T. Raven @ 2009-09-09 21:19 UTC (permalink / raw)
  To: help-gnu-emacs

I want only .txt, .tex, and the .emacs files listed in recentf (under 
Open Recent). Is there some way to construct a regular expression to 
prevent other opened files from being added to the list?

Thanks,
Ed


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

* Re: recentf exclude question
  2009-09-09 21:19 recentf exclude question B. T. Raven
@ 2009-09-09 23:43 ` Andreas Politz
       [not found] ` <mailman.6340.1252539848.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Politz @ 2009-09-09 23:43 UTC (permalink / raw)
  To: help-gnu-emacs

"B. T. Raven" <nihil@nihilo.net> writes:

> I want only .txt, .tex, and the .emacs files listed in recentf (under
> Open Recent). Is there some way to construct a regular expression to
> prevent other opened files from being added to the list?
>
> Thanks,
> Ed

Try this.

(setq recentf-exclude nil
      recentf-include '("\\.t\\(ex\\|xt\\)\\'" "\\`\\.emacs\\'"))

-ap





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

* Re: recentf exclude question
       [not found] ` <mailman.6340.1252539848.2239.help-gnu-emacs@gnu.org>
@ 2009-09-10  1:07   ` B. T. Raven
  2009-09-10  8:00     ` Peter Dyballa
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: B. T. Raven @ 2009-09-10  1:07 UTC (permalink / raw)
  To: help-gnu-emacs

Andreas Politz wrote:
> "B. T. Raven" <nihil@nihilo.net> writes:
> 
>> I want only .txt, .tex, and the .emacs files listed in recentf (under
>> Open Recent). Is there some way to construct a regular expression to
>> prevent other opened files from being added to the list?
>>
>> Thanks,
>> Ed
> 
> Try this.
> 
> (setq recentf-exclude nil
>       recentf-include '("\\.t\\(ex\\|xt\\)\\'" "\\`\\.emacs\\'"))
> 
> -ap
> 
> 
> 

I find a recentf-keep variable in vers. 22 and 23 but no 
recentf-include. Anyway I evaluated the expression but it didn't prevent 
any types of files from being added to the list. Your first regular 
expression in the list with bar disjunction doesn't have a backtick to 
match the tick before the double quote; is this on purpose? I don't see 
how the first regexp specifies any number of characters before tex or 
txt and the second no characters. It looks like tex and txt are kept if 
I change the variable in your expression to recentf-include but .emacs 
isn't added to the list.

???

Ed


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

* Re: recentf exclude question
  2009-09-10  1:07   ` B. T. Raven
@ 2009-09-10  8:00     ` Peter Dyballa
  2009-09-10 12:32     ` Andreas Politz
       [not found]     ` <mailman.6383.1252585965.2239.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2009-09-10  8:00 UTC (permalink / raw)
  To: B. T. Raven; +Cc: help-gnu-emacs


Am 10.09.2009 um 03:07 schrieb B. T. Raven:

> Your first regular expression in the list with bar disjunction  
> doesn't have a backtick to match the tick before the double quote;  
> is this on purpose?


What you call a "backtick" are apostrophes ('`' are called  
backticks). And neither matches. \' (or escaped \\') is a regular  
expression for a word's end. So

	"\\.t\\(ex\\|xt\\)\\'"

stands for all words which end in '.tex' or '.txt'.

--
Greetings

   Pete

The world would be a better place if Larry Wall had been born in  
Iceland, or any other country where the native language actually has  
syntax.
				– Peter da Silva







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

* Re: recentf exclude question
  2009-09-10  1:07   ` B. T. Raven
  2009-09-10  8:00     ` Peter Dyballa
@ 2009-09-10 12:32     ` Andreas Politz
       [not found]     ` <mailman.6383.1252585965.2239.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Andreas Politz @ 2009-09-10 12:32 UTC (permalink / raw)
  To: help-gnu-emacs

"B. T. Raven" <nihil@nihilo.net> writes:

> Andreas Politz wrote:
>> "B. T. Raven" <nihil@nihilo.net> writes:
>>
>>> I want only .txt, .tex, and the .emacs files listed in recentf (under
>>> Open Recent). Is there some way to construct a regular expression to
>>> prevent other opened files from being added to the list?
>>>
>>> Thanks,
>>> Ed
>>
>> Try this.
>>
>> (setq recentf-exclude nil
>>       recentf-include '("\\.t\\(ex\\|xt\\)\\'" "\\`\\.emacs\\'"))
>>
>> -ap
>>
>>
>>
>
> I find a recentf-keep variable in vers. 22 and 23 but no
> recentf-include. Anyway I evaluated the expression but it didn't
> prevent any types of files from being added to the list. Your first
> regular expression in the list with bar disjunction doesn't have a
> backtick to match the tick before the double quote; is this on
> purpose? I don't see how the first regexp specifies any number of
> characters before tex or txt and the second no characters. It looks
> like tex and txt are kept if I change the variable in your expression
> to recentf-include but .emacs isn't added to the list.
>
> ???
>
> Ed

\` and \' match at the beginning and end of a string or buffer.

The regexp does not necessarily have to match the whole file-name.

Yes, it's called recentf-keep.

Yes,the \` before .emacs is to restrictive, remove it. Or replace it
with [/\\] (match directory separator character).

-ap









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

* Re: recentf exclude question
       [not found]     ` <mailman.6383.1252585965.2239.help-gnu-emacs@gnu.org>
@ 2009-09-10 17:39       ` B. T. Raven
  0 siblings, 0 replies; 6+ messages in thread
From: B. T. Raven @ 2009-09-10 17:39 UTC (permalink / raw)
  To: help-gnu-emacs

Andreas Politz wrote:
> "B. T. Raven" <nihil@nihilo.net> writes:
> 
>> Andreas Politz wrote:
>>> "B. T. Raven" <nihil@nihilo.net> writes:
>>>
>>>> I want only .txt, .tex, and the .emacs files listed in recentf (under
>>>> Open Recent). Is there some way to construct a regular expression to
>>>> prevent other opened files from being added to the list?
>>>>
>>>> Thanks,
>>>> Ed
>>> Try this.
>>>
>>> (setq recentf-exclude nil
>>>       recentf-include '("\\.t\\(ex\\|xt\\)\\'" "\\`\\.emacs\\'"))
>>>
>>> -ap
>>>
>>>
>>>
>> I find a recentf-keep variable in vers. 22 and 23 but no
>> recentf-include. Anyway I evaluated the expression but it didn't
>> prevent any types of files from being added to the list. Your first
>> regular expression in the list with bar disjunction doesn't have a
>> backtick to match the tick before the double quote; is this on
>> purpose? I don't see how the first regexp specifies any number of
>> characters before tex or txt and the second no characters. It looks
>> like tex and txt are kept if I change the variable in your expression
>> to recentf-include but .emacs isn't added to the list.
>>
>> ???
>>
>> Ed
> 
> \` and \' match at the beginning and end of a string or buffer.
> 
> The regexp does not necessarily have to match the whole file-name.
> 
> Yes, it's called recentf-keep.
> 
> Yes,the \` before .emacs is to restrictive, remove it. Or replace it
> with [/\\] (match directory separator character).
> 
> -ap

Thanks, Peter and Andreas. This expression filters out what I want to 
ignore:

(setq recentf-exclude nil
       recentf-keep '("\\.t\\(ex\\|xt\\)\\'" "\\.emacs\\'"))

If I do this through Custom I guess I don't need (and can't use the bar 
expression) the escape mechanism to prevent inappropriate interpretation 
by the lisp reader. Do I just set recentf-exclude to nil and use the 
three strings ".txt" ".tex" and ".emacs" in Customize or can the same 
regexps in the setq be used there too?

Ed


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

end of thread, other threads:[~2009-09-10 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09 21:19 recentf exclude question B. T. Raven
2009-09-09 23:43 ` Andreas Politz
     [not found] ` <mailman.6340.1252539848.2239.help-gnu-emacs@gnu.org>
2009-09-10  1:07   ` B. T. Raven
2009-09-10  8:00     ` Peter Dyballa
2009-09-10 12:32     ` Andreas Politz
     [not found]     ` <mailman.6383.1252585965.2239.help-gnu-emacs@gnu.org>
2009-09-10 17:39       ` B. T. Raven

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).