Subject: bug#31231: Symbol search broken in NEWS and ChangeLogs

From: Juri Linkov <[email-masked]>
Date: Wed, 25 Apr 2018 22:38:10 +0300

>> > Emacs itself does, not just in Info.  The standalone Info reader (part
>> > of the Texinfo package) has a slightly different solution.
>>
>> Then using the same solution as not just for Info, Emacs will automatically
>> substitute ASCII characters for undisplayable Unicode ones in all
>> other places like NEWS and ChangeLogs.
>
> You for some reason elided the part where I explained why an
> Emacs-only solution is unacceptable.

You said that using Unicode quotes will make it harder to view the files
on text terminals that don't support UTF-8.  This means that we have
to find another solution.  Maybe just removing quote characters is enough.
If not, then modifying the syntax of ‘'’ to ‘expression quote’ looks good
since it will correctly handle spell-checking words with an apostrophe
with this patch that solves the problem for ChangeLogs:

diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index 4c64ae1..629470a 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
@@ -1024,6 +1024,12 @@ change-log-indent
 (defvar smerge-resolve-function)
 (defvar copyright-at-end-flag)
 
+(defvar change-log-mode-syntax-table
+  (let ((st (make-syntax-table)))
+    (modify-syntax-entry ?' "'   " st)
+    st)
+  "Syntax table used while in `change-log-mode'.")
+
 ;;;###autoload
 (define-derived-mode change-log-mode text-mode "Change Log"
   "Major mode for editing change logs; like Indented Text mode.

>> It's a good habit to use symbol search to search symbols because
>> it reduces the likelihood of errors, so using it should be
>> encouraged in NEWS and ChangeLogs.
>
> I think you are trying to use features that make no sense in
> text-based modes.  Just because the text mentions symbols quoted in
> some way doesn't yet mean that text is like a program source.

NEWS and ChangeLogs are not just conventional prose, they are
technical writings with symbol references, so they should be
handled exactly the same way as Emacs Info manuals, docstrings
and code comments.

> Maybe we should have separate (sub)commands for when symbols are
> mentioned within human-readable text.  Tweaking what a word is due to
> this is a too large hammer, IMO.

Maybe creating a new minor mode for NEWS files that in addition
to modifying the syntax of quotes will also highlight quoted symbols
with a special face like is used currently in Info.