[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
27/38: emacs: info: Get rid of syntactic fontification.
From: |
Alex Kost |
Subject: |
27/38: emacs: info: Get rid of syntactic fontification. |
Date: |
Sat, 02 Jan 2016 14:27:25 +0000 |
alezost pushed a commit to branch master
in repository guix.
commit 8103c22fea9eef5e6ed1b97fedb565e0296bb6e3
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 d71d8f5..871c4b0 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)))))
- 03/38: emacs: Add API for 'guix-entry'., (continued)
- 03/38: emacs: Add API for 'guix-entry'., Alex Kost, 2016/01/02
- 06/38: emacs: Rename internal procedures., Alex Kost, 2016/01/02
- 11/38: emacs: list: Generalize 'describe' code., Alex Kost, 2016/01/02
- 14/38: emacs: list: Split 'guix-list-format' variable., Alex Kost, 2016/01/02
- 20/38: emacs: Add wrappers for 'history-size' and 'revert-confirm'., Alex Kost, 2016/01/02
- 23/38: emacs: Generalize buffer reverting., Alex Kost, 2016/01/02
- 19/38: emacs: Split 'guix-param-titles' variable., Alex Kost, 2016/01/02
- 25/38: emacs: info: Buttonize package name heading., Alex Kost, 2016/01/02
- 22/38: emacs: Generalize buffer redisplaying., Alex Kost, 2016/01/02
- 21/38: emacs: Split 'guix-root-map' keymap., Alex Kost, 2016/01/02
- 27/38: emacs: info: Get rid of syntactic fontification.,
Alex Kost <=
- 24/38: emacs: Improve messages for packages found by ID., Alex Kost, 2016/01/02
- 18/38: emacs: info: Split 'guix-info-format' variable., Alex Kost, 2016/01/02
- 32/38: emacs: Add 'guix-list-get-display-entries'., Alex Kost, 2016/01/02
- 17/38: emacs: Factorize macros for defining interfaces., Alex Kost, 2016/01/02
- 33/38: emacs: Return nil instead of "" in completing readers., Alex Kost, 2016/01/02
- 31/38: emacs: Add 'list-single' variables., Alex Kost, 2016/01/02
- 29/38: emacs: Reorganize 'readers' code., Alex Kost, 2016/01/02
- 26/38: emacs: Generalize buffer naming., Alex Kost, 2016/01/02
- 35/38: emacs: Add 'guix-ui-read-profile'., Alex Kost, 2016/01/02
- 37/38: emacs: Use "B" key in "Package List" to display latest builds., Alex Kost, 2016/01/02