Closed ghost closed 3 years ago
TL;DR: I was able to work around this by setting the text-quoting-style
variable to 'grave
.
This has been bugging me as well. describe-function
is also broken. I read through the elisp and it seems that a recent change to substitute-command-chars
from a commit last year may have caused an incompatibility between the built-in substitute-command-chars
function and the version that ergoemacs uses to override (via "advice").
Observe the following in a scratch buffer:
(ergoemacs-mode 0)
nil
(substitute-command-keys "`\\([^`']+\\)'")
"‘\\([^‘’]+\\)’"
(ergoemacs-mode 1)
t
(substitute-command-keys "`\\([^`']+\\)'")
"`\\([^`']+\\)'"
Look carefully at the values returned by each substitute-command-keys
because they are different.
One common use in the elisp for substitute-command-keys
has nothing whatsoever to do with command keys. Instead, this function is often used to normalize single quotes based on user preference. From the docs via describe-function
:
Each ‘ and ` is replaced by left quote, and each ’ and ' is replaced by right quote. Left and right quote characters are specified by ‘text-quoting-style’.
The above scratch output is with the default (nil) value for text-quoting-style
and causes the back tick and single-quote to be replaced by unicode equivalents (aka "curved"). The referenced commit for emacs above appears to be trying to resolve multi-byte problems, so maybe this was an unintended side-effect of that success.
I can trick the first substitute-command-keys
function call into matching the ergoemacs version by setting the text-quoting-style
to 'grave
. This deftly avoids the larger problem, which is:
*Help*
buffer, the describe
functions use format-message
which transforms single quotes into their unicode equivalents similar to substitute-command-keys
.substitute-command-keys
to transform the quotes in the regex equivalently.substitute-command-keys
(which does not appear to transform single quotes) and so produced a regular expression that does not match what was just printed.describe-function
does not check to make sure the regular expression found the single quotes.describe-function
attempts to make a clickable button from the regular expression match which failed. The nil
value visible in the OP's stack trace is supposed to be the position returned by the search.I will have to look into this. I think this unicorn quoting was introduced in 25.2, and the original substitute command keys advice was made before then.
lvl1 theme will no longer be supported
This is very similar to issue #466.
I am using GNU Emacs 25.1.2 and ergoemacs-mode-5.14.7.3 installed from elpa.
Steps to reproduce:
emacs -q
debug-on-error
tot
C-h m
I get the following output: