diff options
author | niels giesen <niels.giesen@gmail.com> | 2011-09-16 20:32:38 +0000 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2011-10-08 16:30:56 +0200 |
commit | a6d74af2b93ba31d367f21bad9fef18d19ceb931 (patch) | |
tree | 14bd12f2257b2fa136b837f14fdc395c3e1371a4 | |
parent | 468aa115ef3303b3fa014965a83a7ef694992861 (diff) | |
download | org-mode-a6d74af2b93ba31d367f21bad9fef18d19ceb931.tar.gz |
Continue numbering from any previous numbered snippet with +n, even when previous numbered snippet does not immediately precede it.
* org-mode/lisp/org-exp.el (org-export-number-lines):
Check whether number parameter (this is a numbered block!) is
non-nil as well as whether cont is nil (this numbered block should
*not* continue numbering where we left off before!) before resetting
the count to zero.
From the docs:
If you use a `+n' switch, the numbering from the previous
numbered snippet will be continued in the current one.
With this change I believe the code complies with the docs.
-rw-r--r-- | lisp/org-exp.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 9884a31..12590e1 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2731,7 +2731,7 @@ INDENT was the original indentation of the block." (defun org-export-number-lines (text &optional skip1 skip2 number cont replace-labels label-format) (setq skip1 (or skip1 0) skip2 (or skip2 0)) - (if (not cont) (setq org-export-last-code-line-counter-value 0)) + (if (and number (not cont)) (setq org-export-last-code-line-counter-value 0)) (with-temp-buffer (insert text) (goto-char (point-max)) |