Commit Graph

7008 Commits

Author SHA1 Message Date
Bastien Guerry 0c8e87b8d2 Rename UTILITIES/ to utils/ 2012-08-23 12:47:10 +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
Achim Gratz dd76fceddc Makefile: error out on invalid values of ORGCM
* lisp/Makefile: Check validity of value given in ORGCM and terminate
  with an error message if an illegal value is used.
2012-08-22 20:02:47 +02:00
Bastien Guerry 841d949d9c org.el: Delete `org-beginning-of-defun' and `org-end-of-defun'
* org.el (org-beginning-of-defun, org-end-of-defun): Delete.
(org-mode): Set `beginning-of-defun-function' and
`end-of-defun-function' directly.
2012-08-22 19:02:39 +02:00
Bastien Guerry 53c230a9f6 org.el: Fix bug: include links abbreviations when completing
* org.el (org-insert-link): Fix bug: include links
abbreviations when completing.
2012-08-22 12:24:14 +02:00
Bastien Guerry 7d8f69068e org-icalendar.el: Fix bug.
* org-icalendar.el (org-icalendar-print-entries): Fix bug:
when `org-icalendar-use-plain-timestamp' is nil, scheduled and
deadline items should not be ignored.

Thanks to Friedrich Delgado for reporting this.
2012-08-22 02:41:18 +02:00
Bastien Guerry 655c7fb360 org.el: Small docstring clean-up
* org.el (org-ds-keyword-length, org-make-tags-matcher):
Docstring clean-up.
2012-08-22 02:39:18 +02:00
Bastien Guerry 8e307a8ef2 org-freemind.el: Fix bug when converting links
* org-freemind.el (org-freemind-convert-links-from-org):
Replace literally to prevent errors when replacing with string
containing backslashes.

Thanks to Martin Beck for reporting this.
2012-08-22 00:42:02 +02:00
Bastien Guerry 65e0b5bccd org-pcomplete.el: Allow to match and complete a "thing" containing dashes
* org-pcomplete.el (org-thing-at-point): Allow to match (and
then complete) a "thing" containing dashes.

Thanks to Aidan Gauland for reporting this problem.
2012-08-22 00:20:09 +02:00
Achim Gratz 226b15baa0 Makefile: implement different compilation methods, rename _COMPILE_ to ORGCM
* default.mk, targets.mk, lisp/Makefile: Rename _COMPILE_ to ORGCM.

* default.mk: Define ORGCM=dirall, show other possible values as
  comments

* targets.mk: Implement target `single´, temporarily set
  ORGCM (overriding configuration).  Show newly introduced
  configuration variables with `check-*´.

* lisp/Makefile: Implement dispatch for compile based on ORGCM.
  Output header that contains the target for easier debugging.

* Makefile: Document target `single´.
2012-08-21 21:24:23 +02:00
Achim Gratz 3c1c04d8bc Revert "Revert "Makefile: allow for different compilation methods""
This reverts commit 510f6464b0.
2012-08-21 21:24:21 +02:00
Bastien Guerry 51b9ad93c9 org-table.el: Better message when interactively toggling Row/Col display
* org-table.el (org-table-toggle-coordinate-overlays): Better
message when interactively toggling.
2012-08-21 20:09:25 +02:00
Jay McCarthy ade209b7c5 org-colview.el: Make sure to add a face to a string that has no face
* org-colview.el (org-columns-new-overlay): Make sure to add a
face to a string that has no face.

TINYCHANGE

