Commit graph

3876 commits

Author SHA1 Message Date
Eric Schulte 025921e94f Babel language files should not require org mode explicitly
* lisp/ob-C.el (org): no longer requires org
* lisp/ob-ledger.el (org): no longer requires org
2010-09-10 09:33:00 -06:00
David Maus ece2c578f0 Save match data before call to `read-char-exclusive'
* org.el (org-priority): Save match data before call to
`read-char-exclusive'.

Otherwise interactively calling `org-priority' with org-indent-mode
enabled fails to set a new priority cookie.

Bug reported by Joseph Buchignani.
2010-09-09 20:57:26 +02:00
Nicolas Goaziou 385c2666b1 More general regexp for descriptions items
* org-list.el (org-list-to-generic): Descriptions labels can be any
  suit of symbols, and will end at double colons.
2010-09-09 19:24:55 +02:00
Nicolas Goaziou 7c28d8d336 Fix indentation when using a [@start:num] or [@num] construct.
* org.el (org-indent-line-function): Indent past [@num] and
  [@start:num], consistently with what is already done with
  checkboxes.
2010-09-09 19:24:50 +02:00
Nicolas Goaziou 06c332cfee Fix notes indentation
* org.el (org-store-log-note): Indent new notes to the right column.
  Also take `org-list-two-spaces-after-bullet-regexp' into
  consideration when creating the note.
2010-09-09 19:24:46 +02:00
David Maus 9209139d1e Declare function to silence byte compiler
* org-gnus.el (nnimap-group-overview-filename): Declare function to
silence byte compiler.
2010-09-09 14:51:16 +02:00
David Maus 6d7b15cf9f Mitigate access to messages on slow IMAP servers.
* org-gnus.el (org-gnus-nnimap-query-article-no-from-file): New
customization variable.
(org-gnus-nnimap-cached-article-number): New function.
(org-gnus-follow-link): Try to fetch cached article number of
message-id.

Some IMAP servers (e.g. Courier) are slow when searching for a message
by its message id header field.  Because article numbers in IMAP
mailboxes are persistent UIDs, we can try to look up the UID of a IMAP
message in Gnus' cache for the mailbox in question and skip the slow
search on the server.

The problem with slow server was reported by Sébastien Vauban and the
patch is based on the work of Tassilo Horn.
2010-09-09 14:16:22 +02:00
Eric Schulte 24efe784d5 ob-org: no longer drop first line when exporting org code block
* lisp/ob-org.el (org-babel-org-default-header): used to insert a
  dummy first line into code blocks before export so that the first
  line is not interpreted as a title
  (org-babel-org-export): use new dummy code block prefix
2010-09-09 00:38:14 -06:00
Eric Schulte 8ca802166b Babel no longer throws error when inserting an empty result
Thanks to Sébastien Vauban for pointing this out

* lisp/ob.el (org-babel-insert-result): no longer throws error when
  inserting an empty result
2010-09-08 11:50:44 -06:00
Eric Schulte b238e6f2e7 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-08 11:34:19 -06:00
Eric Schulte 207390dfa8 autoload org-babel-tangle-lang-exts from ob-tangle
* lisp/ob-tangle.el: autoload org-babel-tangle-lang-exts from ob-tangle
2010-09-08 11:33:24 -06:00
Dan Davison 0e1ff9ddbc `org-babel-do-in-edit-buffer': more lightweight test of context
* ob.el (org-babel-do-in-edit-buffer): Use
	`org-babel-where-is-src-block-head' to test for source block
	at point.
2010-09-08 13:26:39 -04:00
Dan Davison ad1ab9d419 Merge branch 'master' of git://repo.or.cz/org-mode 2010-09-08 09:48:02 -04:00
Eric Schulte 7dd72699a9 a new function for jumping to the head of the current code block
* lisp/ob-keys.el (org-babel-key-bindings): adding key-binding for
  `org-babel-goto-src-block-head'
* lisp/ob.el (org-babel-goto-src-block-head): jump to the head of the
  current code block
2010-09-08 00:13:12 -06:00
Eric Schulte e92a4b0813 ob: better error messages when searches for code blocks fail
* lisp/ob.el (org-babel-next-src-block): now raising more informative
  error when no further code blocks can be found
  (org-babel-previous-src-block): now raising more informative error
  when no previous code blocks can be found
2010-09-07 23:59:04 -06:00
Eric Schulte 58fe371299 org-exp-blocks now expands blocks *after* including files
* lisp/org-exp-blocks.el (org-export-preprocess-after-include-files-hook):
  now using this hook instead of `org-export-preprocess-hook'
2010-09-07 23:50:27 -06:00
Eric Schulte 5bdea686ed ob-plantuml: raises an error when the :file header argument is not set
* lisp/ob-plantuml.el (org-babel-execute:plantuml):
2010-09-07 23:23:08 -06:00
Dan Davison 7127eb44c1 babel: python: refactor `org-babel-python-evaluate'
* ob-python.el (org-babel-python-evaluate): Refactor as call
	to either `org-babel-python-evaluate-external-process' or
	`org-babel-python-evaluate-session'.
	(org-babel-python-evaluate-external-process): New function to
	handle evaluation in external process.
	(org-babel-python-evaluate-session): New function to
	handle evaluation in emacs inferior process.
2010-09-07 21:58:58 -04:00
Eric Schulte dd9d42f515 ob-org: evaluates body to latex ascii or html respecting :results header arg
* lisp/ob-org.el (org-babel-execute:org): evaluates body to latex
  ascii or html respecting :results header arg
  (org-babel-org-export): exports a string of text to an output format
2010-09-07 18:51:38 -06:00
Eric Schulte 1ebb9131ef Babel: remove existing results when nil results are returned
Thanks to Sébastien Vauban for making the case for this behavior

* lisp/ob.el (org-babel-insert-result): remove existing results when
  nil results are returned
2010-09-07 16:59:57 -06:00
David Maus 510ada442e Bind and set link path for link type specific markup function
* org-ascii.el (org-export-as-ascii): Bind and set link path for link
type specific markup function.
2010-09-07 20:04:35 +02:00
David Maus 82b7d0bf07 Properly declare function to silence byte compiler
* org-clock.el (notifications-notify): Properly declare function to
silence byte compiler.
2010-09-07 20:03:30 +02:00
Nicolas Goaziou 0f44a66523 Don't insert item when tree is folded
* org-list.el (org-insert-item): check invisibility of point at a
  meaningful location.
2010-09-07 19:36:13 +02:00
Nicolas Goaziou 7e8aec9c09 Fix `org-list-insert-item-generic' when checkboxes are updated
* org-list.el (org-list-insert-item-generic): Updating checkboxes can
  modifiy bottom point of a list, so make it a marker before calling
  `org-update-checkbox-count-maybe'.
2010-09-07 19:36:05 +02:00
Dan Davison 569ba0eee8 Turn off code fontification by default; supply customize interface
* org.el (org-src-fontify-natively): Set to nil by default.
	Supply cutomize interface.
2010-09-07 12:42:15 -04:00
Bastien Guerry 413caacfd7 Require org-clock.el where needed.
Also declare org-notify instead of org-show-notification.

This was reported by Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl>
See http://article.gmane.org/gmane.emacs.orgmode/29900
2010-09-07 02:28:06 +02:00
Bastien Guerry 7c73bf1f74 Remove bzg-test function. 2010-09-06 22:20:46 +02:00
Bastien Guerry 86f4ef6d19 Fix bug in ASCII export: correctly set the `type' variable.
* org-ascii.el (org-export-as-ascii): Fix bug in ASCII export:
  use `org-bracket-link-analytic-regexp++' to match the link
  type.
2010-09-06 13:14:36 +02:00
aaa bbb d2e071cd97 Merge branch 'special-formatting-of-links-in-ascii' 2010-09-06 08:15:46 +02:00
Eric Schulte 07250ec74a tangle: rename lang' variable to language' so it is not overridden
- this is required due to recent changes to org-babel-map-src-blocks
- thanks to Dan for pointing this out

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): rename `lang'
  to `language'
2010-09-05 19:29:28 -06:00
Eric Schulte 9a72fe8718 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-05 15:17:57 -06:00
Eric Schulte ee801fd88c ob-tangle: customizable link formats in tangled comments
* lisp/ob-tangle.el (org-babel-tangle-comment-format-beg): format
  string specifying the link-comment preceding a code block
  (org-babel-tangle-comment-format-end): format string specifying the
  link-comment following a code block
  (org-babel-tangle-collect-blocks): storing more information in the
  spec of a tangling code block
  (org-babel-spec-to-string): now makes use of customizable
  link-comment formats
2010-09-05 15:15:11 -06:00
Bastien Guerry e13843ef65 Keep byte compiler happy. 2010-09-05 22:59:07 +02:00
Bastien Guerry 6a99e63dda Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-05 22:58:32 +02:00
David Maus bb30d4f1c9 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-05 22:45:11 +02:00
Achim Gratz bd8a0a6f39 inside table, delete-backward-char must not insert spaces when overwrite mode is on
* lisp/org.el (org-delete-backward-char): check for nil overwrite-mode before inserting
spaces.

TINYCHANGE

There's probably a different/better way to do this, but this seemed the least intrusive.
This patch is in the public domain.
2010-09-05 22:29:14 +02:00
Bastien 872d401fb3 Use C-c C-x _' for interactively calling org-timer-stop'
Unless I missed something, `org-timer-stop' has no keybinding yet.
I propose to use `C-c C-x _'.

Is that okay for everyone?
2010-09-05 22:28:17 +02:00
David Maus 108f2f2857 Exclude tags from the summary of ical entries
* org-icalendar.el (org-print-icalendar-entries): Exclude tags from
summary of non-TODO ical entries.
(org-print-icalendar-entries): Use
`org-complex-heading-regexp' to exclude tags from summary of
TODO ical entries.
2010-09-05 21:18:36 +02:00
David Maus dbe5c6031a Revert "org-icalendar.el: exclude tags from the summary of the ical entry."
This reverts commit 373224ecdb.
2010-09-05 21:13:03 +02:00
Bastien Guerry 4b01880430 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-05 21:10:06 +02:00
Bastien Guerry 3ec4750271 Third fix for the time-grid problem.
Hopefully the last one.  See commit 7b188f7d.
Reported by Memnon Anon <gegendosenfleisch@googlemail.com>.
2010-09-05 21:09:50 +02:00
Eric Schulte 1a34708ade Babel: org-babel-map-src-blocks now sets a variety of local variables
* lisp/ob.el (org-babel-map-src-blocks): now exposes much information
  about the code block in the form of let-bound local variables.
