[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode 4b6054b5c8 079/199: added adoc-insert-indented
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode 4b6054b5c8 079/199: added adoc-insert-indented |
Date: |
Sun, 3 Sep 2023 06:59:36 -0400 (EDT) |
branch: elpa/adoc-mode
commit 4b6054b5c8f934f19b84b0f2467cfbadaf643d3e
Author: Florian Kaufmann <sensorflo@gmail.com>
Commit: Florian Kaufmann <sensorflo@gmail.com>
added adoc-insert-indented
---
adoc-mode-test.el | 11 +++++++++++
adoc-mode.el | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index d6c8f7a701..8ad4079fdd 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -756,6 +756,17 @@ removed before TRANSFORM is evaluated.
(should (equal (adoc-repeat-string "lorem" 1) "lorem"))
(should (equal (adoc-repeat-string "lorem" 2) "loremlorem")))
+(ert-deftest adoctest-test-indent-by-example ()
+ (let ((tab-width 2)
+ (indent-tabs-mode nil))
+ (adoctest-trans "" " x" '(adoc-insert-indented "x" 1))
+ (adoctest-trans "" " x" '(adoc-insert-indented "x" 2)))
+
+ (let ((tab-width 3)
+ (indent-tabs-mode t))
+ (adoctest-trans "" " x" '(adoc-insert-indented "x" 1))
+ (adoctest-trans "" "\t x" '(adoc-insert-indented "x" 2))))
+
;; purpose
;; - ensure that the latest version, i.e. the one currently in buffer(s), of
;; adoc-mode and adoc-mode-test is used for the test
diff --git a/adoc-mode.el b/adoc-mode.el
index d65d964faa..7ab3e21186 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -2467,6 +2467,11 @@ Is influenced by customization variables such as
`adoc-title-style'."))))
;;;; misc
+(defun adoc-insert-indented (str indent-level)
+ "Indents and inserts STR such that point is at INDENT-LEVEL."
+ (indent-to (- (* tab-width indent-level) (length str)))
+ (insert str))
+
(defun adoc-repeat-string (str n)
"Returns str n times concatenated"
(let ((retval ""))
- [nongnu] elpa/adoc-mode d4a57c5c03 045/199: cleaned up file comments a bit, (continued)
- [nongnu] elpa/adoc-mode d4a57c5c03 045/199: cleaned up file comments a bit, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 97602c1577 046/199: fixed important typo, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 7b0009904e 047/199: updated URL and copyright date, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a08c7f26cc 053/199: bugfixes for promote / denote title, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 504d490785 055/199: test: running the test is now more smoothly, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fb170735f8 056/199: bugfixes and new tests for promote/denote/toggle title, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 4e13247892 058/199: test: added test for adjust-title-del, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 73b790fcf2 064/199: Merge branch 'develop', ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fb4e940e0d 066/199: edited adoc-version's doc string, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a805bd9787 071/199: bump version to 0.5.1, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 4b6054b5c8 079/199: added adoc-insert-indented,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode f779544180 084/199: bumped version to 0.6.1, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 27bf57f6fd 095/199: in commentary section, fixed wrong recipe how to use autoload, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 1b3a175861 100/199: renamings and improved comments in field of macros, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fc590439b0 110/199: attribute list of macros can now spawn more than two lines, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 745884359a 117/199: added imenu support, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fceae4560c 133/199: Kill all tabs, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 92da496f3d 151/199: Tweak the test command, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode e6b8e69843 090/199: bugfix: empty AsciiDoc attributes (e.g. [, ]) caused adoc-mode to enter infinite loop, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 976794ddc2 171/199: Update the changelog, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode cd2da9591a 172/199: Fix function name, ELPA Syncer, 2023/09/03