Commit graph

957 commits

Author SHA1 Message Date
Nicolas Goaziou bb671936b5 org-element: Speed up parsing when granularity is bigger than default
* contrib/lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser, org-element-item-parser,
  org-element-verse-block-parser, org-element-current-element): New
  optional argument so parsing of secondary string is not mandatory.
(org-element-parse-elements): Remove duplicate part from doc-string.
(org-element-at-point): Improve speed of function since secondary
string are never parsed.
(org-element-secondary-value-alist): Simplify doc-string.
* testing/lisp/test-org-element.el: Add test.
2012-03-28 16:31:56 +02:00
Nicolas Goaziou 763991fbda org-element: Store keywords in upper cases
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-keyword): Apply keywords
  case change.
* EXPERIMENTAL/org-e-html.el (org-e-html-keyword): Apply keywords case
  change.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-keyword): Apply keywords
  case change.
* EXPERIMENTAL/org-e-odt.el (org-e-odt-keyword): Apply keywords case change.
* contrib/lisp/org-element.el (org-element-export-block-parser):
  Internally store type in upper cases.
(org-element-keyword-parser): Internally store keyword `:key' property
in upper cases.
(org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist, org-element-multiple-keywords,
org-element-parsed-keywords, org-element-dual-keywords):
Use uppercased keywords.
(org-element-current-element): Use uppercase for keywords.
(org-element-collect-affiliated-keywords): Store affiliated keywords
in upper cases.
* contrib/lisp/org-export.el (org-export-get-inbuffer-options,
  org-export-collect-tree-properties, org-export-resolve-fuzzy-link):
  Use upper cased keywords.
* testing/lisp/test-org-export.el: Update tests.
2012-03-28 14:27:15 +02:00
Nicolas Goaziou ada00fb857 org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
  org-element-quote-block-parser,
  org-element-quote-block-interpreter,
  org-element-special-block-parser,
  org-element-special-block-interpreter,
  org-element-babel-call-interpreter,
  org-element-comment-block-parser,
  org-element-export-block-interpreter,
  org-element-src-block-interpreter,
  org-element-example-block-interpreter): Use standard case for Org
  syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore.  Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property.  Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.

Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 13:59:18 +02:00
Bastien Guerry 5fc7b7d138 Merge branch 'hotfix-7.8.06' 2012-03-27 12:22:04 +02:00
Bastien Guerry 410dd12d89 org-mime.el: Set `org-export-with-LaTeX-fragments' correctly.
* org-mime.el (org-mime-htmlize): Set
`org-export-with-LaTeX-fragments' correctly.
2012-03-27 12:21:56 +02:00
Bastien Guerry 9602e1cb38 org-collector.el: Don't narrow to subtree when collecting properties on the whole buffer.
* org-collector.el (org-dblock-write:propview): Don't narrow
to subtree when collecting properties on the whole buffer.

TINYCHANGE
2012-03-26 17:24:26 +02:00
Bastien Guerry 973695beb3 Add org-notify.el by Peter Münster to contrib/lisp/.
It's useful for getting notifications for todo items and more flexible
than org-agenda-to-appt.

Here a summary:
- different warning periods for different todo-types
- fine grained warning periods (smallest unit is second)
- continue notifications, when deadline is overdue
- easy modification of timestamps (just one click, to say
  "let's do it tomorrow")
- switch from "todo" to "done" by clicking on the notification window
- configurable notification types (email, notifications-notify, beep,
  etc.)
- configurable notification period
- configurable notification duration
- crescendo notifications (be more aggressive, when time gets closer to
  deadline)

There was a little thread about this subject:
http://thread.gmane.org/gmane.emacs.orgmode/48832

Example usage:
  (org-notify-add 'appt
                  '(:time "-1s" :period "20s" :duration 10
                    :actions (-message -ding))
                  '(:time "15m" :period "2m" :duration 100
                    :actions -notify/window)
                  '(:time "2h" :period "5m" :actions -message)
                  '(:time "1d" :actions -email))

This means for todo-items with `notify' property set to `appt': 1 day before
deadline, send a reminder-email, 2 hours before deadline, start to send
messages every 5 minutes, then, 15 minutes before deadline, start to pop up
notification windows every 2 minutes. The timeout of the window is set to
100 seconds. Finally, when deadline is overdue, send messages and make
noise.
2012-03-24 07:48:07 +01:00
Bastien Guerry eb7f7159c9 Merge branch 'hotfix-7.8.06' 2012-03-23 13:42:29 +01:00
Ilya Shlyakhter 532a1ac40a Tags/properties matcher: Fixed issues with todo-only matches
lisp/org.el (org-scan-tags): Require todo-only argument, and document
that it should be the same one set by make-org-tags-matcher.
Fix documentation to explain that todo-only is really
not-done-todo-only.

