Commit Graph

849 Commits

Author SHA1 Message Date
Carsten Dominik 820a36f66c Implement proper handling of agenda markers when using sticky agendas
* lisp/org-agenda.el (org-toggle-sticky-agenda): Kill all agenda buffers
when toggling sticky-agendas.
(org-agenda-get-restriction-and-command): Add `C-c a C-k' as a key to
explicitly kill all agenda buffers.
(org-agenda-run-series): Remove any old agenda markers in the buffer
that is going to take the new block agenda.
(org-prepare-agenda): Reset markers before erasing the buffer anc
running `org-agenda-mode', because after that hte local variable
`org-agenda-markers' will have gone away.
(org-agenda-Quit):
(org-finalize-agenda): Install the marker resetter into
the `kill-buffer-hook'.
(org-agenda-save-markers-for-cut-and-paste): Look for markers in all
agenda buffers.
(org-agenda-kill-all-agenda-buffers): New function.
2012-03-09 09:33:46 +01:00
Carsten Dominik d4cd88bfe5 Merge branch 'master' into max-sticky-agenda 2012-03-09 05:37:35 +01:00
Bastien Guerry b879590f3b Merge branch 'maint' 2012-03-08 13:50:51 +01:00
Adam Spiers 11e441e85f Fix typos 2012-03-08 13:50:19 +01:00
Carsten Dominik 79472e466f Merge branch 'master' into max-sticky-agenda 2012-03-06 07:30:16 +01:00
Carsten Dominik bc608605ca Remove another commented line 2012-03-05 10:37:05 +01:00
Carsten Dominik 1f613bb011 Remove a commented line 2012-03-05 10:32:56 +01:00
Carsten Dominik b40226a597 Test commit on new branch 2012-03-05 10:19:16 +01:00
David Maus 21c7ad67cf Merge branch 'maint'
org-bbdb in master already contained declare-function for external
bbdb-functions.

Conflicts:
	lisp/org-bbdb.el
2012-03-04 20:53:05 +01:00
Karl Fogel 1749db14fb org-agenda: Handle case of heading w/ date but no keyword
* lisp/org-agenda.el (org-agenda-highlight-todo): Handle the case of a
  heading that has a date but no todo keyword.

This is a fix for the args-out-of-range bug discussed in these threads:

  http://thread.gmane.org/gmane.emacs.orgmode/52621
  http://thread.gmane.org/gmane.emacs.orgmode/52793
  http://thread.gmane.org/gmane.emacs.orgmode/52786
  http://thread.gmane.org/gmane.emacs.orgmode/52810

The discussions involved Ilya Shlyakhter, James Atwood, Nick Dokos,
and myself, and the subject headers are:

  bug report: agenda timeline crashes
  Bug report: weekly agenda and blank, timestamped headers
  org-agenda-list (from git) giving "args-out-of-range error"

TINYCHANGE
2012-03-04 20:13:05 +01:00
Max Mikhanosha ed0859969b Fix exiting sticky agenda refresh with C-g, was forgetting what kind of agenda it was 2012-03-03 11:04:12 -05:00
Max Mikhanosha 1b3dc456e4 Automatically name sticky agenda buffers with keys used to invoke it, patch
by Carsten Dominik
2012-03-03 08:57:32 -05:00
Max Mikhanosha 1bbf87a968 Apply Carsten's patch to prune org-agenda-local-vars list 2012-03-02 11:40:54 -05:00
Max Mikhanosha 68f802ca72 Re-create mulitple-agenda-buffers support, to avoid git rebase hell 2012-03-01 10:49:23 -05:00
David Maus 2adf4b059b Merge branch 'maint' 2012-02-25 11:13:58 +01:00
David Maus 89949e69a3 org-agenda: Fix handling of indirect buffer and window
* org-agenda.el (org-agenda-tree-to-indirect-buffer): Fix handling of
indirect buffer and window.

