Implement description lists.
These are implemented as part of plain lists, so a leading "-" or "+" is still needed. Maybe this is not the most pretty implementation, but it works without rewriting the quite complex list formatting code. So all the list formatting continues to work just fine. The description tag is highlighted in bold, so still easy to spot. The HTML exporter does export these already, the LaTeX exporter still needs to be adapted.
This commit is contained in:
parent
97eef5ed07
commit
e6b87d40b3
|
@ -1,3 +1,11 @@
|
|||
2008-05-04 Carsten Dominik <dominik@science.uva.nl>
|
||||
|
||||
* lisp/org.el (org-set-font-lock-defaults): Make the description
|
||||
tag bold.
|
||||
|
||||
* lisp/org-exp.el (org-export-as-html, org-close-li): Implement
|
||||
description lists.
|
||||
|
||||
2008-05-02 Carsten Dominik <dominik@science.uva.nl>
|
||||
|
||||
* lisp/org.el (org-read-date-analyze): "." as an alias for "+0" in
|
||||
|
|
|
@ -12,6 +12,30 @@
|
|||
|
||||
** Details
|
||||
|
||||
*** Description lists are now supported natively
|
||||
|
||||
A plain list will be exported as a description list if the
|
||||
first item in the list has a /term/ and the /description/,
|
||||
separated by " :: ". For example
|
||||
|
||||
: Free software by Carsten Dominik
|
||||
: - RefTeX :: Support for LaTeX Labels, References, Citations
|
||||
: - CDLaTeX :: more LaTeX functionality for Emacs
|
||||
: - TeXmathp :: checking LaTeX buffers for Math mode.
|
||||
: - ORG :: An Emacs mode for notes and projet planning.
|
||||
: - CONSTANTS :: An Emacs package for inserting the definition of
|
||||
: natural constants and units into a buffer.
|
||||
: - IDLWAVE :: The Emacs modes for editing and
|
||||
: running IDL and WAVE CL files.
|
||||
: - CHAIN :: A tool for running a code with
|
||||
: different sets of parameters
|
||||
: - MPP :: A preprocessor tool for creating MPEG
|
||||
: and other movie streams
|
||||
: - Dirabbrev :: Using abbreviations for directories
|
||||
: in the shell
|
||||
: - PSFIXBB :: fixing the BoundingBox in postscript files
|
||||
: - TFMT :: A table formatting tool
|
||||
|
||||
*** Blockquotes for export
|
||||
|
||||
For quoting an entire paragraph as a citation, use
|
||||
|
|
80
doc/org.texi
80
doc/org.texi
|
@ -1128,24 +1128,34 @@ additional structure. They also provide a way to create lists of
|
|||
checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
|
||||
and the HTML exporter (@pxref{Exporting}) parses and formats them.
|
||||
|
||||
Org knows ordered and unordered lists. Unordered list items start
|
||||
with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
|
||||
bullet, lines must be indented or they will be seen as top-level
|
||||
headlines. Also, when you are hiding leading stars to get a clean
|
||||
outline view, plain list items starting with a star are visually
|
||||
indistinguishable from true headlines. In short: even though @samp{*}
|
||||
is supported, it may be better to not use it for plain list items.} as
|
||||
bullets. Ordered list items start with a numeral followed by either a
|
||||
period or a right parenthesis, such as @samp{1.} or @samp{1)}. Items
|
||||
belonging to the same list must have the same indentation on the first
|
||||
line. In particular, if an ordered list reaches number @samp{10.}, then
|
||||
the 2--digit numbers must be written left-aligned with the other numbers
|
||||
in the list. Indentation also determines the end of a list item. It
|
||||
ends before the next line that is indented like the bullet/number, or
|
||||
less. Empty lines are part of the previous item, so you can have
|
||||
several paragraphs in one item. If you would like an empty line to
|
||||
terminate all currently open plain lists, configure the variable
|
||||
@code{org-empty-line-terminates-plain-lists}. Here is an example:
|
||||
Org knows ordered lists, unordered lists, and description lists.
|
||||
@itemize @bullet
|
||||
@item
|
||||
@emph{Unordered} list items start with @samp{-}, @samp{+}, or
|
||||
@samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
|
||||
they will be seen as top-level headlines. Also, when you are hiding leading
|
||||
stars to get a clean outline view, plain list items starting with a star are
|
||||
visually indistinguishable from true headlines. In short: even though
|
||||
@samp{*} is supported, it may be better to not use it for plain list items.}
|
||||
as bullets.
|
||||
@item
|
||||
@emph{Ordered} list items start with a numeral followed by either a period or
|
||||
a right parenthesis, such as @samp{1.} or @samp{1)}.
|
||||
@item
|
||||
@emph{Description} list items are like unordered list items, but contain the
|
||||
separator @samp{ :: } to separate the description @emph{term} from the
|
||||
desciption.
|
||||
@end itemize
|
||||
|
||||
Items belonging to the same list must have the same indentation on the first
|
||||
line. In particular, if an ordered list reaches number @samp{10.}, then the
|
||||
2--digit numbers must be written left-aligned with the other numbers in the
|
||||
list. Indentation also determines the end of a list item. It ends before
|
||||
the next line that is indented like the bullet/number, or less. Empty lines
|
||||
are part of the previous item, so you can have several paragraphs in one
|
||||
item. If you would like an empty line to terminate all currently open plain
|
||||
lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
|
||||
Here is an example:
|
||||
|
||||
@example
|
||||
@group
|
||||
|
@ -1159,6 +1169,10 @@ terminate all currently open plain lists, configure the variable
|
|||
- on DVD only
|
||||
He makes a really funny face when it happens.
|
||||
But in the end, not individual scenes matter but the film as a whole.
|
||||
Important actors in this film are:
|
||||
- @b{Elijah Wood} :: He plays the Frodo
|
||||
- @b{Sean Austin} :: He plays the Sam, Frodos friend. I still remember
|
||||
him very well from his role as Mikey Walsh a in the Goonies.
|
||||
@end group
|
||||
@end example
|
||||
|
||||
|
@ -1166,7 +1180,8 @@ Org supports these lists by tuning filling and wrapping commands to
|
|||
deal with them correctly@footnote{Org only changes the filling
|
||||
settings for Emacs. For XEmacs, you should use Kyle E. Jones'
|
||||
@file{filladapt.el}. To turn this on, put into @file{.emacs}:
|
||||
@code{(require 'filladapt)}}.
|
||||
@code{(require 'filladapt)}}, and by exporting them properly
|
||||
(@pxref{Exporting}).
|
||||
|
||||
The following commands act on items when the cursor is in the first line
|
||||
of an item (the line with the bullet or number).
|
||||
|
@ -1260,7 +1275,8 @@ Visibility cycling (@pxref{Visibility cycling}) on the headline will
|
|||
hide and show the entry, but keep the drawer collapsed to a single line.
|
||||
In order to look inside the drawer, you need to move the cursor to the
|
||||
drawer line and press @key{TAB} there. Org mode uses a drawer for
|
||||
storing properties (@pxref{Properties and Columns}).
|
||||
storing properties (@pxref{Properties and Columns}), and another one for
|
||||
storing clock times (@pxref{Clocking work time}).
|
||||
|
||||
@node Orgstruct mode, , Drawers, Document Structure
|
||||
@section The Orgstruct minor mode
|
||||
|
@ -9042,15 +9058,17 @@ single key navigation.
|
|||
@i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
|
||||
conflict with @file{allout.el}.
|
||||
@item
|
||||
@i{Jason Riedy} sent a patch to fix a bug with export of TODO keywords.
|
||||
@i{Jason Riedy} generalized the send-receive mechanism for orgtbl tables with
|
||||
extensive patches.
|
||||
@item
|
||||
@i{Philip Rooke} created the Org reference card and provided lots
|
||||
of feedback.
|
||||
@i{Philip Rooke} created the Org reference card, provided lots
|
||||
of feedback, developed and applied standards to the Org documentation and
|
||||
wrote the manual for the contributed packages.
|
||||
@item
|
||||
@i{Christian Schlauer} proposed angular brackets around links, among
|
||||
other things.
|
||||
@item
|
||||
Linking to VM/BBDB/Gnus was inspired by @i{Tom Shannon}'s
|
||||
Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
|
||||
@file{organizer-mode.el}.
|
||||
@item
|
||||
@i{Ilya Shlyakhter} proposed the Archive Sibling.
|
||||
|
@ -9075,14 +9093,12 @@ keyword.
|
|||
@i{David Wainberg} suggested archiving, and improvements to the linking
|
||||
system.
|
||||
@item
|
||||
@i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}. The
|
||||
development of Org was fully independent, and both systems are really
|
||||
different beasts in their basic ideas and implementation details. I later
|
||||
looked at John's code, however, and learned from his implementation of (i)
|
||||
links where the link itself is hidden and only a description is shown, and
|
||||
(ii) popping up a calendar to select a date. John has also contributed a
|
||||
number of great ideas and patches directly to Org, including the file
|
||||
@code{org-mac-message.el}'
|
||||
@i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
|
||||
@file{muse.el}, which have similar goals as Org. Initially the development
|
||||
of Org was fully independent because I was not aware of the existence of
|
||||
these packages. But with time I have accasionally looked at John's code and
|
||||
learned a lot from it. John has also contributed a number of great ideas and
|
||||
patches directly to Org, including the file @code{org-mac-message.el}'
|
||||
@item
|
||||
@i{Carsten Wimmer} suggested some changes and helped fix a bug in
|
||||
linking to Gnus.
|
||||
|
|
|
@ -468,6 +468,7 @@ Org-mode file."
|
|||
vertical-align: top;
|
||||
<!--border: 1pt solid #ADB9CC;-->
|
||||
}
|
||||
dt { font-weight: bold; }
|
||||
</style>"
|
||||
"The default style specification for exported HTML files.
|
||||
Since there are different ways of setting style information, this variable
|
||||
|
@ -2309,7 +2310,7 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
(inquote nil)
|
||||
(infixed nil)
|
||||
(in-local-list nil)
|
||||
(local-list-num nil)
|
||||
(local-list-type nil)
|
||||
(local-list-indent nil)
|
||||
(llt org-plain-list-ordered-item-terminator)
|
||||
(email (plist-get opt-plist :email))
|
||||
|
@ -2349,7 +2350,7 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
"[\r\n]"))
|
||||
table-open type
|
||||
table-buffer table-orig-buffer
|
||||
ind start-is-num starter didclose
|
||||
ind item-type starter didclose
|
||||
rpl path desc descp desc1 desc2 link
|
||||
snumber fnc
|
||||
)
|
||||
|
@ -2716,10 +2717,10 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(setq head-count (+ head-count 1)))
|
||||
(when in-local-list
|
||||
;; Close any local lists before inserting a new header line
|
||||
(while local-list-num
|
||||
(org-close-li)
|
||||
(insert (if (car local-list-num) "</ol>\n" "</ul>"))
|
||||
(pop local-list-num))
|
||||
(while local-list-type
|
||||
(org-close-li (car local-list-type))
|
||||
(insert (format "</%sl>\n" (car local-list-type)))
|
||||
(pop local-list-type))
|
||||
(setq local-list-indent nil
|
||||
in-local-list nil))
|
||||
(setq first-heading-pos (or first-heading-pos (point)))
|
||||
|
@ -2757,10 +2758,15 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(t (error "Invalid value of `org-plain-list-ordered-item-terminator'")))
|
||||
line)
|
||||
(setq ind (org-get-string-indentation line)
|
||||
start-is-num (match-beginning 4)
|
||||
item-type (if (match-beginning 4) "o" "u")
|
||||
starter (if (match-beginning 2)
|
||||
(substring (match-string 2 line) 0 -1))
|
||||
line (substring line (match-beginning 5)))
|
||||
line (substring line (match-beginning 5))
|
||||
item-tag)
|
||||
(if (string-match "\\(.*?\\) ::[ \t]*" line)
|
||||
(setq item-type "d"
|
||||
item-tag (match-string 1 line)
|
||||
line (substring line (match-end 0))))
|
||||
(unless (string-match "[^ \t]" line)
|
||||
;; empty line. Pretend indentation is large.
|
||||
(setq ind (if org-empty-line-terminates-plain-lists
|
||||
|
@ -2772,9 +2778,9 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(not starter))
|
||||
(< ind (car local-list-indent))))
|
||||
(setq didclose t)
|
||||
(org-close-li)
|
||||
(insert (if (car local-list-num) "</ol>\n" "</ul>"))
|
||||
(pop local-list-num) (pop local-list-indent)
|
||||
(org-close-li (car local-list-type))
|
||||
(insert (format "</%sl>\n" (car local-list-type)))
|
||||
(pop local-list-type) (pop local-list-indent)
|
||||
(setq in-local-list local-list-indent))
|
||||
(cond
|
||||
((and starter
|
||||
|
@ -2782,14 +2788,21 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(> ind (car local-list-indent))))
|
||||
;; Start new (level of) list
|
||||
(org-close-par-maybe)
|
||||
(insert (if start-is-num "<ol>\n<li>\n" "<ul>\n<li>\n"))
|
||||
(push start-is-num local-list-num)
|
||||
(insert (cond
|
||||
((equal item-type "u") "<ul>\n<li>\n")
|
||||
((equal item-type "o") "<ol>\n<li>\n")
|
||||
((equal item-type "d")
|
||||
(format "<dl>\n<dt>%s</dt><dd>\n" item-tag))))
|
||||
(push item-type local-list-type)
|
||||
(push ind local-list-indent)
|
||||
(setq in-local-list t))
|
||||
(starter
|
||||
;; continue current list
|
||||
(org-close-li)
|
||||
(insert "<li>\n"))
|
||||
(org-close-li (car local-list-type))
|
||||
(insert (cond
|
||||
((equal (car local-list-type) "d")
|
||||
(format "<dt>%s</dt><dd>\n" (or item-tag "???")))
|
||||
(t "<li>\n"))))
|
||||
(didclose
|
||||
;; we did close a list, normal text follows: need <p>
|
||||
(org-open-par)))
|
||||
|
@ -2827,10 +2840,10 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(when inquote (insert "</pre>\n"))
|
||||
(when in-local-list
|
||||
;; Close any local lists before inserting a new header line
|
||||
(while local-list-num
|
||||
(org-close-li)
|
||||
(insert (if (car local-list-num) "</ol>\n" "</ul>\n"))
|
||||
(pop local-list-num))
|
||||
(while local-list-type
|
||||
(org-close-li (car local-list-type))
|
||||
(insert (format "</%sl>\n" (car local-list-type)))
|
||||
(pop local-list-type))
|
||||
(setq local-list-indent nil
|
||||
in-local-list nil))
|
||||
(org-html-level-start 1 nil umax
|
||||
|
@ -3376,10 +3389,10 @@ stacked delimiters is N. Escaping delimiters is not possible."
|
|||
(when org-par-open
|
||||
(insert "</p>")
|
||||
(setq org-par-open nil)))
|
||||
(defun org-close-li ()
|
||||
(defun org-close-li (&optional type)
|
||||
"Close <li> if necessary."
|
||||
(org-close-par-maybe)
|
||||
(insert "</li>\n"))
|
||||
(insert (if (equal type "d") "</dd>\n" "</li>\n")))
|
||||
|
||||
(defvar body-only) ; dynamically scoped into this.
|
||||
(defun org-html-level-start (level title umax with-toc head-count)
|
||||
|
|
|
@ -3659,6 +3659,9 @@ between words."
|
|||
(if org-provide-checkbox-statistics
|
||||
'("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
|
||||
(0 (org-get-checkbox-statistics-face) t)))
|
||||
;; Description list items
|
||||
'("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(.*?\\) ::"
|
||||
2 'bold prepend)
|
||||
(list (concat "^\\*+ \\(.*:" org-archive-tag ":.*\\)")
|
||||
'(1 'org-archived prepend))
|
||||
;; Specials
|
||||
|
|
Loading…
Reference in New Issue