Better fontification and auto-indentation of description lists.
This commit is contained in:
parent
bb53613c9f
commit
4d99cbe28e
|
@ -1,5 +1,11 @@
|
||||||
2008-05-13 Carsten Dominik <dominik@science.uva.nl>
|
2008-05-13 Carsten Dominik <dominik@science.uva.nl>
|
||||||
|
|
||||||
|
* org.el (org-set-font-lock-defaults): Improve fontification of
|
||||||
|
description lists.
|
||||||
|
(org-insert-item): Handle description lists.
|
||||||
|
(org-adaptive-fill-function): Improve auto indentation in
|
||||||
|
description lists.
|
||||||
|
|
||||||
* org-exp.el (org-export-as-html, org-export-preprocess-string):
|
* org-exp.el (org-export-as-html, org-export-preprocess-string):
|
||||||
Implement VERSE environment.
|
Implement VERSE environment.
|
||||||
(org-export-preprocess-string): Implement the COMMENT
|
(org-export-preprocess-string): Implement the COMMENT
|
||||||
|
|
29
lisp/org.el
29
lisp/org.el
|
@ -749,6 +749,12 @@ with \\[org-ctrl-c-ctrl-c\\]."
|
||||||
:group 'org-plain-lists
|
:group 'org-plain-lists
|
||||||
:type 'boolean)
|
:type 'boolean)
|
||||||
|
|
||||||
|
(defcustom org-description-max-indent 20
|
||||||
|
"Maximum indentation for the second line of a description list.
|
||||||
|
When the indentation would be larger than this, it will become
|
||||||
|
5 characters instead."
|
||||||
|
:group 'org-plain-lists
|
||||||
|
:type 'integer)
|
||||||
|
|
||||||
(defgroup org-imenu-and-speedbar nil
|
(defgroup org-imenu-and-speedbar nil
|
||||||
"Options concerning imenu and speedbar in Org-mode."
|
"Options concerning imenu and speedbar in Org-mode."
|
||||||
|
@ -3693,7 +3699,7 @@ between words."
|
||||||
'("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
|
'("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
|
||||||
(0 (org-get-checkbox-statistics-face) t)))
|
(0 (org-get-checkbox-statistics-face) t)))
|
||||||
;; Description list items
|
;; Description list items
|
||||||
'("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(.*?\\) ::"
|
'("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(.*? ::\\)"
|
||||||
2 'bold prepend)
|
2 'bold prepend)
|
||||||
(list (concat "^\\*+ \\(.*:" org-archive-tag ":.*\\)")
|
(list (concat "^\\*+ \\(.*:" org-archive-tag ":.*\\)")
|
||||||
'(1 'org-archived prepend))
|
'(1 'org-archived prepend))
|
||||||
|
@ -5291,10 +5297,15 @@ Return t when things worked, nil when we are not in an item."
|
||||||
t)
|
t)
|
||||||
(error nil)))
|
(error nil)))
|
||||||
(let* ((bul (match-string 0))
|
(let* ((bul (match-string 0))
|
||||||
|
(descp (save-excursion (goto-char (match-beginning 0))
|
||||||
|
(beginning-of-line 1)
|
||||||
|
(save-match-data
|
||||||
|
(looking-at "[ \t]*.*? ::"))))
|
||||||
(eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
|
(eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
|
||||||
(match-end 0)))
|
(match-end 0)))
|
||||||
(blank (cdr (assq 'plain-list-item org-blank-before-new-entry)))
|
(blank (cdr (assq 'plain-list-item org-blank-before-new-entry)))
|
||||||
pos)
|
pos)
|
||||||
|
(if descp (setq checkbox nil))
|
||||||
(cond
|
(cond
|
||||||
((and (org-at-item-p) (<= (point) eow))
|
((and (org-at-item-p) (<= (point) eow))
|
||||||
;; before the bullet
|
;; before the bullet
|
||||||
|
@ -5307,7 +5318,10 @@ Return t when things worked, nil when we are not in an item."
|
||||||
(end-of-line 1)
|
(end-of-line 1)
|
||||||
(delete-horizontal-space))
|
(delete-horizontal-space))
|
||||||
(newline (if blank 2 1))))
|
(newline (if blank 2 1))))
|
||||||
(insert bul (if checkbox "[ ]" ""))
|
(insert bul
|
||||||
|
(if checkbox "[ ]" "")
|
||||||
|
(if descp (concat (if checkbox " " "")
|
||||||
|
(read-string "Term: ") " :: ") ""))
|
||||||
(just-one-space)
|
(just-one-space)
|
||||||
(setq pos (point))
|
(setq pos (point))
|
||||||
(end-of-line 1)
|
(end-of-line 1)
|
||||||
|
@ -13370,12 +13384,14 @@ not an indirect buffer."
|
||||||
((org-in-item-p)
|
((org-in-item-p)
|
||||||
(org-beginning-of-item)
|
(org-beginning-of-item)
|
||||||
; (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
|
; (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
|
||||||
(looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\[[- X]\\][ \t]*\\)?")
|
(looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\[[- X]\\][ \t]*\\|.*? :: \\)?")
|
||||||
(setq bpos (match-beginning 1) tpos (match-end 0)
|
(setq bpos (match-beginning 1) tpos (match-end 0)
|
||||||
bcol (progn (goto-char bpos) (current-column))
|
bcol (progn (goto-char bpos) (current-column))
|
||||||
tcol (progn (goto-char tpos) (current-column))
|
tcol (progn (goto-char tpos) (current-column))
|
||||||
bullet (match-string 1)
|
bullet (match-string 1)
|
||||||
bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
|
bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
|
||||||
|
(if (> tcol (+ bcol org-description-max-indent))
|
||||||
|
(setq tcol (+ bcol 5)))
|
||||||
(if (not itemp)
|
(if (not itemp)
|
||||||
(setq column tcol)
|
(setq column tcol)
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
|
@ -13459,6 +13475,13 @@ In particular, this makes sure hanging paragraphs for hand-formatted lists
|
||||||
work correctly."
|
work correctly."
|
||||||
(cond ((looking-at "#[ \t]+")
|
(cond ((looking-at "#[ \t]+")
|
||||||
(match-string 0))
|
(match-string 0))
|
||||||
|
((looking-at "[ \t]*\\([-*+] .*? :: \\)")
|
||||||
|
(save-excursion
|
||||||
|
(if (> (match-end 1) (+ (match-beginning 1)
|
||||||
|
org-description-max-indent))
|
||||||
|
(goto-char (+ (match-beginning 1) 5))
|
||||||
|
(goto-char (match-end 0)))
|
||||||
|
(make-string (current-column) ?\ )))
|
||||||
((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] \\)?")
|
((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] \\)?")
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (match-end 0))
|
(goto-char (match-end 0))
|
||||||
|
|
Loading…
Reference in New Issue