[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 0740e62df8: lisp/ox-ascii.el: Fix justification of
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/org 0740e62df8: lisp/ox-ascii.el: Fix justification of special blocks |
|
Date: |
Fri, 17 Nov 2023 03:58:32 -0500 (EST) |
branch: externals/org
commit 0740e62df8fe73078eec06e316b90745d5c385dd
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
lisp/ox-ascii.el: Fix justification of special blocks
* lisp/ox-ascii.el (org-ascii--current-justification): Fix typos in
the code.
* testing/lisp/test-ox-ascii.el (test-ox-ascii/justify): Add test.
Reported-by: Gregor Zattler <telegraph@gmx.net>
Link: https://orgmode.org/list/87o7ft8gxo.fsf@no.lan
---
lisp/ox-ascii.el | 20 ++++++++++----------
testing/lisp/test-ox-ascii.el | 16 ++++++++++++++++
2 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index ae4273489a..b567e23425 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -633,16 +633,16 @@ INFO is a plist used as a communication channel."
Return value is a symbol among `left', `center', `right' and
`full'."
(or (org-element-lineage-map
- element
- (lambda (el)
- (pcase (org-element-type el)
- (`center-block 'center)
- (`special-block
- (let ((name (org-element-property :type element)))
- (cond ((string= name "JUSTIFYRIGHT") 'right)
- ((string= name "JUSTIFYLEFT") 'left))))))
- '(center-block 'special-block)
- nil 'first-match)
+ element
+ (lambda (el)
+ (pcase (org-element-type el)
+ (`center-block 'center)
+ (`special-block
+ (let ((name (org-element-property :type el)))
+ (cond ((string= name "JUSTIFYRIGHT") 'right)
+ ((string= name "JUSTIFYLEFT") 'left))))))
+ '(center-block special-block)
+ nil 'first-match)
;; default
'left))
diff --git a/testing/lisp/test-ox-ascii.el b/testing/lisp/test-ox-ascii.el
index fe12c0c27d..b93fdbdeb4 100644
--- a/testing/lisp/test-ox-ascii.el
+++ b/testing/lisp/test-ox-ascii.el
@@ -66,5 +66,21 @@
(search-forward
"1. bar")))))
+(ert-deftest test-ox-ascii/justify ()
+ "Test justification."
+ ;; Right justify.
+ (org-test-with-exported-text
+ 'ascii
+ "#+OPTIONS: author:nil *:t
+#+BEGIN_JUSTIFYRIGHT
+left or right
+#+END_JUSTIFYRIGHT
+"
+ (goto-char (point-min))
+ (search-forward
+ "left or right")
+ (should
+ (equal org-ascii-text-width (org-current-text-column)))))
+
(provide 'test-ox-ascii)
;;; test-ox-ascii.el ends here
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/org 0740e62df8: lisp/ox-ascii.el: Fix justification of special blocks,
ELPA Syncer <=