Check if the window of last indirect buffer is still live and properly
handle the case of `org-last-indirect-buffer' being nil.

Changes suggested by Dave Abrahams in <m2boow1q9e.fsf@boostpro.com>.
2012-02-25 11:13:33 +01:00
Bastien Guerry d5ca0780f9 Fix typos and spelling mistakes.
Thanks to Paul Eggert for this fixes in Emacs trunk.
2012-02-19 08:23:42 -07:00
Bastien Guerry 04971de4b9 Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1)
* org-exp.el (org-export-kill-product-buffer-when-displayed)
(org-export-initial-scope, org-export-date-timestamp-format)
(org-export-with-tasks, org-export-email-info)
(org-export-table-remove-empty-lines): Add version tag.

* org-mobile.el (org-mobile-files-exclude-regexp)
(org-mobile-use-encryption, org-mobile-encryption-tempfile)
(org-mobile-encryption-password, org-mobile-agendas): Add
version tag.

* ob-plantuml.el (org-plantuml-jar-path): Add version tag.

* org.el (org-babel-load-languages, org-clone-delete-id)
(org-log-buffer-setup-hook)
(org-loop-over-headlines-in-active-region)
(org-use-sub-superscripts, org-startup-with-beamer-mode)
(org-startup-with-inline-images, org-ctrl-k-protect-subtree)
(org-catch-invisible-edits)
(org-link-search-must-match-exact-headline)
(org-confirm-shell-link-not-regexp)
(org-confirm-elisp-link-not-regexp, org-log-refile)
(org-refile-use-cache)
(org-refile-active-region-within-subtree)
(org-todo-repeat-to-state, org-get-priority-function)
(org-agenda-jump-prefer-future)
(org-read-date-force-compatible-dates)
(org-use-effective-time)
(org-complete-tags-always-offer-all-agenda-tags)
(org-properties-postprocess-alist)
(org-format-latex-signal-error)
(org-latex-to-mathml-jar-file)
(org-latex-to-mathml-convert-command)
(org-export-latex-default-packages-alist)
(org-hidden-keywords, org-pretty-entities)
(org-pretty-entities-include-sub-superscripts)
(org-src-fontify-natively, org-effort-durations)
(org-speed-command-hook): Add version tag.

* org-html.el (org-export-html-footnote-separator)
(org-export-html-mathjax-options)
(org-export-html-mathjax-template)
(org-export-html-headline-anchor-format)
(org-export-html-preamble-format)
(org-export-html-postamble-format)
(org-export-html-table-align-individual-fields)
(org-export-html-protect-char-alist, org-export-html-divs):
Add version tag.

* org-ctags.el (org-ctags-path-to-ctags)
(org-ctags-open-link-functions)
(org-ctags-new-topic-template): Add version tag.

* ob-exp.el (org-export-babel-evaluate): Add version tag.

* org-beamer.el (org-beamer-use-parts)
(org-beamer-frame-level, org-beamer-frame-default-options)
(org-beamer-column-view-format, org-beamer-themes)
(org-beamer-environments-extra, org-beamer-fragile-re)
(org-beamer-outline-frame-title)
(org-beamer-outline-frame-options): Add version tag.

* org-wl.el (org-wl-link-remove-filter)
(org-wl-shimbun-prefer-web-links)
(org-wl-nntp-prefer-web-links, org-wl-disable-folder-check)
(org-wl-namazu-default-index): Add version tag.

* org-clock.el (org-task-overrun-text)
(org-clocktable-defaults, org-clock-clocktable-formatter)
(org-clock-clocktable-language-setup)
(org-clock-report-include-clocking-task)
(org-clock-resolve-expert): Add version tag.

* ob-lob.el (org-babel-lob-files): Add version tag.

* org-freemind.el (org-freemind-node-css-style): Add version
tag.

* org-archive.el (org-archive-reversed-order)
(org-archive-subtree-add-inherited-tags): Add version tag.

* org-bibtex.el (org-bibtex-autogen-keys, org-bibtex-prefix)
(org-bibtex-treat-headline-as-title)
(org-bibtex-export-arbitrary-fields)
(org-bibtex-key-property, org-bibtex-tags)
(org-bibtex-tags-are-keywords, org-bibtex-no-export-tags)
(org-bibtex-type-property-name): Add version tag.

* org-timer.el (org-timer-default-timer): Add version tag.

* org-taskjuggler.el (org-export-taskjuggler-extension)
(org-export-taskjuggler-project-tag)
(org-export-taskjuggler-resource-tag)
(org-export-taskjuggler-target-version)
(org-export-taskjuggler-default-project-version)
(org-export-taskjuggler-default-project-duration)
(org-export-taskjuggler-default-reports)
(org-export-taskjuggler-default-global-properties): Add
version tag.

* org-habit.el (org-habit-today-glyph)
(org-habit-completed-glyph): Add version tag.

* org-list.el (org-alphabetical-lists)
(org-list-ending-method, org-list-end-regexp)
(org-list-automatic-rules, org-list-use-circular-motion)
(org-list-indent-offset): Add version tag.

* ob-picolisp.el (org-babel-picolisp-cmd): Add version tag.

* org-icalendar.el (org-icalendar-alarm-time)
(org-icalendar-combined-description)
(org-icalendar-honor-noexport-tag)
(org-icalendar-date-time-format): Add version tag.

* org-src.el (org-src-tab-acts-natively): Add version tag.

* org-exp-blocks.el (org-export-blocks-postblock-hook): Add
version tag.

* org-table.el (org-table-exit-follow-field-mode-when-leaving-table)
(org-table-fix-formulas-confirm)
(org-table-duration-custom-format)
(org-table-formula-field-format): Add version tag.

* org-publish.el (org-publish-sitemap-sort-files)
(org-publish-sitemap-sort-folders)
(org-publish-sitemap-sort-ignore-case)
(org-publish-sitemap-date-format)
(org-publish-sitemap-file-entry-format): Add version tag.

* ob-js.el (org-babel-js-cmd): Add version tag.

* org-docbook.el (org-export-docbook-footnote-separator)
(org-export-docbook-xslt-stylesheet): Add version tag.

* org-entities.el (org-entities-ascii-explanatory)
(org-entities-user): Add version tag.

* ob.el (org-confirm-babel-evaluate)
(org-babel-no-eval-on-ctrl-c-ctrl-c): Add version tag.

* ob-tangle.el (org-babel-tangle-lang-exts)
(org-babel-post-tangle-hook, org-babel-pre-tangle-hook)
(org-babel-tangle-body-hook)
(org-babel-tangle-comment-format-beg)
(org-babel-tangle-comment-format-end)
(org-babel-process-comment-text): Add version tag.

* org-gnus.el (org-gnus-nnimap-query-article-no-from-file):
Add version tag.

* org-crypt.el (org-crypt-disable-auto-save): Add version tag.

* org-inlinetask.el (org-inlinetask-default-state): Add
version tag.

* ob-scheme.el (org-babel-scheme-cmd): Add version tag.

* ob-lisp.el (org-babel-lisp-dir-fmt): Add version tag.

* org-attach.el (org-attach-store-link-p): Add version tag.

* org-capture.el (org-capture-templates)
(org-capture-before-finalize-hook)
(org-capture-after-finalize-hook): Add version tag.

* org-agenda.el (org-agenda-skip-deadline-prewarning-if-scheduled)
(org-agenda-time-leading-zero, org-agenda-follow-indirect)
(org-agenda-menu-two-column, org-agenda-menu-show-matcher)
(org-agenda-timegrid-use-ampm)
(org-agenda-remove-timeranges-from-blocks)
(org-agenda-inactive-leader, org-agenda-current-time-string)
(org-agenda-show-current-time-in-grid)
(org-agenda-search-view-force-full-words)
(org-agenda-search-view-always-boolean)
(org-agenda-clock-consistency-checks)
(org-agenda-include-deadlines)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-day-face-function)
(org-agenda-category-icon-alist)
(org-agenda-bulk-custom-functions)
(org-agenda-insert-diary-extract-time): Add version tag.

* org-latex.el (org-export-latex-inputenc-alist)
(org-export-latex-tag-markup)
(org-export-latex-timestamp-inactive-markup)
(org-export-latex-href-format)
(org-export-latex-hyperref-format)
(org-export-latex-footnote-separator)
(org-export-latex-quotes)
(org-export-latex-table-caption-above)
(org-export-latex-listings-w-names)
(org-export-latex-minted-langs)
(org-export-latex-listings-options)
(org-export-latex-minted-options)
(org-latex-default-figure-position, org-export-pdf-logfiles):
Add version tag.

* org-faces.el (org-faces-easy-properties)
(org-fontify-quote-and-verse-blocks, org-cycle-level-faces):
Add version tag.

* ob-ditaa.el (org-ditaa-jar-option): Add version tag.

Thanks to Glenn Morris for reporting this.
2012-02-13 15:49:28 +01:00
Bastien Guerry c74fe88c01 org-agenda.el: Allow `C-u' to display the item without unfolding drawers and logbooks.
* org-agenda.el (org-agenda-show-and-scroll-up): Allow `C-u'
to display the item without unfolding drawers and logbooks.
2012-01-24 17:03:03 +01:00
Bastien Guerry 95e71f5705 Revert "Honour existing restrictions when visiting tasks from the agenda"
This reverts commit 8f93a75cac.
2012-01-19 16:21:50 +01:00
Bastien Guerry 9b9f2d0d8d Revert "Honour existing restrictions when clocking in from the agenda"
This reverts commit c41a6f5a33.
2012-01-19 16:20:07 +01:00
Bernt Hansen 8f93a75cac Honour existing restrictions when visiting tasks from the agenda
* lisp/org-agenda.el (org-agenda-switch-to): Widen org buffer only if point is
  outside the current restriction

Widen org buffer when visiting from agenda only if point is outside
current restriction.

Visiting a task with RET or TAB in the agenda should not affect the
org-mode buffer restriction unless the target task is not currently
visible due to the restriction.
2012-01-11 16:42:35 +01:00
Bernt Hansen c41a6f5a33 Honour existing restrictions when clocking in from the agenda
* lisp/org-agenda.el (org-agenda-clock-in): Save restriction when clocking in from the agenda

Narrowed org buffers are now retained when clocking in from the agenda.
We only widen the buffer when the task to clock in is outside the existing
restriction.
2012-01-11 16:42:34 +01:00
Bastien Guerry a9c15fe9ab Don't create an alias for `list-diary-entries-hook'.
This is already taken care of by emacs/lisp/calendar/diary-lib.el
See comments in commit d6e40f.
2012-01-11 08:52:37 +01:00
Bastien Guerry d6e40fb347 Create an alias for `list-diary-entries-hook'.
* org-agenda.el: New alias for `list-diary-entries-hook'.