2010-09-05 13:04:58 -06:00
Bastien Guerry 373224ecdb org-icalendar.el: exclude tags from the summary of the ical entry.
This was reported by Guy Wiener <wiener.guy@gmail.com>.

http://article.gmane.org/gmane.emacs.orgmode/29819
2010-09-05 20:42:52 +02:00
aaa bbb e72fa4dcc5 Honor special link formatting of custom links for ASCII export 2010-09-05 19:48:44 +02:00
David Maus 3ece67cc13 org-list.el: Declare functions and variables to fix compiler warning
* org-list.el (org-outline-regexp, org-ts-regexp)
(org-ts-regexp-both, org-in-regexps-block-p)
(org-level-increment, org-at-heading-p)
(outline-previous-heading, org-icompleting-read)
(org-time-string-to-seconds): Declare to fix compiler warning.
2010-09-05 17:58:30 +02:00
Nicolas Goaziou 045e3aea28 Fix checkbox statistics
* org-list.el (org-toggle-checkbox): Ignore items in drawers when used
  from an heading. Send an error when no item is in region.

* org-list.el (org-update-checkbox-count): Correctly handle argument
  ALL. Speed optimization.
2010-09-05 17:46:01 +02:00
Bastien Guerry a581ee00a6 ob-R.el: Bugfix: explicitely set variables to `nil'. 2010-09-05 17:41:23 +02:00
Dan Davison 798a78fe06 Protect against errors when operating in temporary code edit buffer
* ob.el (org-babel-do-in-edit-buffer): Use unwind-protect to
	ensure that edit buffer is exited
2010-09-04 13:36:48 -04:00
Eric Schulte c881fa0760 ob-tangle: :comments header argument can now tangle surrounding text
This commit introduces a new set of :comments header arguments
- no :: retains its behavior of not tangling any comments
- yes :: retains its behavior of wrapping the code in links back to
         the original org-mode file
- link :: is synonymous with "yes"
- org :: does not wrap the code in links back to the original org
         file, but does include preceding text from the org-mode
         file as a comment before the code block
- both :: turns on both the "link" and "org" options

* lisp/ob-tangle.el (org-babel-tangle-pad-newline): can be used to
  control the amount of extra newlines inserted into tangled code
  (org-babel-tangle-collect-blocks): now conditionally collects
  information to be used for "org" style comments
  (org-babel-spec-to-string): now inserts "org" style comments, and
  obeys the newline configuration variable when inserting whitespace
* doc/org.texi (comments): documenting the new :comments header
  arguments
2010-09-04 08:45:45 -06:00
Eric Schulte 48114acd2a ob-tangle: adding pre-tangle hook for customization of tangle preparation
* lisp/ob-tangle.el (org-babel-pre-tangle-hook): defines new tangle
  hook
  (org-babel-tangle): calls new tangle hook
2010-09-03 07:55:59 -06:00
Eric Schulte 006ebbcd80 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-03 07:43:16 -06:00
Bastien Guerry 4f95c5469c `org-timer-set-timer': allow to run even before the first heading.
In this case, the notification will tell the user in what file the timer
was set.
2010-09-03 15:35:15 +02:00
Bastien Guerry 8f173ce843 Make `org-timer-cancel-timer' turn off the modeline countdown.
Also bind `org-timer-cancel-timer' to `C-c C-x :' in org-mode.
We may want to bind this command in org-agenda-mode as well but
I don't have any good idea of a keybinding now.
2010-09-03 15:26:47 +02:00
Bastien Guerry 00fadebf9c `org-get-refile-targets': trim multiple [%] and [/] cookies. 2010-09-03 15:08:47 +02:00
Bastien Guerry ba4bf2c96e `org-get-refile-targets': also trim [%] cookies from refile targets. 2010-09-03 10:43:09 +02:00
Carsten Dominik 8302e2b0d8 Fix read-only property removal bug
* lisp/org-capture.el (org-capture): Compute the length of the
correct string when removing properties.
2010-09-03 07:09:18 +02:00
Carsten Dominik 8d980d219e Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-03 07:06:57 +02:00
Bastien Guerry 538cf4e07c Fix docstring. 2010-09-03 02:43:22 +02:00
Eric Schulte b0dce5a074 ob-plantuml: now expanding file names before shell quoting
* lisp/ob-plantuml.el (org-babel-execute:plantuml): now expanding file
names before shell quoting
2010-09-02 17:58:08 -06:00
Bastien Guerry 0c67513e7d `org-get-refile-targets': don't include [/] cookies in targets.
This was requested by Marcel van der Boom <marcel@hsdev.com>.
2010-09-03 01:47:28 +02:00
Bastien Guerry fea907285c org-show-notification: use notifications.el when available.
notifications.el is a new package from Julien Danjou, available
in Emacs 24.1.  From etc/NEWS:

,----
| ** notifications.el provides an implementation of the Desktop
| Notifications API.  It requires D-Bus for communication.
`----
2010-09-02 23:51:22 +02:00
Bastien Guerry 58a49d1739 `org-timer-set-timer': display a countdown in the modeline for.
This was requested long time ago by Frederic Couchet and more recently
by Łukasz Stelmach.
2010-09-02 23:40:44 +02:00
Dan Davison eb666ed8e7 Merge branch 'master' of git://repo.or.cz/org-mode 2010-09-02 13:33:42 -07:00
Bastien Guerry f1d19d5e75 org-timer: Fix the docstring. 2010-09-02 22:32:32 +02:00
Dan Davison a008d84163 Merge branch 'master' of git://repo.or.cz/org-mode 2010-09-02 13:32:27 -07:00
Dan Davison 0d5791e7b7 Allow language-native TAB command in code blocks.
* org-src.el (org-src-tab-indents-natively): New variable controlling
    whether language-native TAB action should be performed
    (org-src-native-tab-command-maybe): New function to perform
    language-native TAB action.
    (org-tab-first-hook): Add `org-src-native-tab-command-maybe'
