Commit Graph

11262 Commits

Author SHA1 Message Date
Nicolas Goaziou 61b5e28509 org-export: Flesh out dictionary
* contrib/lisp/org-export.el (org-export-dictionary): Flesh out
  dictionary.
(org-export-translate): Allow for a :default charset in order to
simplify dictionary completion.
2012-08-25 14:07:41 +02:00
Nicolas Goaziou d86f09a854 org-element: Extract search option and application in "file"-type links
* lisp/org-element.el (org-element-link-type-is-file): New variable.
(org-element-link-parser): Extract search option and application in
"file"-type links.
* contrib/lisp/org-e-html.el (org-e-html-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-e-odt.el: Remove components extraction since this
  in now done in `org-element-link-parser'.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-link): Remove
  components extraction since this in now done in
  `org-element-link-parser'.
* contrib/lisp/org-e-latex.el (org-e-latex-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-e-man.el (org-e-man-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-e-groff.el (org-e-groff-link): Remove components
  extraction since this in now done in `org-element-link-parser'.
* contrib/lisp/org-md.el (org-md-link): Remove components extraction
  since this in now done in `org-element-link-parser'.
* testing/lisp/test-org-element.el: Add tests.
2012-08-25 10:38:25 +02:00
Bastien Guerry d09a6b3db5 Merge branch 'maint' 2012-08-25 10:29:09 +02:00
Bastien Guerry eaa1dee2d0 Fix version in README_DIST and doc/orgcard.tex 2012-08-25 10:28:59 +02:00
Bastien Guerry e9b4debd0f Move x11idle.c from utils/ to contrib/scripts/ 2012-08-25 10:25:01 +02:00
Bastien Guerry 9c3386567c contrib/lisp/org-notify.el: Make `org-notify-start' interactive. Clean-up.
* org-notify.el (org-notify-start): Make interactive.
(org-notify-add, org-notify-start, org-notify-stop)
(org-notify-select-highest-window, default): Docstring and
indentation clean-up.
2012-08-25 10:06:55 +02:00
Bastien Guerry 2ecc210822 Merge branch 'maint' 2012-08-24 21:59:06 +02:00
Nicolas Goaziou 53334042b5 Fix bug in comment-dwin when at a keyword
* lisp/org.el (org-mode): Set back comment-start-skip so comment-dwin
  can tell a keyword from a comment.
* testing/lisp/test-org.el: Add test.
2012-08-24 21:58:48 +02:00
Nicolas Goaziou 302fdfd2b0 Fix bug in comment-dwin when at a keyword
* lisp/org.el (org-mode): Set back comment-start-skip so comment-dwin
  can tell a keyword from a comment.
* testing/lisp/test-org.el: Add test.
2012-08-24 21:15:00 +02:00
Achim Gratz dcdc141331 Merge branch 'maint' 2012-08-24 20:40:21 +02:00
Achim Gratz 961f994b14 utils/server.mk: use --transform, not alias --xform
* utils/server.mk: For compatibility with GNU tar 1.20, use
  --transform, not alias --xform.
2012-08-24 20:39:30 +02:00
Michael Brand efab563317 org.texi: Mention when a table header is mandatory
* org.texi (Column formulas): Add a sentence to be more explicit about
when a table header is mandatory.
2012-08-24 19:53:04 +02:00
Bastien Guerry e39299d822 Merge branch 'maint' 2012-08-24 19:12:25 +02:00
Bastien Guerry a986d316a3 server.mk: include the full utils/ directory for now 2012-08-24 19:07:23 +02:00
Bastien Guerry 35e2118866 Merge branch 'maint' 2012-08-24 18:59:43 +02:00
Bastien Guerry 1d1d5e6e4e Fix previous commit 2012-08-24 18:59:30 +02:00
Bastien Guerry f480d47819 Merge branch 'maint' 2012-08-24 18:56:40 +02:00
Bastien Guerry d3af5d02b0 utils/server.mk: include utils/org-fixup.el and utils/org-install.el in release target 2012-08-24 18:56:30 +02:00
Bastien Guerry bb75dd9f8d utils/server.mk: include utils/org-fixup.el and utils/org-install.el in release target 2012-08-24 18:55:41 +02:00
Bastien Guerry d44b56e81e org-agenda.el: Fix bug about restoring existing window conf
* org-agenda.el (org-prepare-agenda-window): Use
`org-pre-agenda-window-conf' if already set.
(org-agenda-Quit): Set `org-pre-agenda-window-conf' to nil
when quitting.
(org-agenda-quit): Ditto.

Thanks to Moritz Ulrich for reporting a bug about this.
2012-08-24 15:54:58 +02:00
Bastien Guerry dd31878ee7 org-capture.el: Protect the text used for replacement from being further replaced
* org-capture.el (org-capture-fill-template): Protect the text
used for replacement from being further replaced.

Thanks to Moritz Ulrich for reporting this bug.
2012-08-24 15:45:03 +02:00
Nicolas Goaziou 82007c40da Fix comment auto-filling
* lisp/org.el (org-set-autofill-regexps): Install new comment line
  break function.
(org-comment-line-break-function): New function.
(org-mode): Remove unnecessary line.
2012-08-24 14:57:00 +02:00
Bastien Guerry 5e7ffbe1d4 Merge branch 'master' of orgmode.org:org-mode 2012-08-24 14:23:07 +02:00
Bastien Guerry bfe3e2102f org.el: Fix the contextual check against a function
* org.el (org-contextualize-validate-key): Fix the check
against a function.
2012-08-24 14:22:45 +02:00
Nicolas Goaziou 8a97c601a1 Do not fill verse blocks contents
* lisp/org.el (org-fill-context-prefix, org-fill-paragraph): Do not
  fill verse blocks contents.  Verse blocks can be used to format
  free-form poetry, so filling has to be done manually.
* testing/lisp/test-org.el: Remove unnecessary tests.
2012-08-24 12:58:43 +02:00
Nicolas Goaziou b1223be34d Auto-filling must not break current paragraph
* lisp/org.el (org-fill-paragraph-separate-nobreak-p): New function.
(org-set-autofill-regexps): Introduce new predicate.
(org-fill-item-nobreak-p): Remove function.
2012-08-24 12:58:42 +02:00
Nicolas Goaziou 4bc4e8ec18 org-element: Paragraphs don't end at incomplete latex environments
* lisp/org-element.el (org-element-paragraph-separate): Since this
  variable is meant to be searched forward, \end{...} shouldn't
  trigger the end of a paragraph before checking if it is the end of
  a complete environment.
(org-element-latex-environment-parser): Slight change to the regexp
matching the beginning of a latex environment.
(org-element-paragraph-parser): Paragraphs don't end at incomplete
latex environments.
(org-element-latex-or-entity-successor): Remove paragraph environments
from latex fragment search.
2012-08-24 12:58:42 +02:00
Bastien Guerry 10dbdf5fc2 Update the handling of agenda/capture keys contextualization.
* org.el (org-contextualize-keys): Rename from
`org-contextualize-agenda-or-capture'.  Fix normalization to
handle empty key replacement string.
(org-contextualize-validate-key): Rename from
`org-contexts-validate'.  Allow checking against a custom
function.

* org-agenda.el (org-agenda-custom-commands-contexts): Update.
(org-agenda): Use `org-contextualize-keys'.

* org-capture.el (org-capture-templates-contexts): Ditto.

* org.texi (Templates in contexts, Setting Options): Update to
reflect changes in how contexts options are processed.
2012-08-24 12:18:05 +02:00
Bastien Guerry 9d73d6d680 org.el (org-contextualize-agenda-or-capture): Normalize contexts
* org.el (org-contextualize-agenda-or-capture): Normalize
contexts.
2012-08-24 12:18:02 +02:00
Bastien Guerry 6c94ea0518 Implement key replacement depending on the contexts.
* org.el (org-contextualize-agenda-or-capture): Handle key
replacement depending on the contexts.

* org-capture.el (org-capture-templates-contexts): Allow to
use the context as a way to replace one capture template by
another one.

* org-agenda.el (org-agenda-custom-commands-contexts): Allow
to use the context as a way to replace one agenda custom
command by another one.

* org.texi (Templates in contexts): Document the new structure
of the variables `org-agenda-custom-commands-contexts' and
`org-capture-templates-contexts'.

In the setup below, X is not a real capture template, it is just
an alias to templates A and B in .txt and .el files.  A and B are
deactivated by default in all files.

(setq org-capture-templates
      '(("X" "Nothing but an alias")
	("A" "AAAA" entry (file+headline [...]))
	("B" "BBBB" entry (file+headline [...]))))

(setq org-capture-templates-contexts
      '(("A" "A" ((not-in-file . ".*")))
	("B" "B" ((not-in-file . ".*")))
	("X" "A" ((in-file . "\\.txt")))
	("X" "B" ((in-file . "\\.el")))))

Thanks to Carsten for suggesting this "key-replacement" idea!
2012-08-24 12:17:58 +02:00
Bastien Guerry be70cfd084 org-e-texinfo.el: Tiny formatting and code fix
* org-e-texinfo.el (org-e-texinfo-table-column-widths): Remove
a quote before a lambda expression.
2012-08-24 11:21:24 +02:00
Nicolas Goaziou 7e466ea883 org-export: Small clean-up 2012-08-24 10:44:05 +02:00
Nicolas Goaziou 095f9322e5 org-export: Make sure back-end specific filters do not make any back-end check
* contrib/lisp/org-e-ascii.el (org-e-ascii-filter-headline-blank-lines):
  Remove backend check.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-filter-section-blank-lines):
  Remove backend check.
