From cada0d387148fc4c8a7589a339dea3394de6b690 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 30 Sep 2022 09:54:01 +0300 Subject: [PATCH] DOC: document quasi-quotation highlighting in the manual --- README.org | 24 ++++++++++++++++++++++-- sweeprolog.el | 8 ++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 7d69447..0d8fbc5 100644 --- a/README.org +++ b/README.org @@ -459,9 +459,9 @@ To choose a style, customize the user option =sweeprolog-faces-style= with apply to all new =sweeprolog-mode= buffers. To apply the new style to an existing buffer, use =C-x x f= (=font-lock-update=) in that buffer. -*** Extra highlighting features +*** Highlighting occurrences of a variable :PROPERTIES: -:CUSTOM_ID: highlighting-extras +:CUSTOM_ID: variable-highlighting :END: #+CINDEX: variable highlighting @@ -485,6 +485,26 @@ highlight, defaulting to the variable at point, if any. If called with a prefix argument (=C-u M-x sweeprolog-highlight-variable=), it clears all variable highlighting in the current clause instead. +*** Quasi-quotation highlighting +:PROPERTIES: +:CUSTOM_ID: qq-highlighting +:END: + +Quasi-quotations in =sweeprolog-mode= buffer are highlighted according +to the Emacs mode corresponding to the quoted language by default. + +#+VINDEX: sweeprolog-qq-mode-alist +The association between SWI-Prolog quasi-quotation types and Emacs +major modes is determined by the user option =sweeprolog-qq-mode-alist=. +To modify the default associations provided by =sweeprolog-mode=, type +=M-x customize-option RET sweeprolog-qq-mode-alist RET=. + +If a quasi-quotation type does not have a matching mode in +=sweeprolog-qq-mode-alist=, the function =sweeprolog-qq-content-face= is +used to determine a default face for quoted content. + + + ** Term-based editing and motion commands :PROPERTIES: :CUSTOM_ID: term-based-commands diff --git a/sweeprolog.el b/sweeprolog.el index 3846c2c..6a14623 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -6,7 +6,7 @@ ;; Maintainer: Eshel Yaron <~eshel/dev@lists.sr.ht> ;; Keywords: prolog languages extensions ;; URL: https://git.sr.ht/~eshel/sweep -;; Package-Version: 0.4.2 +;; Package-Version: 0.4.3 ;; Package-Requires: ((emacs "28")) ;; This file is NOT part of GNU Emacs. @@ -43,7 +43,11 @@ (defcustom sweeprolog-qq-mode-alist '(("graphql" . graphql-mode) ("javascript" . js-mode) ("html" . html-mode)) - "Association between Prolog quasi-quotation types and Emacs modes." + "Association between Prolog quasi-quotation types and Emacs modes. + +This is a list of pairs of the form (TYPE . MODE), where TYPE is +a Prolog quasi-quotation type given as a string, and MODE is a +symbol specifing a major mode." :package-version '((sweeprolog . "0.4.3")) :type '(alist :key-type string :value-type symbol) :group 'sweeprolog) -- 2.39.5