guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

27/35: emacs: info: Get rid of syntactic fontification.


From: Alex Kost
Subject: 27/35: emacs: info: Get rid of syntactic fontification.
Date: Fri, 11 Dec 2015 11:42:40 +0000

alezost pushed a commit to branch wip-refactor-emacs-ui
in repository guix.

commit 9491a19433e7b756e770aaeecacd5f9690f36ccd
Author: Alex Kost <address@hidden>
Date:   Fri Nov 27 16:01:20 2015 +0300

    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.
---
 emacs/guix-info.el |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/emacs/guix-info.el b/emacs/guix-info.el
index 962c546..77f4cfb 100644
--- a/emacs/guix-info.el
+++ b/emacs/guix-info.el
@@ -404,6 +404,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] ...
@@ -460,6 +469,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)))))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]