(org-make-tags-matcher): If todo part of matcher starts with /!,
matcher now always checks that the TODO keyword is present and
is a not-done state.  This matters e.g. for org-map-entries
which unlike org-scan-tags does not do its own separate todo-only
filtering.  Added docs to explain matcher dependencies.

(org-map-entries): Make sure todo-only is correctly passed from
org-make-tags-matcher to org-scan-tags.

* lisp/org-clock.el: (org-clock-get-table-data): Make sure todo-only
does not leak when it is set by make-org-tags-macher.

* lisp/org-crypt.el: (org-encrypt-entries, org-decrypt-entries): Make
sure todo-only is correctly passed from org-make-tags-matcher to
org-scan-tags.

* contrib/lisp/contacts.el: (org-contacts-filter) : Make sure todo-only
is correctly passed from org-make-tags-matcher to org-scan-tags.
2012-03-23 13:42:06 +01:00
Nicolas Goaziou 1581b16c78 org-element: Small refactoring
* contrib/lisp/org-element.el (org-element-swap-A-B,
  org-element-drag-backward, org-element-drag-forward): Small
  refactoring.
* testing/lisp/test-org-element.el: Add tests.
2012-03-22 19:32:09 +01:00
Nicolas Goaziou 5e950a9e56 org-element: Remove an unused argument
* contrib/lisp/org-element.el (org-element-parse-secondary-string):
  Remove unused optional argument.
2012-03-22 18:26:34 +01:00
Nicolas Goaziou dd7aa8ece9 org-export: Fix export with Babel calls outside export scope
* contrib/lisp/org-export.el (org-export-as): Fix export with Babel
  calls outside export scope by providing buffer's name holding full
  data instead of the one holding its copy limited to scope.
* testing/lisp/test-org-export.el (test-org-export/export-scope): Add
  a test.
2012-03-22 16:49:19 +01:00
Tom Alexander ce7579e1f7 contrib/lisp/org-export-generic.el: Added variables for exporting tables and a mediawiki exporter. 2012-03-20 17:01:21 +01:00
Bastien Guerry 6c911234ac Remove files coming from maint. 2012-03-20 01:50:59 +01:00
Bastien Guerry df82832fb7 Merge maint fixup and finish master fixup 2012-03-20 00:35:55 +01:00
Bastien Guerry 4e5c24ea81 Delete files that sneaked in while fixing the master branch. 2012-03-19 23:48:07 +01:00
Bastien Guerry ecd0562c5f Fix the master branch.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.

This commit also bumps the version number to 7.8.06.

The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
2012-03-19 22:01:29 +01:00
Bastien Guerry c44e07a4fa Fix the maint branch.
Thanks to Achim Gratz for his precious help on this.
2012-03-19 20:27:28 +01:00
Bastien Guerry 6e306f65ff Fix copyright years in maint. 2012-03-17 16:31:04 +01:00
Bastien Guerry de42649f7b Manually revert maint to e85080.
e85080 is the last correct commit in the maint branch
before releasing 7.8.04.  The 7.8.05 release should be
done from this commit.
2012-03-17 16:28:46 +01:00
Bastien Guerry eea3802bba Whitespace cleanup. 2012-03-17 15:59:38 +01:00
Bastien Guerry 73bb18ba37 Manually revert to the Release 7.8.04 tag. 2012-03-17 15:52:24 +01:00
Bastien Guerry fdc20f7792 Fix more copyright years. 2012-03-17 14:39:43 +01:00
Bastien Guerry 6e534f9c61 Manually revert back to commit e85080.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.

