emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagno


From: Paul Eggert
Subject: Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagnostics
Date: Mon, 17 Aug 2015 09:39:38 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Bastien Guerry wrote:
I sometimes use something like

   find . -type f -exec grep --color -nH -e "\`.\+'" {} +

from M-x fing-grep to match variables in docstrings among various
files.

If the code is using ‘...’ quotes, how can I grep to match quoted
strings?

You can use curved quotes in the grep pattern. I just now tried the above command in the Emacs source code and got 108,000 hits, mostly false alarms. I had better luck with this:

find . -name test -prune -o '(' -name '*.el' -o -name '*.c' ')' -exec \
  grep --color -nH -Ee \
  "[\`'‘][[:alpha:]][[:alnum:]]*-[[:alnum:]-]*[[:alnum:]][’']" \
  {} +

This yields only 39,000 hits, mostly not false alarms. Although this is the sort of thing one would want to package up rather than type by hand, the curved quotes aren't the major reason for needing packaging.



reply via email to

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