branch: elpa/adoc-mode commit efa9ef97a0f79919907d736655bb092b0214f5da Author: Florian Kaufmann <sensor...@gmail.com> Commit: Florian Kaufmann <sensor...@gmail.com>
list item tempos respect tab-width and indent-tabs-mode --- adoc-mode-test.el | 12 +++++++----- adoc-mode.el | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/adoc-mode-test.el b/adoc-mode-test.el index 8ad4079fdd..3889e553da 100644 --- a/adoc-mode-test.el +++ b/adoc-mode-test.el @@ -711,11 +711,13 @@ removed before TRANSFORM is evaluated. (adoctest-delimited-block "--" '(tempo-template-adoc-delimited-block-open-block))) (ert-deftest adoctest-test-tempo-lists () - (adoctest-trans "" "- " '(tempo-template-adoc-bulleted-list-item-1)) - (adoctest-trans "" " ** " '(tempo-template-adoc-bulleted-list-item-2)) - (adoctest-trans "<foo>" "- foo" '(tempo-template-adoc-bulleted-list-item-1)) - (adoctest-trans "" ":: " '(tempo-template-adoc-labeled-list-item)) - (adoctest-trans "<foo>" ":: foo" '(tempo-template-adoc-labeled-list-item))) + (let ((tab-width 2) + (indent-tabs-mode nil)) + (adoctest-trans "" "- " '(tempo-template-adoc-bulleted-list-item-1)) + (adoctest-trans "" " ** " '(tempo-template-adoc-bulleted-list-item-2)) + (adoctest-trans "<foo>" "- foo" '(tempo-template-adoc-bulleted-list-item-1)) + (adoctest-trans "" ":: " '(tempo-template-adoc-labeled-list-item)) + (adoctest-trans "<foo>" ":: foo" '(tempo-template-adoc-labeled-list-item)))) (ert-deftest adoctest-test-tempo-macros () (adoctest-trans "" "http://foo.com[]" '(tempo-template-adoc-url-caption)) diff --git a/adoc-mode.el b/adoc-mode.el index 7ab3e21186..1dc8c57310 100644 --- a/adoc-mode.el +++ b/adoc-mode.el @@ -2424,18 +2424,18 @@ Is influenced by customization variables such as `adoc-title-style'.")))) ;; Lists ;; todo: customize indentation -(adoc-tempo-define "adoc-bulleted-list-item-1" '(bol "- " (r "text" text))) -(adoc-tempo-define "adoc-bulleted-list-item-2" '(bol " ** " (r "text" text))) -(adoc-tempo-define "adoc-bulleted-list-item-3" '(bol " *** " (r "text" text))) -(adoc-tempo-define "adoc-bulleted-list-item-4" '(bol " **** " (r "text" text))) -(adoc-tempo-define "adoc-bulleted-list-item-5" '(bol " ***** " (r "text" text))) +(adoc-tempo-define "adoc-bulleted-list-item-1" '(bol (adoc-insert-indented "- " 1) (r "text" text))) +(adoc-tempo-define "adoc-bulleted-list-item-2" '(bol (adoc-insert-indented "** " 2) (r "text" text))) +(adoc-tempo-define "adoc-bulleted-list-item-3" '(bol (adoc-insert-indented "*** " 3) (r "text" text))) +(adoc-tempo-define "adoc-bulleted-list-item-4" '(bol (adoc-insert-indented "**** " 4) (r "text" text))) +(adoc-tempo-define "adoc-bulleted-list-item-5" '(bol (adoc-insert-indented "***** " 5) (r "text" text))) (adoc-tempo-define "adoc-numbered-list-item" '(bol (p "number" number) ". " (r "text" text))) (adoc-tempo-define "adoc-numbered-list-item-roman" '(bol (p "number" number) ") " (r "text" text))) -(adoc-tempo-define "adoc-implicit-numbered-list-item-1" '(bol ". " (r "text" text))) -(adoc-tempo-define "adoc-implicit-numbered-list-item-2" '(bol " .. " (r "text" text))) -(adoc-tempo-define "adoc-implicit-numbered-list-item-3" '(bol " ... " (r "text" text))) -(adoc-tempo-define "adoc-implicit-numbered-list-item-4" '(bol " .... " (r "text" text))) -(adoc-tempo-define "adoc-implicit-numbered-list-item-5" '(bol " ..... " (r "text" text))) +(adoc-tempo-define "adoc-implicit-numbered-list-item-1" '(bol (adoc-insert-indented ". " 1) (r "text" text))) +(adoc-tempo-define "adoc-implicit-numbered-list-item-2" '(bol (adoc-insert-indented ".. " 2) (r "text" text))) +(adoc-tempo-define "adoc-implicit-numbered-list-item-3" '(bol (adoc-insert-indented "... " 3) (r "text" text))) +(adoc-tempo-define "adoc-implicit-numbered-list-item-4" '(bol (adoc-insert-indented ".... " 4) (r "text" text))) +(adoc-tempo-define "adoc-implicit-numbered-list-item-5" '(bol (adoc-insert-indented "..... " 5) (r "text" text))) (adoc-tempo-define "adoc-labeled-list-item" '(bol (p "label" label) ":: " (r "text" text))) (adoc-tempo-define "adoc-list-item-continuation" '(bol "+" %) nil adoc-help-list-item-continuation)