summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/guix-info.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/emacs/guix-info.el b/emacs/guix-info.el
index d71d8f52a3..871c4b085f 100644
--- a/emacs/guix-info.el
+++ b/emacs/guix-info.el
@@ -409,6 +409,15 @@ See `insert-text-button' for the meaning of PROPERTIES."
 (define-derived-mode guix-info-mode special-mode "Guix-Info"
   "Parent mode for displaying information in info buffers.")
 
+(defun guix-info-mode-initialize ()
+  "Set up the current 'info' buffer."
+  ;; Without this, syntactic fontification is performed, and it may
+  ;; break our highlighting.  For example, description of "emacs-typo"
+  ;; package contains a single " (double-quote) character, so the
+  ;; default syntactic fontification highlights the rest text after it
+  ;; as a string.  See (info "(elisp) Font Lock Basics") for details.
+  (setq font-lock-defaults '(nil t)))
+
 (defmacro guix-info-define-interface (entry-type &rest args)
   "Define 'info' interface for displaying ENTRY-TYPE entries.
 Remaining arguments (ARGS) should have a form [KEYWORD VALUE] ...
@@ -465,6 +474,7 @@ After calling each METHOD, a new line is inserted."
           'guix-info-data ',entry-type)
 
          (guix-buffer-define-interface info ,entry-type
+           :mode-init-function 'guix-info-mode-initialize
            ,@%foreign-args)))))