Re: Continued lists

2019-11-03 Thread Fraga, Eric
Jarmo,

John has already given you some elisp code that can help.  The other
possibility could be to use the counter macro.

See the info manual: (org) Macro Replacement

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78



Re: Continued lists

2019-11-02 Thread Samuel Wales
continuing one after prev list is a great idea.  then you won't get
out of sync.  dunno if feasible.

-- 
The Kafka Pandemic

What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.



Re: Continued lists

2019-11-02 Thread John Kitchin
It seems a little tricky to do much better.

With numbering you can do something like this where you find the last
element of the previous list, and then continue it. This won't do what you
want for nested lists I guess. For lettering, you would need to figure out
how to increment the letter. but for simple numbered lists, this might do
the trick for you.

#+BEGIN_SRC emacs-lisp
(defun auto-continue ()
  (interactive)
  (when-let (p (org-in-item-p))
(save-excursion
  (goto-char (line-end-position))
  (goto-char (org-element-property :contents-begin
(org-element-context)))
  (let* ((lists (org-element-map (org-element-parse-buffer) 'plain-list
 (lambda (lst)
(when (eq 'ordered (org-element-property :type lst))
 (cons
  (org-element-property :end lst)
  (length (org-element-property :structure lst)))
(last-list (nth (- (or (-find-index (lambda (x)
  (> (car x) (point)))
lists)
   (length lists))
1)
lists)))
(insert (format "[@%s] " (+ 1 (cdr last-list
(org-ctrl-c-ctrl-c)

#+END_SRC


John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Sat, Nov 2, 2019 at 5:49 AM Jarmo Hurri  wrote:

>
> Greetings.
>
> I know that lists can be continued using the following syntax:
>
> # ---
> * First heading
>   1. a list begins here
> * Second heading
>   2. [@2] list continues
> # ---
>
> I find myself doing this all the time, especially when working on Beamer
> slides.
>
> Given how smart org mode is (it is!), I find manual list continuation
> weird. My questions are:
>
> a. Is there already a better way?
> b. [@b] Could we have one?
>
> Jarmo
>
>
>


Continued lists

2019-11-02 Thread Jarmo Hurri


Greetings.

I know that lists can be continued using the following syntax:

# ---
* First heading
  1. a list begins here
* Second heading
  2. [@2] list continues
# ---

I find myself doing this all the time, especially when working on Beamer
slides.

Given how smart org mode is (it is!), I find manual list continuation
weird. My questions are:

a. Is there already a better way?
b. [@b] Could we have one?

Jarmo