Commit Graph

7127 Commits

Author SHA1 Message Date
Jambunathan K 8a0abc4dc2 org-export-odt-preferred-output-format: Mark string values as safe 2012-09-01 23:59:21 +05:30
Bastien Guerry eed50349bc org-colview.el: Fix several bugs
* org-colview.el (org-columns-goto-top-level): Correctly move
the marker `org-columns-top-level-marker'.
(org-agenda-columns): Don't set
`org-agenda-overriding-columns-format' as a buffer variable,
as we only need it dynamically.
(org-agenda-colview-summarize): Fix a bug in returning the
match string.

(The problem with `org-columns-goto-top-level' was introduced
by the commit 8d9e83.)

Thanks to Hannes Schulz and Jacob Riko who reported this.
2012-08-31 07:56:58 +02:00
Bastien Guerry 93fcfe4d36 org-agenda.el: Fix ̀org-agenda-goto-date' again
* org-agenda.el (org-agenda-span-to-ndays): Make the second
argument `starting-day' optional.
(org-agenda-goto-date): Keep parameters of custom agendas.
2012-08-30 13:23:29 +02:00
Bastien Guerry 4f601b6748 org-agenda.el: Fix compiler warning 2012-08-30 12:11:57 +02:00
Bastien Guerry b78520e149 org-agenda.el: Fix another bug with `org-agenda-goto-date' with sticky agendas
* org-agenda.el (org-agenda-list): Allow setting the agenda
buffer name through a temporary variable.
(org-agenda-buffer-tmp-name): New variable to temporary store
the agenda buffer name.

Thanks to Rainer Stengele for reporting this bug.
2012-08-30 11:52:16 +02:00
Bastien Guerry a2c4d3e0e9 org-agenda.el (org-agenda-goto-date): Fix behavior when using sticky agendas
* org-agenda.el (org-agenda-goto-date): Fix behavior when
using sticky agendas.

Thanks to Charles Philip Chan and Rainer Stengele who reported
problems about this.
2012-08-30 10:56:35 +02:00
Mike Sperber 1e678d8cba XEmacs: Make call to `fill-paragraph' work on XEmacs.
2012-08-25  Michael Sperber  <mike@xemacs.org>

* org.el (org-fill-paragraph): Pass optional argument to
`fill-paragraph' to fix compatibility with XEmacs.
2012-08-30 10:32:54 +02:00
Mats Lidell 8e88bc0e0b org-element.el: Remove illegal t clause in case
* lisp/org-element.el (org-element-paragraph-separate): Remove
redundant and misplaced t clause in case.

TINYCHANGE
2012-08-30 10:25:44 +02:00
Mike Sperber 501db42c8c XEmacs: Default `org-self-insert-cluster-for-undo' also on XEmacs.
2012-08-25  Michael Sperber  <mike@xemacs.org>

	* org.el (org-self-insert-cluster-for-undo): Default
	`org-self-insert-cluster-for-undo' also on XEmacs.
2012-08-30 10:13:52 +02:00
Bastien Guerry b74140e1b0 org-agenda.el: Unconditionnally set ̀org-compile-prefix-format'
* org-agenda.el (org-diary): Don't check whether there is an
agenda buffer when trying to compile the prefix format.
(org-compile-prefix-format): Check if there is an agenda
buffer.  If not, use the current buffer.
2012-08-30 10:10:18 +02:00
Bastien Guerry 92f2e9efb2 org-agenda.el: Fix bug in `org-agenda-get-day-entries'
* org-agenda.el (org-agenda-get-day-entries): Set the agenda
buffer inconditionnally.

For example, when `org-agenda-get-day-entries' is called
through ̀org-diary', we need to make sure `org-agenda-buffer'
is set, otherwise org-diary triggers an error.
2012-08-30 09:52:03 +02:00
Bastien Guerry a740781fe2 ob.el (org-babel-named-src-block-regexp-for-name): Generate a more general regexp
* ob.el (org-babel-named-src-block-regexp-for-name): Generate
a more general regexp.

Thanks to Loris Bennett for reporting this, and to Nicolas Girard for
pointing out what was the problem precisely.
2012-08-30 08:58:02 +02:00
Bastien Guerry 4b3f64fdcc ob.el: Find a src block head correctly when #+header(s) is before #+name
* ob.el (org-babel-where-is-src-block-head): Find a src block
head correctly when #+header(s) is before #+name.
2012-08-30 08:45:50 +02:00
Bastien Guerry 96cef218f0 Clean-up variables declaration
Remove some duplicate declarations.
When the variable is declared in another file,
use (defvar [var]).  When it is dynamically bound
in this file (defvar [var]) is enough, but mixed
installations make (defvar [var] [val]) safer.
2012-08-30 06:39:35 +02:00
Bastien Guerry c1ce6143b7 org-agenda.el: Rename org-finalize-agenda* to org-agenda-finalize*
* org-agenda.el (org-agenda-finalize-hook)
(org-agenda-finalize, org-agenda-finalize-entries): Rename
from org-finalize-agenda-*.
(org-agenda-run-series, org-agenda-finalize, org-timeline)
(org-agenda-list, org-search-view, org-todo-list)
(org-tags-view, org-diary, org-agenda-finalize-entries)
(org-agenda-change-all-lines): Use the new names.
2012-08-30 06:24:22 +02:00
Bastien Guerry 555ffa084d org-agenda.el: Fix initialization of some variables 2012-08-29 20:15:47 +02:00
Muchenxuan Tong e2329cc961 org-timer.el: Check `org-timer-display' in `org-timer-set-mode-line' when value is 'off
* lisp/org-timer.el (org-timer-set-mode-line): Check
`org-timer-display' when value is 'off.

This solves the error of (org-timer-set-mode-line 'off) when
`org-timer-display' is 'mode-line. In this case `frame-title-format'
may not be a list.

TINYCHANGE
2012-08-29 19:54:44 +02:00
Stuart Hickinbottom 4f5bd2522e Fix org-clock evaluation startup hang on Windows
* lisp/org-clock.el (org-x11idle-exists-p): Only shell out when running
on X.

The definition of this variable currently executes "command" via the
shell during evaluation, irrespective of the platform on which
Org-mode is running. Unfortunately, on Windows, this matches the
"command.com" NT Virtual DOS Machine executable and so this gets
launched, but this is a shell and therefore sits there waiting for
user input and never returns. The net result is that Emacs will hang
on Windows when evaluating org-clock.el with the ntdvm.exe process
spinning at 100%.

The simple fix is to check that the platform is X before trying to
deal with the "x11idle" external process.

TINYCHANGE
2012-08-29 19:41:14 +02:00
Bastien Guerry 0455cc2084 org-agenda.el: Rewrite of the redo/change/append commands
* org-agenda.el (org-agenda-local-vars): Remove
̀org-agenda-last-arguments' from the list of local variables.
(org-agenda-mode-map): `g' does the same than `r' in buffers
with only one agenda view, but its behavior differs when there
are several views.  In manually appended agendas (with `A'),
`g' displays only the agenda under the point.  With multiple
agenda blocks, `g' reinitializes the view by discarding any
temporary changes (e.g. with ̀f' or `w'), while ̀r' keeps those
temporary changes for the agenda view under the point.
(org-agenda-run-series, org-agenda-redo): Implement the above
changes.
(org-agenda-mark-header-line): Don't set useless properties.
(org-agenda-list, org-todo-only, org-search-view)
(org-todo-list, org-tags-view, org-agenda-list-stuck-projects)
(org-agenda-manipulate-query, org-agenda-goto-today)
(org-agenda-later, org-agenda-change-time-span): Use text
properties for storing the last command and the last arguments
for each agenda block.
(org-unhighlight-once): Delete.
2012-08-29 19:18:05 +02:00
Bastien Guerry 69e99dff07 org-agenda.el (org-agenda-append-agenda): Fit agenda window to buffer
* org-agenda.el (org-agenda-append-agenda): Fit agenda window
to buffer.
2012-08-29 01:05:34 +02:00
Bastien Guerry db4c1454a3 org-agenda.el: Bugfix: correctly check whether we are in org-agenda-mode
* org-agenda.el (org-agenda-append-agenda): Bugfix: correctly
check whether we are in org-agenda-mode.
2012-08-28 18:47:12 +02:00
Bastien Guerry 04526ae0de org-agenda.el: Fix name of `org-agenda-pre-window-conf'
* org-agenda.el (org-agenda-pre-window-conf): Rename from
`org-pre-agenda-window-conf'.
(org-agenda-local-vars, org-agenda-prepare-window)
(org-agenda-Quit, org-agenda-quit): Use the new name.
2012-08-28 18:29:18 +02:00
Bastien Guerry 5848ac36c8 org-agenda.el: Fix compiler warnings
* org-agenda.el (org-keys, org-match): New variable,
dynamically scoped in `org-agenda'.
(org-agenda, org-agenda-list, org-search-view, org-todo-list)
(org-tags-view): Use the new variables.
(org-batch-store-agenda-views): Let-bind `match'.
2012-08-28 18:26:10 +02:00
Bastien Guerry da9c67a7a5 org-agenda.el: Fix one byte-compiler warning 2012-08-28 15:10:44 +02:00
Bastien Guerry cc9487004d org-agenda.el: `org-search-view', `org-todo-list' and `org-tags-view' use sticky agenda correctly
* org-agenda.el (org-search-view, org-todo-list)
(org-tags-view): Do not let `org-agenda-sticky' prevent the
use of these functions programmatically.  Also use the sticky
agenda function correctly.
2012-08-28 15:06:47 +02:00
Bastien Guerry 38507b0493 org-agenda.el: Set `org-agenda-buffer-name' correctly in `org-agenda'
* org-agenda.el (org-agenda): Set `org-agenda-buffer-name'
correctly with sticky agendas and non-custom commands.
2012-08-28 14:37:49 +02:00
Bastien Guerry d2b807b1a6 Merge branch 'maint' of orgmode.org:org-mode into maint 2012-08-28 13:39:09 +02:00
Bastien Guerry e9fee9cd63 org-agenda.el (org-agenda-fit-window-to-buffer): Rename from `org-fit-agenda-window'
* org-agenda.el (org-agenda-fit-window-to-buffer): Rename from
`org-fit-agenda-window'.
(org-agenda-run-series, org-agenda-prepare, org-agenda-list)
(org-search-view, org-todo-list, org-tags-view): Use the new
name.
2012-08-28 13:36:43 +02:00
Bastien Guerry 29afec9cd0 org-agenda.el (org-agenda-prepare): Let `throw' display an error
* org-agenda.el (org-agenda-prepare): Let `throw' display an
error.
2012-08-28 13:31:52 +02:00
Bastien Guerry 23204aaab7 org-agenda.el: Fix bug in `org-agenda-list'
* org-agenda.el (org-agenda-list): Fix bug: don't throw an
error when called from programs as (org-agenda-list).

Thanks to Rainer Thiel for reporting this bug.
2012-08-28 13:29:37 +02:00
Nicolas Goaziou d58d40f0c8 Externalize filling and comments initializers
* lisp/org.el (org-mode): Call external initalizers.  Now both filling
  code and comments code have their own independant part in org.el.
(org-setup-filling): Renamed from `org-set-autofill-regexps'.
(org-setup-comments-handling): New function.
2012-08-28 13:27:58 +02:00
Bastien Guerry 72f25ccfd9 org-agenda.el (org-todo-list): Make arg optional
* org-agenda.el (org-todo-list): Make arg optional.
2012-08-28 13:17:29 +02:00
Nicolas Goaziou 11f119776a Improve filling
* lisp/org.el (org-fill-paragraph): Refine filling in comments and in
  paragraphs.  Allow commented blank lines.  Take into consideration
  the indentation of the second line of the paragraph being filled.
(org-comment-or-uncomment-region): Rewrite function.  Now comment
region at a fixed column: the minimal indentation of the region.
(org-fill-context-prefix): Rename function into
`org-adaptive-fill-function'. Also, In a paragraph, choose the same
prefix as the current line.
2012-08-28 13:12:09 +02:00
Bastien Guerry a9b8778b0c Code clean-up: rename some agenda internals.
* org.el (org-agenda-prepare-buffers): Rename from
`org-prepare-agenda-buffers'.
(org-match-sparse-tree, org-map-entries): Use the new names.

* org-agenda.el (org-agenda-prepare-window): Rename from
`org-prepare-agenda-window'.
(org-agenda-prepare): Rename from `org-prepare-agenda'.
(org-agenda-run-series, org-agenda-prepare, org-timeline)
(org-agenda-list, org-search-view, org-todo-list)
(org-tags-view, org-agenda-list-stuck-projects, org-diary)
(org-agenda-to-appt): Use the new names.

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

* org-icalendar.el (org-export-icalendar): Ditto.

* org-clock.el (org-dblock-write:clocktable)
(org-dblock-write:clocktable): Ditto.

* org2rem.el (org2rem): Ditto.
2012-08-28 13:11:12 +02:00
Bastien Guerry 89cdbda63e org-agenda.el: Use the current command's match to set the buffer name
* org-agenda.el (org-agenda): In sticky agendas, use the
current command's match to set the buffer name.  This gives
more information to the user and allows to distinguish various
agendas triggered by the same key.
(org-batch-store-agenda-views): Handle the new sticky agenda
buffer name.
2012-08-28 13:02:01 +02:00
Bastien Guerry 9c2b17bac3 org-agenda.el: Use `S' as a key for searching words in TODO-only entries
* org-agenda.el (org-agenda)
(org-agenda-get-restriction-and-command): Use `S' as a key for
searching words in TODO-only entries.
2012-08-28 12:35:05 +02:00
Bastien Guerry 5590972648 org-agenda.el: Fit agenda window when displaying a sticky agenda
* org-agenda.el (org-prepare-agenda): Fit agenda window when
displaying a sticky agenda.
2012-08-27 21:24:23 +02:00
Bastien Guerry 3013b7c5dc org-table.el: Switch back to the old default for `org-table-number-regexp'
* org-table.el (org-table-number-regexp): Allow the user to
set it to a new regexp, which allows commas as decimal mark.
The default is to not use this setting, but the one before
commit 7ff8c1, which has ben reverted.

See the discussion here:
http://thread.gmane.org/gmane.emacs.orgmode/59389
2012-08-27 18:03:05 +02:00
Bastien Guerry 4a508fdfa4 Revert "org-table: Accept comma as a decimal mark to represent numbers"
This reverts commit 7ff8c166e6.
2012-08-27 17:55:18 +02:00
Bastien Guerry 97e4d643a8 Revert "org-table.el: Minor docstring update"
This reverts commit 5d57364256.
2012-08-27 17:55:05 +02:00
Bastien Guerry 424f3ecedb Fix bug when redoing multiple (agenda) blocks.
* org-agenda.el (org-agenda-overriding-cmd)
(org-agenda-multi-current-cmd)
(org-agenda-multi-overriding-arguments): New variables.
(org-agenda-run-series): `org-agenda-overriding-arguments'
defaults to the last agenda block arguments, so don't use it
globally.
(org-agenda-mark-header-line): Add properties needed so that
`org-agenda-overriding-arguments', `org-agenda-current-span'
and `org-agenda-last-arguments' can be set to their correct
contextual value.
(org-agenda-multi-back-to-pos): New variable.
(org-agenda-later): Retrieve `org-agenda-current-span' and
`org-agenda-overriding-arguments' from text properties.  Also
handle numeric span.
(org-agenda-later, org-agenda-change-time-span): Set
`org-agenda-overriding-cmd' so that we to take overriding
arguments into account for this command only.

The behavior for agenda blocks where there is only one (agenda)
command is not changed.  Changing the time span and redoing with
`g' will keep the new time span.  The behavior changed for blocks
where there are multiples (agenda) blocks.  In this case, redoing
will restore the initial view (before any time span change) and
changing the time span is done independantly for each block.

Thanks to Charles Philip Chan for reporting this nasty bug.
2012-08-27 17:52:22 +02:00
Nicolas Goaziou 857b980515 Fix commit 40084a55d1
* lisp/org-exp.el (org-export-handle-comments): Also remove comments
  at column 0.
2012-08-27 12:13:25 +02:00
Nicolas Goaziou 40084a55d1 org-exp: Handle inline comments with new syntax
* lisp/org-exp.el (org-export-handle-comments): Handle inline comments
  with new syntax.
2012-08-27 11:21:52 +02:00
Nicolas Goaziou 805a9f019d Add missing colon to #+INCLUDE in structure template
* lisp/org.el (org-structure-template-alist): Add missing colon to
  #+INCLUDE.
2012-08-27 09:11:01 +02:00
Nicolas Goaziou 664132667b Fix org-backward-element with point on first element in section
* lisp/org.el (org-backward-element): When called at the beginning of
  first element in section, the function shouldn't return an error but
  move point to headline or point-min instead.
* testing/lisp/test-org.el: Add test.
2012-08-26 23:44:51 +02:00
Bastien Guerry 3404ac84ec Move `org-toggle-sticky-agenda' again and autoload it
The previous related commit was to prevent an error
when M-x org-reload RET was reloading org files from
an ELPA directory.  We now autoload the function so
that it is know by the time org-reload might be called.
2012-08-26 23:44:49 +02:00
Bastien Guerry 290a035bfc Fix compiler warning. 2012-08-26 23:43:30 +02:00
Bastien Guerry d832837693 org-agenda.el: Define `org-toggle-sticky-agenda' before calling it 2012-08-26 23:24:40 +02:00
Bastien Guerry 4bde726bbb * org-compat.el (org-check-version): Autoload. 2012-08-26 20:04:41 +02:00
Sean O'Halpin 4b6b6f4799 Make it possible to use buffer local noweb start/end patterns
* lisp/ob.el (org-babel-expand-noweb-references): Capture current
noweb start and end patterns then use to set buffer locals in
(with-temp-buffer) form.

This solves the problem that using different patterns for
org-babel-noweb-wrap-start and org-babel-noweb-wrap-end could be done
only globally.

TINYCHANGE
2012-08-26 19:26:01 +02:00
Achim Gratz bf352eceda Rename utils/ to mk/, move some files to mk/ and make the requisite changes throughout
* Makefile: Include default.mk and targets.mk from mk/ where they've
  been moved to.

* README_maintainer: Rename utils to make throughout.

* doc/Makefile: Rename utils to make throughout.

* doc/org.texi: Remove reference to utils/, x11idle.c is now in
  contrib/scripts.

* mk/make_emacs_changelog: Add mk/ to list of directories not to be
  reported in Emacs' ChangeLog.  Also retain utils/ and re-add
  UTILITIES; add a comment explaining why these need to stay.

* mk/default.mk: Rename utils to make throughout.  Include version.mk
  from mk/ where it's been moved to.

* mk/targets.mk: Rename utils to make throughout.

* mk/server.mk: Rename utils to make throughout.  Only put those files
  from mk/ into the archives that are needed outside the server:
  default.mk targets.mk version.mk and org-fixup.el.

* lisp/org-compat.el: Rename utils to make throughout.

* .gitignore:  Rename utils to make throughout.
2012-08-26 15:27:19 +02:00
Bastien Guerry d85e7bc10a org-agenda.el: Fix bug when calling `org-agenda-kill' and `org-agenda-archive-with' with a non-nil value of `org-agenda-stick'
* org-agenda.el (org-agenda-kill, org-agenda-archive-with):
Fix bug when called with a non-nil value of `org-agenda-stick'.

Thanks to Moritz Ulrich for reporting this.
2012-08-26 14:53:59 +02:00
Bastien Guerry 74d1658c60 org-agenda.el (org-agenda-refile): Fix bug when refiling an sticky agenda entry
* org-agenda.el (org-agenda-refile): Fix bug when refiling an
entry from a sticky agenda.

Thanks a lot to Moritz Ulrich for reporting this.
2012-08-26 11:20:02 +02:00
Nicolas Goaziou 11082518ee org-element: Tiny refactoring
* lisp/org-element.el (org-element-paragraph-parser): Tiny refactoring.
2012-08-25 23:45:14 +02:00
Nicolas Goaziou 3113c5fce9 org-element: Small code comment clean-up
* lisp/org-element.el (org-element-paragraph-parser): Remove trailing
  code comments.
2012-08-25 23:30:29 +02:00
Nicolas Goaziou 90f6324dbf Add missing part from commit b4604d2833
* lisp/org.el (org-fill-context-prefix): Fix incorrect output when
  called at the beginning of a plain list with an affiliated keyword.
(org-fill-paragraph): Remove useless variable.
2012-08-25 15:41:01 +02:00
Nicolas Goaziou b4604d2833 org-element: Fix filling bug in a list with affiliated keyword
* lisp/org-element.el (org-element-paragraph-parser): Fix parsing of
   paragraph at the beginning of an item.
* testing/lisp/test-org-element.el: Add test.
2012-08-25 15:27:01 +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
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 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