From: "Mattias Engdegård" <mattiase@acm.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Scan of regexps in Emacs (March 17)
Date: Tue, 19 Mar 2019 11:34:54 +0100 [thread overview]
Message-ID: <05269D79-B016-4FCB-94B8-068BF7D1C2D2@acm.org> (raw)
In-Reply-To: <5363970c-3207-1bb4-8b30-74a7d12277cc@cs.ucla.edu>
19 mars 2019 kl. 02.21 skrev Paul Eggert <eggert@cs.ucla.edu>:
>
> Thanks for doing that. I fixed all the regular expressions I could
> easily fix, by installing the attached patch into master.
Good work, comments below.
> I saw two false alarms, both in lisp/org/org-datetree.el. Both are of
> the form (re-search-forward (format "[chars%%]+" ...) nil t), in which
> both '%' characters are needed. Perhaps you could tweak the trawler to
> not report these?
If you could stomach some sophistry, I believe the Computer is Right here. The argument to org-datetree--find-create is named REGEX, but these strings are not regexps, merely templates for such. Thus, the argument is misnamed; by changing it to REGEX-TEMPLATE, the complaint goes away.
(By the way, I was appalled to discover that `format' doesn't complain about supernumerary arguments. Its (ab)use in this function indicates that it would be hard to change that behaviour.)
> I assume this was a complete trawl, so that I can ignore the earlier
> scans you emailed (I got behind in looking into them). If not, please
> let me know.
Yes, it was complete.
--- a/lisp/auth-source-pass.el
+++ b/lisp/auth-source-pass.el
...
(defun auth-source-pass--parse-data (contents)
"Parse the password-store data in the string CONTENTS and return an alist.
CONTENTS is the contents of a password-store formatted file."
- (let ((lines (split-string contents "\\\n" t "\\\s")))
+ (let ((lines (split-string contents "\n" t "\\\s")))
^^^^
The last argument is also a regexp. Presumably it should be just " ",
or did the author mean any horizontal whitespace?
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -513,7 +513,7 @@ Return the number of characters removed."
(url-http-debug "url-http-parse-response called in (%s)" (buffer-name))
(goto-char (point-min))
(skip-chars-forward " \t\n") ; Skip any blank crap
- (skip-chars-forward "HTTP/") ; Skip HTTP Version
+ (skip-chars-forward "/HPT") ; Skip HTTP Version "HTTP/".
It looks rather like the intention was to skip the very string "HTTP/",
but I suppose that will do. A few lines later:
(setq url-http-response-version
(buffer-substring (point)
(progn
(skip-chars-forward "[0-9].")
^^^^^^
This one should surely not include the brackets.
The HTTP response string is something like "HTTP/1.1 451 CENSORED".
next prev parent reply other threads:[~2019-03-19 10:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-17 13:50 Scan of regexps in Emacs (March 17) Mattias Engdegård
2019-03-19 1:21 ` Paul Eggert
2019-03-19 10:34 ` Mattias Engdegård [this message]
2019-03-20 1:53 ` Paul Eggert
2019-03-20 2:20 ` Stefan Monnier
2019-03-20 22:01 ` Paul Eggert
2019-03-20 22:59 ` Drew Adams
2019-03-20 23:10 ` Paul Eggert
2019-03-21 3:38 ` Eli Zaretskii
[not found] ` <<deeccd91-0f43-c329-6087-17435550b328@cs.ucla.edu>
[not found] ` <<83d0mk6go5.fsf@gnu.org>
2019-03-21 4:21 ` Drew Adams
2019-03-21 14:17 ` Eli Zaretskii
2019-03-21 0:57 ` Stefan Monnier
2019-03-21 11:15 ` Mattias Engdegård
2019-04-02 7:33 ` Paul Eggert
2019-04-02 14:15 ` Mattias Engdegård
2019-04-02 14:26 ` Noam Postavsky
2019-04-02 19:13 ` Mattias Engdegård
2019-04-02 16:58 ` Stefan Monnier
2019-04-02 22:08 ` Paul Eggert
2019-04-03 4:52 ` Eli Zaretskii
2019-04-03 17:02 ` Paul Eggert
2019-04-06 9:43 ` Mattias Engdegård
2019-04-07 8:15 ` Michael Albinus
2019-04-07 9:47 ` Paul Eggert
2019-04-07 10:06 ` Mattias Engdegård
2019-04-07 18:45 ` Paul Eggert
2019-03-21 2:07 ` Richard Stallman
2019-03-22 13:26 ` Stephen Leake
2019-03-22 14:03 ` Stefan Monnier
2019-03-22 14:12 ` Mattias Engdegård
2019-03-20 10:04 ` Mattias Engdegård
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=05269D79-B016-4FCB-94B8-068BF7D1C2D2@acm.org \
--to=mattiase@acm.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).