This commit reverts back the maint branch to its state before
merging the master branch.  From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
2012-03-17 14:34:01 +01:00
Nicolas Goaziou 3fda301b07 org-element: Unhide contents of collapsed elements before entering them
* contrib/lisp/org-element.el (org-element-down): Unhide contents of
  collapsed elements before entering them.
2012-03-14 18:47:38 +01:00
David Maus 21391e2f84 Merge branch 'maint' 2012-03-14 06:00:49 +01:00
Tassilo Horn 429cf28ebe Add missing word to org-contacts y-or-n-p question
* org-contacts.el (org-contacts-check-mail-address): Add missing word
to y-or-n-p question.
2012-03-14 05:46:04 +01:00
Nicolas Goaziou beb024687b org-export: Remove useless INFO argument from `org-export-unravel-code'
* contrib/lisp/org-export.el (org-export-unravel-code): Remove INFO
  argument.  Fix a bug preventing code references to be properly
  recognized.
(org-export-format-code-default): Apply signature change.
(org-export-resolve-coderef): Fix a bug preventing code references to
be properly recognized.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-src-block): Apply signature
  change.
* testing/lisp/test-org-export.el: Add tests.
2012-03-10 20:25:32 +01:00
Nicolas Goaziou c7203b4142 org-export: Change source code handling API
* contrib/lisp/org-element.el (org-element-example-block-parser,
  org-element-src-block-parser): Add `:number-lines',
  `:preserve-indent, `:retain-labels', `:use-labels'  and
  `:label-fmt' properties.
* contrib/lisp/org-export.el (org-export-resolve-coderef,
  org-export-get-loc): Apply changes to src-block and example-block
  elements' properties.
(org-export-unravel-code, org-export-format-code,
org-export-format-code-default): New functions.
(org-export-handle-code): Removed function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-example-block): Use new
  function.
(org-e-latex-src-block): Use new API.  Better handling of numbered
lines with special packages.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-example-block,
  org-e-ascii-src-block): Use new functions.
* testing/lisp/test-org-element.el: Add tests.
* testing/lisp/test-org-export.el: Add tests.
2012-03-10 13:42:46 +01:00
Nicolas Goaziou 86131a8b50 org-element: New `org-element-down' function
* contrib/lisp/org-element.el (org-element-down): New function.
* testing/lisp/test-org-element.el: Add test.
2012-03-09 19:47:50 +01:00
Nicolas Goaziou 62a631e236 org-export: Small fix
* contrib/lisp/org-export.el (org-export-get-ordinal): Change signature.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--build-caption): Apply
  changes to previous function
2012-03-07 18:02:57 +01:00
Nicolas Goaziou bbbdff9f81 org-export: Predicate in `org-export-get-ordinal' accepts two arguments
* contrib/lisp/org-export.el (org-export-get-ordinal): Predicate in
  `org-export-get-ordinal' accepts two arguments.
2012-03-07 17:18:20 +01:00
Nicolas Goaziou bf609d8844 org-export: Avoid duplicates in `org-export-collect-footnote-definitions'
* contrib/lisp/org-element.el (org-element-map): New optional argument
  to avoid recursion into certain recursive types.
* contrib/lisp/org-export.el (org-export-footnote-first-reference-p,
  org-export-get-footnote-number,
  org-export-collect-footnote-definitions): Use new argument from
  `org-element-map'.
* testing/lisp/test-org-export.el: Add test.

The new argument allows to force entering footnotes definitions at
a certain time (when their first reference is found) but not a second
time when they are encountered in the parse tree.

