I'm using a custom mode that I believe is based on cc-mode, and it's been working great for years. Recently, I upgraded to Ubuntu 20.04, which brought Emacs to 26.3 (I forget what it was before, maybe 25.2.2), and now, my single-quoted strings are not being highlighted correctly anymore (while double-quoted strings are working fine):

enter image description here

How can I fix this?

  • My suggestion, unless you happen to get a helpful answer here, is to contact the maintainer of that code.
    – Drew
    Jan 4, 2021 at 21:52
  • That's a fine suggestion, @Drew, thanks. I was just hoping some emacs-minded folks here could help.
    – Jeff Ward
    Jan 4, 2021 at 23:41

1 Answer 1


Well, I didn't want to downgrade emacs for a simple formatting problem, but I suppose that's my option as I wait for a better answer.

I didn't find a repo for 20.04 with old emacs 25, so I built it from source. Here's what I did, in case you or I have to do it again:

First, remove apt-installed emacs:

sudo apt-get remove --purge emacs emacs-gtk

Download http://mirrors.ocf.berkeley.edu/gnu/emacs/emacs-25.2.tar.gz - personally I untarred it in /opt/ which may require sudo or chown

My first ./configure complained about missing support for gif, tiff, and xpm -- don't care, build without.

cd /opt/emacs-25.2
./configure --with-xpm=no --with-gif=no --with-tiff=no

Finally, symlink this to /usr/bin/emacs so it's available system-wide:

sudo ln -s /opt/emacs-25.2/src/emacs /usr/bin/emacs

And voila, the formatting works again, highlighting single-or-double quoted strings the same:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.