1 ;;; org-list.el --- Plain lists for Org-mode
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 ;; Free Software Foundation, Inc.
6 ;; Author: Carsten Dominik <carsten at orgmode dot org>
7 ;; Bastien Guerry <bzg AT altern DOT org>
8 ;; Keywords: outlines, hypermedia, calendar, wp
9 ;; Homepage: http://orgmode.org
12 ;; This file is part of GNU Emacs.
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation, either version 3 of the License, or
17 ;; (at your option) any later version.
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 ;; This file contains the code dealing with plain lists in Org-mode.
39 (defvar org-blank-before-new-entry
)
40 (defvar org-M-RET-may-split-line
)
41 (defvar org-complex-heading-regexp
)
42 (defvar org-odd-levels-only
)
44 (declare-function org-invisible-p
"org" ())
45 (declare-function org-on-heading-p
"org" (&optional invisible-ok
))
46 (declare-function outline-next-heading
"outline" ())
47 (declare-function org-back-to-heading
"org" (&optional invisible-ok
))
48 (declare-function org-back-over-empty-lines
"org" ())
49 (declare-function org-skip-whitespace
"org" ())
50 (declare-function org-trim
"org" (s))
51 (declare-function org-get-indentation
"org" (&optional line
))
52 (declare-function org-timer-item
"org-timer" (&optional arg
))
53 (declare-function org-combine-plists
"org" (&rest plists
))
54 (declare-function org-entry-get
"org"
55 (pom property
&optional inherit literal-nil
))
56 (declare-function org-narrow-to-subtree
"org" ())
57 (declare-function org-show-subtree
"org" ())
59 (defgroup org-plain-lists nil
60 "Options concerning plain lists in Org-mode."
61 :tag
"Org Plain lists"
62 :group
'org-structure
)
64 (defcustom org-cycle-include-plain-lists t
65 "When t, make TAB cycle visibility on plain list items.
67 Cycling plain lists works only when the cursor is on a plain list
68 item. When the cursor is on an outline heading, plain lists are
69 treated as text. This is the most stable way of handling this,
70 which is why it is the default.
72 When this is the symbol `integrate', then during cycling, plain
73 list items will *temporarily* be interpreted as outline headlines
74 with a level given by 1000+i where i is the indentation of the
75 bullet. This setting can lead to strange effects when switching
76 visibility to `children', because the first \"child\" in a
77 subtree decides what children should be listed. If that first
78 \"child\" is a plain list item with an implied large level
79 number, all true children and grand children of the outline
80 heading will be exposed in a children' view."
81 :group
'org-plain-lists
83 (const :tag
"Never" nil
)
84 (const :tag
"With cursor in plain list (recommended)" t
)
85 (const :tag
"As children of outline headings" integrate
)))
87 (defcustom org-list-demote-modify-bullet nil
88 "Default bullet type installed when demoting an item.
89 This is an association list, for each bullet type, this alist will point
90 to the bullet that should be used when this item is demoted.
93 (setq org-list-demote-modify-bullet
94 '((\"+\" . \"-\") (\"-\" . \"+\") (\"*\" . \"+\")))
99 + Silence of the Lambs
102 + The Hunt for Red October
108 - Silence of the Lambs
111 - The Hunt for Red October
113 :group
'org-plain-lists
116 (choice :tag
"If the current bullet is "
122 (choice :tag
"demotion will change it to"
129 (defcustom org-plain-list-ordered-item-terminator t
130 "The character that makes a line with leading number an ordered list item.
131 Valid values are ?. and ?\). To get both terminators, use t. While
132 ?. may look nicer, it creates the danger that a line with leading
133 number may be incorrectly interpreted as an item. ?\) therefore is
135 :group
'org-plain-lists
136 :type
'(choice (const :tag
"dot like in \"2.\"" ?.
)
137 (const :tag
"paren like in \"2)\"" ?\
))
138 (const :tab
"both" t
)))
140 (defcustom org-list-two-spaces-after-bullet-regexp nil
141 "A regular expression matching bullets that should have 2 spaces after them.
142 When nil, no bullet will have two spaces after them.
143 When a string, it will be used as a regular expression. When the bullet
144 type of a list is changed, the new bullet type will be matched against this
145 regexp. If it matches, there will be two spaces instead of one after
146 the bullet in each item of he list."
147 :group
'org-plain-lists
149 (const :tag
"never" nil
)
152 (defcustom org-empty-line-terminates-plain-lists nil
153 "Non-nil means an empty line ends all plain list levels.
154 This is currently effective only during export. It should also have
155 an effect for indentation and plain list folding, but it does not.
156 When nil, empty lines are part of the preceding item."
157 :group
'org-plain-lists
160 (defcustom org-auto-renumber-ordered-lists t
161 "Non-nil means automatically renumber ordered plain lists.
162 Renumbering happens when the sequence have been changed with
163 \\[org-shiftmetaup] or \\[org-shiftmetadown]. After other editing commands,
164 use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
165 :group
'org-plain-lists
168 (defcustom org-provide-checkbox-statistics t
169 "Non-nil means update checkbox statistics after insert and toggle.
170 When this is set, checkbox statistics is updated each time you
171 either insert a new checkbox with \\[org-insert-todo-heading] or
172 toggle a checkbox with \\[org-ctrl-c-ctrl-c]."
173 :group
'org-plain-lists
176 (defcustom org-hierarchical-checkbox-statistics t
177 "Non-nil means checkbox statistics counts only the state of direct children.
178 When nil, all boxes below the cookie are counted.
179 This can be set to nil on a per-node basis using a COOKIE_DATA property
180 with the word \"recursive\" in the value."
181 :group
'org-plain-lists
184 (defcustom org-description-max-indent
20
185 "Maximum indentation for the second line of a description list.
186 When the indentation would be larger than this, it will become
187 5 characters instead."
188 :group
'org-plain-lists
191 (defvar org-list-beginning-re
192 "^\\([ \t]*\\)\\([-+]\\|[0-9]+[.)]\\) +\\(.*\\)$")
194 (defcustom org-list-radio-list-templates
195 '((latex-mode "% BEGIN RECEIVE ORGLST %n
196 % END RECEIVE ORGLST %n
198 #+ORGLST: SEND %n org-list-to-latex
201 (texinfo-mode "@c BEGIN RECEIVE ORGLST %n
202 @c END RECEIVE ORGLST %n
204 #+ORGLST: SEND %n org-list-to-texinfo
207 (html-mode "<!-- BEGIN RECEIVE ORGLST %n -->
208 <!-- END RECEIVE ORGLST %n -->
210 #+ORGLST: SEND %n org-list-to-html
213 "Templates for radio lists in different major modes.
214 All occurrences of %n in a template will be replaced with the name of the
215 list, obtained by prompting the user."
216 :group
'org-plain-lists
218 (list (symbol :tag
"Major mode")
219 (string :tag
"Format"))))
221 ;;;; Plain list items, including checkboxes
225 (defun org-item-re (&optional general
)
226 "Return the correct regular expression for plain lists.
227 If GENERAL is non-nil, return the general regexp independent of the value
228 of `org-plain-list-ordered-item-terminator'."
230 ((or general
(eq org-plain-list-ordered-item-terminator t
))
231 "\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
232 ((= org-plain-list-ordered-item-terminator ?.
)
233 "\\([ \t]*\\([-+]\\|\\([0-9]+\\.\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
234 ((= org-plain-list-ordered-item-terminator ?\
))
235 "\\([ \t]*\\([-+]\\|\\([0-9]+)\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
236 (t (error "Invalid value of `org-plain-list-ordered-item-terminator'"))))
238 (defun org-at-item-p ()
239 "Is point in a line starting a hand-formatted item?"
242 (goto-char (point-at-bol))
243 (looking-at (org-item-re))))
245 (defun org-at-item-bullet-p ()
246 "Is point at the bullet of a plain list item?"
248 (not (member (char-after) '(?\ ?
\t)))
249 (< (point) (match-end 0))))
251 (defun org-in-item-p ()
252 "Is the cursor inside a plain list item.
253 Does not have to be the first line."
257 (org-beginning-of-item)
262 (defun org-insert-item (&optional checkbox
)
263 "Insert a new item at the current level.
264 Return t when things worked, nil when we are not in an item."
265 (when (save-excursion
268 (org-beginning-of-item)
270 (if (org-invisible-p) (error "Invisible item"))
273 (let* ((bul (match-string 0))
274 (descp (save-excursion (goto-char (match-beginning 0))
275 (beginning-of-line 1)
277 (and (looking-at "[ \t]*\\(.*?\\) ::")
279 (empty-line-p (save-excursion
280 (goto-char (match-beginning 0))
282 (or (beginning-of-line 0) t
)
284 (looking-at "[ \t]*$")))))
287 (string-match "^[-+*][ \t]+[0-9]+:[0-9]+:[0-9]+$"
289 (eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
291 (blank-a (if org-empty-line-terminates-plain-lists
293 (cdr (assq 'plain-list-item org-blank-before-new-entry
))))
294 (blank (if (eq blank-a
'auto
) empty-line-p blank-a
))
296 (if descp
(setq checkbox nil
))
298 (progn (org-timer-item) t
)
300 ((and (org-at-item-p) (<= (point) eow
))
302 (beginning-of-line 1)
303 (open-line (if blank
2 1)))
305 (beginning-of-line 1))
307 (unless (org-get-alist-option org-M-RET-may-split-line
'item
)
309 (delete-horizontal-space))
310 (newline (if blank
2 1))))
312 (if checkbox
"[ ]" "")
313 (if descp
(concat (if checkbox
" " "")
314 (read-string "Term: ") " :: ") ""))
318 (unless (= (point) pos
) (just-one-space) (backward-delete-char 1)))
319 (org-maybe-renumber-ordered-list)
320 (and checkbox
(org-update-checkbox-count-maybe))
325 (defun org-at-item-checkbox-p ()
326 "Is point at a line starting a plain-list item with a checklet?"
329 (goto-char (match-end 0))
330 (skip-chars-forward " \t")
331 (looking-at "\\[[- X]\\]"))))
333 (defun org-toggle-checkbox (&optional toggle-presence
)
334 "Toggle the checkbox in the current line.
335 With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.
336 With double prefix, set checkbox to [-].
337 When there is an active region, toggle status or presence of the checkbox
338 in the first line, and make every item in the region have the same
339 status or presence, respectively.
340 If the cursor is in a headline, apply this to all checkbox items in the
341 text below the heading."
344 (let (beg end status first-present first-status blocked
)
346 ((org-region-active-p)
347 (setq beg
(region-beginning) end
(region-end)))
349 (setq beg
(point) end
(save-excursion (outline-next-heading) (point))))
350 ((org-at-item-checkbox-p)
352 (if (equal toggle-presence
'(4))
355 (goto-char (match-beginning 0))
357 (when (setq blocked
(org-checkbox-blocked-p))
358 (error "Checkbox blocked because of unchecked box in line %d"
361 (cond ((equal toggle-presence
'(16)) "[-]")
362 ((member (match-string 0) '("[ ]" "[-]")) "[X]")
369 (goto-char (match-end 0))
372 (t (error "Not at a checkbox or heading, and no active region")))
373 (setq end
(move-marker (make-marker) end
))
376 (setq first-present
(org-at-item-checkbox-p)
379 (and (re-search-forward "[ \t]\\(\\[[ X]\\]\\)" end t
)
380 (equal (match-string 1) "[X]"))))
381 (while (< (point) end
)
384 ((and first-present
(org-at-item-checkbox-p))
387 (goto-char (match-beginning 0))
389 ((and (not first-present
) (not (org-at-item-checkbox-p))
392 (goto-char (match-end 0))
394 (when (org-at-item-checkbox-p)
395 (setq status
(equal (match-string 0) "[X]"))
397 (if first-status
"[ ]" "[X]") t t
)))
398 (beginning-of-line 2)))))
399 (org-update-checkbox-count-maybe))
401 (defun org-reset-checkbox-state-subtree ()
402 "Reset all checkboxes in an entry subtree."
406 (org-narrow-to-subtree)
408 (goto-char (point-min))
409 (let ((end (point-max)))
410 (while (< (point) end
)
411 (when (org-at-item-checkbox-p)
412 (replace-match "[ ]" t t
))
413 (beginning-of-line 2))))
414 (org-update-checkbox-count-maybe)))
416 (defun org-checkbox-blocked-p ()
417 "Is the current checkbox blocked from for being checked now?
418 A checkbox is blocked if all of the following conditions are fulfilled:
420 1. The checkbox is not checked already.
421 2. The current entry has the ORDERED property set.
422 3. There is an unchecked checkbox in this entry before the current line."
426 (unless (org-at-item-checkbox-p) (throw 'exit nil
))
427 (when (equal (match-string 0) "[X]")
428 ;; the box is already checked!
430 (let ((end (point-at-bol)))
431 (condition-case nil
(org-back-to-heading t
)
432 (error (throw 'exit nil
)))
433 (unless (org-entry-get nil
"ORDERED") (throw 'exit nil
))
434 (if (re-search-forward "^[ \t]*[-+*0-9.)] \\[[- ]\\]" end t
)
438 (defvar org-checkbox-statistics-hook nil
439 "Hook that is run whenever Org thinks checkbox statistics should be updated.
440 This hook runs even if `org-provide-checkbox-statistics' is nil, to it can
441 be used to implement alternative ways of collecting statistics information.")
443 (defun org-update-checkbox-count-maybe ()
444 "Update checkbox statistics unless turned off by user."
445 (when org-provide-checkbox-statistics
446 (org-update-checkbox-count))
447 (run-hooks 'org-checkbox-statistics-hook
))
449 (defun org-update-checkbox-count (&optional all
)
450 "Update the checkbox statistics in the current section.
451 This will find all statistic cookies like [57%] and [6/12] and update them
452 with the current numbers. With optional prefix argument ALL, do this for
456 (let* ((buffer-invisibility-spec (org-inhibit-invisibility)) ; Emacs 21
457 (beg (condition-case nil
458 (progn (org-back-to-heading) (point))
459 (error (point-min))))
460 (end (move-marker (make-marker)
461 (progn (outline-next-heading) (point))))
462 (re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
463 (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\)")
464 (re-find (concat re
"\\|" re-box
))
465 beg-cookie end-cookie is-percent c-on c-off lim new
466 eline curr-ind next-ind continue-from startsearch
468 (or (not org-hierarchical-checkbox-statistics
)
469 (string-match "\\<recursive\\>"
471 (org-entry-get nil
"COOKIE_DATA"))
476 (goto-char (point-min))
477 (outline-next-heading)
478 (setq beg
(point) end
(point-max)))
480 ;; find each statistics cookie
481 (while (and (re-search-backward re-find beg t
)
482 (not (save-match-data
483 (and (org-on-heading-p)
484 (string-match "\\<todo\\>"
489 (setq beg-cookie
(match-beginning 1)
490 end-cookie
(match-end 1)
491 cstat
(+ cstat
(if end-cookie
1 0))
492 startsearch
(point-at-eol)
493 continue-from
(match-beginning 0)
494 is-percent
(match-beginning 2)
496 ((org-on-heading-p) (outline-next-heading) (point))
497 ((org-at-item-p) (org-end-of-item) (point))
502 ;; find first checkbox for this cookie and gather
503 ;; statistics from all that are at this indentation level
504 (goto-char startsearch
)
505 (if (re-search-forward re-box lim t
)
507 (org-beginning-of-item)
508 (setq curr-ind
(org-get-indentation))
509 (setq next-ind curr-ind
)
510 (while (and (bolp) (org-at-item-p)
512 (<= curr-ind next-ind
)
513 (= curr-ind next-ind
)))
514 (save-excursion (end-of-line) (setq eline
(point)))
515 (if (re-search-forward re-box eline t
)
516 (if (member (match-string 2) '("[ ]" "[-]"))
517 (setq c-off
(1+ c-off
))
518 (setq c-on
(1+ c-on
))))
522 (when (re-search-forward org-list-beginning-re lim t
)
523 (beginning-of-line)))
524 (setq next-ind
(org-get-indentation)))))
525 (goto-char continue-from
)
528 (setq new
(if is-percent
529 (format "[%d%%]" (/ (* 100 c-on
) (max 1 (+ c-on c-off
))))
530 (format "[%d/%d]" c-on
(+ c-on c-off
))))
531 (goto-char beg-cookie
)
533 (delete-region (point) (+ (point) (- end-cookie beg-cookie
))))
534 ;; update items checkbox if it has one
535 (when (org-at-item-p)
536 (org-beginning-of-item)
537 (when (and (> (+ c-on c-off
) 0)
538 (re-search-forward re-box
(point-at-eol) t
))
539 (setq beg-cookie
(match-beginning 2)
540 end-cookie
(match-end 2))
541 (delete-region beg-cookie end-cookie
)
542 (goto-char beg-cookie
)
543 (cond ((= c-off
0) (insert "[X]"))
544 ((= c-on
0) (insert "[ ]"))
547 (goto-char continue-from
))
548 (when (interactive-p)
549 (message "Checkbox statistics updated %s (%d places)"
550 (if all
"in entire file" "in current outline entry") cstat
)))))
552 (defun org-get-checkbox-statistics-face ()
553 "Select the face for checkbox statistics.
554 The face will be `org-done' when all relevant boxes are checked. Otherwise
555 it will be `org-todo'."
557 (if (equal (match-string 1) "100%")
558 'org-checkbox-statistics-done
559 'org-checkbox-statistics-todo
)
560 (if (and (> (match-end 2) (match-beginning 2))
561 (equal (match-string 2) (match-string 3)))
562 'org-checkbox-statistics-done
563 'org-checkbox-statistics-todo
)))
565 (defun org-beginning-of-item ()
566 "Go to the beginning of the current hand-formatted item.
567 If the cursor is not in an item, throw an error."
570 (limit (save-excursion
573 (org-back-to-heading)
574 (beginning-of-line 2) (point))
575 (error (point-min)))))
576 (ind-empty (if org-empty-line-terminates-plain-lists
0 10000))
579 (beginning-of-line 1)
580 (beginning-of-line 1)
581 (skip-chars-forward " \t")
582 (setq ind
(current-column))
585 (beginning-of-line 0)
586 (if (or (bobp) (< (point) limit
)) (throw 'exit nil
))
588 (if (looking-at "[ \t]*$")
589 (setq ind1 ind-empty
)
590 (skip-chars-forward " \t")
591 (setq ind1
(current-column)))
593 (progn (beginning-of-line 1) (throw 'exit
(org-at-item-p))))))
596 (error "Not in an item")))))
598 (defun org-end-of-item ()
599 "Go to the end of the current hand-formatted item.
600 If the cursor is not in an item, throw an error."
604 (ind-empty (if org-empty-line-terminates-plain-lists
0 10000))
605 (limit (save-excursion (outline-next-heading) (point)))
607 (org-beginning-of-item)
608 (skip-chars-forward " \t")
612 (beginning-of-line 2)
613 (if (eobp) (throw 'exit
(point)))
614 (if (>= (point) limit
) (throw 'exit
(point-at-bol)))
615 (if (looking-at "[ \t]*$")
616 (setq ind1 ind-empty
)
617 (skip-chars-forward " \t")
618 (setq ind1
(current-column)))
620 (throw 'exit
(point-at-bol)))))))
624 (error "Not in an item"))))
626 (defun org-end-of-item-text-before-children ()
627 "Move to the end of the item text, stops before the first child if any.
628 Assumes that the cursor is in the first line of an item."
630 (min (save-excursion (org-end-of-item) (point))
632 (goto-char (point-at-eol))
633 (if (re-search-forward (concat "^" (org-item-re t
)) nil
'move
)
637 (defun org-next-item ()
638 "Move to the beginning of the next item in the current plain list.
639 Error if not at a plain list, or if this is the last item in the list."
641 (let (ind ind1
(pos (point)))
642 (org-beginning-of-item)
643 (setq ind
(org-get-indentation))
645 (setq ind1
(org-get-indentation))
646 (unless (and (org-at-item-p) (= ind ind1
))
648 (error "On last item"))))
650 (defun org-previous-item ()
651 "Move to the beginning of the previous item in the current plain list.
652 Error if not at a plain list, or if this is the first item in the list."
654 (let (beg ind ind1
(pos (point)))
655 (org-beginning-of-item)
657 (setq ind
(org-get-indentation))
661 (beginning-of-line 0)
662 (if (looking-at "[ \t]*$")
664 (if (<= (setq ind1
(org-get-indentation)) ind
)
666 (if (bobp) (throw 'exit t
))))
668 (if (or (not (org-at-item-p))
671 (org-beginning-of-item))
672 (error (goto-char pos
)
673 (error "On first item")))))
675 (defun org-first-list-item-p ()
676 "Is this heading the first item in a plain list?"
677 (unless (org-at-item-p)
678 (error "Not at a plain list item"))
680 (org-beginning-of-item)
681 (= (point) (save-excursion (org-beginning-of-item-list)))))
683 (defun org-move-item-down ()
684 "Move the plain list item at point down, i.e. swap with following item.
685 Subitems (items with larger indentation) are considered part of the item,
686 so this really moves item trees."
688 (let ((col (current-column))
690 beg beg0 end end0 ind ind1 txt ne-end ne-beg
)
691 (org-beginning-of-item)
694 (setq ne-beg
(org-back-over-empty-lines))
697 (setq ind
(org-get-indentation))
700 (setq ind1
(org-get-indentation))
701 (setq ne-end
(org-back-over-empty-lines))
704 (when (and (org-first-list-item-p) (< ne-end ne-beg
))
705 ;; include less whitespace
708 (forward-line (- ne-beg ne-end
))
711 (if (and (org-at-item-p) (= ind ind1
))
714 (org-back-over-empty-lines)
715 (setq txt
(buffer-substring beg end
))
717 (delete-region beg end
))
720 (goto-char pos
) (org-skip-whitespace)
721 (org-maybe-renumber-ordered-list)
722 (move-to-column col
))
725 (error "Cannot move this item further down"))))
727 (defun org-move-item-up (arg)
728 "Move the plain list item at point up, i.e. swap with previous item.
729 Subitems (items with larger indentation) are considered part of the item,
730 so this really moves item trees."
732 (let ((col (current-column)) (pos (point))
733 beg beg0 end ind ind1 txt
734 ne-beg ne-ins ins-end
)
735 (org-beginning-of-item)
737 (setq ind
(org-get-indentation))
739 (setq ne-beg
(org-back-over-empty-lines))
743 (org-back-over-empty-lines)
748 (beginning-of-line 0)
749 (if (looking-at "[ \t]*$")
750 (if org-empty-line-terminates-plain-lists
753 (error "Cannot move this item further up"))
755 (if (<= (setq ind1
(org-get-indentation)) ind
)
758 (org-beginning-of-item)
759 (error (goto-char beg0
)
761 (error "Cannot move this item further up")))
762 (setq ind1
(org-get-indentation))
763 (if (and (org-at-item-p) (= ind ind1
))
765 (setq ne-ins
(org-back-over-empty-lines))
766 (setq txt
(buffer-substring beg end
))
768 (delete-region beg end
))
771 (setq ins-end
(point))
772 (goto-char pos
) (org-skip-whitespace)
774 (when (and (org-first-list-item-p) (> ne-ins ne-beg
))
775 ;; Move whitespace back to beginning
778 (let ((kill-whole-line t
))
779 (kill-line (- ne-ins ne-beg
)) (point)))
780 (insert (make-string (- ne-ins ne-beg
) ?
\n)))
782 (org-maybe-renumber-ordered-list)
783 (move-to-column col
))
786 (error "Cannot move this item further up"))))
788 (defun org-maybe-renumber-ordered-list ()
789 "Renumber the ordered list at point if setup allows it.
790 This tests the user option `org-auto-renumber-ordered-lists' before
791 doing the renumbering."
793 (when (and org-auto-renumber-ordered-lists
795 (if (match-beginning 3)
796 (org-renumber-ordered-list 1)
797 (org-fix-bullet-type))))
799 (defun org-maybe-renumber-ordered-list-safe ()
802 (org-maybe-renumber-ordered-list))
805 (defun org-cycle-list-bullet (&optional which
)
806 "Cycle through the different itemize/enumerate bullets.
807 This cycle the entire list level through the sequence:
809 `-' -> `+' -> `*' -> `1.' -> `1)'
811 If WHICH is a string, use that as the new bullet. If WHICH is an integer,
812 0 means `-', 1 means `+' etc."
815 (org-beginning-of-item-list)
817 (beginning-of-line 1)
818 (let ((current (match-string 0))
819 (prevp (eq which
'previous
))
822 ((and (numberp which
)
823 (nth (1- which
) '("-" "+" "*" "1." "1)"))))
824 ((string-match "-" current
) (if prevp
"1)" "+"))
825 ((string-match "\\+" current
)
826 (if prevp
"-" (if (looking-at "\\S-") "1." "*")))
827 ((string-match "\\*" current
) (if prevp
"+" "1."))
828 ((string-match "\\." current
)
829 (if prevp
(if (looking-at "\\S-") "+" "*") "1)"))
830 ((string-match ")" current
) (if prevp
"1." "-"))
831 (t (error "This should not happen"))))
832 (and (looking-at "\\([ \t]*\\)\\(\\S-+\\)")
833 (setq old
(match-string 2))
834 (replace-match (concat "\\1" new
)))
835 (org-shift-item-indentation (- (length new
) (length old
)))
836 (org-fix-bullet-type)
837 (org-maybe-renumber-ordered-list))))
839 (defun org-get-string-indentation (s)
840 "What indentation has S due to SPACE and TAB at the beginning of the string?"
841 (let ((n -
1) (i 0) (w tab-width
) c
)
843 (while (< (setq n
(1+ n
)) (length s
))
845 (cond ((= c ?\
) (setq i
(1+ i
)))
846 ((= c ?
\t) (setq i
(* (/ (+ w i
) w
) w
)))
847 (t (throw 'exit t
)))))
850 (defun org-renumber-ordered-list (arg)
851 "Renumber an ordered plain list.
852 Cursor needs to be in the first line of an item, the line that starts
853 with something like \"1.\" or \"2)\"."
855 (unless (and (org-at-item-p)
857 (error "This is not an ordered list"))
858 (let ((line (org-current-line))
859 (col (current-column))
860 (ind (org-get-string-indentation
861 (buffer-substring (point-at-bol) (match-beginning 3))))
862 ;; (term (substring (match-string 3) -1))
864 fmt bobp old new delta
)
865 ;; find where this list begins
866 (org-beginning-of-item-list)
868 (looking-at "[ \t]*[0-9]+\\([.)]\\)")
869 (setq fmt
(concat "%d" (or (match-string 1) ".")))
871 (goto-char (match-end 0))
872 (if (looking-at "[ \t]*\\[@start:\\([0-9]+\\)")
873 (setq n
(1- (string-to-number (match-string 1))))))
874 (beginning-of-line 0)
875 ;; walk forward and replace these numbers
879 (if bobp
(setq bobp nil
) (beginning-of-line 2))
880 (if (eobp) (throw 'exit nil
))
881 (if (looking-at "[ \t]*$") (throw 'next nil
))
882 (skip-chars-forward " \t") (setq ind1
(current-column))
883 (if (> ind1 ind
) (throw 'next t
))
884 (if (< ind1 ind
) (throw 'exit t
))
885 (if (not (org-at-item-p)) (throw 'exit nil
))
886 (setq old
(match-string 2))
887 (delete-region (match-beginning 2) (match-end 2))
888 (goto-char (match-beginning 2))
889 (insert (setq new
(format fmt
(setq n
(1+ n
)))))
890 (setq delta
(- (length new
) (length old
)))
891 (org-shift-item-indentation delta
)
892 (if (= (org-current-line) line
) (setq col
(+ col delta
))))))
894 (org-move-to-column col
)))
896 (defvar org-suppress-item-indentation
) ; dynamically scoped parameter
897 (defun org-fix-bullet-type (&optional force-bullet
)
898 "Make sure all items in this list have the same bullet as the first item.
899 Also, fix the indentation."
901 (unless (org-at-item-p) (error "This is not a list"))
902 (let ((line (org-current-line))
903 (chars-from-eol (- (point-at-eol) (point)))
904 (ind (current-indentation))
905 ind1 bullet oldbullet
)
906 ;; find where this list begins
907 (org-beginning-of-item-list)
908 (beginning-of-line 1)
909 ;; find out what the bullet type is
910 (looking-at "[ \t]*\\(\\S-+\\)")
911 (setq bullet
(concat (or force-bullet
(match-string 1)) " "))
912 (if (and org-list-two-spaces-after-bullet-regexp
913 (string-match org-list-two-spaces-after-bullet-regexp bullet
))
914 (setq bullet
(concat bullet
" ")))
915 ;; walk forward and replace these numbers
916 (beginning-of-line 0)
920 (beginning-of-line 2)
921 (if (eobp) (throw 'exit nil
))
922 (if (looking-at "[ \t]*$") (throw 'next nil
))
923 (skip-chars-forward " \t") (setq ind1
(current-column))
924 (if (> ind1 ind
) (throw 'next t
))
925 (if (< ind1 ind
) (throw 'exit t
))
926 (if (not (org-at-item-p)) (throw 'exit nil
))
927 (skip-chars-forward " \t")
928 (looking-at "\\S-+ *")
929 (setq oldbullet
(match-string 0))
930 (unless (equal bullet oldbullet
) (replace-match bullet
))
931 (org-shift-item-indentation (- (length bullet
)
932 (length oldbullet
))))))
934 (goto-char (max (point-at-bol) (- (point-at-eol) chars-from-eol
)))
935 (if (string-match "[0-9]" bullet
)
936 (org-renumber-ordered-list 1))))
938 (defun org-shift-item-indentation (delta)
939 "Shift the indentation in current item by DELTA."
940 (unless (org-bound-and-true-p org-suppress-item-indentation
)
942 (let ((beg (point-at-bol))
943 (end (progn (org-end-of-item) (point)))
946 (beginning-of-line 0)
947 (while (> (point) beg
)
948 (when (looking-at "[ \t]*\\S-")
949 ;; this is not an empty line
950 (setq i
(org-get-indentation))
951 (if (and (> i
0) (> (setq i
(+ i delta
)) 0))
953 (beginning-of-line 0))))))
955 (defun org-beginning-of-item-list ()
956 "Go to the beginning of the current item list.
957 I.e. to the first item in this list."
959 (org-beginning-of-item)
960 (let ((pos (point-at-bol))
961 (ind (org-get-indentation))
963 ;; find where this list begins
967 (beginning-of-line 0)
968 (if (looking-at "[ \t]*$")
969 (throw (if (bobp) 'exit
'next
) t
))
970 (skip-chars-forward " \t") (setq ind1
(current-column))
973 (not (org-at-item-p)))
974 (and (= (point-at-bol) (point-min))
975 (setq pos
(point-min))))
977 (when (org-at-item-p) (setq pos
(point-at-bol)))))))
980 (defun org-end-of-item-list ()
981 "Go to the end of the current item list.
982 I.e. to the text after the last item."
984 (org-beginning-of-item)
985 (let ((pos (point-at-bol))
986 (ind (org-get-indentation))
988 ;; find where this list begins
992 (beginning-of-line 2)
993 (if (looking-at "[ \t]*$")
995 (progn (setq pos
(point)) (throw 'exit t
))
997 (skip-chars-forward " \t") (setq ind1
(current-column))
1000 (not (org-at-item-p)))
1003 (setq pos
(point-at-bol))
1004 (throw 'exit t
))))))
1008 (defvar org-last-indent-begin-marker
(make-marker))
1009 (defvar org-last-indent-end-marker
(make-marker))
1011 (defun org-outdent-item (arg)
1012 "Outdent a local list item, but not its children."
1014 (org-indent-item-tree (- arg
) 'no-subtree
))
1016 (defun org-indent-item (arg)
1017 "Indent a local list item, but not its children."
1019 (org-indent-item-tree arg
'no-subtree
))
1021 (defun org-outdent-item-tree (arg &optional no-subtree
)
1022 "Outdent a local list item including its children.
1023 If NO-SUBTREE is set, only outdent the item itself, not its children."
1025 (org-indent-item-tree (- arg
) no-subtree
))
1027 (defun org-indent-item-tree (arg &optional no-subtree
)
1028 "Indent a local list item including its children.
1029 If NO-SUBTREE is set, only indent the item itself, not its children."
1031 (and (org-region-active-p) (org-cursor-to-region-beginning))
1032 (unless (org-at-item-p)
1033 (error "Not on an item"))
1034 (let (beg end ind ind1 ind-bul delta ind-down ind-up firstp
)
1035 (setq firstp
(org-first-list-item-p))
1037 (setq end
(and (org-region-active-p) (region-end)))
1038 (if (and (memq last-command
'(org-shiftmetaright org-shiftmetaleft
))
1039 (memq this-command
'(org-shiftmetaright org-shiftmetaleft
)))
1040 (setq beg org-last-indent-begin-marker
1041 end org-last-indent-end-marker
)
1042 (org-beginning-of-item)
1043 (setq beg
(move-marker org-last-indent-begin-marker
(point)))
1045 (org-end-of-item-text-before-children)
1047 (setq end
(move-marker org-last-indent-end-marker
(or end
(point)))))
1049 (setq ind-bul
(org-item-indent-positions)
1051 ind-down
(car (nth 2 ind-bul
))
1052 ind-up
(car (nth 1 ind-bul
))
1054 (if ind-down
(- ind-down ind
) 2)
1055 (if ind-up
(- ind-up ind
) -
2)))
1056 (if (< (+ delta ind
) 0) (error "Cannot outdent beyond margin"))
1057 (while (< (point) end
)
1058 (beginning-of-line 1)
1059 (skip-chars-forward " \t") (setq ind1
(current-column))
1060 (delete-region (point-at-bol) (point))
1061 (or (eolp) (org-indent-to-column (+ ind1 delta
)))
1062 (beginning-of-line 2)))
1063 (org-fix-bullet-type
1066 (cdr (assoc (cdr (nth 0 ind-bul
)) org-list-demote-modify-bullet
))))
1067 (org-maybe-renumber-ordered-list-safe)
1069 (beginning-of-line 0)
1070 (condition-case nil
(org-beginning-of-item) (error nil
))
1071 (org-maybe-renumber-ordered-list-safe))))
1073 (defun org-item-indent-positions ()
1074 "Return indentation for plain list items.
1075 This returns a list with three values: The current indentation, the
1076 parent indentation and the indentation a child should have.
1077 Assumes cursor in item line."
1078 (let* ((bolpos (point-at-bol))
1079 (ind (org-get-indentation))
1080 (bullet (org-get-bullet))
1081 ind-down ind-up bullet-up bullet-down pos
)
1083 (org-beginning-of-item-list)
1084 (skip-chars-backward "\n\r \t")
1085 (when (org-in-item-p)
1086 (org-beginning-of-item)
1087 (setq ind-up
(org-get-indentation))
1088 (setq bullet-up
(org-get-bullet))))
1092 ((and (condition-case nil
(progn (org-previous-item) t
)
1094 (or (forward-char 1) t
)
1095 (re-search-forward "^\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)" bolpos t
))
1096 (setq ind-down
(org-get-indentation)
1097 bullet-down
(org-get-bullet)))
1098 ((and (goto-char pos
)
1100 (goto-char (match-end 0))
1101 (skip-chars-forward " \t")
1102 (setq ind-down
(current-column)
1103 bullet-down
(org-get-bullet)))))
1104 (if (and bullet-down
(string-match "\\`[0-9]+\\(\\.\\|)\\)\\'" bullet-down
))
1105 (setq bullet-down
(concat "1" (match-string 1 bullet-down
))))
1106 (if (and bullet-up
(string-match "\\`[0-9]+\\(\\.\\|)\\)\\'" bullet-up
))
1107 (setq bullet-up
(concat "1" (match-string 1 bullet-up
))))
1108 (if (and bullet
(string-match "\\`[0-9]+\\(\\.\\|)\\)\\'" bullet
))
1109 (setq bullet
(concat "1" (match-string 1 bullet
))))
1110 (list (cons ind bullet
)
1111 (cons ind-up bullet-up
)
1112 (cons ind-down bullet-down
))))
1114 (defvar org-tab-ind-state
) ; defined in org.el
1115 (defun org-cycle-item-indentation ()
1116 (let ((org-suppress-item-indentation t
)
1117 (org-adapt-indentation nil
))
1119 ((and (looking-at "[ \t]*$")
1120 (org-looking-back "^\\([ \t]*\\)\\([-+*]\\|[0-9]+[).]\\)[ \t]+"))
1121 (setq this-command
'org-cycle-item-indentation
)
1122 (if (eq last-command
'org-cycle-item-indentation
)
1124 (progn (org-outdent-item 1)
1125 (if (equal org-tab-ind-state
(org-get-indentation))
1126 (org-outdent-item 1))
1130 (while (< (org-get-indentation) org-tab-ind-state
)
1131 (progn (org-indent-item 1) (end-of-line 1)))
1132 (setq this-command
'org-cycle
))))
1133 (setq org-tab-ind-state
(org-get-indentation))
1134 (org-indent-item 1))
1137 (defun org-get-bullet ()
1139 (goto-char (point-at-bol))
1141 "^\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\(\\*\\)\\)\\( \\|$\\)")
1142 (or (match-string 2) (match-string 4)))))
1144 ;;; Send and receive lists
1146 (defun org-list-parse-list (&optional delete
)
1147 "Parse the list at point and maybe DELETE it.
1148 Return a list containing first level items as strings and
1149 sublevels as a list of strings."
1150 (let* ((item-beginning (org-list-item-beginning))
1151 (start (car item-beginning
))
1152 (end (save-excursion
1153 (goto-char (org-list-end (cdr item-beginning
)))
1154 (org-back-over-empty-lines)
1156 output itemsep ltype
)
1157 (while (re-search-forward org-list-beginning-re end t
)
1158 (goto-char (match-beginning 3))
1160 (cond ((string-match "[0-9]" (match-string 2))
1161 (setq itemsep
"[0-9]+\\(?:\\.\\|)\\)"
1163 ((string-match "^.*::" (match-string 0))
1164 (setq itemsep
"[-+]" ltype
'descriptive
))
1165 (t (setq itemsep
"[-+]" ltype
'unordered
))))
1166 (let* ((indent1 (match-string 1))
1167 (nextitem (save-excursion
1169 (or (and (re-search-forward
1170 (concat "^" indent1 itemsep
" *?") end t
)
1171 (match-beginning 0)) end
))))
1172 (item (buffer-substring
1174 (or (and (org-re-search-forward-unprotected
1175 org-list-beginning-re end t
)
1176 (goto-char (match-beginning 0)))
1178 (nextindent (match-string 1))
1179 (item (org-trim item
))
1180 (item (if (string-match "^\\[\\([xX ]\\)\\]" item
)
1181 (replace-match (if (equal (match-string 1 item
) " ")
1187 (when (> (length nextindent
)
1189 (narrow-to-region (point) nextitem
)
1190 (push (org-list-parse-list) output
)
1192 (when delete
(delete-region start end
))
1193 (setq output
(nreverse output
))
1194 (push ltype output
)))
1196 (defun org-list-item-beginning ()
1197 "Find the beginning of the list item.
1198 Return a cons which car is the beginning position of the item and
1199 cdr is the indentation string."
1201 (if (not (or (looking-at org-list-beginning-re
)
1203 org-list-beginning-re nil t
)))
1204 (progn (goto-char (point-min)) (point))
1205 (cons (match-beginning 0) (match-string 1)))))
1207 (defun org-list-goto-true-beginning ()
1208 "Go to the beginning of the list at point."
1209 (beginning-of-line 1)
1210 (while (looking-at org-list-beginning-re
)
1211 (beginning-of-line 0))
1213 (re-search-forward org-list-beginning-re nil t
)
1214 (goto-char (match-beginning 0))))
1216 (defun org-list-make-subtree ()
1217 "Convert the plain list at point into a subtree."
1219 (org-list-goto-true-beginning)
1220 (let ((list (org-list-parse-list t
)) nstars
)
1222 (if (condition-case nil
1223 (org-back-to-heading)
1225 (progn (re-search-forward org-complex-heading-regexp nil t
)
1226 (setq nstars
(length (match-string 1))))
1228 (org-list-make-subtrees list
(1+ nstars
))))
1230 (defun org-list-make-subtrees (list level
)
1231 "Convert LIST into subtrees starting at LEVEL."
1232 (if (symbolp (car list
))
1233 (org-list-make-subtrees (cdr list
) level
)
1234 (mapcar (lambda (item)
1236 (insert (make-string
1237 (if org-odd-levels-only
1238 (1- (* 2 level
)) level
) ?
*) " " item
"\n")
1239 (org-list-make-subtrees item
(1+ level
))))
1242 (defun org-list-end (indent)
1243 "Return the position of the end of the list.
1244 INDENT is the indentation of the list, as a string."
1247 (while (or (looking-at org-list-beginning-re
)
1248 (looking-at (concat "^" indent
"[ \t]+\\|^$"))
1249 (> (or (get-text-property (point) 'original-indentation
) -
1)
1251 (if (eq (point) (point-max))
1252 (throw 'exit
(point-max)))
1256 (defun org-list-insert-radio-list ()
1257 "Insert a radio list template appropriate for this major mode."
1259 (let* ((e (assq major-mode org-list-radio-list-templates
))
1262 (unless e
(error "No radio list setup defined for %s" major-mode
))
1263 (setq name
(read-string "List name: "))
1264 (while (string-match "%n" txt
)
1265 (setq txt
(replace-match name t t txt
)))
1266 (or (bolp) (insert "\n"))
1271 (defun org-list-send-list (&optional maybe
)
1272 "Send a transformed version of this list to the receiver position.
1273 With argument MAYBE, fail quietly if no transformation is defined for
1277 (unless (org-at-item-p) (error "Not at a list"))
1279 (org-list-goto-true-beginning)
1280 (beginning-of-line 0)
1281 (unless (looking-at "[ \t]*#\\+ORGLST[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?")
1284 (error "Don't know how to transform this list"))))
1285 (let* ((name (match-string 1))
1286 (transform (intern (match-string 2)))
1287 (item-beginning (org-list-item-beginning))
1288 (list (save-excursion (org-list-goto-true-beginning)
1289 (org-list-parse-list)))
1291 (unless (fboundp transform
)
1292 (error "No such transformation function %s" transform
))
1293 (let ((txt (funcall transform list
)))
1294 ;; Find the insertion place
1296 (goto-char (point-min))
1297 (unless (re-search-forward
1298 (concat "BEGIN RECEIVE ORGLST +" name
"\\([ \t]\\|$\\)") nil t
)
1299 (error "Don't know where to insert translated list"))
1300 (goto-char (match-beginning 0))
1301 (beginning-of-line 2)
1303 (unless (re-search-forward (concat "END RECEIVE ORGLST +" name
) nil t
)
1304 (error "Cannot find end of insertion region"))
1305 (beginning-of-line 1)
1306 (delete-region beg
(point))
1309 (message "List converted and installed at receiver location"))))
1311 (defun org-list-to-generic (list params
)
1312 "Convert a LIST parsed through `org-list-parse-list' to other formats.
1314 Valid parameters PARAMS are
1316 :ustart String to start an unordered list
1317 :uend String to end an unordered list
1319 :ostart String to start an ordered list
1320 :oend String to end an ordered list
1322 :dstart String to start a descriptive list
1323 :dend String to end a descriptive list
1324 :dtstart String to start a descriptive term
1325 :dtend String to end a descriptive term
1326 :ddstart String to start a description
1327 :ddend String to end a description
1329 :splice When set to t, return only list body lines, don't wrap
1330 them into :[u/o]start and :[u/o]end. Default is nil.
1332 :istart String to start a list item
1333 :iend String to end a list item
1334 :isep String to separate items
1335 :lsep String to separate sublists
1337 :cboff String to insert for an unchecked checkbox
1338 :cbon String to insert for a checked checkbox"
1340 (let* ((p params
) sublist
1341 (splicep (plist-get p
:splice
))
1342 (ostart (plist-get p
:ostart
))
1343 (oend (plist-get p
:oend
))
1344 (ustart (plist-get p
:ustart
))
1345 (uend (plist-get p
:uend
))
1346 (dstart (plist-get p
:dstart
))
1347 (dend (plist-get p
:dend
))
1348 (dtstart (plist-get p
:dtstart
))
1349 (dtend (plist-get p
:dtend
))
1350 (ddstart (plist-get p
:ddstart
))
1351 (ddend (plist-get p
:ddend
))
1352 (istart (plist-get p
:istart
))
1353 (iend (plist-get p
:iend
))
1354 (isep (plist-get p
:isep
))
1355 (lsep (plist-get p
:lsep
))
1356 (cbon (plist-get p
:cbon
))
1357 (cboff (plist-get p
:cboff
)))
1359 (cond ((eq (car list
) 'ordered
)
1360 (concat ostart
"\n%s" oend
"\n"))
1361 ((eq (car list
) 'unordered
)
1362 (concat ustart
"\n%s" uend
"\n"))
1363 ((eq (car list
) 'descriptive
)
1364 (concat dstart
"\n%s" dend
"\n"))))
1365 rtn term defstart defend
)
1366 (while (setq sublist
(pop list
))
1367 (cond ((symbolp sublist
) nil
)
1369 (when (string-match "^\\(.*\\) ::" sublist
)
1370 (setq term
(org-trim (format (concat dtstart
"%s" dtend
)
1371 (match-string 1 sublist
))))
1372 (setq sublist
(substring sublist
(1+ (length term
)))))
1373 (if (string-match "\\[CBON\\]" sublist
)
1374 (setq sublist
(replace-match cbon t t sublist
)))
1375 (if (string-match "\\[CBOFF\\]" sublist
)
1376 (setq sublist
(replace-match cboff t t sublist
)))
1377 (if (string-match "\\[-\\]" sublist
)
1378 (setq sublist
(replace-match "$\\boxminus$" t t sublist
)))
1379 (setq rtn
(concat rtn istart term ddstart
1380 sublist ddend iend isep
)))
1381 (t (setq rtn
(concat rtn
;; previous list
1382 lsep
;; list separator
1383 (org-list-to-generic sublist p
)
1384 lsep
;; list separator
1386 (format wrapper rtn
))))
1388 (defun org-list-to-latex (list &optional params
)
1389 "Convert LIST into a LaTeX list.
1390 LIST is as returned by `org-list-parse-list'. PARAMS is a property list
1391 with overruling parameters for `org-list-to-generic'."
1392 (org-list-to-generic
1395 '(:splicep nil
:ostart
"\\begin{enumerate}" :oend
"\\end{enumerate}"
1396 :ustart
"\\begin{itemize}" :uend
"\\end{itemize}"
1397 :dstart
"\\begin{description}" :dend
"\\end{description}"
1398 :dtstart
"[" :dtend
"]"
1399 :ddstart
"" :ddend
""
1400 :istart
"\\item " :iend
""
1401 :isep
"\n" :lsep
"\n"
1402 :cbon
"\\texttt{[X]}" :cboff
"\\texttt{[ ]}")
1405 (defun org-list-to-html (list &optional params
)
1406 "Convert LIST into a HTML list.
1407 LIST is as returned by `org-list-parse-list'. PARAMS is a property list
1408 with overruling parameters for `org-list-to-generic'."
1409 (org-list-to-generic
1412 '(:splicep nil
:ostart
"<ol>" :oend
"</ol>"
1413 :ustart
"<ul>" :uend
"</ul>"
1414 :dstart
"<dl>" :dend
"</dl>"
1415 :dtstart
"<dt>" :dtend
"</dt>"
1416 :ddstart
"<dd>" :ddend
"</dd>"
1417 :istart
"<li>" :iend
"</li>"
1418 :isep
"\n" :lsep
"\n"
1419 :cbon
"<code>[X]</code>" :cboff
"<code>[ ]</code>")
1422 (defun org-list-to-texinfo (list &optional params
)
1423 "Convert LIST into a Texinfo list.
1424 LIST is as returned by `org-list-parse-list'. PARAMS is a property list
1425 with overruling parameters for `org-list-to-generic'."
1426 (org-list-to-generic
1429 '(:splicep nil
:ostart
"@itemize @minus" :oend
"@end itemize"
1430 :ustart
"@enumerate" :uend
"@end enumerate"
1431 :dstart
"@table" :dend
"@end table"
1432 :dtstart
"@item " :dtend
"\n"
1433 :ddstart
"" :ddend
""
1434 :istart
"@item\n" :iend
""
1435 :isep
"\n" :lsep
"\n"
1436 :cbon
"@code{[X]}" :cboff
"@code{[ ]}")
1441 ;; arch-tag: 73cf50c1-200f-4d1d-8a53-4e842a5b11c8
1442 ;;; org-list.el ends here