2010-09-02 11:57:03 -07:00
Eric Schulte ebad875b12 ob-plantuml: explicitly check `org-plantuml-jar-path' before use
* lisp/ob-plantuml.el (org-babel-execute:plantuml): explicitly check
  `org-plantuml-jar-path' before use
2010-09-02 12:47:54 -06:00
Bastien Guerry 7b188f7da5 Second fix for the time-grid problem. 2010-09-02 17:48:24 +02:00
Bastien Guerry f2acd5e8d1 Merge branch 't/patch251' 2010-09-02 17:33:19 +02:00
Bastien Guerry 330fb5409e Fix handling of absolute filenames' conversion to HTML links. 2010-09-02 17:33:00 +02:00
Dan Davison b340197b16 Merge branch 'master' of git://repo.or.cz/org-mode 2010-09-02 08:19:49 -07:00
Dan Davison abfc2cc30e Re-use hidden language major mode buffers during code fontification
* org-src.el (org-src-font-lock-fontify-block): Re-use hidden
	language major mode buffers during fontification
2010-09-02 08:13:13 -07:00
Dan Davison 73957b8fbf Fontify code in code blocks.
* org.el (org-fontify-meta-lines-and-blocks): Alter main
    regexp to match code blocks with switches and header
    args. Call `org-src-font-lock-fontify-block' for automatic
    fontification of code in code blocks, controlled by variable
    `org-src-fontify-natively'.
    (org-src-fontify-natively): New variable

    * org-src.el (org-src-font-lock-fontify-block): New function
    called during font-lock
    (org-src-fontify-block): New function for manual fontification
    of code block at point.
    (org-src-fontify-buffer): New function to manually fontify all
    code blocks in buffer
    (org-src-get-lang-mode): New utility function to map language
    name as a string to major mode symbol

Based on an initial fontification patch by David O'Toole and
suggestions from Carsten Dominik.
2010-09-02 08:12:58 -07:00
Eric Schulte 2d6238ae55 ob-ruby: only require inf-ruby when absolutely necessary
* lisp/ob-ruby.el (org-babel-expand-body:ruby): removed requirement of
  inf-ruby
2010-09-02 09:03:08 -06:00
Noorul Islam bd1b57f92a html-export mangels mailto: links
Achim Gratz <Stromeko@nexgo.de> writes:

> HTML export removes the "mailto:" from a link, which will then be
> interpreted as a local link by the browser.
>
> For an example, see the link to this mailing list in
> ORGWEBPAGE/index.org and the corresponding HTML export on orgmode-org
> (or just the local file).
>

org-html.el : Fix exporting file, mailto, news and ftp protocols.

* lisp/org-html.el (org-html-make-link): (expand-file-name
) removes one "/" from "///path-to-file", so add one. Anything other
than 'file' type should be exported along with the type.

TINYCHANGE

Thanks and Regards
Noorul
2010-09-02 16:56:27 +02:00
Sebastian Rose fc49c1ec96 org-protocol default template should be nil
Hi Carsten,

this little patch fixes an issue Richard brought up.

We always used the "w" template as the default for `org-remember' and
also used it for `org-capture' for historical reasons.

Unfortunately, this breaks, if the user has no "w" template defined.

The patch below simply set's the custom variable
`org-protocol-default-template-key' to nil, so the interactive template
selection is used by default.  This works for both, remember an capture.

I will adjust the docs, once the patch is applied.
Thanks,

  Sebastian
2010-09-02 16:41:53 +02:00
Carsten Dominik 452fe93d86 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-02 16:32:14 +02:00
Bastien Guerry 11e7a573a5 org-publish.el: allow :base-directory to omit the ending slash.
This was spotted by Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl>.
2010-09-02 16:01:51 +02:00
Bastien Guerry fbf89f0ecc org-agenda.el: Fixed a problem when computing time-grid.
Memnon Anon reported that this setting yields a bug:

,----
| (setq org-agenda-time-grid (quote
|       ((daily weekly today require-timed) "----------------"
|       ( 000 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2359))))
`----
2010-09-02 15:21:30 +02:00
Noorul Islam f5ff5dbe5a Fix compiler warning
org.el : Fix compiler warning.

* lisp/org.el (org-insert-subheading) : Fix compiler warning
  (org-insert-todo-subheading) : Fix compiler warning

TINYCHANGE

Thanks and Regards
Noorul
2010-09-02 12:21:44 +02:00
Carsten Dominik d8498a40e8 Fix read-only issue with capture
* lisp/org-capture.el (org-capture): Remove read-only text properties
from capture text.
(org-capture-set-target-location): Throw an error if file+headline
target does not point into a file which is in Org mode.

Richard Riley writes:

> If I select a region in, in this case, an erc (emacs irc client)
> buffer in the read only section and then use my global keys to create
> a new item using the following "j" template while the text is still
> selected
>
> ("j" "Journal" entry
>  (file+datetree "journal.org")
>  "* %T %?\n  %i\n  %a")
>
> then I get the following backtrace :-
>
> Debugger entered--Lisp error: (error "Capture abort: (text-read-only)")
>  signal(error ("Capture abort: (text-read-only)"))
>  error("Capture abort: %s" (text-read-only))
>  byte-code("\301\302!\203\n
2010-09-02 11:35:21 +02:00
Carsten Dominik 411c829489 Merge remote branch 'ngz/end-lists' 2010-09-02 10:11:18 +02:00
Eric Schulte 57bc4f672b Babel: tiny tweak
* lisp/ob.el (org-babel-map-src-blocks): prefer `when' to `if'
2010-09-01 23:26:47 -06:00
Dan Davison 49d63185cc babel: Docstring improvement
* org-src.el (org-edit-src-code): Improve docstring

Patch from Richard Riley
2010-09-01 21:16:15 -07:00
Dan Davison e0d9a280ea babel: docstring improvement
* ob.el (org-babel-execute-src-block): Document prefix
	argument in docstring.
2010-09-01 21:10:54 -07:00
Dan Davison 2654704a84 Merge branch 'master' of git://repo.or.cz/org-mode 2010-09-01 21:05:58 -07:00
Eric Schulte 02e6ee37d3 ob-ditaa: now expands tildas in org-ditaa-jar-path
Thanks to John Hendy for pointing out the bad behavior and to Juan
  Pechiar for pointing out the problem in the code

* lisp/ob-ditaa.el (org-babel-execute:ditaa): now expanding
  org-ditaa-jar-path with expand-file-name
2010-09-01 18:08:26 -06:00
Dan Davison d9ca67496f babel: Make `org-babel-execute-subtree' support prefix arg
* ob.el (org-babel-execute-subtree): Pass prefix arg through
	to `org-babel-execute-src-block'
2010-09-01 15:06:21 -07:00
Nicolas Goaziou 15928db323 Implement new list definition
* org-ascii.el (org-export-ascii-preprocess): allow [@start:x] and
  [@x] syntax for list numbering.

* org-capture.el (org-capture-place-item): make use of new tools.

* org-capture.el (org-capture-insert-template-here): mark use of new
  tools.

* org-docbook.el (org-export-as-docbook): remove list ending detection
  as they are now marked explicitely.

* org-exp.el (org-export-mark-list-ending): new function.

* org-exp.el (org-export-preprocess-string): mark list endings with
  `org-export-mark-list-ending'.

* org-html.el (org-export-as-html): remove list ending detection as
  they are now marked explicitely. Use value option in list items
  instead of start when special numbering is needed.

* org-latex.el (org-export-latex-lists): make use of new tools.
  Allow [start:x] and [@x] syntax for list numbering.

* org-list.el (org-list-two-spaces-after-bullet-regexp): docstring
  correction.

* org-list.el (org-list-beginning-re): variable removed.

* org-list.el (org-list-ending-method): new variable.

* org-list.el (org-empty-line-terminates-plain-lists): corrected
  docstring to match new lists.

* org-list.el (org-list-end-regexp): new variable.

* org-list.el (org-list-automatic-rules): new variable.

* org-list.el (org-provide-checkbox-statistics): variable removed.

* org-list.el (org-list-end-re): new function.

* org-list.el (org-item-re): allow regexp to properly recognize items
  with two spaces after bullet.

* org-list.el (org-item-beginning-re): pay attention to
  `org-plain-list-ordered-item-terminator' when defining an item.
  Replace `org-list-beginning-re'.

* org-list.el (org-list-ending-between): new function.

* org-list.el (org-list-maybe-skip-block): new function.

* org-list.el (org-list-search-unenclosed-generic): new function.

* org-list.el (org-search-backward-unenclosed): new function.

* org-list.el (org-search-forward-unenclosed): new function.

* org-list.el (org-list-in-item-p-with-indent): new function.

* org-list.el (org-list-in-item-p-with-regexp): new function.

* org-list.el (org-list-top-point-with-regexp): new function.

* org-list.el (org-list-bottom-point-with-regexp): new function.

* org-list.el (org-list-top-point-with-indent): new function.

* org-list.el (org-list-bottom-point-with-indent): new function.

* org-list.el (org-list-at-regexp-after-bullet-p): new function.

* org-list.el (org-list-get-item-same-level): new function.

* org-list.el (org-list-separating-blank-lines-number): new function.

* org-list.el (org-list-insert-item-generic): new function.

* org-list.el (org-list-indent-item-generic): new function.

* org-list.el (org-in-item-p): now depends on `org-list-ending-method'.

* org-list.el (org-list-first-item-p): now needs list top item as
  argument.

* org-list.el (org-at-item-timer-p): new function.

* org-list.el (org-at-item-description-p): new function.

* org-list.el (org-checkbox-blocked-p): make use of new tools.
  Ignore [@start:x] and [@x] constructs before any checkbox.

* org-list.el (org-list-top-point): new function.

* org-list.el (org-list-bottom-point): new function.

* org-list.el (org-get-item-beginning): new function.

* org-list.el (org-beginning-of-item): make use of new tools.

* org-list.el (org-get-beginning-of-list): new function.

* org-list.el (org-beginning-of-item-list): make use of new list
  tools.

* org-list.el (org-get-end-of-list): new function.

* org-list.el  (org-end-of-item-list): make use of new tools.

* org-list.el (org-get-end-of-item): new function.

* org-list.el (org-end-of-item): make use of new tools.

* org-list.el (org-end-of-item-text-before-children): function removed.

* org-list.el (org-end-of-item-or-at-child): new function.

* org-list.el (org-end-of-item-before-blank): new function.

* org-list.el (org-get-previous-item): new function.

* org-list.el (org-previous-item): make use of new tools.

* org-list.el (org-get-next-item): new function.

* org-list.el (org-next-item): make use of new tools.

* org-list.el (org-list-exchange-items): new function.

* org-list.el (org-move-item-down): preserve blank lines when moving
  items.

* org-list.el (org-move-item-up): preserve blank lines when moving
  items.

* org-list.el (org-cycle-list-bullet): Apply rules defined in
  `org-list-automatic-rules.

* org-list.el (org-insert-item): check `org-list-automatic-rules'
  before inserting a checkbox in an description list. Apply some
  heuristics to guess correct number of blank lines to insert between
  items.

* org-list.el (org-list-struct-assoc-at-point): new function.

* org-list.el (org-list-struct): new function.

* org-list.el (org-list-struct-origins): new function.

* org-list.el (org-list-struct-get-parent): new function.

* org-list.el (org-list-struct-get-child): new function.

* org-list.el (org-list-struct-fix-bul): new function.

* org-list.el (org-list-struct-fix-ind): new function.

* org-list.el (org-list-struct-fix-struct): new function.

* org-list.el (org-list-struct-outdent): new function.

* org-list.el (org-list-struct-indent): new function.

* org-list.el (org-list-struct-apply-struct): new function.

* org-list.el (org-shift-item-indentation): now needs bottom position
  of list as second argument.

* org-list.el (org-item-indent-positions): function removed.

* org-list.el (org-outdent-item): make use of new tools. Document
  region handling.

* org-list.el (org-indent-item): make use of new tools. Document
  region handling.

* org-list.el (org-outdent-item-tree): make use of new tools. Document
  region handling.

* org-list.el (org-indent-item-tree): make use of new tools. Document
  region handling.

* org-list.el (org-suppress-item-indentation): variable removed.

* org-list.el (org-cycle-item-indentation): only cycle to meaningful
  positions in the list.

* org-list.el (org-list-bullet-string): new function.

* org-list.el (org-get-bullet): remove dependence to
  `org-list-item-beginning'.

* org-list.el  (org-list-inc-bullet-maybe): new function.

* org-list.el (org-maybe-renumber-ordered-list): function removed.

* org-list.el (org-maybe-renumber-ordered-list): function removed.

* org-list.el (org-renumber-ordered-list): function removed.

* org-list.el (org-fix-bullet-type): function removed.

* org-list.el (org-list-repair): replace both
  `org-renumber-ordered-list' and `org-fix-bullet-type'.

* org-list.el (org-toggle-checkbox): make use of new tools.
  Handle [@start:x] and [@x] constructs. Check
  `org-list-automatic-rules' when inserting a checkbox in a
  description list.

* org-list.el (org-update-checkbox-count): make use of new tools.

* org-list.el (org-apply-on-list): new function.

* org-list.el (org-sort-list): new function.

* org-list.el (org-list-item-beginning): function removed.

* org-list.el (org-list-goto-true-beginning): function removed.

* org-list.el (org-list-end): function removed.

* org-list.el (org-list-parse-list): make use of new tools. Handle
  [@start:x] and [@x] constructs.

* org-list.el (org-list-send-list): make use of new tools.

* org-list.el (org-list-to-generic): correctly transform description
  items.

* org-timer.el (org-timer): added one optional argument to return the
  string instead of inserting it in the buffer.

* org-timer.el (org-timer-item): insert timer item at correct column.
  Return an error when inserting such item in a list of another type.

* org.el (org-set-font-lock-defaults): correctly fontify [@start:x]
  and [@x] structures.

* org.el (org-cycle-internal-local): correctly cycle visibility of
  items

* org.el (org-sort): now sort timer items.

* org.el (org-sort-entries-or-items): function removed.

* org.el (org-sort-entries-sort): New function. Replace
  `org-sort-entries-or-items'. List sorting code has been moved to
  `org-sort-list'.

* org.el (org-add-log-setup): removed extra &optional in arguments.

* org.el (org-store-log-note): make use of new tools. Indent correctly
  before inserting an item.

* org.el (org-ctrl-c-ctrl-c): make use of new tools. Unconditionally
  repair list when function is called.

* org.el (org-toggle-item): check
  `org-list-two-spaces-after-bullet-regexp' when toggling items.

* org.el (org-in-regexps-block-p): allow string and form returning
  string as END-RE argument.

* org.el (org-indent-line-function): documented code. Correctly indent
  item body and text after a list. Indentation of source code is left
  to `org-edit-src-exit'. Indentation of others blocks should be the
  same as the #+begin line.
2010-09-01 20:42:05 +02:00
Nicolas Goaziou 398c7bb528 Indent correctly body of source blocks
* org.el (org-indent-line-function): indentation of source block is
  left to `org-edit-src-exit' and shouldn't be modified by
  `org-indent-line-function'. Indentation of others blocks should be
  the same as the #+begin line.
2010-09-01 20:42:05 +02:00
Dan Davison 13891fce6e babel: Allow `org-babel-map-src-blocks' to operate on current buffer
* ob.el (org-babel-map-src-blocks): If FILE is nil evaluate
	BODY forms on source blocks in current buffer; restore point
	in current buffer.
2010-09-01 10:57:53 -07:00
Nicolas Goaziou 86b4d5e69d Keep byte-compiler happy 2010-09-01 19:05:56 +02:00
Nicolas Goaziou 8e5729c466 Speed optimizations and docstring modifications. 2010-09-01 19:05:56 +02:00
Nicolas Goaziou d05c77d6a5 Fix infinite loop when buffer was ending on a blank lines with whitespaces. 2010-09-01 19:05:56 +02:00
Nicolas Goaziou 421ba3a187 Correctly get bullet when point is not at bol. 2010-09-01 19:05:56 +02:00
Nicolas Goaziou bfce8dd357 Do not crash when trying to export an ill-formed list in HTML and DocBook. 2010-09-01 19:05:56 +02:00
Nicolas Goaziou 0932dac73d Fix `org-list-bottom-point' when point is after end of list. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou e2dc3cd985 Small modification to `org-list-ending-method' docstring. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 7a46718ec6 Optimize search of top and bottom points when ending method is `both' 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 595ce4e7f8 Minor fix. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 5de49d2032 Optimize list indentation.
* org-list.el (org-list-struct): accept list boundaries as an
  argument in order to avoid computing `org-list-top-point' and
  `org-list-bottom-point' twice when indenting.
2010-09-01 19:05:55 +02:00
Nicolas Goaziou 7e6778c16f When indenting a region, first check if there is any item to move. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 668e5832c2 Bug fix: `org-list-struct' would get the last item twice sometimes. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 5dee2ec351 Fix code typo. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 86228b817c Changed default value of `org-list-ending-method'
* org-list.el (org-list-ending-method): default value is now `both',
  to ensure maximum compatibility before previous implementation.
2010-09-01 19:05:55 +02:00
Nicolas Goaziou ebf5e1236b Fix bug when buffer is starting with a list.
* org-list.el (org-list-in-item-p-with-indent): Test if first line is
  the item beginning.
* org-list.el (org-list-top-point-with-indent): Test if first line is
  a valid list beginning.
2010-09-01 19:05:55 +02:00
Nicolas Goaziou df33ccb956 Do not drag outside items when moving whole list multiple times. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou 7b8352f94b Renamed org-indent-item-tree' to org-list-indent-item-generic'. 2010-09-01 19:05:55 +02:00
Nicolas Goaziou bac9497d7a Handle drawers correctly. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 50f2c13ddc Modified docstrings according to `checkdoc-current-buffer'. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou c675061eb2 Speed optimization of indent method 2010-09-01 19:05:54 +02:00
Nicolas Goaziou c96c14a9d5 Fix bug in org-list-bottom-point' and org-list-top-point'. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 221ff58e19 Small optimization. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 113818cdf0 Bug fix: infinite loop while looking for top point with indent method 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 6b2468477e [@num] is valid to enforce a numbering (same as [@start:num]) 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 56542f799c Removed renumber rule. Documentation fixes. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 347f39445a Added some documentation to code. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou b5eb7047f3 Now both indentation and regexps can end lists
* org-list.el (org-list-ending-method): New customizable variable to
  tell Org Mode how lists end. See docstring.
2010-09-01 19:05:54 +02:00
Nicolas Goaziou 2cca510276 Fix structure for malformed lists. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou 8b66f26920 Modified indentation of long lines of code. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou d2b3923b6a Keep byte-compiler happy. 2010-09-01 19:05:54 +02:00
Nicolas Goaziou dae1ec63a9 org-fix-bullet-type is now org-list-repair. Created aliases for compatibility. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou dea5050dbc Ensure shifting top-level item can catch column 0
* org-list.el (org-indent-item-tree): shifting step of top-level item
  depends on `org-level-increment'.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 05aeeae9ed First line after a list should not be indented according to list
* org.el (org-indent-line-function): Indent first non blank line after
  a list according to current heading level.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 7ef456426e Fix DocBook and HTML sensitivity about item's body indentation
* org-docbook.el (org-export-as-docbook): Removed check for
  indentation on lines that do not start with a list bullet.
* org-html.el (org-export-as-html): Same thing.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 1230cf9f09 Fix bug when inserting an item after bottom point of list
* org-list.el (org-list-bottom-point): Take into consideration that
  bound of search can be before true ending of the list.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 8385393fe6 Optimize writing of structure to buffer.
* org-list.el (org-list-struct-apply-struct): No longer shift item's
  body twice: one after replacing bullet and one after changing
  indentation.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 8c89086e73 Refactoring of search functions. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou bed92c6863 Refactoring 2010-09-01 19:05:53 +02:00
Nicolas Goaziou 443afde30c Handle `org-list-demote-modify-bullet'
* org-list.el (org-list-struct-indent): Added code to replace bullets
  if needed when indenting.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou 0c1b40bd6c Removed unused functions. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou 97c60a1a86 More rules to determine blank lines when inserting item
* org-list.el (org-list-insert-item-generic): A single item already
  counting blank lines in his body should be separated with the next
  one by a blank line. Moreover, if user already provided blank lines,
  follow his wishes.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou d726f924dd Fix bug when moving a *-list at column 0. Docstrings modifications.
* org-list.el (org-indent-item-tree): when moving top item of a *-list
  to column 0, only the first item had its bullet changed to -. It now
  changes all items of the top-level list, as expected.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou a2a72f38fa Toggle checkbox even if not at beginning of line.
* org-list.el (org-toggle-checkbox): go to beginning of line before processing.
2010-09-01 19:05:53 +02:00
Nicolas Goaziou e890cb5eeb Small changes to fontification. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou e8967901fa Little bug fix.
* org-list.el (org-list-struct-apply-struct): check if ancestor exists.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou fd16515b4a Removed last call to org-provide-checkbox-statistics. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 5d196be958 Small refactoring. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 9eab167626 Indentation is faster and now correct. Indenting region is back. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 030fc40b1d Minor refactoring. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 12acf70f92 Little fix to ASCII exporter with regards to [@start:num] structures. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 0dab6a2e1b Do not enforce white spaces just after [@start:num]. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou 5a3113592a Allow multiple [@start:num] in a list.
* org-list.el (org-renumber-ordered-list): check for [@start:x] is
  done at each item.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou c5f4081221 Fix reordering bug when when cycling indentation above 10th item.
* org-list.el : Removed unused variable
  `org-suppress-item-indentation'.
* org-list.el (org-renumber-ordered-list): Skip item if bullet number
  is already good.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou 5903c08447 Moving top list item will move whole list only if moving by subtree.
* org-list.el (org-list-automatic-rules): doc-string reflects this
  change.
* org-list.el (org-indent-item-tree): prevent whole list from being
  moved when user is not moving subtree. Thus,
  `org-cycle-item-indentation' will not allow to move the list.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou ee568516e8 Bug fix when indenting items.
* org-list.el (org-indent-item-tree): Removed region code. It was prone
  to errors and undocumented.
* org-list.el (org-item-indent-positions): Better heuristics to
  determine what bullet the item will have when demoted.
2010-09-01 19:05:52 +02:00
Nicolas Goaziou d9c4c52533 Documentation fix. 2010-09-01 19:05:52 +02:00
Nicolas Goaziou a665ecb666 Fix bug when `org-list-two-spaces-after-bullet-regexp' would be nil.
* org-list.el (org-list-bullet-string): first check if
  `org-list-two-spaces-after-bullet-regexp' isn't nil.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 7eb193de1d Minor refactoring. 2010-09-01 19:05:51 +02:00
Nicolas Goaziou 80b269d947 `org-toggle-item' working as expected.
* org-list.el (org-list-bullet-string): do not modify match-data.
* org.el (org-toggle-item): now working again when changing list items
  into plain text. Moreover take into consideration
  `org-list-two-spaces-after-bullet-regexp'.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 884489c3fb When indenting an item, bullet should be more predictable.
* org-list.el (org-indent-item-tree): removed unnecessary bullets fix,
  and improved heuristics to determine bullet when indenting.
* org-list.el (org-item-indent-positions): function now returns sane
  results when there are two lists separated with blank lines only.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou cb23060a46 HTML and DocBook exporters handle multiple uses of [@start:?].
* org-docbook.el (org-export-as-docbook): Use override="num" in any
  listitem matching [@start:num]
* org-html.el (org-export-as-html): Use value="num" in any li matching
  [@start:num]
2010-09-01 19:05:51 +02:00
Nicolas Goaziou a73ce76fe3 Checkbox rule forbids inserting checkboxes in description item 2010-09-01 19:05:51 +02:00
Nicolas Goaziou 4d40259e56 Better handling of checkboxes with regards to [@start:x] constructs
* org.el (org-set-font-lock-defaults): Correct fontification for
  checkboxes found after [@start:?].
* org-list.el (org-list-at-regexp-after-bullet-p): skip any [@start:?]
  when looking at a regex after a bullet.
* org-list.el (org-toggle-checkbox): correct insertion of checkboxes
  when there is already a [@start:?] in the item.
* org-list.el (org-checkbox-blocked-p): properly check if there's an
  unchecked item before.
* org-list.el (org-list-parse-list): function handles items having
  both a counter and a checkbox.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou c444086ade Documentation fixes. 2010-09-01 19:05:51 +02:00
Nicolas Goaziou 4a4c4f2cf1 Ensure new indentation cycles always start with same bullet
* org-list.el (org-cycle-item-indentation): org-tab-ind-state stores
  both indentation and bullet when cycle started.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 3f762cf76d Refactoring
* org-list.el: `org-at-description-p' renamed to
  `org-at-item-description-p', `org-first-list-item-p' renamed to
  `org-list-first-item-p', `org-end-of-item-text-before-children'
  renamed to `org-end-of-item-or-at-child'.
2010-09-01 19:05:51 +02:00
Nicolas Goaziou 6593fcc7cd Unconditionally fix list when using C-c C-c.
* org.el (org-ctrl-c-ctrl-c): call `org-fix-bullet-type' instead of
  `org-maybe-renumber-ordered-list' and `org-fix-bullet-type' before
  toggling a checkbox.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 66bf386e25 Correctly handle bullets with two spaces.
* org-list.el (org-list-bullet-string): New function returning bullet
  concatenated with an appropriate number of white spaces.
* org-list.el (org-list-insert-item-generic): Insert the right bullet,
  with help of `org-list-bullet-string'.
* org-list.el (org-indent-item-tree): Use `org-list-bullet-string'.
* org-list.el (org-fix-bullet-type): Use `org-list-bullet-string'.
* org-list.el (org-toggle-checkbox): send an error when
  `org-toggle-checkbox' is trying to insert a checkbox at a
  description item.
* org-list.el (org-item-re): modified regexp so it can catch correct
  number of white space before item body.
* org-list.el (org-list-at-regexp-after-bullet-p): Take into
  consideration new `org-item-re'.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou cbc337f285 Bug fix. First bullet of *-list would not become "-" when hitting column 0. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou 3a91400baa Modified default number of blank lines when inserting an item.
* org-list.el (org-list-insert-item-generic): the second item in a
  list will be separated from its predecessor with the number of blank
  lines separating the first item from its parent, if any, or no blank
  line.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou a905db7db7 Smarter fix and reordering of list when indenting items.
* org-list.el (org-indent-item-tree): Fix and reorder every list and
  sublist, from parent of list that has moved if indenting, or from
  list at point if outdenting.

* org-list.el (org-list-replace-bullet): New internal function.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou d99f7fcf05 Try to keep relative column in line when indenting item.
* org-list.el (org-indent-item-tree): Try to keep relative position on
  line. It can't if point is in white spaces before bullet because
  mixed tabs and spaces make some columns unattainable.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou eabb018913 `org-cycle-item-indentation' works only on empty items.
* org-list.el (org-cycle-item-indentation): Cycle when the whole item
  only contains bullet and maybe a checkbox. Previously, TAB would
  cycle when the first line of the item was blank.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 7c424b33ea Cycle indentation for newly created description items or checkboxes.
* org-list.el (org-cycle-item-indentation): Allow a point just after a
  description item or a checkboxed item to start cycling.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 25de94f3cc Take `org-plain-list-ordered-item-terminator' into consideration when cycling bullets.
* org-list.el (org-cycle-list-bullet): Check
  `org-plain-list-ordered-item-terminator' before allowing 1. or 1) as
  valid bullets when cycling.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 1bfe98bdf6 Minor refactoring. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou 91488c75d5 Added variable `org-list-automatic-rules'. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou ca106beabb New function `org-item-has-children-p'. 2010-09-01 19:05:50 +02:00
Nicolas Goaziou c4d0151b28 Return value of `org-cycle-item-indentation' was broken.
* org-list.el (org-cycle-item-indentation): Do return t if and only if
  cycling is possible and succeded.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou a13ee91cbe Rules preserving integrity of a list now apply when moving subtree.
* org-list.el (org-indent-item-tree): when outdenting a subtree, the
  last item shouldn't have a children.
2010-09-01 19:05:50 +02:00
Nicolas Goaziou 330c27e4ec Fix cycling problems.
* org-list.el (org-cycle-item-indentation): cycling should play nicely
  with indent rule in `org-list-automatic-rules'.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 0a14598575 Added a rule for indentation and improved reordering.
* org-list.el (org-indent-item-tree): If indent rule is activated, it
  should be impossible to outdent an item having children without
  moving its subtree. Improved reordering of lists modified by cycling
  indentation.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 19372845f9 Melt org-maybe-renumber-ordered-list-safe' into org-maybe-renumber-ordered-list'. 2010-09-01 19:05:49 +02:00
Nicolas Goaziou aed0cb3b9e org-maybe-renumber-ordered-list' do not call org-fix-bullet-type'.
* org-list.el (org-maybe-renumber-ordered-list): Removed call for
  `org-fix-bullet-type' to prevent infinite loop, and some checks
  already done in `org-renumber-ordered-list'.
* org-list.el (org-fix-bullet-type): Remove a check and call directly
  `org-maybe-renumber-ordered-list'
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 4c9eb76846 Do not indent the first item in a sublist.
* org-list.el (org-indent-item-tree): It shouldn't be possible to
  indent the first item of a sublist (though outdent is possible) as
  it would break list's structure.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 2c3157e34e Better guessing of blank lines when inserting an item.
* org-list.el (org-list-insert-item-generic): When local search
  doesn't help, search the list globally for blank lines. Moreover,
  don't bother with new lists, and add 1 blank line.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou ff6c147ac6 Defined `org-item-beginning-re'. Org capture should recognize new lists.
* org-capture.el (org-capture-place-item): use `org-search-forward-unenclosed'
  and `org-search-backward-unenclosed' and new variable `org-item-beginning-re'.
* org-list.el (org-item-beginning-re): regexp matching beginning of an item.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 3d3e307c31 Fix list folding. Refactoring. 2010-09-01 19:05:49 +02:00
Nicolas Goaziou 5b9857da7c Minor fix. 2010-09-01 19:05:49 +02:00
Nicolas Goaziou 0bac5c248b Forgot to handle 'previous argument in `org-cycle-list-bullet'.
* org-list.el (org-cycle-list-bullet): Put back support for 'previous argument.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 3a084384f4 Refactoring. 2010-09-01 19:05:49 +02:00
Nicolas Goaziou eebd8eb022 Fixed bug in `org-in-item-p' with point at an heading just beyond list.
* org-list.el (org-in-item-p): Handle case when point is at an
  heading.
* org-list.el (org-list-make-subtree): Add protection when used
  outside of list
* org-list.el (org-insert-item): Removed useless hack now
  `org-in-item-p' is fixed.
* org-timer.el (org-timer-item): Removed useless hack now
  `org-in-item-p' is fixed.
2010-09-01 19:05:49 +02:00
Nicolas Goaziou 42f82d1bad Descriptions items shouldn't be numbered.
* org-list.el (org-cycle-list-bullet): prevent description items from
  being numbered. String argument is also recognized now, as long as
  it is a valid bullet.
2010-09-01 19:05:48 +02:00
Nicolas Goaziou 8241e9b652 Refactoring. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou a42f8066d4 Can't insert new item after `org-list-bottom-point' anymore. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou fb7183c619 Forgot a save-excursion' in org-apply-on-list'. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou 9e3b3d023d List follows indentation of its top item.
* org-list.el (org-indent-item-tree): moving indentation of top list
  item will make the whole list move.
* org-list.el (org-apply-on-list): function is less sensitive to
  changes of indentation.

Before this patch, cycling indentation of top list item would just
break list. Now, it does something useful.
2010-09-01 19:05:48 +02:00
Nicolas Goaziou d22d58acf1 Allow cycling indentation at creation of description and checkboxed items.
* org-list.el (org-at-item-checkbox-p): add whitespaces at the end of
  the regexp.
* org-list.el (org-checkbox-blocked-p): use new checkbox regexp.
* org-list.el (org-cycle-item-indentation): allow cycling description
  items and checkbox items.
* org-list.el (org-toggle-checkbox): use new checkbox regexp.
* org-list.el (org-reset-checkbox-state-subtree): use new checkbox regexp.
2010-09-01 19:05:48 +02:00
Nicolas Goaziou 85868125c2 Fix cycling indentation. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou 8597bb25ee Description item regexp was too strict. 2010-09-01 19:05:48 +02:00
Nicolas Goaziou 97f857c9b7 Minor refactoring. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou abb490c572 Internal functions stay with org-list- prefix. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou d830b4b3ee Refactoring 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 8a215f56eb No checkboxes for description items. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 2b5b8cf8a2 Refactoring. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou c3bbbc0926 Blank lines number is guessed locally when inserting item.
* org-list.el (org-insert-item-internal): guessing of blank lines
  number is made by looking at neighbours items, if any.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 905ad49e9a Fixed some corner-case when inserting item. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 3dfc889cce Refactoring. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 0229bcc054 Sort also timer lists.
* org-list.el (org-sort-list): add the possibility to sort timer lists
  with the ?t or ?T options.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 802a3d1b3f Refactoring.
* org-list.el (org-search-unenclosed-internal): new function to handle
  both `org-search-forward-unenclosed' and
  `org-search-backward-unenclosed'.
* org-list.el (org-search-backward-unenclosed): Can send errors now.
  Removed useless usage of COUNT.
* org-list.el (org-search-forward-unenclosed): Can send errors now.
  Removed useless usage of COUNT.
* org-list.el (org-update-checkbox-count): Use
  `org-search-forward-unenclosed' and `org-search-backward-unenclosed'
  instead of `re-search-forward' and `re-search-backward'.
* org-list.el (org-sort-list): Use
  `org-search-forward-unenclosed' and `org-search-backward-unenclosed'
  instead of `re-search-forward' and `re-search-backward'.
* org-list.el (org-list-make-subtree): Use
  `org-search-forward-unenclosed' and `org-search-backward-unenclosed'
  instead of `re-search-forward' and `re-search-backward'.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 7cf8ab06de Fix inserting item with point before first char of item's body.
* lisp/org-list.el (org-insert-item-internal): fixes the problem when
  point was before the first char of the item's body.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou deb6b0c504 Some comments changes. 2010-09-01 19:05:47 +02:00
Nicolas Goaziou 53c4b53e8f Less latency in org-timer-item.
* org-timer.el (org-timer-item): Refactoring. Compute timer string
  before inserting it in the buffer
* org-timer.el (org-timer): added an optional argument to return timer
  string instead of inserting it.
2010-09-01 19:05:47 +02:00
Nicolas Goaziou 8eece59f9e Refactoring and increased protection on item insertion.
* org-list.el (org-insert-item-internal): New function to handle
  positionning and contents of an item being inserted at a specific
  pos. It is not possible anymore to split a term in a description
  list or a checkbox when inserting a new item.
* org-list.el (org-insert-item): Refactored by using the new
  `org-insert-item-internal' function.
* org-timer.el (org-timer-item): Refactored by using the new
  `org-insert-item-internal' function.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 472579fb96 Minor refactoring. 2010-09-01 19:05:46 +02:00
Nicolas Goaziou 1f41236014 Cycle lists properly.
* org-list.el (org-list-bottom-point): Be sure to check real
  ORG-OUTLINE-REGEXP and not outline-regexp, that might be modified.
* org.el (org-cycle-internal-local): cycle up to end of subtree or end
  of item if we are in a list.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 2dd3b8a2a8 Better support for timer lists. Trying to insert a new item with point
in a special block now move before block.

* org-list.el (org-insert-item): Move before any special block in a
  list prior to add a new item.
* org-timer.el (org-timer-item): When in a timer list, insert a new
  timer item like `org-insert-item'. If in another list, send an
  error. Otherwise, start a new timer list.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 2e4e05b3d6 Minor refactoring.
* lisp/org-list.el: Minor refactoring.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 2b8aa4c406 Position items with relative timer at the right place.
* org-timer.el (org-timer-item): Insert description list item at the
  right column.
* org-list.el (org-insert-item): Insert the right number of blank
  lines before a relative timer.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 292b52f596 Insert item even in LaTeX environments.
* org-list.el (org-insert-item): Remove restriction on latex blocks.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 47cd0c193d Make parsing of lists more powerful during export.
* org-list.el (org-search-backward-unenclosed): Do not stop in
  protected places.
* org-list.el (org-search-forward-unenclosed): Do not stop in
  protected places.
* org-latex.el (org-export-latex-lists): Use the fact that
  org-search-forward do not stop anymore at protected places.
2010-09-01 19:05:46 +02:00
Nicolas Goaziou 168a8b6007 Do not prevent list items from being inside LaTeX blocks.
* org-list.el (org-search-backward-unenclosed): Do not prevent list
  items from being inside LaTeX blocks.
* org-list.el (org-search-forward-unenclosed): Do not prevent list
  items from being inside LaTeX blocks.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 968fa927c4 Fix for org-list-send-list.
* org-list.el (org-in-item-p): Do not widen before checking if we are
  in item.
* org-list.el (org-list-send-list): We cannot count on
  `org-list-top-point' and `org-list-bottom-point' before buffer is
  narrowed. Find bounds of list otherwise.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou b2433f9eb6 Changed default for end-list regexp.
* lisp/org-list.el (org-list-end-regexp): By default, list ending is
  exactly 2 blank lines.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 197ed8b273 Remove useless checks for `org-empty-line-terminates-plain-lists'.
* org-docbook.el (org-export-as-docbook): When we find an empty line,
  we do not need to check for `org-empty-line-terminates-plain-lists'
  because we would have found end-list marker before.
* org-html.el (org-export-as-html): Same.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 0c4770e661 Refactoring.
* org-list.el (org-insert-item): Simplify count of blank lines to insert.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 37733b77a4 List ending is now customizable.
* org-list.el (org-list-end-regexp): New customizable variable to
  define what string should end lists.
* org-list.el (org-list-end-re): Function is now aware of
  `org-list-end-regexp'.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 27cfeefc3b Code cleanup.
* org-html.el (org-export-as-html): Code cleanup.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 07eb3308c1 Docbook exporter now handles new list definition.
* org-docbook.el (org-export-as-docbook): Properly close any open list
  when seeing ORG-LIST-END. Removed any reference to now unneeded
  DIDCLOSE variable.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou a63ecfa89b Better handling of non-blank-lines types of list enders.
* org-exp.el (org-export-mark-list-ending): fix number of blank lines
  inserted after a list.
* org-list.el (org-list-parse-list): fix case when `org-list-end-re'
  would have an indentation greater than current list.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou fe42a5e83e Export supports any list ender. Export to ascii has been fixed.
* org-exp.el (org-export-mark-list-ending): Differentiate between
  export backends, and replace `org-list-end-re' by a blank line upon
  exporting.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 4c2bc51c52 Remove the no longer needed didclose variable.
* org-html.el (org-export-as-html): Delete didclose and everything
  related to it, as it is no longer needed.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou 99306969b0 Both latex and html should now export correctly.
* org-html.el (org-export-html-preprocess): Remove unneeded insertion
  of list end marker, as it is now handled by
  `org-export-mark-list-ending'.
* org-html.el (org-export-as-html): Cleaner termination of lists.
* org-exp.el (org-export-mark-list-ending): New function to insert
  specific markers at the end of lists when exporting to a backend not
  using `org-list-parse-list'.
  This function is called early in `org-export-preprocess-string',
  while it is still able to recognize lists.
* org-latex.el (org-export-latex-lists): Better search for lists. It
  now only finds items not enclosed and not protected.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou f677013276 Use org-search-forward-unenclosed' instead of re-search-forward'.
* lisp/org-list.el: Replaced `re-search-forward' by
  `org-search-forward-unenclosed' where it made sense.
2010-09-01 19:05:45 +02:00
Nicolas Goaziou ecd5a4b0f1 Make `org-apply-to-list' more functional.
* lisp/org-list.el (org-apply-to-list): Now a return value is handed
  at each new call of the function applied.
* lisp/org-list.el (org-fix-bullet-type): Use the new
  `org-apply-to-list' format.
* lisp/org-list.el (org-renumber-ordered-list): Use the new
  `org-apply-to-list' format.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou fb5cab814e Better regexps in searches unenclosed.
* lisp/org.el (org-in-regexps-block-p): minor fix: limit wasn't
  correctly used.
* lisp/org-list.el (org-search-forward-unenclosed): Better regexp
  used.
* lisp/org-list.el (org-search-backward-unenclosed): Better regexp
  used.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 2dec9eb473 Fix regression in `org-sort-list'.
* lisp/org-list.el (org-sort-list): end-rec function was ill-defined.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou f7f07198dd Fix for org-search-forward-unenclosed' and org-search-backward-unenclosed'.
* lisp/org-list.el (org-search-forward-unenclosed): fix behavior when
  last occurence was enclosed.
* lisp/org-list.el (org-search-backward-unenclosed): fix behavior when
  last occurence was enclosed.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 30fb7a570a Fix documentation.
* lisp/org.el (org-in-regexps-block-p): Fix documentation.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou a0ad769d0b Fixed blocks regexp.
* lisp/org-list.el (org-search-backward-unenclosed): fix block regexp.
* lisp/org-list.el (org-search-forward-unenclosed): fix block regexp.
* lisp/org-list.el (org-list-parse-list): minor fix.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 82f0bd75e7 Delete org-list-end-re' when org-list-parse-list' is used for
export.

* org-list.el (org-list-parse-list): Delete `org-list-end-re' when
  called with t argument.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou e3813fcfcb List ending is replaced by a blank line during html export.
* org-html.el (org-export-html-preprocess): Replace `org-list-end-re'
  by a blank line during pre-process.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou a0a86fbba0 Minor fix.
* lisp/org-list.el (org-list-bottom-point): No need for square
  brackets for `skip-chars-backward'.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 4c0bf39469 Do not delete space between end of list and beginning of the following
* lisp/org-html.el: Do not delete space between end of list and
  beginning of the following.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 1d99d9ee73 Do not try to guess list ending and let org-list.el do its job.
* lisp/org-html.el: preprocess buffer string and add ORG-LIST-END
  where needed. Lists should not end before seeing this.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 6167dfa444 Notice end of lists.
* lisp/org-html.el: Notice end of lists.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 9996da73a3 Fix radio lists and radio templates.
* lisp/org-list.el (org-list-parse-list): Better handling of
  restrictions when function is called on a list with sublists.
* lisp/org-list.el (org-list-send-list): find the true ending of the
  list being sent.
* lisp/org-list.el (org-list-radio-list-templates): templates are more
  specific to lists.
2010-09-01 19:05:44 +02:00
Nicolas Goaziou 5fda851968 Initial commit. 2010-09-01 19:05:44 +02:00
Eric Schulte c7ed188859 ob-js: now supports session based evaluation through mozrepl
* lisp/ob-js.el (org-babel-js-eoe): indicate end of input
  (org-babel-execute:js): support for session evaluation
  (org-babel-prep-session:js): fleshed out definition
  (org-babel-js-initiate-session): can initiate a session using
  mozrepl
2010-09-01 08:48:21 -06:00
David Maus 3d6c1090cb Protect escape char in `org-complex-heading-regexp-format'
* org.el (org-set-regexps-and-options): Protect escape char in
`org-complex-heading-regexp-format'.
2010-08-31 22:58:08 +02:00
Carsten Dominik 0a46f202ca Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-08-31 10:03:02 +02:00
Eric Schulte fc69523827 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-08-31 01:48:46 -06:00
Carsten Dominik fa18c1c232 Fix read-date problem that could result in August 34th
Paul Sexton writes:

> Today (31 August),
> if I evaluate "(org-read-date t)", then at the prompt type
> "+3"
> The string returned is:
> "2010-08-34"
2010-08-31 09:22:26 +02:00
Eric Schulte ab95959057 ob-scheme: now supports session-based evaluation
* lisp/ob-scheme.el (org-babel-scheme-eoe): for marking the end of
  session-based evaluation
  (org-babel-execute:scheme): now supports session-based evaluation
  (org-babel-prep-session:scheme): now works and defines variables
  (org-babel-scheme-initiate-session): now works using run-scheme from
  cmuscheme
2010-08-31 01:14:02 -06:00
Dan Davison 381f913af3 Merge branch 'master' of git://repo.or.cz/org-mode 2010-08-31 00:11:41 -07:00
Carsten Dominik dabfd646ae LaTeX export: remove the t1enc package
* lisp/org.el (org-export-latex-default-packages-alist): Remove the
t1enc package - this is already covered by fontenc.
2010-08-31 08:31:14 +02:00
Manish Sharma 2cf6136523 Allow "#" and "%" in tags
Patch largely from Manish, missing points added by Carsten
2010-08-31 08:25:20 +02:00
Dan Davison 8cb53ddc1a babel: Eliminate compiler warnings
* ob.el (with-parsed-tramp-file-name): declared
	(org-babel-tramp-localname): Ensure variable name exists
	locally

	* ob-R.el (ess-eval-buffer): declared

	* ob-comint.el (with-parsed-tramp-file-name): declared
	(tramp-flush-directory-property): declared
	(org-babel-comint-eval-invisibly-and-wait-for-file): Ensure
	variable name exists locally
2010-08-30 18:20:01 -07:00
Dan Davison 9c878a8290 babel: Fix temporary file processing in the remote execution case.
* ob.el (org-babel-temp-file): Don't use babel temporary
	directory in remote case; use make-temp-file with remote file
	name so that temp file is guaranteed not to exist previously
	on remote machine.
	(org-babel-tramp-localname): New function to return local name
	portion of possibly remote file specification

	* ob-R.el (org-babel-R-evaluate-external-process): Respond to
	changes in `org-babel-temp-file'; pass local file name to
	remote R process.
	(org-babel-R-evaluate-session) Respond to
	changes in `org-babel-temp-file'; pass local file name to
	remote R process.
2010-08-30 09:35:48 -07:00