* org.el (org-babel-load-languages): Use "LaTeX".
2012-01-10 21:19:44 +01:00
Bastien Guerry fadca5e8eb Fix typos and spelling mistakes.
Thanks to Paul Eggert for this fixes in Emacs trunk.
2012-01-10 11:56:15 +01:00
Bastien Guerry 40ea26e7a6 Silent compiler warning. 2012-01-05 17:42:08 +01:00
Bastien Guerry 5eb414281d Fix compiler warning and define an alias for `org-agenda-filter'.
* org-agenda.el: Add an alias for `org-agenda-filter'.
(diary-list-entries-hook): Use the non-obsolete hook.
(org-agenda-filter-apply): Silent compiler warning.
2012-01-04 16:36:46 +01:00
Bastien Guerry e44d2975ff Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
Bastien Guerry b73075a8d2 Code cleanup up: rename org-on-*-p to org-at-*-p.
Rename `org-on-heading-p' and `org-on-target-p' to
`org-at-heading-p' and `org-at-target-p' to be more
consistent with the org-at-*-p family.

Also define two aliases.
2012-01-02 19:52:35 +01:00
Bastien Guerry 8c36e92f88 Implement category filtering.
* org-agenda.el (org-agenda-filter-preset): New alias.
(org-agenda-filter-by-category): New command.
(org-agenda-mode-map): Add the new command.
(org-agenda-custom-commands-local-options): Add category
filter preset.
(org-agenda-mark-filtered-text): Mark both tag and filter
overlays.
(org-agenda-category-filter-preset): New variable.
(org-finalize-agenda, org-agenda-redo)
(org-agenda-filter-make-matcher, org-agenda-filter-apply):
Handle both category and tag filters.
(org-agenda-filter-show-all-tag): Rename from
`org-agenda-filter-by-tag-show-all'.
(org-agenda-filter-show-all-cat): New function.
(org-agenda-set-mode-name): Show the category filter in the
modeline.

* org-faces.el (org-agenda-filter-category): New face.

* org.texi (Agenda commands): Update documentation about the
new category filtering feature.

This feature has been requested by several people -- thanks
to all of them for mentioning this possibility.
2011-12-31 17:10:44 +01:00
Carsten Dominik 4e0fe88f7e Merge branch 'master' of orgmode.org:org-mode 2011-12-31 15:24:14 +01:00
Carsten Dominik 21e99fedc4 Revert "Honour existing restrictions when clocking in from the agenda"
This reverts commit fc1f01c54e.
2011-12-31 15:23:43 +01:00
Carsten Dominik a954f0e01a Revert "Honour existing restrictions when visiting tasks from the agenda"
This reverts commit 31d003ad28.
2011-12-31 15:23:23 +01:00
Bastien Guerry 112d128180 org-agenda.el: Small code cleanup.
* org-agenda.el (org-batch-agenda, org-batch-agenda-csv):
Remove deleted function `org-encode-for-stdout'.
2011-12-31 13:31:02 +01:00
Bastien Guerry 855213f481 Rename `org-write-agenda' to `org-agenda-write'.
* org-agenda.el (org-agenda-write): Rename from
`org-write-agenda'.
(org-agenda-mode-map, org-agenda-menu)
(org-batch-store-agenda-views): Use new name
`org-agenda-write'.
2011-12-31 12:45:05 +01:00
Bastien Guerry e9633aeb45 org-agenda.el: Use `read-char-exclusive' instead of `read-char'.
* org-agenda.el (org-agenda-filter-by-tag): Use
`read-char-exclusive' instead of `read-char'.
2011-12-31 11:45:54 +01:00
Bastien Guerry 6b5c0bd0b6 Merge branch '2-org-agenda-write-buffer-name' 2011-12-31 09:29:09 +01:00
Bernt Hansen 31d003ad28 Honour existing restrictions when visiting tasks from the agenda
* lisp/org-agenda.el (org-agenda-switch-to): Widen org buffer only if point is
  outside the current restriction

