[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/assess c6e666413a 21/95: Merge branch 'master' of githu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/assess c6e666413a 21/95: Merge branch 'master' of github.com:phillord/sisyphus |
Date: |
Tue, 19 Jul 2022 15:57:30 -0400 (EDT) |
branch: externals/assess
commit c6e666413aa6ed3c597c16348d4d396e4e4df48d
Merge: 1b01542ccd 238d9028e2
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Merge branch 'master' of github.com:phillord/sisyphus
Conflicts:
sisyphus.el
test/sisyphus-test.el
Merge resulting from Christmas unison disaster.
---
dev-resources/elisp-indented.el | 5 +++++
dev-resources/elisp-unindented.el | 5 +++++
sisyphus.el | 36 +++++++++++++++++++++++++++---------
test/sisyphus-test.el | 4 ----
4 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/dev-resources/elisp-indented.el b/dev-resources/elisp-indented.el
new file mode 100644
index 0000000000..faf0165354
--- /dev/null
+++ b/dev-resources/elisp-indented.el
@@ -0,0 +1,5 @@
+(
+ (
+ (
+ (
+ ))))
diff --git a/dev-resources/elisp-unindented.el
b/dev-resources/elisp-unindented.el
new file mode 100644
index 0000000000..cb5bab9dc9
--- /dev/null
+++ b/dev-resources/elisp-unindented.el
@@ -0,0 +1,5 @@
+(
+(
+(
+(
+))))
\ No newline at end of file
diff --git a/sisyphus.el b/sisyphus.el
index 3c290dbf53..f110aabfce 100644
--- a/sisyphus.el
+++ b/sisyphus.el
@@ -426,7 +426,6 @@ See also `sisyphus-make-related-file'."
(kill-buffer ,temp-buffer))))))
;; #+end_src
-
;; ** Indentation functions
;; There are two main ways to test indentation -- we can either take unindented
@@ -442,8 +441,10 @@ See also `sisyphus-make-related-file'."
;; We start with some functionality for making Emacs quiet while indenting.
;; #+begin_src emacs-lisp
-(defun sisyphus--indent-buffer ()
+(defun sisyphus--indent-buffer (&optional column)
(cond
+ (column
+ (indent-region (point-min) (point-max) column))
;; if indent-region-function is set, use it, and hope that it is not
;; noisy.
(indent-region-function
@@ -467,7 +468,10 @@ See also `sisyphus-make-related-file'."
"Return non-nil if UNINDENTED indents in MODE to INDENTED.
Both UNINDENTED and INDENTED can be any value usable by
`sisyphus-to-string'. Indentation is performed using
-`indent-region'."
+`indent-region', which MODE should set up appropriately.
+
+See also `sisyphus-file-roundtrip-indentation=' for an
+alternative mechanism."
(sisyphus=
(sisyphus--indent-in-mode
mode
@@ -475,6 +479,7 @@ Both UNINDENTED and INDENTED can be any value usable by
indented))
(defun sisyphus-explain-indentation= (mode unindented indented)
+ "Explanation function for `sisyphus-indentation='."
(sisyphus-explain=
(sisyphus--indent-in-mode
mode
@@ -483,11 +488,10 @@ Both UNINDENTED and INDENTED can be any value usable by
(put 'sisyphus-indentation= 'ert-explainer 'sisyphus-explain-indentation=)
-;; TODO -- this bit is noisy and we need to stop it being so
(defun sisyphus--buffer-unindent (buffer)
(with-current-buffer
buffer
- (indent-region (point-min) (point-max) nil)))
+ (sisyphus--indent-buffer 0)))
(defun sisyphus--roundtrip-1 (comp mode indented)
(with-temp-buffer
@@ -501,11 +505,20 @@ Both UNINDENTED and INDENTED can be any value usable by
indented)))
(defun sisyphus-roundtrip-indentation= (mode indented)
+ "Return t if in MODE, text in INDENTED is corrected indented.
+
+This is checked by unindenting the text, then reindenting it according
+to MODE.
+
+See also `sisyphus-indentation=' and
+`sisyphus-file-roundtrip-indentation=' for alternative
+mechanisms of checking indentation."
(sisyphus--roundtrip-1
#'sisyphus-indentation=
mode indented))
(defun sisyphus-explain-roundtrip-indentation= (mode indented)
+ "Explanation function for `sisyphus-roundtrip-indentation='."
(sisyphus--roundtrip-1
#'sisyphus-explain-indentation=
mode indented))
@@ -525,20 +538,25 @@ Both UNINDENTED and INDENTED can be any value usable by
file))
(defun sisyphus-file-roundtrip-indentation= (file)
+ "Return t if text in FILE is indented correctly.
+
+FILE is copied with `sisyphus-make-related-file', so this
+function should be side-effect free whether or not FILE is
+already open. The file is opened with `find-file-noselect', so
+hooks associated with interactive visiting of a file should all
+be called, with the exception of directory local variables, as
+the copy of FILE will be in a different directory."
(sisyphus--file-roundtrip-1
#'sisyphus= file))
(defun sisyphus-explain-file-roundtrip-indentation= (file)
+ "Explanation function for `sisyphus-file-roundtrip-indentation=."
(sisyphus--file-roundtrip-1
#'sisyphus-explain= file))
-;; #+end_src
-;; #+begin_src emacs-lisp
(put 'sisyphus-file-roundtrip-indentation=
'ert-explainer
'sisyphus-explain-file-roundtrip-indentation=)
-;; #+end_src
-
;; ** Font-lock support functions
diff --git a/test/sisyphus-test.el b/test/sisyphus-test.el
index ce1de3cc7b..012ffcd3e9 100644
--- a/test/sisyphus-test.el
+++ b/test/sisyphus-test.el
@@ -85,7 +85,6 @@ This also tests the advice on string=."
(sisyphus= "1" "2"))))))
;; #+end_src
-
;; ** To-String testing
;; #+begin_src emacs-lisp
@@ -328,7 +327,6 @@ This also tests the advice on string=."
"hello"
"goodbye"))))))
-
(defvar sisyphus-dev-resources
(relative-expand-file-name "../dev-resources/"))
@@ -369,7 +367,6 @@ This also tests the advice on string=."
(sisyphus-file-roundtrip-indentation=
sisyphus-dev-elisp-unindented)))
-
(ert-deftest sisyphus-test-file-roundtrip-indentation-explain= ()
(should
(sisyphus-test--explanation
@@ -448,5 +445,4 @@ This also tests the advice on string=."
(m-buffer-match buffer "defun"))
'font-lock-keyword-face)))
-
;; #+end_src
- [elpa] externals/assess 41a297b066 01/95: Initial Checkin, (continued)
- [elpa] externals/assess 41a297b066 01/95: Initial Checkin, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 8eb105f351 02/95: Travis Build status, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 3d659897df 03/95: Require cl-lib, local emacs test override., ELPA Syncer, 2022/07/19
- [elpa] externals/assess af38180b77 10/95: buffer= and file-string= functions added., ELPA Syncer, 2022/07/19
- [elpa] externals/assess eb3336543c 13/95: declare debug for `sisyphus-with-preserved-buffer-list'., ELPA Syncer, 2022/07/19
- [elpa] externals/assess af8b3a8d8b 14/95: with-temp-buffers now works like let., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 238d9028e2 19/95: Support for indentation checking., ELPA Syncer, 2022/07/19
- [elpa] externals/assess b3f9a7cf97 04/95: Require cl-lib, local emacs test override., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 196470b1e1 08/95: New function buffer-string=, ELPA Syncer, 2022/07/19
- [elpa] externals/assess dae3a60f7a 09/95: Docstring fix., ELPA Syncer, 2022/07/19
- [elpa] externals/assess c6e666413a 21/95: Merge branch 'master' of github.com:phillord/sisyphus,
ELPA Syncer <=
- [elpa] externals/assess 83973f4047 23/95: Add dash as a dependency., ELPA Syncer, 2022/07/19
- [elpa] externals/assess f33b371177 25/95: Specify minimum dash version, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 3e74c4b70d 30/95: Add test for string font-lock comparison., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 6a4aa34ec3 33/95: Fixed multiple string matching for face match., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 5dde98a124 31/95: Merge branch 'master' of github.com:phillord/sisyphus, ELPA Syncer, 2022/07/19
- [elpa] externals/assess 0eb198f05e 40/95: Documentation Fix., ELPA Syncer, 2022/07/19
- [elpa] externals/assess c0bdc94e49 41/95: Remove erroneous debug statement., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 2db9834e4e 44/95: Rework Makefile for update to cask, ELPA Syncer, 2022/07/19
- [elpa] externals/assess e820ccf163 05/95: Emacs 24.4 or later., ELPA Syncer, 2022/07/19
- [elpa] externals/assess 3f89d8601f 15/95: Port tests to sisyphus with-temp-buffers., ELPA Syncer, 2022/07/19