* contrib/lisp/org-export.el (org-export-define-backend): Update
  docstring accordingly.
2012-08-24 10:41:41 +02:00
Nicolas Goaziou cced6735a7 org-export: Run export hook with current back-end as argument
* contrib/lisp/org-export.el (org-export-as): Run export hook with
  current back-end as argument.
* testing/lisp/test-org-export.el: Update test.
2012-08-24 10:10:44 +02:00
Nicolas Goaziou cc839259a4 org-export: Nil value from a filter means filter will be skipped
* contrib/lisp/org-export.el (org-export-filter-apply-functions): Nil
  value from a filter means filter will be skipped. To ignore the
  current element or object, the filter has to return the empty string
  instead.

This change is done to ease filter writing. When writing
a backend-specific filter (and I guess most are), there's no more need
for the somewhat contrived:

  (if (not (eq backend 'e-latex)) data
    ... filter's job...)

A more straightforward:

  (when (eq backend 'e-latex)
    ... filter's job...)

is now enough.

On the other hand, it is not possible anymore to specify 'ignore as
a filter to ignore every element or object of a given type. To
achieve that goal, one can now write, for example:

  (add-to-list 'org-export-filter-example-block-functions
                 (lambda (value backend info)
                   (when (eq backend 'e-html) "")))

It will ignore every example block in the `e-html' export back-end.
2012-08-24 09:56:48 +02:00
Nicolas Goaziou 3f40057adc org-export: Limit depth of headline collection to headline level
* contrib/lisp/org-export.el (org-export-collect-headlines): By
  default, limit depth of headline collection to last headline level.
* contrib/lisp/org-e-html.el (org-e-html-toc): Small refactoring.
2012-08-24 09:36:18 +02:00
Nicolas Goaziou 5b19471358 org-e-html: Fix TOC generation with a non numeric value
* contrib/lisp/org-e-html.el (org-e-html-toc): Accept non numeric
  values for depth.
(org-e-html-template): Call previous function even when depth isn't
a number.
(org-e-html-keyword): Call previous function even when depth isn't
a number.  Also react on #+HTML keywords, not #+LATEX.
2012-08-23 21:32:12 +02:00
Achim Gratz a81b54968d Makefile: remove circular dependency created by robo-changing UTILITIES->utils
* targets.mk: Remove circular dependency created by robo-changing
  UTILITIES->utils.

Fortunately this was non-fatal since direct circular dependencies are
ignored by GNU Make.  Must happen more often... :-)
2012-08-23 17:59:23 +02:00
Jonathan Leech-Pepin d4d29efb53 contrib/lisp/org-e-texinfo: Ensure valid export of escaped characters
and remove invalid characters from menu items

* contrib/lisp/org-e-texinfo.el (org-e-texinfo--sanitize-menu): Remove
  invalid characters from menu entries and nodes.
(org-e-texinfo--sanitize-contents): Ensure @ { and } are properly
escaped in text and headlines.
(org-e-texinfo--generate-menu-items): Strip invalid characters from
menu titles.
(org-e-texinfo-fixed-width): Escape @ { and } in fixed-width
environments.
(org-e-texinfo-headline): Ensure nodes do not have invalid characters
and escape @ { and } in section titles.
(org-e-texinfo-plain-text): Use proper escape character for @ { and }.
2012-08-23 10:51:47 -04:00
Jonathan Leech-Pepin 8441782b11 contrib/lisp/org-e-texinfo: Remove markup from headlines when
exporting to ensure info can process them properly

* contrib/lisp/org-e-texinfo.el (org-e-texinfo--generate-menu-items):
  Use org-e-texinfo--sanitize-headline to ensure markup is stripped
  before being used for sectioning and menu information.  Nodes and
  menus can fail because of formatting and section titles do not show
  any formatting when viewed in an info-viewer.
(org-e-texinfo--sanitize-headline): Wrapper function for
org-e-texinfo--sanitize-healine-contents
(org-e-texinfo--sanitize-headline-contents): Strips markup from
headlines.  It treats content recursively to ensure nested formatting
is removed as well.
2012-08-23 09:20:02 -04:00
Jonathan Leech-Pepin 44d68803d3 contrib/lisp/org-e-texinfo: Improve error reporting after makeinfo
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-collect-errors): Fixed
  error checking to actually return an error message.
2012-08-23 08:40:47 -04:00
Bastien Guerry e759d34826 Add eldo.el to utils/
eldo.el allows to write documentation from Elisp files in an org file.
2012-08-23 12:55:45 +02:00
Bastien Guerry 0c8e87b8d2 Rename UTILITIES/ to utils/ 2012-08-23 12:47:10 +02:00
Achim Gratz 91e4ccb6c1 server.mk: implement `cleanrel´ here
* targets.mk: Remove `cleanrel´.

* UTILITIES/server.mk: Implement `cleanrel´, use only the names that
  will be produced by server.mk.
2012-08-23 12:32:43 +02:00
Achim Gratz a90ff91350 Makefile: adding files from contrib
* default.mk: Add customizatin variable ORG_ADD_CONTRIB with
  descriptiona and commented example.

* targets.mk: Strip leading path and trailing suffix from all elements
  of ORG_ADD_CONTRIB, then prefix with contrib/lisp and do wildcard
  expansion (this will also remove any invalid names); store the
  result in ORG_FROM_CONTRIB.  Strip /contrib from ORG_FROM_CONTRIB
  and store the result in ORG_TO_LISP.  If these are non-empty, copy
  the files from contrib/lisp/ into lisp/ before compilation and
  remove them when cleanlisp is called.
2012-08-23 12:32:38 +02:00
Bastien Guerry 85d6b781e4 Revert "server.mk: implement `cleanrel´ here"
This reverts commit ddcf4f8511.
2012-08-23 12:31:44 +02:00
Achim Gratz ddcf4f8511 server.mk: implement `cleanrel´ here
* targets.mk: Remove `cleanrel´.

* UTILITIES/server.mk: Implement `cleanrel´, use only the names that
  will be produced by server.mk.
2012-08-23 12:28:35 +02:00
Bastien Guerry 58885997b6 Merge branch 'master' of orgmode.org:org-mode 2012-08-23 11:51:24 +02:00
Bastien Guerry d378c7b41b Implement context filtering for agenda commands and capture templates.
* org.el (org-contextualize-agenda-or-capture)
(org-rule-validate): New functions, implement context
filtering for agenda commands and capture templates.

* org-agenda.el (org-agenda-custom-commands-contexts): New
option.
(org-agenda): Use it.

* org-capture.el (org-capture-templates-contexts): New option.
(org-capture-select-template): Use it.

* org.texi (Templates in contexts): Document the new option
`org-capture-templates-contexts'.
(Storing searches): Document the new option
`org-agenda-custom-commands-contexts'.

This idea comes from Sylvain Rousseau, who implemented a similar
feature with org-context.el: https://github.com/thisirs/org-context

This implementation is a bit simpler and more general.  Simpler
because it relies on existing templates, no need to define other
contextual ones.  More general because contexts can be defined
wrt files and modes.

Thanks *very much* to Sylvain for paving the way -- certainly a
great addition to Org.
2012-08-23 11:08:47 +02:00
Nicolas Goaziou f9e5600f82 org-export: Fix reference to a free variable in macros
* contrib/lisp/org-export.el (org-export-define-backend,
  org-export-define-derived-backend): Fix reference to a free variable
  in macro.
2012-08-23 11:03:09 +02:00