Widen org buffer when visiting from agenda only if point is outside
current restriction.

Visiting a task with RET or TAB in the agenda should not affect the
org-mode buffer restriction unless the target task is not currently
visible due to the restriction.
2011-12-31 09:10:36 +01:00
Bernt Hansen fc1f01c54e Honour existing restrictions when clocking in from the agenda
* lisp/org-agenda.el (org-agenda-clock-in): Save restriction when clocking in from the agenda

Narrowed org buffers are now retained when clocking in from the agenda.
We only widen the buffer when the task to clock in is outside the existing
restriction.
2011-12-31 09:10:25 +01:00
Bastien Guerry 81f907c9f9 New variable `org-agenda-write-buffer-name'.
* org-agenda.el (org-agenda-write-buffer-name): New variable.
(org-write-agenda): Use it.

Setting this variable through `org-agenda-exporter-settings' can
be useful -- thanks to Konstantin Ziegler for mentioning this need.
2011-12-28 18:07:35 +01:00
Bastien Guerry dc1c9567b1 `org-agenda-do-tree-to-indirect-buffer': rewrite of the docstring. 2011-12-12 17:40:34 +01:00
Dave Abrahams 35d6d9f505 Maintain stable window config when `org-agenda-follow-indirect' is set.
* org-agenda.el (org-agenda-do-tree-to-indirect-buffer): New
function.
(org-agenda-tree-to-indirect-buffer): Use the new function.

TINYCHANGE

