[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/assess 0d079db1a7 34/95: Completed documentation.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/assess 0d079db1a7 34/95: Completed documentation. |
Date: |
Tue, 19 Jul 2022 15:57:31 -0400 (EDT) |
branch: externals/assess
commit 0d079db1a74af6a6f6ca694688c267af3df846b0
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Completed documentation.
---
sisyphus.el | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 54 insertions(+), 6 deletions(-)
diff --git a/sisyphus.el b/sisyphus.el
index 850f4fef10..c9da968320 100644
--- a/sisyphus.el
+++ b/sisyphus.el
@@ -787,13 +787,16 @@ the copy of FILE will be in a different directory."
;; ** Font-Lock
-;; Set up a buffer from string or file, font-lock it, test it.
-
-;; We need to define some functionality for testing font-lock.
-
-;; API below -- so we can define functionality that works generally over a
list,
-;; and automatically coerce an item to a list.
+;; Here we define two predicates that can be used to checking
+;; fontification/syntax highlighting; as with indentation, one accepts strings
+;; but requires an explicit mode, while the other reads from file and depends
on
+;; the normal Emacs mechanisms for defining the mode. These two are
+;; `sisyphus-font-at=' and `sisyphus-file-font-at='. Both of these have the
same
+;; interface and have attached explainer functions. Here, we show examples with
+;; `sisyphus-face-at='.
+;; The simplest use is to specify a point location and a face. This returns
true
+;; if at least that face is present at the location.
;; #+begin_src elisp
;; (sisyphus-face-at=
@@ -801,7 +804,12 @@ the copy of FILE will be in a different directory."
;; 'emacs-lisp-mode
;; 2
;; 'font-lock-keyword-face)
+;; #+end_src
+
+;; It is also possible to specify several locations in a list, with a single
+;; face. This checks that the given font is present at every location.
+;; #+begin_src elisp
;; (sisyphus-face-at=
;; "(defun x ())
;; (defun y ())
@@ -809,14 +817,45 @@ the copy of FILE will be in a different directory."
;; 'emacs-lisp-mode
;; '(2 15 28)
;; 'font-lock-keyword-face)
+;; #+end_src
+;; Or, we can specify a list of faces in which case the locations and faces are
+;; checked in a pairwise manner.
+
+;; #+begin_src elisp
;; (sisyphus-face-at=
;; "(defun x ())"
;; 'emacs-lisp-mode
;; '(2 8)
;; '(font-lock-keyword-face font-lock-function-name-face))
+;; #+end_src
+
+;; It is also possible to define locations with regexps; again either one or
+;; multiple regexps can be used. With a single string, all matches are checked,
+;; with the first match to the first is checked, then the next match to the
+;; second, incrementally.
+
+;; #+begin_src elisp
+;; (sisyphus-face-at=
+;; "(defun x ())\n(defun y ())\n(defun z ())"
+;; 'emacs-lisp-mode
+;; "defun"
+;; 'font-lock-keyword-face)
+
+;; (sisyphus-face-at=
+;; "(defun x ())\n(defmacro y ())\n(defun z ())"
+;; 'emacs-lisp-mode
+;; '("defun" "defmacro" "defun")
+;; 'font-lock-keyword-face)
+;; #+end_src
+;; The locations can also be specified as a `lambda' which takes a single
+;; argument of a buffer. The return result can be any form of location accepted
+;; by `sisyphus-face-at=', including a list of match data generated, as in this
+;; case, by the `m-buffer' package.
+
+;; #+begin_src elisp
;; (sisyphus-face-at=
;; "(defun x ())\n(defun y ())\n(defun z ())"
;; 'emacs-lisp-mode
@@ -826,6 +865,11 @@ the copy of FILE will be in a different directory."
;; #+end_src
+;; *** Implementation
+
+;; First, `sisyphus-face-at='.
+
+
;; #+begin_src emacs-lisp
(defun sisyphus--face-at-location=
(location face property throw-on-nil)
@@ -974,7 +1018,11 @@ operates over files and takes the mode from that file."
(put 'sisyphus-face-at=
'ert-explainer
'sisyphus-explain-face-at=)
+;; #+end_src
+
+;; Followed by `sisyphus-file-face-at='.
+;; #+begin_src emacs-lisp
(defun sisyphus--file-face-at=-1 (file locations faces property throw-on-nil)
(sisyphus-with-find-file
(sisyphus-make-related-file file)
- [elpa] externals/assess a459abe966 11/95: New macro `sisyphus-with-preserved-buffer-list'., (continued)
- [elpa] externals/assess a459abe966 11/95: New macro `sisyphus-with-preserved-buffer-list'., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 33b6c3c390 12/95: New macro `sisyphus-with-temp-buffers'., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 890906bfcb 17/95: Interface written as single overloaded function., ELPA Syncer, 2022/07/19
- [elpa] externals/assess f3416dadb1 18/95: Indentation test functions., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 1b01542ccd 20/95: Fontification testing., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 2e556a62ae 22/95: Add new test file., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 32a00524a8 24/95: Fix unused variable issues, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 3cf57afcaf 26/95: Merge pull request #1 from syohex/fix, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 00c794a516 29/95: Add package support., ELPA Syncer, 2022/07/19
- [elpa] externals/assess f490f18a18 32/95: Merge branch 'master' of github.com:phillord/sisyphus, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 0d079db1a7 34/95: Completed documentation.,
ELPA Syncer <=
- [elpa] externals/assess cab9fea7b8 28/95: Documentation for everything, ELPA Syncer, 2022/07/19
- [elpa] externals/assess f521db4101 36/95: Add sisyphus-discover, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 46290f163d 37/95: Add tests for discover., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 38fc7829bc 42/95: Interpret nil to mean no faces., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 818cf77258 27/95: Merge pull request #2 from syohex/minimum, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 880d519d6b 35/95: Update readme, add infojs., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 216adb069c 47/95: Add assess-call.el, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 07bd7f8915 58/95: Doc fixes, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 739661405b 59/95: Add assess-robot.el and tests, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 9521b07480 71/95: Fix and Publish documentation statically, ELPA Syncer, 2022/07/19