See the description of the bug here:
http://thread.gmane.org/gmane.emacs.orgmode/58984
2012-08-21 20:05:34 +02:00
Bastien Guerry 5d57364256 org-table.el: Minor docstring update
* org-table.el (org-table-number-regexp): Update the docstring
to show an example of a decimal number using the comma as a
separation mark.
2012-08-21 18:31:12 +02:00
Bastien Guerry 43df5aa25a Merge branch 'master' of orgmode.org:org-mode 2012-08-21 18:16:11 +02:00
Bastien Guerry 6a69ceaed6 org-agenda.el: Fix a bug in category filtering
* org-agenda.el (org-prepare-agenda): Minor code clean-up.
(org-agenda-filter-by-category): Filtering must be turned off
only when a category filter has been set and this filter is
not empty.
2012-08-21 18:12:16 +02:00
Bastien Guerry 88213fff61 org-agenda.el: Code clean-up
* org-agenda.el (org-search-view, org-agenda-get-todos)
(org-agenda-get-timestamps, org-agenda-get-sexps)
(org-agenda-get-progress, org-agenda-get-deadlines)
(org-agenda-get-scheduled, org-agenda-get-blocks): Use
`category-pos' instead of `org-category-pos'.
2012-08-21 18:01:30 +02:00
Nicolas Goaziou 7ff8c166e6 org-table: Accept comma as a decimal mark to represent numbers
* lisp/org-table.el (org-table-number-regexp): By default, accept
  comma as a decimal mark to represent numbers.
2012-08-21 13:53:57 +02:00
Bastien Guerry c71b0dacb1 Replace "ob-" by "org-babel-" as a prefix for two functions
* ob-fortran.el (org-babel-fortran-transform-list): Rename
from `ob-fortran-transform-list'.
(org-babel-fortran-var-to-fortran): Use the new function's
name.

* ob-calc.el (org-babel-calc-maybe-resolve-var): Rename from
`ob-calc-maybe-resolve-var'.
(org-babel-execute:calc): Use the new function's name.
2012-08-21 13:17:08 +02:00
Bastien Guerry 1b35780196 Add licenses to embedded and external javascript code.
* org-jsinfo.el (org-infojs-template): Add a license.
(org-infojs-handle-options): Replace all template elements.

* org-html.el (org-export-html-scripts): Add a license.
(org-export-html-mathjax-config): Replace all template
elements.
(org-export-html-mathjax-template): Add a license.
(org-export-as-html): Minor code clean-up.
2012-08-21 12:37:32 +02:00
Bastien Guerry 0782bea46e org.el: Add "#+MATHJAX" and "#+INFOJS_OPT" to the list of keywords for completion
* org.el (org-options-keywords): Add "#+MATHJAX" and
"#+INFOJS_OPT" to the list of keywords for completion.
2012-08-21 12:34:02 +02:00
Bastien Guerry 4eb8b05a5b org.el (org-src-prevent-auto-filling): Remove unused and useless option
* org.el (org-src-prevent-auto-filling): Remove unused and
useless option.
2012-08-20 19:22:26 +02:00
Bastien Guerry d6db2566d9 org.el: Autoload `org-element-at-point' instead of requiring org-element it in some commands
* org.el (org-element-at-point): Autoload.
(org-element-up): Remove useless declaration.
(org-fill-context-prefix, org-fill-paragraph)
(org-mark-element, org-narrow-to-element)
(org-transpose-element, org-unindent-buffer): Do not require
org-element.
2012-08-20 13:31:22 +02:00
Nicolas Goaziou 49905a5669 org-element: Fix comment typo
* lisp/org-element.el (org-element-map): Fix comment typo.
2012-08-20 11:21:16 +02:00
Nicolas Goaziou ec9e7ab9c1 org-element: Add a couple of autoload cookies 2012-08-20 10:16:21 +02:00
Bastien Guerry dd7b0aa171 org.el (org-fill-paragraph): Require org-element
* org.el (org-fill-paragraph): Require org-element.
2012-08-20 08:35:54 +02:00
Bastien Guerry 4e5ed3c453 org-agenda.el (org-agenda-persistent-marks): Minor docstring enhancement
* org-agenda.el (org-agenda-persistent-marks): Minor docstring enhancement.
2012-08-20 08:02:36 +02:00
Bastien Guerry b4df37076d Don't use :version "24.3" until Emacs 24.3 is released and/or Org sync'ed in Emacs 2012-08-20 07:49:16 +02:00
Bastien Guerry 8393a76f78 Always use the compatibility function `org-region-active-p'
* org.el (org-create-math-formula): Use the compatibility
function `org-region-active-p'.

* org-odt.el (org-export-as-odf): Ditto.

* ob.el (org-babel-demarcate-block): Ditto.
2012-08-20 05:45:25 +02:00
Bastien Guerry 58a6d823ee org.el: Fix bug in `org-mark-subtree'
* org.el (org-mark-subtree): Maybe call `org-mark-element'
interactively.
(org-mark-element): Only mark further elements when called
interactively.

For example, M-x org-export RET calls `org-mark-subtree' and
should not mark the further element when an element is already
marked.

