emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Errors indicated by ineffective backslashes in string literals


From: Stefan Monnier
Subject: Re: Errors indicated by ineffective backslashes in string literals
Date: Sat, 16 Mar 2019 14:25:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Sorry to bother you again, but while trying to get a better understanding of
> regexp usage and errors I found several ineffective backslashes in string
> literals (like "\.") and decided to do something about them.

I went through something similar "recently" and added the corresponding
highlighting in elisp-mode (see elisp--font-lock-backslash in lisp-mode.el).

> -     (directory-files-recursively store-dir "\.gpg$"))))
> +     (directory-files-recursively store-dir "\\.gpg$"))))
                                                      ^
should be \\'

[ Yes, I know it's unrelated, but it's another common (minor) error.  ]

> -                  (if file (replace-regexp-in-string "\.pdf$" ".ps" file)
> +                  (if file (replace-regexp-in-string "\\.pdf$" ".ps" file)
                                                               ^
Here's another ;-)


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]