Thanks to Jambunathan for reporting this.
2012-03-04 11:57:16 +01:00
Nicolas Goaziou 933c0fa441 Implement numbered cross-references
* lisp/org.el (org-link-search): Search for #+name affiliated keywords
  and invisible targets.
* contrib/lisp/org-element.el (org-element-link-parser): Remove "ref"
  links relative part.
(org-element-target-parser): Move property name from `:raw-value' to
`:value'.
(org-element-recursive-objects): Remove targets from tables.  Cells
are not parsed unless explicitely asked by back-end developer, too
late.  A target wouldn't be noticed in time.  One solution could be to
parse every table, but that's time consumming.
(org-element-object-restrictions): Target are not recursive anymore.
* contrib/lisp/org-export.el (org-export-resolve-fuzzy-link): Find
  elements with a matching "#+name: path" affiliated keyword.
(org-export-get-ordinal): Make special cases for headlines, items,
footnotes definitions and references.
(org-export-resolve-ref-link): Removed function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Handle
  cross-reference numbers.
(org-e-latex-target): Targets have no contents.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--describe-links): Ignore
  fuzzy links in link description at the end of the section.
(org-e-ascii-link): Handle cross-reference numbers.
* testing/contrib/lisp/test-org-export.el: Add tests.
* testing/lisp/test-org.el: Add tests.
2012-03-01 14:49:53 +01:00
Nicolas Goaziou 701e99e923 org-element: Fix misleading comments 2012-02-29 19:06:50 +01:00
Nicolas Goaziou 73c5044963 org-export: Add `org-export-headline-numbered-p' predicate
* contrib/lisp/org-export.el (org-export-numbered-headline-p): New function.
* EXPERIMENTAL/org-e-ascii.el: Apply new function.
* EXPERIMENTAL/org-e-latex.el: Apply new function.
* testing/lisp/test-org-export.el: Add a test.
2012-02-29 19:05:45 +01:00
Eric Schulte e4ac36225d org-bibtex-extras --- extras for working with org-bibtex entries
A contributed package which is still in early development, but
  should eventually have some fun extras for working with org-mode
  bibtex entries
2012-02-28 13:01:22 -07:00
Nicolas Goaziou fcd4418a70 org-element: Refactor code 2012-02-26 13:24:27 +01:00
Nicolas Goaziou 29e633f7cd org-element: Fix small bug in org-element-map
* contrib/lisp/org-element.el (org-element-map): Don't forget to apply
  function on paragraph even when no object should be mapped.  Just
  don't recurse in it.
2012-02-26 11:24:26 +01:00
Nicolas Goaziou c166bfbb1a org-export: fix bug with nested footnotes in invisible definitions
* contrib/lisp/org-export.el (org-export-collect-footnote-definitions):
  Also collect footnotes in footnote definitions
(org-export-get-footnote-number): Remove unused check.
* testing/contrib/lisp/test-org-export.el: Add test.
2012-02-26 10:57:42 +01:00
Nicolas Goaziou 12c94310a2 org-export: Allow nested footnotes (part 2)
* EXPERIMENTAL/org-e-latex.el (org-e-latex-footnote-reference):
  Correctly handle numbering with nested footnotes.
* contrib/lisp/org-element.el (org-element-map): Apply function to
  element or object before applying it to its secondary string, if
  any.  Otherwise, linearity is broken.
* contrib/lisp/org-export.el (org-export-footnote-first-reference-p,
  org-export-get-footnote-number): Take care of recursive footnotes.
(org-export-get-genealogy): Correctly get genealogy of an item within
a secondary string.
* testing/contrib/lisp/test-org-export.el: Add tests.
2012-02-26 01:38:26 +01:00
Nicolas Goaziou 81cc6dff19 org-e-latex: Allow nested footnotes
* EXPERIMENTAL/org-e-latex.el (org-e-latex-footnote-reference): Allow
  nested footnotes.
* contrib/lisp/org-element.el (org-element-string-restrictions): Allow
  footnote references within a footnote reference.
* testing/contrib/lisp/test-org-export.el: Add a test for nested
  footnotes.
2012-02-25 14:56:37 +01:00
Nicolas Goaziou 5313dc9d09 org-export: Allow user to explicitely ignore parts of parse tree
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
  Do not overwrite any user's ignore list.
* testing/contrib/lisp/test-org-export.el: Add test.

A good way to populate `:ignore-list' is through the use of
`org-export-filter-parse-tree-functions', with the help of
`org-element-map' and `org-export-ignore-element'.  As an example, the
following code will skip every headline containing the word "note"
in its title during a LaTeX export:

(defun user-skip-note-headlines (data backend info)
  ;; For now LaTeX back-end is called `e-latex'.
  (when (eq backend 'test)
    ;; Traverse the parse tree, adding to ignore list any headline
    ;; matching criteria.
    (org-element-map
     data 'headline
     (lambda (headline)
       (when (string-match "\\<note\\>"
                           (org-element-property :raw-value headline))
         (org-export-ignore-element headline info)))
     info))
  ;; Return original DATA.
  data)

Then install it in parse-tree filters:

(add-to-list 'user-skip-note-headlines org-export-filter-parse-tree-functions)

Back-end delevopers will install it via `org-BACKEND-filters-alist'
where BACKEND stands for the name of the back-end considered.  Se
`org-export-filters-alist' for more information.
2012-02-25 14:55:21 +01:00
Nicolas Goaziou 9f7965a80e org-element: Function mapped through org-element-map accepts only one argument
* contrib/lisp/org-element.el (org-element-map): Remove use of an
  alternate communication channel.  Function is now called with only
  one argument.
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
(org-export-collect-headline-numbering, org-export--selected-trees,
org-export-collect-footnote-definitions,
org-export-footnote-first-reference-p,
org-export-get-footnote-number, org-export-resolve-fuzzy-link,
org-export-resolve-id-link, org-export-resolve-ref-link,
org-export-resolve-coderef, org-export-get-ordinal,
org-export-get-loc, org-export-collect-headlines): Apply changes.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--unique-links): Apply
  changes.
* EXPERIMENTAL/org-e-publish.el (org-e-publish-collect-index): Apply
  changes.
2012-02-25 14:53:35 +01:00
Nicolas Goaziou 3b3936b9a9 org-export: Do not ignore automatically elements with empty output
* contrib/lisp/org-export.el (org-export-data): org-export: Do not
  ignore automatically elements with empty output.
2012-02-25 14:53:34 +01:00
Nicolas Goaziou 752a531eb5 org-element: Refactor code 2012-02-24 22:33:16 +01:00
Nicolas Goaziou 404ede23fc org-element: Change algorithm for `org-element-at-point'
* contrib/lisp/org-element.el (org-element-at-point): Change
  algorithm.
(org-element-guess-type): Removed function.
(org-element--element-block-types): Removed variable.
(org-element-forward, org-element-backward, org-element-up): Rewrite
functions.
* testing/contrib/lisp/test-org-element.el: Add tests.
2012-02-24 17:52:43 +01:00
Nicolas Goaziou fc7c80c37e org-export: Minor UI change
* contrib/lisp/org-export.el (org-export-dispatch-ui): Small UI change.
2012-02-24 17:52:43 +01:00
Nicolas Goaziou 94185eac92 org-export: Fix bug with recursive file inclusion and relative paths
* contrib/lisp/org-export.el (org-export-expand-include-keyword): Use
  another optional argument to specify the current working directory.
(org-export-as): Apply changes.
* testing/contrib/lisp/test-org-export.el: Add tests.
* testing/examples/include.org: New test file.
* testing/examples/include2.org: New test file.
2012-02-23 21:28:15 +01:00
Nicolas Goaziou 186f0f7594 org-element: Small refactoring
* contrib/lisp/org-element.el (org-element-parse-elements): Small refactoring.
2012-02-23 19:08:23 +01:00