Release 6.28e
[org-mode/org-tableheadings.git] / lisp / org-list.el
blob70c991407d227ea91b103b4b24086a33168f05e2
1 ;;; org-list.el --- Plain lists for Org-mode
2 ;;
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
4 ;; Free Software Foundation, Inc.
5 ;;
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
10 ;; Version: 6.28e
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 ;;; Commentary:
30 ;; This file contains the code dealing with plain lists in Org-mode.
32 ;;; Code:
34 (require 'org-macs)
35 (require 'org-compat)
37 (defvar org-blank-before-new-entry)
38 (defvar org-M-RET-may-split-line)
40 (declare-function org-invisible-p "org" ())
41 (declare-function org-on-heading-p "org" (&optional invisible-ok))
42 (declare-function outline-next-heading "outline" ())
43 (declare-function outline-back-to-heading "outline" (&optional invisible-ok))
44 (declare-function org-back-to-heading "org" (&optional invisible-ok))
45 (declare-function org-back-over-empty-lines "org" ())
46 (declare-function org-skip-whitespace "org" ())
47 (declare-function org-trim "org" (s))
48 (declare-function org-get-indentation "org" (&optional line))
49 (declare-function org-timer-item "org-timer" (&optional arg))
50 (declare-function org-combine-plists "org" (&rest plists))
51 (declare-function org-entry-get "org" (pom property &optional inherit))
52 (declare-function org-narrow-to-subtree "org" ())
53 (declare-function org-show-subtree "org" ())
55 (defgroup org-plain-lists nil
56 "Options concerning plain lists in Org-mode."
57 :tag "Org Plain lists"
58 :group 'org-structure)
60 (defcustom org-cycle-include-plain-lists nil
61 "Non-nil means, include plain lists into visibility cycling.
62 This means that during cycling, plain list items will *temporarily* be
63 interpreted as outline headlines with a level given by 1000+i where i is the
64 indentation of the bullet. In all other operations, plain list items are
65 not seen as headlines. For example, you cannot assign a TODO keyword to
66 such an item."
67 :group 'org-plain-lists
68 :type 'boolean)
70 (defcustom org-plain-list-ordered-item-terminator t
71 "The character that makes a line with leading number an ordered list item.
72 Valid values are ?. and ?\). To get both terminators, use t. While
73 ?. may look nicer, it creates the danger that a line with leading
74 number may be incorrectly interpreted as an item. ?\) therefore is
75 the safe choice."
76 :group 'org-plain-lists
77 :type '(choice (const :tag "dot like in \"2.\"" ?.)
78 (const :tag "paren like in \"2)\"" ?\))
79 (const :tab "both" t)))
81 (defcustom org-list-two-spaces-after-bullet-regexp nil
82 "A regular expression matching bullets that should have 2 spaces after them.
83 When nil, no bullet will have two spaces after them.
84 When a string, it will be used as a regular expression. When the bullet
85 type of a list is changed, the new bullet type will be matched against this
86 regexp. If it matches, there will be two spaces instead of one after
87 the bullet in each item of he list."
88 :group 'org-plain-list
89 :type '(choice
90 (const :tag "never" nil)
91 (regexp)))
93 (defcustom org-empty-line-terminates-plain-lists nil
94 "Non-nil means, an empty line ends all plain list levels.
95 When nil, empty lines are part of the preceding item."
96 :group 'org-plain-lists
97 :type 'boolean)
99 (defcustom org-auto-renumber-ordered-lists t
100 "Non-nil means, automatically renumber ordered plain lists.
101 Renumbering happens when the sequence have been changed with
102 \\[org-shiftmetaup] or \\[org-shiftmetadown]. After other editing commands,
103 use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
104 :group 'org-plain-lists
105 :type 'boolean)
107 (defcustom org-provide-checkbox-statistics t
108 "Non-nil means, update checkbox statistics after insert and toggle.
109 When this is set, checkbox statistics is updated each time you either insert
110 a new checkbox with \\[org-insert-todo-heading] or toggle a checkbox
111 with \\[org-ctrl-c-ctrl-c\\]."
112 :group 'org-plain-lists
113 :type 'boolean)
115 (defcustom org-hierarchical-checkbox-statistics t
116 "Non-nil means, checkbox statistics counts only the state of direct children.
117 When nil, all boxes below the cookie are counted."
118 :group 'org-plain-lists
119 :type 'boolean)
121 (defcustom org-description-max-indent 20
122 "Maximum indentation for the second line of a description list.
123 When the indentation would be larger than this, it will become
124 5 characters instead."
125 :group 'org-plain-lists
126 :type 'integer)
128 (defvar org-list-beginning-re
129 "^\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) +\\(.*\\)$")
131 (defcustom org-list-radio-list-templates
132 '((latex-mode "% BEGIN RECEIVE ORGLST %n
133 % END RECEIVE ORGLST %n
134 \\begin{comment}
135 #+ORGLST: SEND %n org-list-to-latex
136 | | |
137 \\end{comment}\n")
138 (texinfo-mode "@c BEGIN RECEIVE ORGLST %n
139 @c END RECEIVE ORGLST %n
140 @ignore
141 #+ORGLST: SEND %n org-list-to-texinfo
142 | | |
143 @end ignore\n")
144 (html-mode "<!-- BEGIN RECEIVE ORGLST %n -->
145 <!-- END RECEIVE ORGLST %n -->
146 <!--
147 #+ORGLST: SEND %n org-list-to-html
148 | | |
149 -->\n"))
150 "Templates for radio lists in different major modes.
151 All occurrences of %n in a template will be replaced with the name of the
152 list, obtained by prompting the user."
153 :group 'org-plain-lists
154 :type '(repeat
155 (list (symbol :tag "Major mode")
156 (string :tag "Format"))))
158 ;;;; Plain list items, including checkboxes
160 ;;; Plain list items
162 (defun org-at-item-p ()
163 "Is point in a line starting a hand-formatted item?"
164 (let ((llt org-plain-list-ordered-item-terminator))
165 (save-excursion
166 (goto-char (point-at-bol))
167 (looking-at
168 (cond
169 ((eq llt t) "\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
170 ((= llt ?.) "\\([ \t]*\\([-+]\\|\\([0-9]+\\.\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
171 ((= llt ?\)) "\\([ \t]*\\([-+]\\|\\([0-9]+)\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
172 (t (error "Invalid value of `org-plain-list-ordered-item-terminator'")))))))
174 (defun org-at-item-bullet-p ()
175 "Is point at the bullet of a plain list item?"
176 (and (org-at-item-p)
177 (not (member (char-after) '(?\ ?\t)))
178 (< (point) (match-end 0))))
180 (defun org-in-item-p ()
181 "It the cursor inside a plain list item.
182 Does not have to be the first line."
183 (save-excursion
184 (condition-case nil
185 (progn
186 (org-beginning-of-item)
187 (org-at-item-p)
189 (error nil))))
191 (defun org-insert-item (&optional checkbox)
192 "Insert a new item at the current level.
193 Return t when things worked, nil when we are not in an item."
194 (when (save-excursion
195 (condition-case nil
196 (progn
197 (org-beginning-of-item)
198 (org-at-item-p)
199 (if (org-invisible-p) (error "Invisible item"))
201 (error nil)))
202 (let* ((bul (match-string 0))
203 (descp (save-excursion (goto-char (match-beginning 0))
204 (beginning-of-line 1)
205 (save-match-data
206 (and (looking-at "[ \t]*\\(.*?\\) ::")
207 (match-string 1)))))
208 (empty-line-p (save-excursion
209 (goto-char (match-beginning 0))
210 (and (not (bobp))
211 (or (beginning-of-line 0) t)
212 (save-match-data
213 (looking-at "[ \t]*$")))))
214 (timerp (and descp
215 (save-match-data
216 (string-match "^[-+*][ \t]+[0-9]+:[0-9]+:[0-9]+$"
217 descp))))
218 (eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
219 (match-end 0)))
220 (blank-a (if org-empty-line-terminates-plain-lists
222 (cdr (assq 'plain-list-item org-blank-before-new-entry))))
223 (blank (if (eq blank-a 'auto) empty-line-p blank-a))
224 pos)
225 (if descp (setq checkbox nil))
226 (if timerp
227 (progn (org-timer-item) t)
228 (cond
229 ((and (org-at-item-p) (<= (point) eow))
230 ;; before the bullet
231 (beginning-of-line 1)
232 (open-line (if blank 2 1)))
233 ((<= (point) eow)
234 (beginning-of-line 1))
236 (unless (org-get-alist-option org-M-RET-may-split-line 'item)
237 (end-of-line 1)
238 (delete-horizontal-space))
239 (newline (if blank 2 1))))
240 (insert bul
241 (if checkbox "[ ]" "")
242 (if descp (concat (if checkbox " " "")
243 (read-string "Term: ") " :: ") ""))
244 (just-one-space)
245 (setq pos (point))
246 (end-of-line 1)
247 (unless (= (point) pos) (just-one-space) (backward-delete-char 1)))
248 (org-maybe-renumber-ordered-list)
249 (and checkbox (org-update-checkbox-count-maybe))
250 t)))
252 ;;; Checkboxes
254 (defun org-at-item-checkbox-p ()
255 "Is point at a line starting a plain-list item with a checklet?"
256 (and (org-at-item-p)
257 (save-excursion
258 (goto-char (match-end 0))
259 (skip-chars-forward " \t")
260 (looking-at "\\[[- X]\\]"))))
262 (defun org-toggle-checkbox (&optional toggle-presence)
263 "Toggle the checkbox in the current line.
264 With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.
265 With double prefix, set checkbox to [-].
266 When there is an active region, toggle status or presence of the checkbox
267 in the first line, and make every item in the region have the same
268 status or presence, respectively.
269 If the cursor is in a headline, apply this to all checkbox items in the
270 text below the heading."
271 (interactive "P")
272 (catch 'exit
273 (let (beg end status first-present first-status blocked)
274 (cond
275 ((org-region-active-p)
276 (setq beg (region-beginning) end (region-end)))
277 ((org-on-heading-p)
278 (setq beg (point) end (save-excursion (outline-next-heading) (point))))
279 ((org-at-item-checkbox-p)
280 (save-excursion
281 (if (equal toggle-presence '(4))
282 (progn
283 (replace-match "")
284 (goto-char (match-beginning 0))
285 (just-one-space))
286 (when (setq blocked (org-checkbox-blocked-p))
287 (error "Checkbox blocked because of unchecked box in line %d"
288 blocked))
289 (replace-match
290 (cond ((equal toggle-presence '(16)) "[-]")
291 ((member (match-string 0) '("[ ]" "[-]")) "[X]")
292 (t "[ ]"))
293 t t)))
294 (throw 'exit t))
295 ((org-at-item-p)
296 ;; add a checkbox
297 (save-excursion
298 (goto-char (match-end 0))
299 (insert "[ ] "))
300 (throw 'exit t))
301 (t (error "Not at a checkbox or heading, and no active region")))
302 (setq end (move-marker (make-marker) end))
303 (save-excursion
304 (goto-char beg)
305 (setq first-present (org-at-item-checkbox-p)
306 first-status
307 (save-excursion
308 (and (re-search-forward "[ \t]\\(\\[[ X]\\]\\)" end t)
309 (equal (match-string 1) "[X]"))))
310 (while (< (point) end)
311 (if toggle-presence
312 (cond
313 ((and first-present (org-at-item-checkbox-p))
314 (save-excursion
315 (replace-match "")
316 (goto-char (match-beginning 0))
317 (just-one-space)))
318 ((and (not first-present) (not (org-at-item-checkbox-p))
319 (org-at-item-p))
320 (save-excursion
321 (goto-char (match-end 0))
322 (insert "[ ] "))))
323 (when (org-at-item-checkbox-p)
324 (setq status (equal (match-string 0) "[X]"))
325 (replace-match
326 (if first-status "[ ]" "[X]") t t)))
327 (beginning-of-line 2)))))
328 (org-update-checkbox-count-maybe))
330 (defun org-reset-checkbox-state-subtree ()
331 "Reset all checkboxes in an entry subtree."
332 (interactive "*")
333 (save-restriction
334 (save-excursion
335 (org-narrow-to-subtree)
336 (org-show-subtree)
337 (goto-char (point-min))
338 (let ((end (point-max)))
339 (while (< (point) end)
340 (when (org-at-item-checkbox-p)
341 (replace-match "[ ]" t t))
342 (beginning-of-line 2))))
343 (org-update-checkbox-count-maybe)))
345 (defun org-checkbox-blocked-p ()
346 "Is the current checkbox blocked from for being checked now?
347 A checkbox is blocked if all of the following conditions are fulfilled:
349 1. The checkbox is not checked already.
350 2. The current entry has the ORDERED property set.
351 3. There is an unchecked checkbox in this entry before the current line."
352 (catch 'exit
353 (save-match-data
354 (save-excursion
355 (unless (org-at-item-checkbox-p) (throw 'exit nil))
356 (when (equal (match-string 0) "[X]")
357 ;; the box is already checked!
358 (throw 'exit nil))
359 (let ((end (point-at-bol)))
360 (condition-case nil (org-back-to-heading t)
361 (error (throw 'exit nil)))
362 (unless (org-entry-get nil "ORDERED") (throw 'exit nil))
363 (if (re-search-forward "^[ \t]*[-+*0-9.)] \\[[- ]\\]" end t)
364 (org-current-line)
365 nil))))))
367 (defvar org-checkbox-statistics-hook nil
368 "Hook that is run whenever Org thinks checkbox statistics should be updated.
369 This hook runs even if `org-provide-checkbox-statistics' is nil, to it can
370 be used to implement alternative ways of collecting statistics information.")
372 (defun org-update-checkbox-count-maybe ()
373 "Update checkbox statistics unless turned off by user."
374 (when org-provide-checkbox-statistics
375 (org-update-checkbox-count))
376 (run-hooks 'org-checkbox-statistics-hook))
378 (defun org-update-checkbox-count (&optional all)
379 "Update the checkbox statistics in the current section.
380 This will find all statistic cookies like [57%] and [6/12] and update them
381 with the current numbers. With optional prefix argument ALL, do this for
382 the whole buffer."
383 (interactive "P")
384 (save-excursion
385 (let* ((buffer-invisibility-spec (org-inhibit-invisibility)) ; Emacs 21
386 (beg (condition-case nil
387 (progn (org-back-to-heading) (point))
388 (error (point-min))))
389 (end (move-marker (make-marker)
390 (progn (outline-next-heading) (point))))
391 (re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
392 (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\)")
393 (re-find (concat re "\\|" re-box))
394 beg-cookie end-cookie is-percent c-on c-off lim
395 eline curr-ind next-ind continue-from startsearch
396 (recursive
397 (or (not org-hierarchical-checkbox-statistics)
398 (string-match "\\<recursive\\>"
399 (or (org-entry-get nil "COOKIE_DATA") ""))))
400 (cstat 0)
402 (when all
403 (goto-char (point-min))
404 (outline-next-heading)
405 (setq beg (point) end (point-max)))
406 (goto-char end)
407 ;; find each statistics cookie
408 (while (and (re-search-backward re-find beg t)
409 (not (save-match-data
410 (and (org-on-heading-p)
411 (string-match "\\<todo\\>"
412 (downcase
413 (or (org-entry-get
414 nil "COOKIE_DATA")
415 "")))))))
416 (setq beg-cookie (match-beginning 1)
417 end-cookie (match-end 1)
418 cstat (+ cstat (if end-cookie 1 0))
419 startsearch (point-at-eol)
420 continue-from (match-beginning 0)
421 is-percent (match-beginning 2)
422 lim (cond
423 ((org-on-heading-p) (outline-next-heading) (point))
424 ((org-at-item-p) (org-end-of-item) (point))
425 (t nil))
426 c-on 0
427 c-off 0)
428 (when lim
429 ;; find first checkbox for this cookie and gather
430 ;; statistics from all that are at this indentation level
431 (goto-char startsearch)
432 (if (re-search-forward re-box lim t)
433 (progn
434 (org-beginning-of-item)
435 (setq curr-ind (org-get-indentation))
436 (setq next-ind curr-ind)
437 (while (and (bolp) (org-at-item-p)
438 (if recursive
439 (<= curr-ind next-ind)
440 (= curr-ind next-ind)))
441 (save-excursion (end-of-line) (setq eline (point)))
442 (if (re-search-forward re-box eline t)
443 (if (member (match-string 2) '("[ ]" "[-]"))
444 (setq c-off (1+ c-off))
445 (setq c-on (1+ c-on))
448 (if (not recursive)
449 (org-end-of-item)
450 (end-of-line)
451 (when (re-search-forward org-list-beginning-re lim t)
452 (beginning-of-line)))
453 (setq next-ind (org-get-indentation))
455 (goto-char continue-from)
456 ;; update cookie
457 (when end-cookie
458 (delete-region beg-cookie end-cookie)
459 (goto-char beg-cookie)
460 (insert
461 (if is-percent
462 (format "[%d%%]" (/ (* 100 c-on) (max 1 (+ c-on c-off))))
463 (format "[%d/%d]" c-on (+ c-on c-off)))))
464 ;; update items checkbox if it has one
465 (when (org-at-item-p)
466 (org-beginning-of-item)
467 (when (and (> (+ c-on c-off) 0)
468 (re-search-forward re-box (point-at-eol) t))
469 (setq beg-cookie (match-beginning 2)
470 end-cookie (match-end 2))
471 (delete-region beg-cookie end-cookie)
472 (goto-char beg-cookie)
473 (cond ((= c-off 0) (insert "[X]"))
474 ((= c-on 0) (insert "[ ]"))
475 (t (insert "[-]")))
477 (goto-char continue-from))
478 (when (interactive-p)
479 (message "Checkbox statistics updated %s (%d places)"
480 (if all "in entire file" "in current outline entry") cstat)))))
482 (defun org-get-checkbox-statistics-face ()
483 "Select the face for checkbox statistics.
484 The face will be `org-done' when all relevant boxes are checked. Otherwise
485 it will be `org-todo'."
486 (if (match-end 1)
487 (if (equal (match-string 1) "100%")
488 'org-checkbox-statistics-done
489 'org-checkbox-statistics-todo)
490 (if (and (> (match-end 2) (match-beginning 2))
491 (equal (match-string 2) (match-string 3)))
492 'org-checkbox-statistics-done
493 'org-checkbox-statistics-todo)))
495 (defun org-beginning-of-item ()
496 "Go to the beginning of the current hand-formatted item.
497 If the cursor is not in an item, throw an error."
498 (interactive)
499 (let ((pos (point))
500 (limit (save-excursion
501 (condition-case nil
502 (progn
503 (org-back-to-heading)
504 (beginning-of-line 2) (point))
505 (error (point-min)))))
506 (ind-empty (if org-empty-line-terminates-plain-lists 0 10000))
507 ind ind1)
508 (if (org-at-item-p)
509 (beginning-of-line 1)
510 (beginning-of-line 1)
511 (skip-chars-forward " \t")
512 (setq ind (current-column))
513 (if (catch 'exit
514 (while t
515 (beginning-of-line 0)
516 (if (or (bobp) (< (point) limit)) (throw 'exit nil))
518 (if (looking-at "[ \t]*$")
519 (setq ind1 ind-empty)
520 (skip-chars-forward " \t")
521 (setq ind1 (current-column)))
522 (if (< ind1 ind)
523 (progn (beginning-of-line 1) (throw 'exit (org-at-item-p))))))
525 (goto-char pos)
526 (error "Not in an item")))))
528 (defun org-end-of-item ()
529 "Go to the end of the current hand-formatted item.
530 If the cursor is not in an item, throw an error."
531 (interactive)
532 (let* ((pos (point))
533 ind1
534 (ind-empty (if org-empty-line-terminates-plain-lists 0 10000))
535 (limit (save-excursion (outline-next-heading) (point)))
536 (ind (save-excursion
537 (org-beginning-of-item)
538 (skip-chars-forward " \t")
539 (current-column)))
540 (end (catch 'exit
541 (while t
542 (beginning-of-line 2)
543 (if (eobp) (throw 'exit (point)))
544 (if (>= (point) limit) (throw 'exit (point-at-bol)))
545 (if (looking-at "[ \t]*$")
546 (setq ind1 ind-empty)
547 (skip-chars-forward " \t")
548 (setq ind1 (current-column)))
549 (if (<= ind1 ind)
550 (throw 'exit (point-at-bol)))))))
551 (if end
552 (goto-char end)
553 (goto-char pos)
554 (error "Not in an item"))))
556 (defun org-next-item ()
557 "Move to the beginning of the next item in the current plain list.
558 Error if not at a plain list, or if this is the last item in the list."
559 (interactive)
560 (let (ind ind1 (pos (point)))
561 (org-beginning-of-item)
562 (setq ind (org-get-indentation))
563 (org-end-of-item)
564 (setq ind1 (org-get-indentation))
565 (unless (and (org-at-item-p) (= ind ind1))
566 (goto-char pos)
567 (error "On last item"))))
569 (defun org-previous-item ()
570 "Move to the beginning of the previous item in the current plain list.
571 Error if not at a plain list, or if this is the first item in the list."
572 (interactive)
573 (let (beg ind ind1 (pos (point)))
574 (org-beginning-of-item)
575 (setq beg (point))
576 (setq ind (org-get-indentation))
577 (goto-char beg)
578 (catch 'exit
579 (while t
580 (beginning-of-line 0)
581 (if (looking-at "[ \t]*$")
583 (if (<= (setq ind1 (org-get-indentation)) ind)
584 (throw 'exit t)))))
585 (condition-case nil
586 (if (or (not (org-at-item-p))
587 (< ind1 (1- ind)))
588 (error "")
589 (org-beginning-of-item))
590 (error (goto-char pos)
591 (error "On first item")))))
593 (defun org-first-list-item-p ()
594 "Is this heading the item in a plain list?"
595 (unless (org-at-item-p)
596 (error "Not at a plain list item"))
597 (org-beginning-of-item)
598 (= (point) (save-excursion (org-beginning-of-item-list))))
600 (defun org-move-item-down ()
601 "Move the plain list item at point down, i.e. swap with following item.
602 Subitems (items with larger indentation) are considered part of the item,
603 so this really moves item trees."
604 (interactive)
605 (let ((col (current-column))
606 (pos (point))
607 beg beg0 end end0 ind ind1 txt ne-end ne-beg)
608 (org-beginning-of-item)
609 (setq beg0 (point))
610 (save-excursion
611 (setq ne-beg (org-back-over-empty-lines))
612 (setq beg (point)))
613 (goto-char beg0)
614 (setq ind (org-get-indentation))
615 (org-end-of-item)
616 (setq end0 (point))
617 (setq ind1 (org-get-indentation))
618 (setq ne-end (org-back-over-empty-lines))
619 (setq end (point))
620 (goto-char beg0)
621 (when (and (org-first-list-item-p) (< ne-end ne-beg))
622 ;; include less whitespace
623 (save-excursion
624 (goto-char beg)
625 (forward-line (- ne-beg ne-end))
626 (setq beg (point))))
627 (goto-char end0)
628 (if (and (org-at-item-p) (= ind ind1))
629 (progn
630 (org-end-of-item)
631 (org-back-over-empty-lines)
632 (setq txt (buffer-substring beg end))
633 (save-excursion
634 (delete-region beg end))
635 (setq pos (point))
636 (insert txt)
637 (goto-char pos) (org-skip-whitespace)
638 (org-maybe-renumber-ordered-list)
639 (move-to-column col))
640 (goto-char pos)
641 (move-to-column col)
642 (error "Cannot move this item further down"))))
644 (defun org-move-item-up (arg)
645 "Move the plain list item at point up, i.e. swap with previous item.
646 Subitems (items with larger indentation) are considered part of the item,
647 so this really moves item trees."
648 (interactive "p")
649 (let ((col (current-column)) (pos (point))
650 beg beg0 end ind ind1 txt
651 ne-beg ne-ins ins-end)
652 (org-beginning-of-item)
653 (setq beg0 (point))
654 (setq ind (org-get-indentation))
655 (save-excursion
656 (setq ne-beg (org-back-over-empty-lines))
657 (setq beg (point)))
658 (goto-char beg0)
659 (org-end-of-item)
660 (org-back-over-empty-lines)
661 (setq end (point))
662 (goto-char beg0)
663 (catch 'exit
664 (while t
665 (beginning-of-line 0)
666 (if (looking-at "[ \t]*$")
667 (if org-empty-line-terminates-plain-lists
668 (progn
669 (goto-char pos)
670 (error "Cannot move this item further up"))
671 nil)
672 (if (<= (setq ind1 (org-get-indentation)) ind)
673 (throw 'exit t)))))
674 (condition-case nil
675 (org-beginning-of-item)
676 (error (goto-char beg0)
677 (move-to-column col)
678 (error "Cannot move this item further up")))
679 (setq ind1 (org-get-indentation))
680 (if (and (org-at-item-p) (= ind ind1))
681 (progn
682 (setq ne-ins (org-back-over-empty-lines))
683 (setq txt (buffer-substring beg end))
684 (save-excursion
685 (delete-region beg end))
686 (setq pos (point))
687 (insert txt)
688 (setq ins-end (point))
689 (goto-char pos) (org-skip-whitespace)
691 (when (and (org-first-list-item-p) (> ne-ins ne-beg))
692 ;; Move whitespace back to beginning
693 (save-excursion
694 (goto-char ins-end)
695 (let ((kill-whole-line t))
696 (kill-line (- ne-ins ne-beg)) (point)))
697 (insert (make-string (- ne-ins ne-beg) ?\n)))
699 (org-maybe-renumber-ordered-list)
700 (move-to-column col))
701 (goto-char pos)
702 (move-to-column col)
703 (error "Cannot move this item further up"))))
705 (defun org-maybe-renumber-ordered-list ()
706 "Renumber the ordered list at point if setup allows it.
707 This tests the user option `org-auto-renumber-ordered-lists' before
708 doing the renumbering."
709 (interactive)
710 (when (and org-auto-renumber-ordered-lists
711 (org-at-item-p))
712 (if (match-beginning 3)
713 (org-renumber-ordered-list 1)
714 (org-fix-bullet-type))))
716 (defun org-maybe-renumber-ordered-list-safe ()
717 (condition-case nil
718 (save-excursion
719 (org-maybe-renumber-ordered-list))
720 (error nil)))
722 (defun org-cycle-list-bullet (&optional which)
723 "Cycle through the different itemize/enumerate bullets.
724 This cycle the entire list level through the sequence:
726 `-' -> `+' -> `*' -> `1.' -> `1)'
728 If WHICH is a string, use that as the new bullet. If WHICH is an integer,
729 0 means `-', 1 means `+' etc."
730 (interactive "P")
731 (org-preserve-lc
732 (org-beginning-of-item-list)
733 (org-at-item-p)
734 (beginning-of-line 1)
735 (let ((current (match-string 0))
736 (prevp (eq which 'previous))
737 new old)
738 (setq new (cond
739 ((and (numberp which)
740 (nth (1- which) '("-" "+" "*" "1." "1)"))))
741 ((string-match "-" current) (if prevp "1)" "+"))
742 ((string-match "\\+" current)
743 (if prevp "-" (if (looking-at "\\S-") "1." "*")))
744 ((string-match "\\*" current) (if prevp "+" "1."))
745 ((string-match "\\." current)
746 (if prevp (if (looking-at "\\S-") "+" "*") "1)"))
747 ((string-match ")" current) (if prevp "1." "-"))
748 (t (error "This should not happen"))))
749 (and (looking-at "\\([ \t]*\\)\\(\\S-+\\)")
750 (setq old (match-string 2))
751 (replace-match (concat "\\1" new)))
752 (org-shift-item-indentation (- (length new) (length old)))
753 (org-fix-bullet-type)
754 (org-maybe-renumber-ordered-list))))
756 (defun org-get-string-indentation (s)
757 "What indentation has S due to SPACE and TAB at the beginning of the string?"
758 (let ((n -1) (i 0) (w tab-width) c)
759 (catch 'exit
760 (while (< (setq n (1+ n)) (length s))
761 (setq c (aref s n))
762 (cond ((= c ?\ ) (setq i (1+ i)))
763 ((= c ?\t) (setq i (* (/ (+ w i) w) w)))
764 (t (throw 'exit t)))))
767 (defun org-renumber-ordered-list (arg)
768 "Renumber an ordered plain list.
769 Cursor needs to be in the first line of an item, the line that starts
770 with something like \"1.\" or \"2)\"."
771 (interactive "p")
772 (unless (and (org-at-item-p)
773 (match-beginning 3))
774 (error "This is not an ordered list"))
775 (let ((line (org-current-line))
776 (col (current-column))
777 (ind (org-get-string-indentation
778 (buffer-substring (point-at-bol) (match-beginning 3))))
779 ;; (term (substring (match-string 3) -1))
780 ind1 (n (1- arg))
781 fmt bobp old new)
782 ;; find where this list begins
783 (org-beginning-of-item-list)
784 (setq bobp (bobp))
785 (looking-at "[ \t]*[0-9]+\\([.)]\\)")
786 (setq fmt (concat "%d" (or (match-string 1) ".")))
787 (beginning-of-line 0)
788 ;; walk forward and replace these numbers
789 (catch 'exit
790 (while t
791 (catch 'next
792 (if bobp (setq bobp nil) (beginning-of-line 2))
793 (if (eobp) (throw 'exit nil))
794 (if (looking-at "[ \t]*$") (throw 'next nil))
795 (skip-chars-forward " \t") (setq ind1 (current-column))
796 (if (> ind1 ind) (throw 'next t))
797 (if (< ind1 ind) (throw 'exit t))
798 (if (not (org-at-item-p)) (throw 'exit nil))
799 (setq old (match-string 2))
800 (delete-region (match-beginning 2) (match-end 2))
801 (goto-char (match-beginning 2))
802 (insert (setq new (format fmt (setq n (1+ n)))))
803 (org-shift-item-indentation (- (length new) (length old))))))
804 (goto-line line)
805 (org-move-to-column col)))
807 (defun org-fix-bullet-type ()
808 "Make sure all items in this list have the same bullet as the first item.
809 Also, fix the indentation."
810 (interactive)
811 (unless (org-at-item-p) (error "This is not a list"))
812 (let ((line (org-current-line))
813 (col (current-column))
814 (ind (current-indentation))
815 ind1 bullet oldbullet)
816 ;; find where this list begins
817 (org-beginning-of-item-list)
818 (beginning-of-line 1)
819 ;; find out what the bullet type is
820 (looking-at "[ \t]*\\(\\S-+\\)")
821 (setq bullet (concat (match-string 1) " "))
822 (if (and org-list-two-spaces-after-bullet-regexp
823 (string-match org-list-two-spaces-after-bullet-regexp bullet))
824 (setq bullet (concat bullet " ")))
825 ;; walk forward and replace these numbers
826 (beginning-of-line 0)
827 (catch 'exit
828 (while t
829 (catch 'next
830 (beginning-of-line 2)
831 (if (eobp) (throw 'exit nil))
832 (if (looking-at "[ \t]*$") (throw 'next nil))
833 (skip-chars-forward " \t") (setq ind1 (current-column))
834 (if (> ind1 ind) (throw 'next t))
835 (if (< ind1 ind) (throw 'exit t))
836 (if (not (org-at-item-p)) (throw 'exit nil))
837 (skip-chars-forward " \t")
838 (looking-at "\\S-+ *")
839 (setq oldbullet (match-string 0))
840 (unless (equal bullet oldbullet) (replace-match bullet))
841 (org-shift-item-indentation (- (length bullet) (length oldbullet))))))
842 (goto-line line)
843 (org-move-to-column col)
844 (if (string-match "[0-9]" bullet)
845 (org-renumber-ordered-list 1))))
847 (defun org-shift-item-indentation (delta)
848 "Shift the indentation in current item by DELTA."
849 (save-excursion
850 (let ((beg (point-at-bol))
851 (end (progn (org-end-of-item) (point)))
853 (goto-char end)
854 (beginning-of-line 0)
855 (while (> (point) beg)
856 (when (looking-at "[ \t]*\\S-")
857 ;; this is not an empty line
858 (setq i (org-get-indentation))
859 (if (and (> i 0) (> (setq i (+ i delta)) 0))
860 (indent-line-to i)))
861 (beginning-of-line 0)))))
863 (defun org-beginning-of-item-list ()
864 "Go to the beginning of the current item list.
865 I.e. to the first item in this list."
866 (interactive)
867 (org-beginning-of-item)
868 (let ((pos (point-at-bol))
869 (ind (org-get-indentation))
870 ind1)
871 ;; find where this list begins
872 (catch 'exit
873 (while t
874 (catch 'next
875 (beginning-of-line 0)
876 (if (looking-at "[ \t]*$")
877 (throw (if (bobp) 'exit 'next) t))
878 (skip-chars-forward " \t") (setq ind1 (current-column))
879 (if (or (< ind1 ind)
880 (and (= ind1 ind)
881 (not (org-at-item-p)))
882 (and (= (point-at-bol) (point-min))
883 (setq pos (point-min))))
884 (throw 'exit t)
885 (when (org-at-item-p) (setq pos (point-at-bol)))))))
886 (goto-char pos)))
889 (defun org-end-of-item-list ()
890 "Go to the end of the current item list.
891 I.e. to the text after the last item."
892 (interactive)
893 (org-beginning-of-item)
894 (let ((pos (point-at-bol))
895 (ind (org-get-indentation))
896 ind1)
897 ;; find where this list begins
898 (catch 'exit
899 (while t
900 (catch 'next
901 (beginning-of-line 2)
902 (if (looking-at "[ \t]*$")
903 (if (eobp)
904 (progn (setq pos (point)) (throw 'exit t))
905 (throw 'next t)))
906 (skip-chars-forward " \t") (setq ind1 (current-column))
907 (if (or (< ind1 ind)
908 (and (= ind1 ind)
909 (not (org-at-item-p)))
910 (eobp))
911 (progn
912 (setq pos (point-at-bol))
913 (throw 'exit t))))))
914 (goto-char pos)))
917 (defvar org-last-indent-begin-marker (make-marker))
918 (defvar org-last-indent-end-marker (make-marker))
920 (defun org-outdent-item (arg)
921 "Outdent a local list item."
922 (interactive "p")
923 (org-indent-item (- arg)))
925 (defun org-indent-item (arg)
926 "Indent a local list item."
927 (interactive "p")
928 (and (org-region-active-p) (org-cursor-to-region-beginning))
929 (unless (org-at-item-p)
930 (error "Not on an item"))
931 (save-excursion
932 (let (beg end ind ind1 tmp delta ind-down ind-up)
933 (setq end (and (org-region-active-p) (region-end)))
934 (if (memq last-command '(org-shiftmetaright org-shiftmetaleft))
935 (setq beg org-last-indent-begin-marker
936 end org-last-indent-end-marker)
937 (org-beginning-of-item)
938 (setq beg (move-marker org-last-indent-begin-marker (point)))
939 (org-end-of-item)
940 (setq end (move-marker org-last-indent-end-marker (or end (point)))))
941 (goto-char beg)
942 (setq tmp (org-item-indent-positions)
943 ind (car tmp)
944 ind-down (nth 2 tmp)
945 ind-up (nth 1 tmp)
946 delta (if (> arg 0)
947 (if ind-down (- ind-down ind) 2)
948 (if ind-up (- ind-up ind) -2)))
949 (if (< (+ delta ind) 0) (error "Cannot outdent beyond margin"))
950 (while (< (point) end)
951 (beginning-of-line 1)
952 (skip-chars-forward " \t") (setq ind1 (current-column))
953 (delete-region (point-at-bol) (point))
954 (or (eolp) (org-indent-to-column (+ ind1 delta)))
955 (beginning-of-line 2))))
956 (org-fix-bullet-type)
957 (org-maybe-renumber-ordered-list-safe)
958 (save-excursion
959 (beginning-of-line 0)
960 (condition-case nil (org-beginning-of-item) (error nil))
961 (org-maybe-renumber-ordered-list-safe)))
963 (defun org-item-indent-positions ()
964 "Return indentation for plain list items.
965 This returns a list with three values: The current indentation, the
966 parent indentation and the indentation a child should have.
967 Assumes cursor in item line."
968 (let* ((bolpos (point-at-bol))
969 (ind (org-get-indentation))
970 ind-down ind-up pos)
971 (save-excursion
972 (org-beginning-of-item-list)
973 (skip-chars-backward "\n\r \t")
974 (when (org-in-item-p)
975 (org-beginning-of-item)
976 (setq ind-up (org-get-indentation))))
977 (setq pos (point))
978 (save-excursion
979 (cond
980 ((and (condition-case nil (progn (org-previous-item) t)
981 (error nil))
982 (or (forward-char 1) t)
983 (re-search-forward "^\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)" bolpos t))
984 (setq ind-down (org-get-indentation)))
985 ((and (goto-char pos)
986 (org-at-item-p))
987 (goto-char (match-end 0))
988 (skip-chars-forward " \t")
989 (setq ind-down (current-column)))))
990 (list ind ind-up ind-down)))
993 ;;; Send and receive lists
995 (defun org-list-parse-list (&optional delete)
996 "Parse the list at point and maybe DELETE it.
997 Return a list containing first level items as strings and
998 sublevels as a list of strings."
999 (let* ((item-beginning (org-list-item-beginning))
1000 (start (car item-beginning))
1001 (end (org-list-end (cdr item-beginning)))
1002 output itemsep ltype)
1003 (while (re-search-forward org-list-beginning-re end t)
1004 (goto-char (match-beginning 3))
1005 (save-match-data
1006 (cond ((string-match "[0-9]" (match-string 2))
1007 (setq itemsep "[0-9]+\\(?:\\.\\|)\\)"
1008 ltype 'ordered))
1009 ((string-match "^.*::" (match-string 0))
1010 (setq itemsep "[-+]" ltype 'descriptive))
1011 (t (setq itemsep "[-+]" ltype 'unordered))))
1012 (let* ((indent1 (match-string 1))
1013 (nextitem (save-excursion
1014 (save-match-data
1015 (or (and (re-search-forward
1016 (concat "^" indent1 itemsep " *?") end t)
1017 (match-beginning 0)) end))))
1018 (item (buffer-substring
1019 (point)
1020 (or (and (re-search-forward
1021 org-list-beginning-re end t)
1022 (goto-char (match-beginning 0)))
1023 (goto-char end))))
1024 (nextindent (match-string 1))
1025 (item (org-trim item))
1026 (item (if (string-match "^\\[\\([xX ]\\)\\]" item)
1027 (replace-match (if (equal (match-string 1 item) " ")
1028 "[CBOFF]"
1029 "[CBON]")
1030 t nil item)
1031 item)))
1032 (push item output)
1033 (when (> (length nextindent)
1034 (length indent1))
1035 (narrow-to-region (point) nextitem)
1036 (push (org-list-parse-list) output)
1037 (widen))))
1038 (when delete (delete-region start end))
1039 (setq output (nreverse output))
1040 (push ltype output)))
1042 (defun org-list-item-beginning ()
1043 "Find the beginning of the list item.
1044 Return a cons which car is the beginning position of the item and
1045 cdr is the indentation string."
1046 (save-excursion
1047 (if (not (or (looking-at org-list-beginning-re)
1048 (re-search-backward
1049 org-list-beginning-re nil t)))
1050 (progn (goto-char (point-min)) (point))
1051 (cons (match-beginning 0) (match-string 1)))))
1053 (defun org-list-end (indent)
1054 "Return the position of the end of the list.
1055 INDENT is the indentation of the list, as a string."
1056 (save-excursion
1057 (catch 'exit
1058 (while (or (looking-at org-list-beginning-re)
1059 (looking-at (concat "^" indent "[ \t]+\\|^$"))
1060 (> (or (get-text-property (point) 'original-indentation) -1)
1061 (length indent)))
1062 (if (eq (point) (point-max))
1063 (throw 'exit (point-max)))
1064 (forward-line 1)))
1065 (point)))
1067 (defun org-list-insert-radio-list ()
1068 "Insert a radio list template appropriate for this major mode."
1069 (interactive)
1070 (let* ((e (assq major-mode org-list-radio-list-templates))
1071 (txt (nth 1 e))
1072 name pos)
1073 (unless e (error "No radio list setup defined for %s" major-mode))
1074 (setq name (read-string "List name: "))
1075 (while (string-match "%n" txt)
1076 (setq txt (replace-match name t t txt)))
1077 (or (bolp) (insert "\n"))
1078 (setq pos (point))
1079 (insert txt)
1080 (goto-char pos)))
1082 (defun org-list-send-list (&optional maybe)
1083 "Send a tranformed version of this list to the receiver position.
1084 With argument MAYBE, fail quietly if no transformation is defined for
1085 this list."
1086 (interactive)
1087 (catch 'exit
1088 (unless (org-at-item-p) (error "Not at a list"))
1089 (save-excursion
1090 (goto-char (car (org-list-item-beginning)))
1091 (beginning-of-line 0)
1092 (unless (looking-at "#\\+ORGLST: *SEND +\\([a-zA-Z0-9_]+\\) +\\([^ \t\r\n]+\\)\\( +.*\\)?")
1093 (if maybe
1094 (throw 'exit nil)
1095 (error "Don't know how to transform this list"))))
1096 (let* ((name (match-string 1))
1097 (item-beginning (org-list-item-beginning))
1098 (transform (intern (match-string 2)))
1099 (txt (buffer-substring-no-properties
1100 (car item-beginning)
1101 (org-list-end (cdr item-beginning))))
1102 (list (org-list-parse-list))
1103 beg)
1104 (unless (fboundp transform)
1105 (error "No such transformation function %s" transform))
1106 (setq txt (funcall transform list))
1107 ;; Find the insertion place
1108 (save-excursion
1109 (goto-char (point-min))
1110 (unless (re-search-forward
1111 (concat "BEGIN RECEIVE ORGLST +" name "\\([ \t]\\|$\\)") nil t)
1112 (error "Don't know where to insert translated list"))
1113 (goto-char (match-beginning 0))
1114 (beginning-of-line 2)
1115 (setq beg (point))
1116 (unless (re-search-forward (concat "END RECEIVE ORGLST +" name) nil t)
1117 (error "Cannot find end of insertion region"))
1118 (beginning-of-line 1)
1119 (delete-region beg (point))
1120 (goto-char beg)
1121 (insert txt "\n"))
1122 (message "List converted and installed at receiver location"))))
1124 (defun org-list-to-generic (list params)
1125 "Convert a LIST parsed through `org-list-parse-list' to other formats.
1127 Valid parameters PARAMS are
1129 :ustart String to start an unordered list
1130 :uend String to end an unordered list
1132 :ostart String to start an ordered list
1133 :oend String to end an ordered list
1135 :dstart String to start a descriptive list
1136 :dend String to end a descriptive list
1137 :dtstart String to start a descriptive term
1138 :dtend String to end a descriptive term
1139 :ddstart String to start a description
1140 :ddend String to end a description
1142 :splice When set to t, return only list body lines, don't wrap
1143 them into :[u/o]start and :[u/o]end. Default is nil.
1145 :istart String to start a list item
1146 :iend String to end a list item
1147 :isep String to separate items
1148 :lsep String to separate sublists
1150 :cboff String to insert for an unchecked checkbox
1151 :cbon String to insert for a checked checkbox"
1152 (interactive)
1153 (let* ((p params) sublist
1154 (splicep (plist-get p :splice))
1155 (ostart (plist-get p :ostart))
1156 (oend (plist-get p :oend))
1157 (ustart (plist-get p :ustart))
1158 (uend (plist-get p :uend))
1159 (dstart (plist-get p :dstart))
1160 (dend (plist-get p :dend))
1161 (dtstart (plist-get p :dtstart))
1162 (dtend (plist-get p :dtend))
1163 (ddstart (plist-get p :ddstart))
1164 (ddend (plist-get p :ddend))
1165 (istart (plist-get p :istart))
1166 (iend (plist-get p :iend))
1167 (isep (plist-get p :isep))
1168 (lsep (plist-get p :lsep))
1169 (cbon (plist-get p :cbon))
1170 (cboff (plist-get p :cboff)))
1171 (let ((wrapper
1172 (cond ((eq (car list) 'ordered)
1173 (concat ostart "\n%s" oend "\n"))
1174 ((eq (car list) 'unordered)
1175 (concat ustart "\n%s" uend "\n"))
1176 ((eq (car list) 'descriptive)
1177 (concat dstart "\n%s" dend "\n"))))
1178 rtn term defstart defend)
1179 (while (setq sublist (pop list))
1180 (cond ((symbolp sublist) nil)
1181 ((stringp sublist)
1182 (when (string-match "^\\(.*\\) ::" sublist)
1183 (setq term (org-trim (format (concat dtstart "%s" dtend)
1184 (match-string 1 sublist))))
1185 (setq sublist (substring sublist (1+ (length term)))))
1186 (if (string-match "\\[CBON\\]" sublist)
1187 (setq sublist (replace-match cbon t t sublist)))
1188 (if (string-match "\\[CBOFF\\]" sublist)
1189 (setq sublist (replace-match cboff t t sublist)))
1190 (setq rtn (concat rtn istart term ddstart
1191 sublist ddend iend isep)))
1192 (t (setq rtn (concat rtn ;; previous list
1193 lsep ;; list separator
1194 (org-list-to-generic sublist p)
1195 lsep ;; list separator
1196 )))))
1197 (format wrapper rtn))))
1199 (defun org-list-to-latex (list &optional params)
1200 "Convert LIST into a LaTeX list.
1201 LIST is as returnd by `org-list-parse-list'. PARAMS is a property list
1202 with overruling parameters for `org-list-to-generic'."
1203 (org-list-to-generic
1204 list
1205 (org-combine-plists
1206 '(:splicep nil :ostart "\\begin{enumerate}" :oend "\\end{enumerate}"
1207 :ustart "\\begin{itemize}" :uend "\\end{itemize}"
1208 :dstart "\\begin{description}" :dend "\\end{description}"
1209 :dtstart "[" :dtend "]"
1210 :ddstart "" :ddend ""
1211 :istart "\\item " :iend ""
1212 :isep "\n" :lsep "\n"
1213 :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}")
1214 params)))
1216 (defun org-list-to-html (list &optional params)
1217 "Convert LIST into a HTML list.
1218 LIST is as returnd by `org-list-parse-list'. PARAMS is a property list
1219 with overruling parameters for `org-list-to-generic'."
1220 (org-list-to-generic
1221 list
1222 (org-combine-plists
1223 '(:splicep nil :ostart "<ol>" :oend "</ol>"
1224 :ustart "<ul>" :uend "</ul>"
1225 :dstart "<dl>" :dend "</dl>"
1226 :dtstart "<dt>" :dtend "</dt>"
1227 :ddstart "<dd>" :ddend "</dd>"
1228 :istart "<li>" :iend "</li>"
1229 :isep "\n" :lsep "\n"
1230 :cbon "<code>[X]</code>" :cboff "<code>[ ]</code>")
1231 params)))
1233 (defun org-list-to-texinfo (list &optional params)
1234 "Convert LIST into a Texinfo list.
1235 LIST is as returnd by `org-list-parse-list'. PARAMS is a property list
1236 with overruling parameters for `org-list-to-generic'."
1237 (org-list-to-generic
1238 list
1239 (org-combine-plists
1240 '(:splicep nil :ostart "@itemize @minus" :oend "@end itemize"
1241 :ustart "@enumerate" :uend "@end enumerate"
1242 :dstart "@table" :dend "@end table"
1243 :dtstart "@item " :dtend "\n"
1244 :ddstart "" :ddend ""
1245 :istart "@item\n" :iend ""
1246 :isep "\n" :lsep "\n"
1247 :cbon "@code{[X]}" :cboff "@code{[ ]}")
1248 params)))
1250 (provide 'org-list)
1252 ;; arch-tag: 73cf50c1-200f-4d1d-8a53-4e842a5b11c8
1253 ;;; org-list.el ends here