all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "B. T. Raven" <nihil@nihilo.net>
To: help-gnu-emacs@gnu.org
Subject: Re: recentf exclude question
Date: Thu, 10 Sep 2009 12:39:42 -0500	[thread overview]
Message-ID: <HLGdnUQef5BFpDTXnZ2dnUVZ_qudnZ2d@posted.cpinternet> (raw)
In-Reply-To: <mailman.6383.1252585965.2239.help-gnu-emacs@gnu.org>

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


      parent reply	other threads:[~2009-09-10 17:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=HLGdnUQef5BFpDTXnZ2dnUVZ_qudnZ2d@posted.cpinternet \
    --to=nihil@nihilo.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.