all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Tyler Smith" <tyler.smith@mail.mcgill.ca>, <help-gnu-emacs@gnu.org>
Subject: RE: special-display-regexps
Date: Fri, 27 Apr 2007 08:06:06 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICCEEJDMAA.drew.adams@oracle.com> (raw)
In-Reply-To: <slrnf33vbc.fqd.tyler.smith@blackbart.mynetwork>

> >> I'm trying to set up special display frames. I want to use if for the
> >> following buffers:
> >>
> >> *Completions*
> >> *Help*
> >> *help[R](functionname)*
> >>
> >> I've tried the following regexps:
> >> (setq special-display-regexps
> >>       '("^\\*Help\\*$"
> >>       "^\\*Completions\\*$"
> >>       "^\\*help\\[R\\]([a-z]*)\\*$"))
> >>
> >> This works fine for the first two, but the third doesn't catch. I've
> >> also tried with single \ and double \, as well as simpler things like
> >> "\*help.*" -- this works for regexp searches when I paste the buffer
> >> name into scratch, but they don't work for the special display. What
> >> am I doing wrong?
> >
> > "[*]Help[*]" etc. is simpler.
> >
> > You want the backslash to be in the string itself, so that the
> > * is escaped.
> > To put a single backslash into a string in Lisp, you need to
> > use \\\\. See node "Regexp Special" in the Elisp manual.
>
> This is really confusing now.
>
>  \\\\*$" matches *Completions*, although I'm not sure
>  why since it is actually the regexp ^*Completions*$, since the double
>  \ should get filtered out by the string reader??

My bad. \\* escapes the `*' OK. You need \\\\ only if you want to escape a
`\', that is, to have a `\' in the string. Here, you just want to escape the
`*'.

> and "^[*]help.*" still doesn't match *help[R](help-topic)* , but the
> same thing entered in a regexp search will match.

The problem with your original code was only this: You have [a-z]*, when you
need [-a-z]*. In your example, you have "(help-topic)", which includes the
character `-', which is not a lowercase letter.

  reply	other threads:[~2007-04-27 15:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2574.1177649782.7795.help-gnu-emacs@gnu.org>
2007-04-27 12:40 ` special-display-regexps Tyler Smith
2007-04-27 15:06   ` Drew Adams [this message]
     [not found] <mailman.2610.1177696237.7795.help-gnu-emacs@gnu.org>
2007-04-27 19:43 ` special-display-regexps Tyler Smith
     [not found] <mailman.2609.1177690056.7795.help-gnu-emacs@gnu.org>
2007-04-27 16:53 ` special-display-regexps Tyler Smith
2007-04-27 17:43   ` special-display-regexps Drew Adams
     [not found] <mailman.2605.1177686747.7795.help-gnu-emacs@gnu.org>
2007-04-27 15:29 ` special-display-regexps Tyler Smith
2007-04-27 16:00   ` special-display-regexps Drew Adams
2007-04-27  2:20 special-display-regexps Tyler Smith
2007-04-27  4:49 ` special-display-regexps Drew Adams

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=DNEMKBNJBGPAOPIJOOICCEEJDMAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tyler.smith@mail.mcgill.ca \
    /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.