Re: [PATCH] Fix indentation in test-org.el

2023-12-04 Thread Ihor Radchenko
Allen Li  writes:

> The indentation in test-org.el is all over the place.  I've attached a
> patch fixing it.

We generally do not accept whitespace-only changes.
Instead, we prefer to fix whitespace together with other _functional_
change.

This is because such changes make it harder to use git blame.
See the discussion in 
https://yhetil.org/emacs-devel/e1k8aul-0001mr...@fencepost.gnu.org/

Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[PATCH] Fix indentation in test-org.el

2023-11-25 Thread Allen Li
The indentation in test-org.el is all over the place.  I've attached a
patch fixing it.

Alternatively, you can do the following to reproduce the changes:

Load org-test.el and test-org.el to pick up macros which define their own
indentation.
In test-org.el, type `C-x h TAB` to mark the entire buffer and re-indent.
From 69ddca72e4744c8f3d3a552b760108bd17c676ae Mon Sep 17 00:00:00 2001
From: Allen Li 
Date: Sat, 25 Nov 2023 03:06:06 -0800
Subject: [PATCH] testing/lisp/test-org.el: Fix indentation

The indentation in this file is all messed up.  Fix it by loading
test-org.el and org-test.el to pick up all the macros, and then C-x h
TAB to re-indent the entire file.

* testing/lisp/test-org.el (org-test-with-timezone): Fix indentation.
---
 testing/lisp/test-org.el | 584 +++
 1 file changed, 292 insertions(+), 292 deletions(-)

diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 612bfa1e5..1825af21d 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -41,7 +41,7 @@
(progn
  (setenv "TZ" ,tz)
  ,@body)
- (setenv "TZ" ,tz-saved)
+ (setenv "TZ" ,tz-saved)
 
 (defmacro org-test-with-result (result &rest body)
   "Evaluate BODY, and return buffer content based on RESULT.
@@ -562,7 +562,7 @@ Otherwise, evaluate RESULT as an sexp and return its result."
   ;; The function ignores incomplete drawers.
   (should-not
(org-test-with-temp-text ":PROPERTIES:\n:PROP: t\n"
-(org-at-property-drawer-p)))
+ (org-at-property-drawer-p)))
   ;; tab separating the value.
   (should
(org-test-with-temp-text ":PROPERTIES:\n:PROP:	t\n:END:\n"
@@ -682,20 +682,20 @@ Otherwise, evaluate RESULT as an sexp and return its result."
 (should
  (equal "* H\n:PROPERTIES:\n:END:\n*** I\n*** END\nP"
 	(org-test-with-temp-text
-		"* H\n*** I\n*** END\nP"
+	"* H\n*** I\n*** END\nP"
 	  (let ((org-adapt-indentation nil)
 		(org-inlinetask-min-level 15))
-		(org-insert-property-drawer))
+	(org-insert-property-drawer))
 	  (buffer-string)
   ;; Correctly set drawer in an inlinetask.
   (when (featurep 'org-inlinetask)
 (should
  (equal "* H\n*** I\n:PROPERTIES:\n:END:\nP\n*** END"
 	(org-test-with-temp-text
-		"* H\n*** I\nP\n*** END"
+	"* H\n*** I\nP\n*** END"
 	  (let ((org-adapt-indentation nil)
 		(org-inlinetask-min-level 15))
-		(org-insert-property-drawer))
+	(org-insert-property-drawer))
 	  (buffer-string))
 
 
@@ -941,21 +941,21 @@ Otherwise, evaluate RESULT as an sexp and return its result."
   (should
(equal "\n- 2345678\n  9\n- 2345678\n  9"
 	  (org-test-with-temp-text "\n- 2345678 9\n- 2345678 9"
-	   (let ((fill-column 10))
-	 (transient-mark-mode 1)
-	 (push-mark (point-min) t t)
-	 (goto-char (point-max))
-	 (call-interactively #'fill-region)
-	 (buffer-string)
+	(let ((fill-column 10))
+	  (transient-mark-mode 1)
+	  (push-mark (point-min) t t)
+	  (goto-char (point-max))
+	  (call-interactively #'fill-region)
+	  (buffer-string)
   (should
(equal "\n- 1 2\n- 1 2"
 	  (org-test-with-temp-text "\n- 1\n  2\n- 1\n  2"
-	   (let ((fill-column 10))
-	 (transient-mark-mode 1)
-	 (push-mark (point-min) t t)
-	 (goto-char (point-max))
-	 (call-interactively #'fill-region)
-	 (buffer-string)  )
+	(let ((fill-column 10))
+	  (transient-mark-mode 1)
+	  (push-mark (point-min) t t)
+	  (goto-char (point-max))
+	  (call-interactively #'fill-region)
+	  (buffer-string)  )
 
 (ert-deftest test-org/auto-fill-function ()
   "Test auto-filling features."
@@ -1127,9 +1127,9 @@ Otherwise, evaluate RESULT as an sexp and return its result."
   (should
(= 1
   (org-test-with-temp-text
-	  "\\begin{equation}\n 1+1=2\n\\end{equation}"
-	(org-indent-line)
-	(org-get-indentation
+  "\\begin{equation}\n 1+1=2\n\\end{equation}"
+(org-indent-line)
+(org-get-indentation
   ;; On blank lines at the end of a list, indent like last element
   ;; within it if the line is still in the list.  If the last element
   ;; is an item, indent like its contents.  Otherwise, indent like the
@@ -1157,9 +1157,9 @@ Otherwise, evaluate RESULT as an sexp and return its result."
   (should
(= 4
   (org-test-with-temp-text
-	  "* H\n  - \n#+BEGIN_SRC emacs-lisp\n  t\n#+END_SRC\n"
-	(let ((org-adapt-indentation t)) (org-indent-line)