Without this change, `org-agenda-follow-indirect' tends to cause the
window configration to bounce around chaotically as you move from item
to item.
2011-12-12 17:37:16 +01:00
Bastien Guerry 5935f04289 org-agenda.el: small indentation fix. 2011-12-12 17:23:44 +01:00
Sebastien Vauban bfe779fe67 Add faces for "calendar events" (active timestamps, or S-expressions).
* org-agenda.el (org-agenda-get-timestamps)
	(org-agenda-get-sexps): Use face for highlighting "calendar"
	events.

	* org-faces.el: Add faces `org-agenda-calendar-event' and
	`org-agenda-calendar-sexp'.
2011-12-11 18:46:28 +01:00
Rob Giardina a42be4b0c0 Fix quoting in org-agenda-with-point-at-orig-entry.
* org-agenda.el (org-agenda-with-point-at-orig-entry): Small
bugfix.

TINYCHANGE
2011-12-11 14:47:25 +01:00
Bastien Guerry 4916e1d401 org-agenda.el (org-agenda-dim-blocked-tasks): Fix typo.
* org-agenda.el (org-agenda-dim-blocked-tasks): Fix typo.

Thanks to Paul Eggert for spotting this and fixing it in Emacs trunk.
2011-11-28 15:24:50 +01:00
Carsten Dominik b43c1c621f Fix function call order in previous patch
* lisp/org-agenda.el (org-agenda-get-todos): Swap calls to `org-trim' and
`buffer-substring'.
2011-11-14 08:35:12 +01:00
Nicolas Goaziou 57caa09106 org-agenda: Do not break TODO list view with empty tasks
* lisp/org-agenda.el (org-agenda-get-todos): Prevent an error when
  encountering tasks with only the TODO keyword.
2011-11-14 00:43:02 +01:00
Bastien Guerry 3267c69ccd Small improvements over the previous commit.
Use org-propertize instead of propertize and
use a better default for tags in the mode-line
when filtering.
2011-10-29 13:23:20 +02:00
Sebastien Vauban 639699518a Add custom face for highlighting tags used in agenda filtering.
* org-agenda.el (org-agenda-set-mode-name): Highlight tags
used for filtering (shown in the mode-line).

* org-faces.el: Add face `org-agenda-filter-tags'.
2011-10-29 13:19:41 +02:00
Bastien Guerry 728611fa77 Fix compiler warnings. 2011-10-28 17:26:22 +02:00
Bastien Guerry ef08850783 * org-agenda.el (calendar-check-holidays): Declare function.
Thanks to Achim Gratz for spotting this.
2011-10-28 16:53:36 +02:00
Matt Lundin 87fc97d131 Fix holidays symbol in org-class
* lisp/org-agenda.el: (org-class): Fix holidays symbol in org-class.
  This was resulting in an "Bad sexp..." warning.
2011-10-28 15:14:12 +02:00
Carsten Dominik 8444207d3e Make `diary-class' skip hlidays if the user asks for it.
* lisp/org-agenda.el (org-class): Allow holidays to be skipped.
2011-10-25 16:07:01 +02:00
Carsten Dominik 4e33bfb83a Mark `org-diary-class obsolete' 2011-10-25 16:00:06 +02:00
Peter Münster 68ffb7a7cc Agenda: Allow filter list without category in org-agenda-to-appt
* lisp/org-agenda.el (org-agenda-to-appt): Make sure filter-items are
strings before calling `string-match'.

Now it's possible to use (org-agenda-to-appt t '((headline "string"))).

TINYCHANGE
2011-10-24 23:43:58 +02:00
Bastien Guerry db04ef7498 org-agenda.el (org-agenda-to-appt): Better filtering.
* org-agenda.el (org-agenda-to-appt): Allow to refine the
scope of entries to pass to `org-agenda-get-day-entries' and
allow to filter out entries using a function.

Thanks to Peter Münster for raising a related issue and to
Tassilo Horn for this idea.
2011-10-23 23:21:34 +02:00
Bastien Guerry ba2d84b5f9 Merge branch 'master' of orgmode.org:org-mode 2011-10-23 23:03:03 +02:00
Bastien Guerry bc29a5c7ab Silence byte-compiler. 2011-10-23 22:45:53 +02:00
Nicolas Goaziou dc62cdcdf1 org-agenda: Fix small display bug.
* lisp/org-agenda.el: Fix small display bug.
2011-10-23 22:42:48 +02:00
Nicolas Goaziou dfcb6faef1 Provide more consistent regexps for headlines
* lisp/org-agenda.el (org-search-view): Simplify regexp.
(org-agenda-get-todos): Use new format string.
* lisp/org-archive.el (org-archive-all-done): Simplify regexp.
* lisp/org-ascii.el (org-export-as-ascii): More accurate regexp.
* lisp/org-colview-xemacs.el (org-columns-capture-view): Use new
  format string and new string.
* lisp/org-colview.el (org-columns-capture-view): Use new format
  string and new string.
* lisp/org-docbook.el (org-export-as-docbook): More accurate
  regexp.  Also use new regexp to match generic headlines.
* lisp/org-exp.el (org-export-protect-quoted-subtrees): More accurate
  regexp.  Also use new regexp to match generic headlines.
* lisp/org-html.el (org-export-as-html): More accurate regexp.  Also
  use new regexp to match generic headlines.
* lisp/org-mouse.el (org-mouse-match-todo-keyword): Removed unused
  and now erroneous function.
