Skip to content
Snippets Groups Projects
Commit 8103c22f authored by Alex Kost's avatar Alex Kost
Browse files

emacs: info: Get rid of syntactic fontification.

* emacs/guix-info.el (guix-info-mode-initialize): New procedure.  Set
  'font-lock-defaults' to avoid syntactic fontification.
  (guix-info-define-interface): Use it.
parent 8bff0c79
No related branches found
No related tags found
No related merge requests found
...@@ -409,6 +409,15 @@ See `insert-text-button' for the meaning of PROPERTIES." ...@@ -409,6 +409,15 @@ See `insert-text-button' for the meaning of PROPERTIES."
(define-derived-mode guix-info-mode special-mode "Guix-Info" (define-derived-mode guix-info-mode special-mode "Guix-Info"
"Parent mode for displaying information in info buffers.") "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) (defmacro guix-info-define-interface (entry-type &rest args)
"Define 'info' interface for displaying ENTRY-TYPE entries. "Define 'info' interface for displaying ENTRY-TYPE entries.
Remaining arguments (ARGS) should have a form [KEYWORD VALUE] ... Remaining arguments (ARGS) should have a form [KEYWORD VALUE] ...
...@@ -465,6 +474,7 @@ After calling each METHOD, a new line is inserted." ...@@ -465,6 +474,7 @@ After calling each METHOD, a new line is inserted."
'guix-info-data ',entry-type) 'guix-info-data ',entry-type)
(guix-buffer-define-interface info ,entry-type (guix-buffer-define-interface info ,entry-type
:mode-init-function 'guix-info-mode-initialize
,@%foreign-args))))) ,@%foreign-args)))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment