From: Glenn Morris <rgm@gnu.org>
To: "Samuel Lê" <samuel.le@gmail.com>
Cc: 17631@debbugs.gnu.org
Subject: bug#17631: 24.3.50; the following should return t
Date: Thu, 29 May 2014 11:51:42 -0400 [thread overview]
Message-ID: <drmwe0y44x.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CABEr5Bs_dp3mYTaboq=E1Kp32WH1bBMJEWWLxfBxKFGzJMJcEw@mail.gmail.com> ("Samuel Lê"'s message of "Thu, 29 May 2014 16:38:02 +0200")
Samuel Lê wrote:
> I ran this code, as someone recommanded on the #emacs chan of freenode:
> (with-temp-buffer
> (insert "foo Bar")
> (goto-char (point-min))
> (re-search-forward "[[:upper:]]")
> (looking-at "Bar"))
>
> t was expected, but instead I got returned nil.
Your expectation is incorrect, for two reasons:
1. `[:upper:]'
This matches any upper-case letter, as determined by the current
case table (*note Case Tables::). If `case-fold-search' is
non-`nil', this also matches any lower-case letter.
2. re-search-forward leaves point at the end of the match, ie after "B"
in this case.
Compare:
(with-temp-buffer
(insert "foo Bar")
(goto-char (point-min))
(let (case-fold-search)
(re-search-forward "[[:upper:]]")
(looking-at "ar")))
The help-gnu-emacs mailing list is probably a better place to discuss
these things, but feel free to keep talking about it here.
I'll close this report though, since it is not a bug.
next prev parent reply other threads:[~2014-05-29 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 14:38 bug#17631: 24.3.50; the following should return t Samuel Lê
2014-05-29 15:51 ` Glenn Morris [this message]
2014-05-29 15:52 ` Eli Zaretskii
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=drmwe0y44x.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=17631@debbugs.gnu.org \
--cc=samuel.le@gmail.com \
/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.