* lisp/org.el (org-heading-regexp, org-heading-keyword-regexp-format):
  New variables.
(org-set-regexps-and-options): Create regexps according to the
following rule: use spaces only to separate elements from an headline,
while allowing mixed tabs and spaces for any indentation job.
(org-nl-done-regexp, org-looking-at-done-regexp): Removed variables.
(org-set-font-lock-defaults): Fontify again headlines with a keyword
and no other text.  Use new format strings.
(org-get-heading, org-toggle-comment, org-prepare-agenda-buffers,
org-toggle-fixed-width-section): Use new format string.
(org-todo): More accurate regexps.
(org-point-at-end-of-empty-headline): Simplify regexp.
(org-insert-heading): Headline can sometimes be nil.

This patch attempts to reduce the number of hard-coded headlines, by
providing two format strings and one generic string to cover most of
the cases of headline construction.
2011-10-23 09:30:13 +02:00
David Maus 440ec7e2da Avoid conflict between bulk command and loop-over-headlines
* org-agenda.el (org-agenda-bulk-action): Bind
`org-loop-over-headlines-in-active-region' to nil to avoid conflict
with bulk command.
2011-10-22 16:20:44 +02:00
Bastien Guerry da5a68a0bc Rename `org-format-agenda-item' to `org-agenda-format-item'.
* org.el (org-format-agenda-item, org-scan-tags): Rename
`org-format-agenda-item' to `org-agenda-format-item'.

* org-agenda.el (org-search-view)
(org-get-entries-from-diary, 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)
(org-agenda-format-item, org-agenda-add-time-grid-maybe)
(org-agenda-change-all-lines)
(org-agenda-add-entry-to-org-agenda-diary-file): Rename
`org-format-agenda-item' to `org-agenda-format-item'.

