[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 04964e36b4 143/166: ENHANCED: also update highl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 04964e36b4 143/166: ENHANCED: also update highlighting between sub terms |
Date: |
Fri, 30 Sep 2022 04:59:32 -0400 (EDT) |
branch: elpa/sweeprolog
commit 04964e36b45ae6c0e6703aadf73b58db89a5b72f
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
ENHANCED: also update highlighting between sub terms
---
sweep.el | 81 +++++++++++++++++++++++++++++++++++++++++++++++++---------------
sweep.pl | 22 +++++++++++++++---
2 files changed, 81 insertions(+), 22 deletions(-)
diff --git a/sweep.el b/sweep.el
index 9cb6b1a35d..8297f5262b 100644
--- a/sweep.el
+++ b/sweep.el
@@ -911,20 +911,6 @@ module name, F is a functor name and N is its arity."
(:weight bold)
"Dict separators.")
-(sweep-defface
- type-error
- (:inherit font-lock-warning-face)
- (:foreground "orange")
- (:foreground "orange")
- "Type errors.")
-
-(sweep-defface
- instantiation-error
- (:inherit font-lock-warning-face)
- (:foreground "orange")
- (:foreground "orange")
- "Instantiation errors.")
-
(sweep-defface
file
(:inherit button)
@@ -1040,17 +1026,66 @@ module name, F is a functor name and N is its arity."
(sweep-defface
error
(:inherit font-lock-warning-face)
- (:foreground "orange")
- (:foreground "orange")
+ (:background "orange")
+ (:background "orange")
"Unspecified errors.")
+(sweep-defface
+ type-error
+ (:inherit font-lock-warning-face)
+ (:background "orange")
+ (:background "orange")
+ "Type errors.")
+
+(sweep-defface
+ instantiation-error
+ (:inherit font-lock-warning-face)
+ (:background "orange")
+ (:background "orange")
+ "Instantiation errors.")
+
(sweep-defface
syntax-error
(:inherit error)
- (:foreground "orange")
- (:foreground "orange")
+ (:background "orange")
+ (:background "orange")
"Syntax errors.")
+(sweep-defface
+ around-syntax-error
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Text around a syntax error.")
+
+(sweep-defface
+ clause
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Predicate clauses.")
+
+(sweep-defface
+ grammar-rule
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "DCG grammar rules.")
+
+(sweep-defface
+ term
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Top terms.")
+
+(sweep-defface
+ directive
+ (:inherit default)
+ (:inherit default)
+ (:inherit default)
+ "Directives.")
+
(sweep-defface
structured-comment
(:inherit font-lock-doc-face)
@@ -1083,7 +1118,11 @@ module name, F is a functor name and N is its arity."
(`("goal",(rx "imported(") . ,_) (sweep-imported-face))
(`("goal",(rx "global(") . ,_) (sweep-global-face))
(`("goal",(rx "local(") . ,_) (sweep-local-face))
- (`("syntax_error" ,_message ,_eb ,_ee) (sweep-syntax-error-face))
+ (`("syntax_error" ,_message ,eb ,ee)
+ (with-silent-modifications
+ (put-text-property eb ee 'font-lock-face
+ (sweep-around-syntax-error-face)))
+ (sweep-syntax-error-face))
("unused_import" (sweep-unused-import-face))
("undefined_import" (sweep-undefined-import-face))
("html_attribute" (sweep-html-attribute-face))
@@ -1120,6 +1159,10 @@ module name, F is a functor name and N is its arity."
("file_no_depend" (sweep-file-no-depend-face))
("nofile" (sweep-no-file-face))
("op_type" (sweep-op-type-face))
+ ("directive" (sweep-directive-face))
+ ("clause" (sweep-clause-face))
+ ("term" (sweep-term-face))
+ ("grammar_rule" (sweep-grammar-rule-face))
("method" (sweep-method-face))
("class" (sweep-class-face))))
diff --git a/sweep.pl b/sweep.pl
index 3556a752f4..a161694a6b 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -126,9 +126,14 @@ sweep_colourise_buffer_(Path0, Contents, []) :-
asserta(sweep_source_time(Path, Time), Ref1),
xref_source(Path, []),
seek(Contents, 0, bof, _),
+ retractall(sweep_current_comment(_, _, _)),
prolog_colourise_stream(Contents,
Path,
- sweep_handle_query_color(1)),
+ sweep_handle_color(1)),
+ forall(sweep_current_comment(Kind, Start, Len),
+ ( atom_string(Kind, String),
+ user:sweep_funcall("sweep--colourise",
[Start,Len,"comment"|String], _)
+ )),
erase(Ref0),
erase(Ref1).
@@ -311,10 +316,15 @@ sweep_colourise_some_terms_(Path0, Offset, Contents, [])
:-
set_stream(Contents, file_name(Path)),
seek(Contents, 0, bof, _),
findall(Op, xref_op(Path, Op), Ops),
+ retractall(sweep_current_comment(_, _, _)),
prolog_colourise_stream(Contents,
Path,
- sweep_handle_query_color(Offset),
- [operators(Ops)]).
+ sweep_handle_color(Offset),
+ [operators(Ops)]),
+ forall(sweep_current_comment(Kind, Start, Len),
+ ( atom_string(Kind, String),
+ user:sweep_funcall("sweep--colourise",
[Start,Len,"comment"|String], _)
+ )).
sweep_documentation([Path, Functor, Arity], Docs) :-
atom_string(P, Path),
@@ -589,6 +599,12 @@ sweep_pack_info(pack(Name0, _, Desc0, Version0, URLS0),
[Name, Desc, Version, UR
sweep_pack_install(PackName, []) :-
atom_string(Pack, PackName), pack_install(Pack, [silent(true),
upgrade(true), interactive(false)]).
+sweep_handle_color(Offset, comment(Kind), Beg, Len) :-
+ !,
+ Start is Beg + Offset,
+ asserta(sweep_current_comment(Kind, Start, Len)).
+sweep_handle_color(Offset, Col, Beg, Len) :-
+ sweep_handle_query_color(Offset, Col, Beg, Len).
sweep_colourise_query([String|Offset], _) :-
prolog_colourise_query(String, module(sweep),
sweep_handle_query_color(Offset)).
- [nongnu] elpa/sweeprolog a563bc36dc 121/166: FIXED: package-lint complaint about autoloaded private function, (continued)
- [nongnu] elpa/sweeprolog a563bc36dc 121/166: FIXED: package-lint complaint about autoloaded private function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c94b509fcb 119/166: DOC: Add Top-level history section, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog fc6c2964d9 105/166: ADDED: (sweep-file-at-point): new function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 1f83ce9f04 088/166: FIXED: use operators from xref in sweep_colourise_some_terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 92f599fbbc 094/166: FIXED: premature cut in sweep_predicate_location/2, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 9d87b4d445 131/166: BUILD: rely on preexisting emacs-module.h, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 504d4ff714 136/166: Find Emacs as `emacs`, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 07fc84b716 140/166: DOC: document new user option sweep-faces-style, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog f7dfbda2f2 148/166: Update LICENSE, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog b6e444bbdc 152/166: FIXED: remove message_hook during cleanup to avoid possible crash, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 04964e36b4 143/166: ENHANCED: also update highlighting between sub terms,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 8affae71da 138/166: ADDED: sweep-faces-style user option for controlling highlighting, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 615312796c 048/166: FIXED: copy paste error (singleton variable), ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 37f83755f6 049/166: PORT: detect older swipl and disable custom GMP alloc functions, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 3139de3e6c 056/166: ENHANCED: prompt for buffer name in sweep-top-level with C-u, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ea43b81c95 058/166: DOC: update manual section about filespec expansion, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 3351766605 103/166: sweep.el: bump Package-Version to 0.2.0, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5b9e2d7d7c 126/166: ADDED: sweep_op_info/2: new_predicate, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5eb4ede8f8 113/166: ADDED: (sweep-prefix-operators): New function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 2abad939fe 108/166: DOC: Following file specifications: new section, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6dd6433920 165/166: ENHANCED: fontify quasi-quotation content according to its type, ELPA Syncer, 2022/09/30