Thanks To Bernt Hansen for reporting a bug related to this.
2012-08-20 05:40:25 +02:00
Bastien Guerry 7d117bd981 org.el: Add (require 'org-element) for more org-element commands
* org.el (org-mark-element, org-narrow-to-element)
(org-transpose-element): Require org-element.
2012-08-20 04:36:38 +02:00
Bastien Guerry 523f13dd08 org-agenda.el: New 'warntime property for agenda entries
* org-agenda.el (org-agenda-get-timestamps)
(org-agenda-get-sexps, org-agenda-get-deadlines)
(org-agenda-get-scheduled): Add the 'warntime as a text
property, getting its value from the APPT_WARNTIME property.
(org-agenda-to-appt): Use the 'warntime text property.

Thanks to Ivan Kanis for reporting a bug related to this.
2012-08-19 21:48:52 +02:00
Bastien Guerry 92271aecea org-capture.el (org-capture-place-table-line): Fix bug
* org-capture.el (org-capture-place-table-line): Fix bug.

Thanks to Ian Barton for reporting this.
2012-08-19 17:41:01 +02:00
Bastien Guerry de015ad055 Merge branch 'master' of orgmode.org:org-mode
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2012-08-19 16:57:28 +02:00
Bastien Guerry ad35e2ac6c org.el: Don't activate a plain link when it is part of a bracketed link
* org.el (org-activate-plain-links): Don't activate a plain
link when it is part of a bracketed link, unless bracketed
links are not enlisted in `org-activate-links'.
(org-open-at-point): Don't consider the text immediately after
a bracketed link is part of a plain link.

This fixes a bug when fontifying [[http://orgmode.org][Org]]Mode --
where "Mode" should not be fontified, because it is not part of the
bracketed link.

Note that there was another related bug: C-c C-o on "Mode" used to
try opening a plain link.  Also fixed in this commit.
2012-08-19 16:56:52 +02:00
Nicolas Goaziou 2fd696716a Forgot a `save-excursion'
* lisp/org.el (org-fill-paragraph): Add a `save-excursion' to avoid
  returning funny results.
2012-08-19 15:51:55 +02:00
Nicolas Goaziou bb895827c2 Try to be smarter when filling paragraphs in message-mode
* lisp/org.el (org-fill-paragraph): Try not to include message header
  and citation lines in a paragraph when filling it.
2012-08-19 14:46:27 +02:00
Bastien Guerry 655da8d1d3 Remove useless (t nil) sexps at the end of some (cond ...) constructs
* org.el (org-compute-latex-and-specials-regexp)
(org-paste-subtree, org-sort-entries, org-store-link)
(org-open-at-point, org-file-remote-p, org-add-log-setup)
(org-set-tags-to, org-fast-tag-selection)
(org-diary-sexp-entry): Ditto.

* org-agenda.el (org-agenda-get-blocks, org-cmp-priority)
(org-cmp-effort, org-cmp-todo-state, org-cmp-alpha)
(org-cmp-tag, org-cmp-time): Remove useless (t nil) sexps at
the end of (cond ...) constructs.

* org-mobile.el (org-mobile-create-index-file): Ditto.

* org-lparse.el (org-lparse-format-table-row): Ditto.

* org-list.el (org-sort-list): Ditto.

* org-id.el (org-id-get): Ditto.

* org-html.el (org-export-html-preprocess): Ditto.

* org-exp.el (org-default-export-plist)
(org-table-clean-before-export): Ditto.

(t nil) in (cond (...) (...) (t nil)) has no other meaning that to
remind the developer that the cond sexp returns nil in case no condition
is matched.  For several (cond ...) constructs this is obvious from reading
the code.  For others, the reminder might be useful and we leave it.

See the discussion about this on emacs-devel:
http://thread.gmane.org/gmane.emacs.devel/152664
2012-08-19 14:42:54 +02:00
Nicolas Goaziou a3c4e10ac1 Fix filling in in a narrowed buffer
* lisp/org.el (org-fill-paragraph): Fix filling in a narrowed buffer.
(org-fill-context-prefix): Fill prefix doesn't depend on current
narrowing.
* testing/lisp/test-org.el: Add test.
2012-08-19 13:44:00 +02:00
Nicolas Goaziou ecb8fbd7d5 Line with a single hash sign on it is a comment
* lisp/org.el (org-mode): Line with a single hash sign on it is a comment.
2012-08-19 11:07:50 +02:00
Nicolas Goaziou e8046d2f63 Fix comment fontification
* lisp/org.el (org-set-font-lock-defaults): Fix comment fontification.
2012-08-19 10:28:21 +02:00
Bastien Guerry 6309dcae6b org.el: Be more strict about matching option keywords
* org.el (org-options-keywords): Add "TODO".
(org-make-options-regexp): Make the hashtag mandatory for
options and don't allow whitespaces between the hashtag and
the plus sign.
2012-08-19 10:15:59 +02:00
Bastien Guerry f926d9019b org.el: Allow lowercase "#+category" and "#+begin:" dynamic blocks
* org.el (org-refresh-category-properties)
(org-find-dblock, org-dblock-start-re, org-dblock-end-re):
Allow lowercase "#+category" and "#+begin:" dynamic blocks.
2012-08-19 08:48:53 +02:00
Bastien Guerry 788f7da285 org.el: Use case-folding when trying to match clocktables and source blocks contexts
* org.el (org-context): Use case-folding when trying to match
clocktables and source blocks contexts.
2012-08-19 08:26:35 +02:00
Bastien Guerry 62064c73fc org-clock.el: Fix clock overlays bug
* org-clock.el (org-clock-put-overlay): Put the overlay on the
whole headline, not only on the last character.  This fixes a
bug with overlays on headlines ending with a bracketed link.

Thanks to Ryan Kaskel for reporting this.
2012-08-19 08:01:43 +02:00
Bastien Guerry 56b731087e Fix HTML export bug for empty headlines when `org-export-with-priority' is nil
* org-html.el (org-export-as-html): Make sure we always
process a string.

* org-exp.el (org-export-cleanup-toc-line): Always return a
string.

Thanks to Friedrich Delgado for reporting this.
2012-08-18 18:44:56 +02:00
Bastien Guerry 90e9aeeff5 org.el: Fix bug in ̀org-fontify-meta-lines-and-blocks-1'
* org.el (org-fontify-meta-lines-and-blocks-1): Correctly
handle metalines with #+results[...]:.
2012-08-18 17:52:02 +02:00
Bastien Guerry f25baf9e1e org-exp.el: Merge functions for removing tables and source blocks metalines
* org-exp.el (org-export-handle-metalines): Rename from
`org-export-handle-table-metalines'.  Now also handle source
block metalines.
(org-export-res/src-name-cleanup): Delete.
(org-export-preprocess-string): Use
`org-export-handle-metalines'.  Don't use
`org-export-res/src-name-cleanup' anymore.

This fixes a but reported by Feiming Chen, thanks to him.
2012-08-18 17:49:01 +02:00
Bastien Guerry 8d382158e7 org-html.el: Don't include the caption tag for empty captions in HTML export
* org-html.el (org-format-org-table-html): Don't include the
caption tag for empty captions in HTML export.  Keep it in the
DocBook export so that it produces valid DocBook XML.
2012-08-18 16:58:28 +02:00
Nicolas Goaziou 7a1bd94df1 org-element: Fix some code comments 2012-08-18 13:34:27 +02:00