[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog e38825d0e2 066/166: ENHANCED: use a distinct fa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog e38825d0e2 066/166: ENHANCED: use a distinct face for structured comments |
Date: |
Fri, 30 Sep 2022 04:59:26 -0400 (EDT) |
branch: elpa/sweeprolog
commit e38825d0e2dba7f89d34693ee5733011df6f6edb
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
ENHANCED: use a distinct face for structured comments
---
README.org | 18 ++++++++++++++++++
sweep.el | 12 +++++++++---
sweep.pl | 3 +++
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/README.org b/README.org
index a72e9b2186..03c7b6afb2 100644
--- a/README.org
+++ b/README.org
@@ -261,6 +261,24 @@ Prolog terms to Elisp objects]]) and passed as a sole
argument to the
invoked Elisp function. The =sweep_funcall/2= variant invokes the Elisp
function without any arguments.
+* Editing Prolog code
+:PROPERTIES:
+:CUSTOM_ID: editing-prolog-code
+:END:
+
+#+CINDEX: sweep-mode
+#+FINDEX: sweep-mode
+#+VINDEX: sweep-mode
+=sweep= includes a dedicated major mode for reading and editing Prolog
+code, called =sweep-mode=. To activate this mode in a buffer, type =M-x
+sweep-mode=. To instruct Emacs to always open Prolog files in
+=sweep-mode=, modify the Emacs variable =auto-mode-alist= like so:
+
+#+begin_src emacs-lisp
+ (add-to-list 'auto-mode-alist '("\\.pl\\'" . sweep-mode))
+ (add-to-list 'auto-mode-alist '("\\.plt\\'" . sweep-mode))
+#+end_src
+
* The Prolog top-level
:PROPERTIES:
:CUSTOM_ID: prolog-top-level
diff --git a/sweep.el b/sweep.el
index d081839c38..f71c3d4af4 100644
--- a/sweep.el
+++ b/sweep.el
@@ -6,7 +6,7 @@
;; Maintainer: Eshel Yaron <me(at)eshelyaron(dot)com>
;; Keywords: prolog languages extensions
;; URL: https://git.sr.ht/~eshel/sweep
-;; Package-Version: 0.1.0
+;; Package-Version: 0.1.1
;; Package-Requires: ((emacs "27"))
;; This file is NOT part of GNU Emacs.
@@ -561,6 +561,11 @@ module name, F is a functor name and N is its arity."
(arg (cddr args)))
(with-silent-modifications
(pcase arg
+ (`("comment" . ,k)
+ (put-text-property beg end 'font-lock-face
+ (pcase k
+ ("structured" sweep-structured-comment-face)
+ (_ sweep-comment-face))))
(`("head" . ,h)
(put-text-property beg end 'font-lock-face
(pcase h
@@ -607,7 +612,6 @@ module name, F is a functor name and N is its arity."
("string" (put-text-property beg end 'font-lock-face
sweep-string-face))
("module" (put-text-property beg end 'font-lock-face
sweep-module-face))
("neck" (put-text-property beg end 'font-lock-face
sweep-neck-face))
- ("comment" (put-text-property beg end 'font-lock-face
sweep-comment-face))
("hook" (put-text-property beg end 'font-lock-face
sweep-hook-face))
("qq_type" (put-text-property beg end 'font-lock-face
sweep-qq-type-face))
("qq_sep" (put-text-property beg end 'font-lock-face
sweep-qq-sep-face))
@@ -855,7 +859,9 @@ Interactively, a prefix arg means to prompt for BUFFER."
(defvar-keymap sweep-mode-map
:doc "Keymap for `sweep-mode'."
- "C-c C-c" #'sweep-colourise-buffer)
+;;"C-c C-l" #'sweep-load-buffer
+ "C-c C-c" #'sweep-colourise-buffer
+ "C-c C-t" #'sweep-top-level)
(defun sweep-indent-line ()
(interactive)
diff --git a/sweep.pl b/sweep.pl
index a856240e57..a8e53b6aba 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -332,6 +332,9 @@ sweep_color_normalized_(Offset, syntax_error,
[Message0,Start0-End0|_], ["syntax
Start is Start0 + Offset,
End is End0 + Offset,
atom_string(Message0, Message).
+sweep_color_normalized_(Offset, comment, [Kind0|_], ["comment"|Kind]) :-
+ !,
+ atom_string(Kind0, Kind).
sweep_color_normalized_(_, Nom0, _, Nom) :-
atom_string(Nom0, Nom).
- [nongnu] elpa/sweeprolog 2f5dd9f13c 024/166: FIXED: Use more robust Prolog to C string conversion, (continued)
- [nongnu] elpa/sweeprolog 2f5dd9f13c 024/166: FIXED: Use more robust Prolog to C string conversion, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5f0f223318 023/166: Use LD_PRELOAD for testing, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ea04f467b9 027/166: ADDED: sweep-pack-install for interactively installing packs, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 25bda86c48 032/166: Use load-file-path instead of custom hack, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c5b1504ca8 033/166: ADDED: sweep-top-level command and appropriate mode, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog a06906287f 036/166: ADDED: sweep_funcall/2, 3 for calling Elisp functions from Prolog, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5b23e9819b 038/166: DOC: Add Prolog initialization section to the manual, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 4e4d8508cd 039/166: ENHANCED: Allow using swipl compiled with GMP, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 4b4b28f15a 007/166: Add module descriptions to sweep-find-module annotation function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0078ef8ff0 060/166: ENHANCED: syntax errors coloring, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog e38825d0e2 066/166: ENHANCED: use a distinct face for structured comments,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 84e6182685 077/166: FIXED: detect "|:" prompt in the top-level, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6e5c822fc8 116/166: ADDED: sweep-colourise-buffer-on-idle user option, on by default, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog a7ce69558e 111/166: Makefile: Use "--batch" instead of "-batch" for consistency, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5b54d23b8b 086/166: ENHANCED: apply an appropriate face to global predicate calls, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog d9b8ffccda 107/166: ADDED: (sweep-mode-map): bind C-c C-o to sweep-find-file-at-point, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ecc36d67e1 089/166: FIXED: handle some missing color terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog f72ebe6d62 127/166: ENHANCHED: automatic syntax aware autoindentation in sweep-mode, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ccaa53a19c 147/166: DOC: update installation instruction to reflect inclusion in swipl, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c8192b8c31 145/166: DOC: document imenu support in sweep-mode buffers, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6b9e2a7833 139/166: Tweak README to prevent a hosting platform from failing to render it, ELPA Syncer, 2022/09/30