Using the `org-agenda-' prefix makes more sense here.
2011-10-22 15:08:33 +02:00
Bastien Guerry e0c1855dba Silent byte-compiler about `category-pos'.
* org-agenda.el: Replace `category-pos' by `org-category-pos'
to silent byte-compiler.
2011-10-22 15:04:33 +02:00
Tassilo Horn 4bbdfd229d Replace org-mode-p with usual (eq major-mode 'org-mode) check
Additionally, replace one

  (or (org-mode-p) (derived-mode-p 'org-mode))

with

  (derived-mode-p 'org-mode)

cause that is reflexive anyway (returns true, if the current mode is
org-mode).

Delete one check testing for org-mode or org derived mode
2011-10-22 11:29:24 +02:00
Bastien Guerry 989b079dd7 org-agenda.el (org-agenda-list-stuck-projects): Fix tiny bug.
* org-agenda.el (org-agenda-list-stuck-projects): Fix tiny bug.

This bug was introduced by a typo in Michael's patch for XEmacs
compatibility.
2011-10-22 10:13:11 +02:00
Carsten Dominik 0c8b9711a3 Agenda: Add missing option, document time stamp movement to future
* lisp/org-agenda.el (org-agenda-move-date-from-past-immediately-to-today):
New option.
(org-agenda-date-later): Improve the logical structure.

* doc/org.texi (Agenda commands): Document that S-right on a line
representing a past date will immediately shift that date to today.
2011-10-22 08:39:54 +02:00
Carsten Dominik 54a9cb0d99 Maintain XEmacs compatibility
* lisp/ob-calc.el (featurep): Require calc-store.
* lisp/org-agenda.el (org-agenda-list-stuck-projects): Fix regexp
special handling.
* lisp/org-compat.el (fboundp): Support for XEmacs.
* lisp/org-exp.el (org-export): Protect XEmacs from `(redisplay)' call.
* lisp/org-footnote.el (org-footnote-re): Optimize macro processing.
* lisp/org.el (org-set-autofill-regexps): Xemacs compatibility.

Patch by Michael Sperber, checked and slightly modified by Carsten.
2011-10-21 22:36:53 +02:00
Leo 5e67e9d824 Check if marker is valid before use
* lisp/org-agenda.el (org-agenda-do-context-action): Check if marker
is valid before use.
2011-10-21 10:09:40 +02:00
Carsten Dominik 7caa7e1ff7 Fix shifting of data ranges.
* lisp/org-agenda.el (org-agenda-date-later): Fix shifting of date ranges.

Patch based on code by Niels Giesen.
TINYCHANGE
2011-10-21 10:07:02 +02:00
Carsten Dominik f20eef318e Agenda: New behaviour when shifting scheduled date forward.
* lisp/org-agenda.el (org-agenda-date-later): Make pushing forward
a past date to jump immedialtely to today.
2011-10-16 11:09:45 +02:00
Carsten Dominik 468aa115ef Merge branch 'master' of orgmode.org:org-mode 2011-10-08 09:02:36 +02:00
Dave Abrahams e53f62eba9 Add indirect agenda follow mode
* lisp/org-agenda.el (org-agenda-follow-indirect): New option.
(org-agenda-follow-mode): Call `org-agenda-do-context-action' fro
follow mode.
(org-agenda-do-context-action): Also do indirect follow mode action.

By setting `org-agenda-follow-indirect' to a non-nil value,
`org-agenda-follow-mode' will use an indirect buffer to display only
the current item, rather than the whole agenda file in which it lives
2011-10-08 09:01:50 +02:00
niels giesen 3d83564b7d Time range end in agenda view not displayed
Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> writes:

> michael holzer <michi_holzer_news@gmx.at> writes:
>
>> When I have an entry that contains a time range, for example:
>>
>> * timerange
>>   <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>
>>
>> this shows up in the agenda view as:
>>
>>   uni:        14:00...... timerange
>>
>> while I would expect something like:
>>
>>   uni:        14:00-18:00 timerange
>>
>
> |the manual says:
> |Time ranges can be specified with two timestamps,
> |like ‘<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>’.
> |
> | 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
>
> I confirm this bug.
>
> Org-mode version 7.7 0e9d401519
> GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-03-10 on 3249CTO
>
> Giovanni
>
>

Funny enough, I noticed this too last week, so I whipped up this patch.
It inserts the range when start date is the same as the end date. Please
test (it's still young) && include in Org if you so please.

#+begin_src diff
>From dcf81753aa5cab311f2a3a0272e4691e4bc6ea38 Mon Sep 17 00:00:00 2001
From: Niels Giesen <niels.giesen@gmail.com>
Date: Mon, 26 Sep 2011 11:43:55 +0200
Subject: [PATCH] Show timestamp ranges in agenda

* lisp/org-agenda.el (org-agenda-get-blocks): Show timestamp ranges in
  agenda if start day is same as end day
2011-10-05 16:46:18 +02:00
Carsten Dominik aefd49b909 Change default value of `org-agenda-skip-additional-timestamps-same-entry'
* lisp/org-agenda.el (org-agenda-skip-additional-timestamps-same-entry):
Change default value.
2011-10-04 14:30:32 +02:00
Carsten Dominik 620913e596 Improve error reporting on bad time stamps during agenda construction
* lisp/org.el (org-time-string-to-time):
(org-time-string-to-absolute): Add optional arguments BUFFER and POS
for error reporting.
* lisp/org-agenda.el (org-get-all-dates):
(org-agenda-get-timestamps):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks): Call time stamp parsing functions with
information on where the timestamp was taken from.
2011-10-04 14:12:11 +02:00
Bastien Guerry 8bd2ff192e org-agenda.el: Add `category-pos' in let construct.
* org-agenda.el (org-search-view, org-agenda-get-todos)
(org-agenda-get-deadlines, org-agenda-get-scheduled): Add
`category-pos' in let construct.

Thanks to Achim Gratz for spotting this.
2011-08-25 23:42:07 +02:00
Bastien Guerry 02fad0981f org-agenda.el: Correctly set the `org-category-pos' property.
* org-agenda.el (org-agenda-get-timestamps)
(org-agenda-get-sexps, org-agenda-get-progress): Correctly set
the `org-category-pos' property.

Thanks to Michael Brand for signaling this problem, and to Nick
Dokos and Erik Iverson for confirming it.
2011-08-25 15:20:10 +02:00
Nicolas Goaziou ecc6e2fe3f org-agenda: refactor code in `org-agenda-dim-blocked-tasks' 2011-08-24 18:32:19 +02:00
Bastien Guerry fc4628ef56 * org-agenda.el (org-agenda-get-todos): Properly set `category-pos'.
* org-agenda.el (org-agenda-get-todos): Properly set
`category-pos'.

Thanks to Noorul Islam for this patch.
2011-08-24 10:17:09 +02:00
Bastien Guerry 15798836e2 New 'org-category-position text property in agendas.
* org.el (org-refresh-category-properties): New text property
'org-category-position to point at the beginning of the
headline from which the category is set.

* 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)
(org-agenda-filter-by-tag-refine): Add the
'org-category-position text property.

This commit prepares for a future `org-agenda-set-category'
function allowing to set the category of the headline at point.
2011-08-23 17:34:15 +02:00
Bastien Guerry cdbf7ed876 Revert "Move three functions and add appropriate require/declarations."
This reverts commit 8c3ecbe39a.
2011-08-19 22:11:15 +02:00
Carsten Dominik 85cc7670c0 Merge branch 'cleanup-include-all-stuff-in-agenda.el' 2011-08-19 15:30:46 +02:00
Bastien Guerry 54fe955c9a org-agenda.el: Mention "%e" in the docstring of org-agenda-prefix-format.
* org-agenda.el (org-agenda-prefix-format): Mention "%e" in
the docstring.
2011-08-19 15:16:38 +02:00
Carsten Dominik b3de2dbb95 Set a default custom command, agenda plus TODO items
* lisp/org-agenda.el (org-agenda-custom-commands): Set a default value
for this command.
2011-08-19 12:41:11 +02:00
Carsten Dominik 8404f15647 Clean up the misleading name INCLUDE-ALL in some agenda functions
* lisp/org-agenda.el (org-agenda-include-all-todo): Declare this
option as no longer working.
(org-timeline): Rename the include-all argument to dotodo.
(org-arg-loc): Renamed from` org-include-all-loc'.
(org-agenda-list): Rename the INCLUDE-ALL argument to ARG, because its
function has changed.
2011-08-19 12:41:02 +02:00
Bastien Guerry 8c3ecbe39a Move three functions and add appropriate require/declarations.
* org-clock.el (org-duration-string-to-minutes)
(org-minutes-to-hh:mm-string, org-hh:mm-string-to-minutes):
Move from org.el.
2011-08-17 16:08:02 +02:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Bastien Guerry afa408dcd6 org-agenda.el (org-cmp-effort): Fix docstring.
* org-agenda.el (org-cmp-effort): Fix docstring.
2011-08-16 16:16:43 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
Bastien Guerry 71332ac8a6 Move org-agenda-todo-yesterday from org.el to org-agenda.el. 2011-08-15 09:39:52 +02:00
Michael Brand 2f07dd5163 Agenda: Simplify old fix of face for deadline warning 0 day
* lisp/org-agenda.el (org-agenda-get-deadlines): Fix dfrac for the
case of wdays being 0.  Don't pass wdays to org-agenda-deadline-face,
like before the old fix.
(org-agenda-deadline-face): Revert to old state that was without
wdays.

This allows a deadline warning period of "-0d" to work also with a
custom configuration like:
(setq org-agenda-deadline-faces
      '((1.0001 . org-warning)              ; due yesterday or before
        (0.0    . org-upcoming-deadline)))  ; due today or later
For org-agenda-deadline-faces left at default and all other settings
not exceeding 1.0, the face for a deadline warning of any length
remains untouched by this patch.

references to history:
* commit of the old fix
  - http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=d0d6325
  - git show d0d6325
* mailing list old thread
  - http://thread.gmane.org/gmane.emacs.orgmode/5753
  - http://lists.gnu.org/archive/html/emacs-orgmode/2008-02/msg00395.html
2011-08-14 18:40:42 +02:00
David Maus 545bfddeea Provide edebug specifications for macros
* org-macs.el (org-with-gensyms, org-called-interactively-p)
(with-silent-modifications, org-bound-and-true-p)
(org-unmodified, org-re, org-preserve-lc)
(org-without-partial-completion, org-with-point-at)
(org-no-warnings, org-if-unprotected, org-if-unprotected-1)
(org-if-unprotected-at, org-with-remote-undo)
(org-no-read-only, org-save-outline-visibility)
(org-with-wide-buffer, org-with-limited-levels)
(org-eval-in-environment): Provide edebug specifications.
* org-src.el (org-src-do-at-code-block): Dto.
* org-publish.el (org-publish-with-aux-preprocess-maybe): Dto.
* org-compat.el (org-xemacs-without-invisibility): Dto.
* org-clock.el (org-with-clock-position, org-with-clock): Dto.
* org-agenda.el (org-agenda-with-point-at-orig-entry)
(org-batch-agenda, org-batch-agenda-csv)
(org-batch-store-agenda-views): Dto.
* ob.el (org-babel-do-in-edit-buffer)
(org-babel-map-src-blocks, org-babel-map-inline-src-blocks): Dto.
* ob-tangle.el (org-babel-with-temp-filebuffer): Dto.
* ob-table.el (sbe): Dto.
* ob-exp.el (org-babel-exp-in-export-file): Dto.
* ob-comint.el (org-babel-comint-in-buffer)
(org-babel-comint-with-output): Dto.
2011-08-12 08:38:59 +02:00
David Maus 06591f2ccc Fix argument to append when creating final parameter alist
* org-agenda.el (org-batch-agenda-csv): Fix argument to append when
creating final parameter alist.
2011-08-10 10:10:40 +02:00
David Maus 679c21f8ec Use macro `org-eval-in-environment' in `org-batch-store-agenda-views'
* org-agenda.el (org-batch-store-agenda-views): Use macro
`org-eval-in-environment'.
2011-08-10 09:43:57 +02:00
David Maus 0837adbec8 Provide explanation why batch functions are implemented as macros
,----
| The functions `org-batch-agenda', `org-batch-agenda-csv', and
| `org-batch-store-agenda-views' are implemented as macros to provide
| a conveniant way for extracting agenda information from the command
| line. The Lisp does not evaluate parameters of a macro call; thus
| it is not necessary to quote the parameters passed to one of those
| functions. E.g. you can write:
|
|   emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a" org-agenda-span 7)'
|
| To export an agenda spanning 7 days. If `org-batch-agenda' would
| have been implemented as a regular function you'd have to quote the
| symbol org-agenda-span. Moreover: To use a symbol as parameter
| value you would have to double quote the symbol.
|
| This is a hack, but it works even when running Org byte-compiled.
`----
2011-08-10 09:43:57 +02:00
David Maus f0958680db Use `org-eval-in-environment
* org-agenda.el (org-batch-agenda, org-batch-agenda-csv): Use
`org-eval-in-environment.
2011-08-10 09:43:57 +02:00
David Maus b471e56a3e Use macro `org-with-gensyms' in `org-agenda-with-point-at-orig-entry'
* org-agenda.el (org-agenda-with-point-at-orig-entry): Use macro
`org-with-gensyms'.
2011-08-10 08:52:15 +02:00