Commit graph

5640 commits

Author SHA1 Message Date
Nicolas Goaziou d775777afc org-inlinetask: fix `org-inlinetask-goto-end' with one line long tasks
* lisp/org-inlinetask.el (org-inlinetask-goto-end): Correctly detect
  the end of an inlinetask when the next one starts immediately after
  the current one.  Also, return position of point.
2011-08-30 14:28:36 +02:00
Nicolas Goaziou 2ff74fc5b6 ob: allow inline src blocks to start at bol
* lisp/ob.el (org-babel-inline-src-block-regexp): Allow regexp to
  start at bol.
2011-08-29 16:05:18 -06:00
Nicolas Goaziou 1421887cde ob-asymptote: small fix
* lisp/ob-asymptote.el (org-babel-asymptote-define-type): elisp floats
  are asymptote reals.
2011-08-29 23:06:35 +02:00
Nicolas Goaziou 755f597a05 ob-asymptote: mixed-types tables default to string arrays
* lisp/ob-asymptote.el (org-babel-asymptote-table-to-array): Require a
new argument TYPE specifying the detected type of array.  If it's a
string array, make sure every element is returned as a string. Also
improve doc-string.
(org-babel-asymptote-var-to-asymptote): Fill new argument.  Small
refactoring.
(org-babel-asymptote-define-type): Rewrite to avoid stopping search at
first float found, as strings have precedence over floats.
2011-08-29 11:56:25 -06:00
Nicolas Goaziou d6aa8ffa13 org-footnote: fix xhtml export
* lisp/org-footnote.el (org-footnote-normalize): be sure to separate
  the last footnote definition from the rest of the buffer.

Thanks to Jambunathan K for reporting this.
2011-08-29 13:05:57 +02:00
Eric Schulte f5e09fbd30 ob-awk: safer variable expansion
* lisp/ob-awk.el (org-babel-expand-body:awk): Allow for symbolic
  variable names.
2011-08-28 09:03:19 -06:00
Nicolas Goaziou 63ce11b1ca Allow $...$ and $x$ latex fragment types at beginning of line
* lisp/org.el (org-latex-regexps): Allow matching latex fragments of
  type "$" and "$1" at beginning of line.
2011-08-27 15:04:51 +02:00
Bastien Guerry c462683ba2 Merge branch 'master' of orgmode.org:org-mode 2011-08-25 23:42:43 +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
Nicolas Goaziou 4574cc11bc org-footnote: preserve narrowing when searching a definition
* lisp/org-footnote.el (org-footnote-get-definition): the function has
  to widen buffer if definition has not been found in the current
  narrowed part. Be sure to restore that restriction once the
  definition is found.
2011-08-25 21:12:07 +02:00
Michal Sojka cd8d1b095b icalendar: Make alarm duration RFC5545 compliant
* org-icalendar.el (org-print-icalendar-entries): Make alarm duration
RFC5545 compliant.

The format of alarm trigger was incorrect because "T" letter from
dur-time element was missing (see
http://tools.ietf.org/html/rfc5545#section-3.3.6). This caused some
software (such as KOrganizer) to not interpret the alarms correctly.

TINYCHANGE
2011-08-25 16:39:35 +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
Bastien Guerry 236642dc54 org-html.el (org-export-html-divs): Improve docstring.
* org-html.el (org-export-html-divs): Improve docstring.
2011-08-25 15:09:44 +02:00
Bastien Guerry 50412d29c5 Merge branch 'master' of orgmode.org:org-mode 2011-08-25 09:39:38 +02:00
Carsten Dominik be25be1c8d Merge branch 'master' of orgmode.org:org-mode 2011-08-25 08:48:16 +02:00
Carsten Dominik e91f6db1e3 Keep table row/column removal from creating invalid formulas
* lisp/org-table.el (org-table-fix-formulas): Throw error when changing
formula leads to an invalid formula.

This fix catches at least one case, the one described by Nicolas:

> | 1 | 2 | 3 |
> | 1 | 2 | 3 |
> #+TBLFM: @2$1..@2$3=@1
> If I remove the second column (M-S-Left), the formula is correctly
> updated. But when I remove the last column, the formula gets partly
> deleted and becomes:
>
>                            #+TBLFM: @2$1..
>
2011-08-25 08:16:00 +02:00
Bastien Guerry eabea0ef85 * org.el (org-archive-location): Minor docstring fix.
Thanks to John Hendy for pointing this out.
2011-08-25 00:33:13 +02:00
Bastien Guerry d203b61a11 Merge branch 'master' of orgmode.org:org-mode 2011-08-24 22:32:55 +02:00
Achim Gratz ccc99317de backport copyright and license headers from Emacs trunk 2011-08-24 22:32:38 +02:00
Nicolas Goaziou ecc6e2fe3f org-agenda: refactor code in `org-agenda-dim-blocked-tasks' 2011-08-24 18:32:19 +02:00
Nicolas Goaziou 25131410f4 Correctly find unchecked boxes in a section
* lisp/org.el (org-block-todo-from-checkboxes):
  `org-list-search-forward' should be used when looking for an item,
  as it filters out contexts where match couldn't be in
  a list (i.e. example blocks). Also use a correct item regexp, taking
  into account alphabetical ordered lists and counters.
2011-08-24 18:30:47 +02:00
Bastien Guerry 8b16fae479 org-html.el (org-html-make-link): Minor fix to the docstring.
* org-html.el (org-html-make-link): Minor fix to the docstring.
2011-08-24 16:13:14 +02:00
Suvayu Ali 3a6956770e Define org-inlinetask face
* org-inlinetask.el (org-inlinetask): New customisable face
  for inlinetasks

TINYCHANGE
2011-08-24 15:22:38 +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
Nicolas Goaziou 0019b6f193 org-list: fix code typo 2011-08-24 02:11:36 +02:00
Eric Schulte 1833a9c1b4 Revert "Revert "make the "FILE" property non-special when resolving bibtex values""
This reverts commit 4b423ac3cb.
2011-08-23 14:44:09 -06:00
Nicolas Goaziou 08ca5be491 org-list: tiny code change
* lisp/org-list.el (org-list-struct-apply-struct): don't
  use (copy-marker (point)) instead of (point-marker).
2011-08-23 22:20:55 +02:00
Nicolas Goaziou 8bb1a0c57f org-list: forgot a double space 2011-08-23 22:19:14 +02:00
Nicolas Goaziou 969baac557 org-list: corrections to commentary section and add linefeed 2011-08-23 22:17:20 +02:00
Nicolas Goaziou 065c5c3241 Make some files pass checkdoc test 2011-08-23 21:43:30 +02:00
Bastien Guerry 984318cea5 Merge branch 'master' of orgmode.org:org-mode 2011-08-23 17:52:53 +02:00
Eric Schulte 21fd1523be Don't require full variable resolution when finding results
* lisp/ob.el (org-babel-where-is-src-block-result): Don't try to
  resolve variables when simply checking if we're inside of a code
  block.
2011-08-23 09:46:32 -06: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
Matt Lundin 8478a5541c No need to call org-back-to-heading with goto argument.
* lisp/org.el: (org-refile) Don't call org-back-to-heading with goto
  argument.

This fixes an error that results when calling org-refile with the
GOTO argument in a non-org buffer.
2011-08-23 17:00:36 +02:00
Bastien Guerry 7475d7da1f org.el: Remove org-link-display-descriptive' and use org-descriptive-links'.
* org.el (org-link-display-descriptive): Remove this option
and rely on the existing `org-descriptive-links' instead.
(org-toggle-link-display): Use `org-descriptive-links'.

Without this change, both options are redundant.  This also
fixes a bug about using `org-descriptive-links' in the `org-mode'
function, that initialize the display using `org-descriptive-links'
instead of `org-link-display-descriptive'.

Thanks to Thomas S. Dye for spotting this.
2011-08-23 16:55:48 +02:00
Eric Schulte b924b34b76 Allow matching of results with tags after the result name.
* lisp/ob-ref.el (org-babel-ref-resolve): Allow matching of results
  with tags after the result name.
2011-08-23 08:36:49 -06:00
Bastien Guerry 76ab4dd422 org-table.el: Allow underscore in field and column names.
* org-table.el (org-table-get-specials): Allow the use of the
underscore character in column names.
(org-table-get-specials): Allow the use of the underscore
character in field names.

Thanks to András Major for bringing this up and to Nick Dokos
for a suggested fix.
2011-08-23 16:27:56 +02:00
Eric Schulte caaadd91a9 cleaning up markers in org-exp-blocks -- Thanks again to Nicolas Goaziou for advice
* lisp/org-exp-blocks.el (org-export-blocks-preprocess): Explicitly
  cleaning up markers.
2011-08-22 08:31:09 -06:00
Eric Schulte cb449a672e improve export of inline code blocks
* lisp/ob-exp.el (org-babel-exp-inline-src-blocks): Save match data
  around `org-babel-exp-do-export' which now searches in this case.
  (org-babel-exp-results): Position the point in the inline source
  block during export evaluation.
* lisp/ob.el (org-babel-insert-result): More readable code.
2011-08-22 08:23:52 -06:00
Eric Schulte 36d80ff505 remove duplicate function, Thanks to Nicolas Goaziou for pointing this out.
* lisp/org-exp-blocks.el (org-export-blocks-preprocess): Use the built
  in function rather than the superfluous (and now removed)
  org-specific function.
2011-08-22 07:40:00 -06:00
Eric Schulte fceb767aea ob-exp: don't examplize inline code blocks which are already escaped
* lisp/ob-exp.el (org-babel-exp-inline-src-blocks): Don't examplize
  inline code blocks which are already escaped.
2011-08-21 14:23:27 -06:00
Eric Schulte f51e540c4c org-exp-blocks: use markers instead of points to remember code block locations
* lisp/org-exp-blocks.el (org-marker-from-point): Helper function to
  create markers at specific points in source buffers.
  (org-export-blocks-preprocess): Use markers instead of points to
  delimit code blocks.
2011-08-21 14:15:18 -06:00
Nicolas Goaziou 405ebb43df org-list: remove dependency on `org-back-over-empty-lines'
* lisp/org-list.el (org-list-separating-blank-lines-number): the
  behaviour of `org-back-over-empty-lines' depends on the associated
  value of `headline' in `org-blank-before-new-entry', which is out of
  context in a list.
2011-08-21 21:39:56 +02:00
Nick Dokos 7f913bc816 Get rid of gratuitous newline after listing/minted environment.
Signed-off-by: Nick Dokos <nick@dokosmarshall.org>
2011-08-21 12:29:56 -06:00
Nick Dokos 707897c25c Eliminate extra newline(s) after example or src block.
Signed-off-by: Nick Dokos <nick@dokosmarshall.org>
2011-08-21 12:28:33 -06:00
Nicolas Goaziou b93087ccf1 org-indent: also initialize background buffers, less aggressively
* lisp/org-indent.el (org-indent-initialize-agent): when the current
  buffer isn't being watched, resume initialization of other watched
  buffers. In that case, give hand to others idle timers or processes
  more frequently.
(org-indent-agent-active-delay): renamed from
org-indent-agent-process-duration.
(org-indent-agent-passive-delay): new variable.
(org-indent-agent-resume-delay): change value.
(org-indent-initialize-buffer): change argument name.
(org-indent-add-properties): change argument name and type
expected. It must be a time value now.

add
2011-08-21 15:28:50 +02:00
Bastien Guerry 3e33c9c37e * org.el (org-set-property): Bugfix. 2011-08-19 23:55:04 +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
Bastien Guerry 5b51893824 org.el: tiny docstring fix. 2011-08-19 17:42:27 +02:00
Eric Schulte 96ad99ba07 ob: idempotent code block evaluation and result removal
* lisp/ob.el (org-babel-remove-result): Idempotent code block
  evaluation and result removal.
2011-08-19 08:58:24 -06:00
Eric Schulte bf740ba41c ob-ruby: No longer require inf-ruby when no session evaluation takes place
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): No longer require
  inf-ruby when no session evaluation takes place.
2011-08-19 08:58:24 -06: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
Bastien Guerry 5239a26309 org-crypt.el: fix copyright years. 2011-08-19 15:15:51 +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 1bb83091a9 org.el (org-fixup-indentation): Fix various small bugs.
* org.el (org-fixup-indentation): Fix various small bugs.

Thanks to Sébastien Vauban for reporting them.
2011-08-19 09:41:15 +02:00
Nicolas Goaziou 0c6b67c191 org-indent: changes to the internals of initialization
* lisp/org-indent.el (org-indent-agent-timer,
  org-indent-agentized-buffers, org-indent-agent-resume-timer,
  org-indent-agent-process-duration, org-indent-agent-resume-delay):
  new variables.
(org-indent-initial-marker): more accurate doc-string.
(org-indent-initial-timer, org-indent-initial-resume-timer,
org-indent-initial-process-duration, org-indent-initial-resume-delay,
org-indent-initial-lock): removed variables.
(org-indent-mode): set up an agent to watch current buffer, or add it
to the list of already watched buffers.
(org-indent-initialize-agent): new function.
(org-indent-initialize-buffer): now requires a mandatory buffer
argument.
(org-indent-add-properties): reflect changes to variables. The resume
timer is now global.

This change was introduced because a buffer killed while initializing
couldn't cancel its own initialization timer. Now, a global agent
watches for buffers, starting or resuming their initialization when
appropriate. It can cancel its own timer, thus killing itself, when no
more buffers are being watched.
2011-08-18 23:14:08 +02:00
Nicolas Goaziou 300b2e8f4e org-footnote: normalize function cleanup
* lisp/org-footnote.el (org-footnote-normalize): refactor, and fix
  some blank lines deletion.
2011-08-18 20:18:24 +02:00
Nicolas Goaziou c4d482b269 org-indent: forgot to make a variable local
* lisp/org-indent.el (org-indent-mode):
  `org-indent-initial-resume-timer ' needs to be local.
2011-08-18 19:06:33 +02:00
Bastien Guerry 0538dd3188 Fix some double-space after ponctuation mark in docstrings. 2011-08-18 18:38:05 +02:00
Bastien Guerry 6b04befa48 org.el (org-fixup-indentation): Correctly indent meta lines.
* org.el (org-fixup-indentation): Correctly indent meta lines.

Thanks to Sébastien Vauban for reporting this.
2011-08-18 18:18:04 +02:00
Nicolas Goaziou 74cca9f57e org-indent: silence byte-compiler 2011-08-18 15:46:09 +02:00
Nicolas Goaziou b3f462a94b org-indent: add virtual indentation for blank lines
* lisp/org-indent.el (org-indent-set-line-properties): add text
  properties down to the beginning of the next line.
(org-indent-add-properties): when last position to add properties to
is at the beginning of a line, all that line will have properties.
2011-08-18 15:45:02 +02:00
Nicolas Goaziou 84faa05c1b org-indent: add breaks during asynchronous indentation
* lisp/org-indent.el (org-indent-initial-resume-timer): new variable.
(org-indent-initialize-buffer): also resume after a small break.
(org-indent-add-properties): when in asynchronous mode, proceed for
2 seconds, then take a break.
2011-08-18 15:45:02 +02:00
Nicolas Goaziou b9962b7829 org-indent: externalize a function for better code readability
* lisp/org-indent.el (org-indent-set-line-properties): new function.
(org-indent-add-properties): externalize worker function.
2011-08-18 15:45:02 +02:00
Nicolas Goaziou d40643f949 org-indent: `org-indent-indent-buffer' acts on accessible part of buffer.
* lisp/org-indent.el (org-indent-indent-buffer): take into account narrowing.
2011-08-18 15:45:02 +02:00
Nicolas Goaziou 4d780baa11 org-indent: corrections to comments and doc-strings 2011-08-18 15:45:02 +02:00
Nicolas Goaziou ff5a081002 org-indent: refactoring 2011-08-18 15:45:01 +02:00
Nicolas Goaziou 4ef4bcd533 org-indent: handle more modifications of headlines
* lisp/org-indent.el (org-indent-modified-headline-flag): renamed from
  `org-indent-deleted-headline-flag'
(org-indent-notify-modified-headline): renamed from
`org-indent-notify-deleted-headline'. Handle situations when the stars
of an headline are modified.
(org-indent-refresh-maybe): remove case now handled by previous function.
(org-indent-mode): apply renames.
2011-08-18 15:45:01 +02:00
Nicolas Goaziou 0fd4c59367 Cleaner handling of inline tasks under org-indent-mode
* lisp/org-indent.el (org-indent-inlinetask-first-star): new variable.
(org-indent-add-properties): set the first star of inline-tasks'
virtual indentation in `org-warning' face.
* lisp/org-inlinetask.el (org-inlinetask-insert-task): create a new
  inline-task slightly differently, so virtual indentation can be
  applied normally.
2011-08-18 15:45:01 +02:00
Nicolas Goaziou acd6ed2140 org-indent: implement asynchronous initialization
* lisp/org-indent.el (org-indent-initial-marker,
  org-indent-initial-timer, org-indent-initial-lock): new variables.
(org-indent-mode): at initialization, start an idle timer to indent
the whole buffer. When the user is asking for control, interrupt the
process, and resume at the same point when idle again.
(org-indent-initialize-buffer): new function.
(org-indent-add-properties): throw an interrupt when indentation of
buffer is stopped during initialization.
2011-08-18 10:41:31 +02:00
Nicolas Goaziou 9479991d4c org-indent: modify messages sent
* lisp/org-indent.el (org-indent-indent-buffer): send more appropriate
  messages .
2011-08-18 10:41:31 +02:00
Nicolas Goaziou a7600032d0 org-indent: remove unused variable org-indent-outline-re
* lisp/org-indent.el (org-indent-notify-deleted-headline,
  org-indent-refresh-maybe): replace `org-indent-outline-re' with
  `org-outline-regexp-bol'.
2011-08-18 10:41:31 +02:00
Nicolas Goaziou b955d7539f org-indent: pay attention to org-indent-max and org-indent-max-levels
* lisp/org-indent.el (org-indent-max-levels): modify default value and
  add comment.
  (org-indent-add-properties): pay attention to org-indent-max and
  org-indent-max-levels values.
  (org-indent-refresh-maybe): refactor code to avoid an unnecessary
  save excursion.
2011-08-18 10:41:31 +02:00
Nicolas Goaziou a968b8c76f org-table: remove a now useless hack
* lisp/org-table.el (org-table-align): remove now useless hack.
2011-08-18 10:41:31 +02:00
Nicolas Goaziou 818c449e2c org-indent: remove refresh timer
* lisp/org-indent.el (org-indent-fix-section-after-idle-time): remove
  variable.
  (org-indent-initialize): remove timer.
  (org-indent-add-properties): refactor code.
  (org-indent-refresh-subtree, org-indent-refresh-section,
  org-indent-refresh-buffer,org-indent-set-initial-properties): remove
  functions.
  (org-indent-deleted-headline): new variable.
  (org-indent-notify-deleted-headline,org-indent-refresh-maybe): new
  functions.
  (org-indent-mode): insert new functions into a hook.
2011-08-18 10:41:31 +02:00
Nicolas Goaziou 4771caa09c Improve compatibility between org-indent-mode and visual-line-mode
* lisp/org-indent.el (org-indent-mode): completely refresh buffer
  before starting org-indent-mode. Also set idle timer to refresh only
  visible portion of buffer, and refresh the subtree instead of
  section when promoting or demoting it.
  (org-indent-add-properties): rewrite function to proceed line by
  line, as required by `wrap-prefix' specificity.
  (org-indent-refresh-section,org-indent-refresh-subtree): refactor.
  (org-indent-refresh-view): new function.
  (org-indent-refresh-to, org-indent-refresh-section): removed
  functions.
* lisp/org.el (org-unfontify-region): do not remove prefix properties
  when unfontifying a region.
2011-08-18 10:41:30 +02:00
Bastien Guerry 3100838dcc org-colview.el: Correctly remove leading stars.
* org-colview.el (org-columns-cleanup-item): Correctly remove
leading stars in items displayed in the agenda column view.

Thanks to Christian Schmidt for spotting this.
2011-08-18 09:14:44 +02:00
Bastien Guerry 9f337ee06c org-clock.el: remove `org-clocktable-sort-clock-data'.
This function by Max Mikhanosha was added accidently.  We are
waiting for the FSF to process Max copyright assignement to get
this function in org-mode.

Thanks to Achim Gratz for spotting at this.
2011-08-18 09:00:20 +02:00
Bastien Guerry 2edd05eaac org-colview: Clean up items in agenda mode too.
* org-colview.el (org-columns-display-here): Clean up items in
org-agenda-mode too.
(org-columns-cleanup-item): Take a new argument CPHR to allow
passing a complex heading regexp.  Rewrite to cleanup ITEM
correctly in `org-agenda-mode'.

Thanks to Christian Schmidt for pointing at this problem.
2011-08-17 16:56:27 +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 a472bee33d org-footnote.el: silence byte-compiler. 2011-08-17 16:05:11 +02:00
Bastien Guerry ea055d3e6d org.el: Minor update of docstrings.
(org-open-at-mouse): Point to the docstring of `org-open-file'
for more details.
(org-open-file): Mention `org-link-frame-setup' in the
docstring.

Thanks to Reiner Steib for pointing at this.
2011-08-17 15:15:35 +02:00
Bastien Guerry 4774b1b026 org.el: Allow to customize the way links are displayed.
(org-link-display-descriptive): New option to customize the
default display of links, either literal or descriptive.
(org-toggle-link-display): New command to toggle link display.
(org-org-menu): Use the new toggle function for links.

Thanks to Reiner Steib for suggesting this.
2011-08-17 15:01:54 +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 c25165c25d org-refile: New option `org-refile-active-region-within-subtree'.
* org.el (org-refile-active-region-within-subtree): New option
to allow refiling a region that is part of a subtree without
containing a subtree itself.  This default to `nil'.
(org-refile): Use the new option.  Put point at the beginning
of the region/subtree to be refiled, so that users understand
what will be refiled.  Also improve the prompt to tell whether
the user is refiling a region or a headline.

Thanks to Jeff Horn for raising the issue of refiling a list item,
and to Nicolas Goaziou, Nick Dokos and Suvayu Ali for discussing
them patiently.  The discussion led to these changes.
2011-08-17 11:20:42 +02:00
Bastien Guerry 163cc38986 org.el: minor fix: delete trailing whitespaces. 2011-08-17 11:12:43 +02:00
Bastien Guerry eb4b035815 New option `org-properties-postprocess-alist'.
* org.el (org-properties-postprocess-alist): New option to
allow postprocessing the values of properties set through
`org-set-property'.
(org-set-property): Use this option.

This is inspired by a request from Pascal Mattia.
2011-08-17 11:11:41 +02:00
Bastien Guerry 436290bfab org.el (org-outline-regexp, org-outline-regexp-bol): Add a docstring.
* org.el (org-outline-regexp, org-outline-regexp-bol): Add a
docstring.
2011-08-17 11:05:23 +02:00
Bastien Guerry d13476b918 org-archive.el: Use org-outline-regexp' instead of outline-regexp'.
* org-archive.el (org-archive-to-archive-sibling): Use
`org-outline-regexp' instead of `outline-regexp'.
2011-08-17 11:05:03 +02:00
Nicolas Goaziou 7a826e09b1 fix code typo 2011-08-17 03:15:22 +02:00
Nicolas Goaziou 430b73b90c Minor fix to org-between-regexps-p
* lisp/org.el (org-between-regexps-p): searching up to pos may match
  again beginning regexp.
2011-08-17 03:11:18 +02:00
Nicolas Goaziou 4178a154f3 org-footnote: do not suggest bindings outside Org
* lisp/org-footnote.el (org-footnote-goto-definition): don't send
  erroneous message: suggested bindings might not be set outside Org.
2011-08-16 23:20:33 +02:00
Nicolas Goaziou 6815e30b62 org-footnote: refactor code 2011-08-16 23:20:33 +02:00
Nicolas Goaziou a8d621c3da org-footnote: remove every footnote tag when normalizing non Org buffers
* lisp/org-footnote.el (org-footnote-normalize): effectively remove
  any footnote tag in non Org buffers, as detailled in
  org-footnote-tag-for-non-org-mode-files doc-string.
2011-08-16 23:20:33 +02:00
Nicolas Goaziou baf7dde28e org-footnote: allow non Org mode files to have no footnote tag
* lisp/org-footnote.el (org-footnote-tag-for-non-org-mode-files):
  notify the opportunity to set the variable to the empty string.
(org-footnote-normalize, org-footnote-create-definition): carefully
  check for inserted newlines and presence of the footnote
  tag.
2011-08-16 23:20:33 +02:00
Nicolas Goaziou cb906e4406 org-footnote: re-use global regexps when possible
* lisp/org-footnote.el (org-footnote-at-definition-p): re-use
  org-footnote-definition-re.
2011-08-16 23:03:04 +02:00
Nicolas Goaziou d053a72066 org-footnote: tweak footnote definition regexp
* lisp/org-footnote.el (org-footnote-definition-re): remove an useless
  group.
(org-footnote-at-definition-p): reflect removal of the group.
2011-08-16 23:03:04 +02:00
Nicolas Goaziou 628ebf04f7 Enforce white space after todo keywords
* lisp/org.el (org-set-regexps-and-options): enforce white space after
  todo keyword, as word boundary isn't sufficient (i.e. in matches * TODO/this)
2011-08-16 22:29:39 +02:00
Jambunathan K 395a816a18 Prettify inlinetasks in odt and (x)html backends
* lisp/org-inlinetask.el (org-inlinetask-export-templates):
Fixed template for html so that the exported file is valid
xhtml. Added template for odt.
(org-inlinetask-export-handler): Fix typo in the regexp that
trims content. Make sure that the content is flanked by
paragraph boundaries on either side.

* lisp/org-html.el (org-export-html-style-default): Add style
for inlinetask.

* contrib/lisp/org-xhtml.el (org-export-xhtml-style-default):
Add style for inlinetask.

* contrib/odt/styles/OrgOdtStyles.xml: Added following custom
styles:  OrgInlineTaskHeading and OrgInlineTaskFrame.

* contrib/lisp/org-odt.el (org-odt-format-textbox)
(org-odt-format-inlinetask): Added

Refer following threads:
1. http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00238.html
2. http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00154.html

Thanks to Suvayu Ali for reporting this issue and suggesting
improvements.
2011-08-16 21:29:52 +02:00
Bastien Guerry 9d5c5c3d26 Don't insert superfluous space when updating timestamps.
* org.el (org-add-planning-info): Don't insert superfluous
space when updating timestamps.

Thanks to Valentin Wüstholz for this patch.
2011-08-16 19:05:17 +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
Nicolas Goaziou b6fab3770b org-list: remove left-over commented code and clean white space 2011-08-16 10:23:04 +02:00
Bastien Guerry ad23b7d173 Fix bzg email address (s/altern/gnu). 2011-08-15 21:22:30 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Nicolas Goaziou dfda5fc8b4 org-list: get correct structure with empty items
* lisp/org-list.el (org-list-full-item-re): when an item has only
  a bullet and no space after it, list structure would not be
  recognized correctly.
2011-08-15 18:29:37 +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 e01ce26c0b org.el: set org-ts-what' correctly in org-at-timestamp-p'.
(org-at-timestamp-p): set `org-ts-what' in a way that point will be
considered to be "on the bracket" whether it is really on it or right
after it.

Thanks to Matt Lundin for reporting this and to Nicolas Goaziou for
discussion about this.
2011-08-15 10:06:02 +02:00
Bastien Guerry c6bee11433 Use outline-regexp in org-overview so that global cycling works outside of Org buffers.
* org.el (org-overview): Use outline-regexp instead of
org-outline-regexp so that global cycling using orgstruct-mode
works outside of Org buffers.

Thanks to Matt Lundin for this fix.
2011-08-15 09:51:44 +02:00
Bastien Guerry bc1b688ff0 Move org-find-visible and org-find-invisible from org-exp.el to org.el. 2011-08-15 09:44:52 +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
Bastien Guerry 258aad0b9a org-table.el: Fix missing variables in let constructs.
* org-table.el (org-table-eval-formula): Fix missing variable
in let construct.
(org-table-time-string-to-seconds): Fix missing variable in
let construct.

Thanks to John Wiegley for pointing at this.
2011-08-14 20:24:43 +02:00
Bastien Guerry 4b423ac3cb Revert "make the "FILE" property non-special when resolving bibtex values"
This reverts commit f5a359f578.

On Aug. 8th Thomas S. Dye reported this commit creates problems:
see http://article.gmane.org/gmane.emacs.orgmode/45392
2011-08-14 19:00:20 +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
Bastien Guerry 6f8bb3bd5d org-latex.el: Only add one line break after exporting verbatim environments.
* org-latex.el (org-export-latex-fixed-width): Only add one
line break after exporting verbatim environments.

Thanks to Maik Beckmann for reporting this.
2011-08-14 16:40:45 +02:00
Bastien Guerry d9b7afd835 org-list.el: Allow the generic list exporter to trim line breaks in items.
* org-list.el (org-list-item-trim-br): New function.
(org-list-to-generic): New parameter :nobr to use the new
function.
2011-08-14 16:38:55 +02:00
Nicolas Goaziou 0bf0b75d51 org-footnote: keep byte-compiler happy 2011-08-14 10:52:14 +02:00
John Wiegley d24a141d96 Renamed unnecessary use of sort* to sort 2011-08-13 16:43:22 -05:00
David Maus 20ff46e825 Merge branch 'master' of orgmode.org:org-mode 2011-08-13 15:02:58 +02:00
David Maus 3771185cae Fix wrong order of lines to move before pasting
* org.el (org-paste-subtree): Fix wrong order of lines to move before
pasting.
2011-08-13 15:02:03 +02:00
John Wiegley 7d2d8f884b Add customization variable `org-use-effective-time'
If non-nil, consider `org-extend-today-until' when creating timestamps.
For example, if `org-extend-today-until' is 8, and it's 4am, then the
"effective time" of any timestamps between midnight and 8am will be
23:59 of the previous day.
2011-08-13 03:21:49 -05:00
Bastien Guerry d2871b007b Merge branch 'master' of orgmode.org:org-mode 2011-08-13 10:11:59 +02:00
Bastien Guerry 92b87288c7 Minor changes: fix copyright years and licenses.
See https://lists.gnu.org/archive/html/emacs-diffs/2011-08/msg00113.html
for the original patches.  Thanks to Glenn Morris.
2011-08-13 10:11:39 +02:00
Bastien Guerry eb5550fd76 ob-maxima.el: fix the copyright years. 2011-08-13 10:05:24 +02:00
Bastien Guerry 3008f05688 ob-lilypond.el: fix the copyright years. 2011-08-13 10:04:58 +02:00
Bastien Guerry 85c40cb36f ob-awk.el: minor fix. Remove double "Commentary:" line in header. 2011-08-13 10:04:17 +02:00
David Maus e5199c4095 Paste subtree above target headline if point is at bol
* org.el (org-paste-subtree): Paste subtree above target headline if
point is at bol.

Capture and refile depend on this buggy behavior of org-past-subtree.
2011-08-13 09:19:19 +02:00
Nicolas Goaziou 1bbfec57af org-list: don't clear marker while still in use
* lisp/org-list.el (org-toggle-checkbox): don't clear lim-down while
  used in the while loop.
2011-08-12 15:17:48 +02:00
Nicolas Goaziou b4aee73ef1 org-list: fix bug in `org-toggle-checkbox' on current item
* lisp/org-list.el (org-toggle-checkbox): lim-down must be a marker.
2011-08-12 15:11:19 +02:00
Nicolas Goaziou 9c33b9c259 Fix fontification error in feb52f9028
* lisp/org.el (org-activate-code): correct regexp so ":.*" isn't
  matched.
2011-08-12 13:06:25 +02:00
David Maus 7410001a47 Merge branch 'refactor/org-macros' 2011-08-12 08:49:24 +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
Nicolas Goaziou 44e42d4dab org-inlinetask: fix a doc-string
* lisp/org-inlinetask.el (org-inlinetask-export-templates): fix doc-string.
2011-08-11 14:10:35 +02:00
Nicolas Goaziou 62e320b8a5 org-inlinetask: error when trying to nest inline tasks
* lisp/org-inlinetask.el (org-inlinetask-insert-task): error when
  trying to nest inline tasks.
2011-08-11 14:09:55 +02:00
Nicolas Goaziou feb52f9028 Allow "^[ \t]*:$" as a special case of fixed-width section
* lisp/org.el (org-activate-code, org-toggle-fixed-width-section,
  org-indent-line-function): allow "[ \t]*:$" as a special case of
  fixed-width section.
2011-08-11 11:46:32 +02:00
David Maus ece3091f16 Don't eat headline when yank with point at existing headline
* org.el (org-paste-subtree): Don't eat headline when called with
point at existing headline.
2011-08-10 18:38:26 +02:00
David Maus 14b556772b Merge branch 'master' of orgmode.org:org-mode 2011-08-10 18:18:06 +02:00
David Maus fc572f5a6b Fix typo in variable name
* org.el (org-paste-subtree): Fix typo in variable name.
2011-08-10 18:17:48 +02:00
Jambunathan K b5b4134d0c Check org-inlinetask-export-templates before exporting inline tasks
* lisp/org-inlinetask.el (org-inlinetask-export-handler): Don't export
inline tasks if the current backend has provided no entries in
org-inlinetask-export-templates.
2011-08-10 11:09:39 +02:00
Valentin Wüstholz ce6010262d Preserve indentation of explicitly indented lines in example blocks
* lisp/org.el (org-indent-line-function): Made the way in which example blocks are
  indented more flexible.

Before: Lines in example blocks were indented like the surrounding begin and end
delimiters.
After: By default, lines in example blocks are indented like the surrounding begin and end
delimiters, unless the user explicitly indents them differently.

TINYCHANGE
2011-08-10 10:54:46 +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 7d5fb7ff38 New function: Return alist based on flat list
* org-macs.el (org-make-parameter-alist): New function. Turn flat list
of alternating symbol names and values into an alist with symbol name
in car and value in cdr.
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
David Maus 19c6b14644 Factor out function for substituting posix class in regular expression
* org-macs.el (org-substitute-posix-classes): New function. Substitute
posix classes in regular expression.
(org-re): Use new function.
2011-08-10 08:52:15 +02:00
David Maus 5423b329c1 New macro: Evaluate FORM in ENVIRONMENT
* org-macs.el (org-eval-in-environment): New macro. Evaluate FORM in
ENVIRONMENT.
2011-08-10 08:52:15 +02:00
David Maus 79605a9007 Use new macro `org-with-gensyms'
* org-macs.el (org-preserve-lc, org-with-point-at)
(org-with-remote-undo, org-save-outline-visibility): Use new macro
`org-with-gensyms'.
2011-08-10 07:33:43 +02:00
David Maus 4fe8369dae New macro: Wrap let-binding of uninterned SYMBOLS around BODY
* org-macs.el (org-with-gensyms): New macro. Wrap let-binding of
SYMBOLS to new uninterned symbols around BODY.

Use this macro to compose macros that need to bind their own symbols
in expansion. It expands into a let-binding of all symbols in SYMBOLS
to new uninterned symbols that cannot collide with symbols used in the
target macro's expansion.
2011-08-10 07:32:27 +02:00
Nicolas Goaziou 1b3798ea07 org-inlinetask: fix HTML export when not clearly defined as a paragraph
* lisp/org-inlinetask.el (org-inlinetask-export-handler): make sure
  the task starts a paragraph or the HTML exporter will produce an
  incorrect output.
2011-08-08 20:21:41 +02:00
Nicolas Goaziou aab16ffdf4 Fix `newline-and-indent' in a list when called on a line being filled
* lisp/org.el (org-return): when filling happens, `newline' can change
  match data, hence modifying the indent column.
2011-08-08 18:32:32 +02:00
John Wiegley bb08fab804 org-footnote: Guard against `def' being nil, if footnote undefined 2011-08-06 19:00:06 -05:00
John Wiegley 54c722a83a Added customization hook `org-log-buffer-setup-hook'
This allows changes to org-mode after the log buffer has been setup.
2011-08-06 18:59:18 -05:00
Nicolas Goaziou c2c7e88677 org-footnote: fix a doc-string 2011-08-06 12:11:07 +02:00
Nicolas Goaziou 2ea5f35fff org-footnote: fix function declaration 2011-08-06 11:56:15 +02:00
Nicolas Goaziou 1913f3f50c org-footnote: allow inserting inlined footnotes at column 0
* lisp/org-footnote.el (org-footnote-new): only forbid non-inlined
  footnotes at column 0, as only them can be confused with a footnote
  definition.
2011-08-06 11:56:14 +02:00
Nicolas Goaziou 795b7c5ca0 org-footnote: add speedups when prompted for a label
* lisp/org-footnote.el (org-footnote-new): use ido or iswitchb when
  available when prompted for a label. Also rename a local variable to
  avoid confusion with an existing function.
2011-08-06 11:56:14 +02:00
Nicolas Goaziou a41541c033 org-footnote: remove an unused variable
* lisp/org-footnote.el (org-footnote-label-history): removed variable
(org-footnote-new): remove call to that variable.
2011-08-06 11:56:14 +02:00
Nicolas Goaziou afa0df9b47 Fix heading insertion before any other headline but after a list
* lisp/org.el (org-insert-heading): with force-heading non-nil,
  inserting an heading before any headline, and just after a list
  would return an error.
2011-08-06 10:57:08 +02:00
Eric Schulte dc904a834d removed use of copy-seq from ob.el
* lisp/ob.el (org-babel-sha1-hash): Removed use of copy-seq.
2011-08-05 14:31:59 -04:00
Sergey Litvinov c0e2351e1a Map "cpp" to c++-mode 2011-08-05 11:32:02 -06:00
Eric Schulte f5a359f578 make the "FILE" property non-special when resolving bibtex values
* lisp/org-bibtex.el (org-bibtex-get): Make the "FILE" property
  non-special when resolving bibtex values.
2011-08-05 11:25:00 -06:00
David Maus 049c0776ff Don't move line upward if point is at eob
* org.el (org-back-over-empty-lines): Don't move line upward if point
is at eob.

Fixes a bug with refiling reported by Bernt Hansen, simplified version
of fix proposed by Jason Dunsmore.
2011-08-04 16:05:08 +02:00
Eric Schulte 41bf22f4dc Revert "new interactive function for removing code block results"
This reverts commit 72817926d7.
2011-08-01 15:45:58 -06:00
Eric Schulte b8ae6a6bdb Revert "fix compilation errors introduced by most recent changes"
This reverts commit 9ff7f80f51.
2011-08-01 15:31:24 -06:00
Nicolas Goaziou c3631aae7e org-footnote: prevent LaTeX export from catching footnotes in protect environment
* lisp/org-footnote.el (org-footnote-in-valid-context-p): check
  `org-protected' property before allowing to match a footnote.
(org-footnote-at-reference-p): remove an obsolete test. It's now done
in the previous function.
2011-07-30 12:38:06 +02:00
Nicolas Goaziou 8c6c6a4f3d Rename org-in-regexps-block-p' to org-between-regexps-p'
* lisp/org.el (org-between-regexps-p): previous name implied the
  function was related to blocks, which isn't mandatory.
(org-narrow-to-block, org-in-block-p, org-indent-line-function):
applied the rename.
* lisp/ob-exp.el (org-babel-in-example-or-verbatim): applied
  rename. Also removed a white space.
2011-07-30 09:32:03 +02:00
Nicolas Goaziou 226f8c873d Change behaviour of `org-in-regexps-block-p'
* lisp/org.el (org-in-regexps-block-p): return an useful value when
  point is between START-RE and END-RE. No incomplete block is allowed
  anymore. Add another optional argument to bound the bottom part of
  the search.
(org-narrow-to-block, org-in-block-p): apply modifications.
2011-07-30 09:32:03 +02:00
Eric Schulte 274823c858 if a code block has a body, its last character must be a newline
* lisp/ob.el (org-babel-src-block-regexp): If a code block has a body,
  its last character must be a newline.
2011-07-29 16:04:36 -06:00
Nicolas Goaziou 520bd1feac org-footnote: don't move point for unsuccessful search of the next footnote
* lisp/org-footnote.el (org-footnote-next-reference-or-definition): if
  no more footnote is found, be sure to go back to the original
  position. Otherwise, point might be left on a footnote-like element
  that has been dished out.
2011-07-29 21:06:38 +02:00
Eric Schulte 9ff7f80f51 fix compilation errors introduced by most recent changes
* lisp/ob-exp.el (org-babel-inline-src-block-regexp): Declare this variable.
* lisp/ob.el (defvar): Wrap variable declaration in eval-when-compile.
2011-07-29 10:36:39 -06:00
Eric Schulte 72817926d7 new interactive function for removing code block results
* lisp/ob-keys.el (org-babel-key-bindings): Bound to C-c C-v k.

* lisp/ob.el (org-babel-map-regexp): New generic mapping macro.
  (org-babel-map-inline-src-blocks): Rewritten to use new macro.
  (org-babel-kill-results): Remove some or all results in the current
  file.

* lisp/ob-lob.el (org-babel-map-call-lines): Map over all lob call
  lines in the current file.

* doc/orgcard.tex: Document new keybinding.
2011-07-29 10:31:56 -06:00
Nicolas Goaziou 36974045b6 org-exp: fix a doc-string 2011-07-29 15:46:03 +02:00
Eric Schulte 2a77c49454 ob-java: allow cmdline flags during compilation and evaluation
* lisp/ob-java.el (org-babel-execute:java): Allow cmdline flags during
  compilation and evaluation.
2011-07-28 18:01:01 -06:00
Bastien Guerry 57f6a8d97a Revert "org-agenda: bugfix: always refresh the agenda when needed."
This reverts commit 1fa0f027cd.
2011-07-28 17:22:38 +02:00
Bastien Guerry c8806bdcf7 org-special-blocks.el: This file is now part of GNU Emacs. 2011-07-28 17:11:41 +02:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Bastien Guerry 1fa0f027cd org-agenda: bugfix: always refresh the agenda when needed.
* org-agenda.el (org-agenda-filter-by-tag): bugfix: always
refresh the agenda when needed.

Thanks to Nicolas Dudebout for pointing this out.
2011-07-28 11:43:56 +02:00
Bastien Guerry f0d7acfb78 Hide .orgx files and use theindex.org directly.
Deleting .orgx files is an error -- thanks to Carsten for pointing
at this.  Instead, we "hide" them by using dotted files: .file.orgx.

Also, use theindex.org directly instead of including theindex.inc in
theindex.org.  This prevents a bug about republication of theindex.org
being skipped because the file has not been updated.

* org-publish.el (org-publish-index-generate-theindex): rename
from `org-publish-index-generate-theindex.inc'.  Use the file
theindex.org directly instead of including theindex.inc.
(org-publish-projects): Don't delete .orgx files.
(org-publish-aux-preprocess): Use .file.orgx.
2011-07-28 11:24:02 +02:00
Bastien Guerry 3dcb89e2b7 org-archive: delete trailing whitespaces. 2011-07-28 10:52:51 +02:00
Bastien Guerry 59e7fc4d3a org.el: (org-map-entries): Allow SCOPE to be the active region. 2011-07-28 10:50:44 +02:00
Bastien Guerry 0c0bce4a67 Manually revert 366254217a.
As David Maus pointed out, the implementation is not good.

* org.el (org-deadline, org-schedule): Don't loop.
(org-loop-over-siblings-within-active-region-p): Remove.
* org-archive.el (org-archive-subtree)
(org-archive-to-archive-sibling, org-toggle-archive-tag):
Don't loop.

* org-macs.el (org-loop-over-siblings-in-active-region):
Remove.
2011-07-28 10:50:35 +02:00
Max Mikhanosha dea1a6f87b Make `org-extend-today-until' variable affect log notes, and CLOSED: line.
(org-done-yesterday), (org-agenda-done-yesterday): new functions
2011-07-28 10:33:14 +02:00
Bastien Guerry 8d25fdc7e1 org-html: put the title back in the content div.
This is needed for the HTML file to interact correctly with
org-info.js.  On the long term, the title should be part of
the preamble, but this requires work on org-info.js.

* org-html.el (org-export-html-preamble-format): New default
for the HTML preamble: don't include the title.  Also improve
the docstring.
(org-export-html-postamble-format): Improve the docstring.
(org-export-as-html): Add the title within the "content" div.
This is necessary for interaction with the org-info.js script.
2011-07-27 19:23:24 +02:00
Michael Brand e7eb56f39b Table editor: Display coordinates of current field
* lisp/org-table.el (org-table-edit-field): Display field coordinates.
2011-07-27 17:48:08 +02:00
Max Mikhanosha f760b919d5 (org-agenda-set-effort): Refresh changed lines 2011-07-27 14:59:25 +02:00
Max Mikhanosha 860caf9f46 (org-agenda-change-all-lines): Change to item's buffer and use original column format that item was generated with 2011-07-27 14:59:19 +02:00
Max Mikhanosha 0cd6d82d39 Fix error with %e agenda prefix format when there is no effort set 2011-07-27 14:59:13 +02:00
Bastien Guerry 2610bfd052 org-publish: delete .orgx and temporary buffers.
Also add the org- prefix to some variable.

* org-publish.el (org-publish-find-title): bugfix: kill
buffers unless they were already visited.
(org-sitemap-sort-files, org-sitemap-sort-folders)
(org-sitemap-ignore-case, org-sitemap-requested)
(org-sitemap-date-format, org-sitemap-file-entry-format): use
a correct prefix.
(org-publish-projects): Make sure to delete .orgx files.
(org-publish-index-generate-theindex.inc): Small docstring
fix.
2011-07-27 14:36:54 +02:00
Bastien Guerry 70fab165e1 org-table: new defcustom `org-table-duration-custom-format'.
This allows to display the output of duration computations
as a fraction of days, hours, minutes or seconds.

Thanks to Daniel E. Doherty for bringing up this need.

* org-table.el (org-table-duration-custom-format): New
defcustom to select output format of durations computations.
(org-table-time-seconds-to-string): Use the new variable.
(org-table-eval-formula): Allow `t' as a flag, on top of `T'.
`t' will use the custom output format defined in
`org-table-duration-custom-format.
2011-07-27 13:14:37 +02:00
Nicolas Goaziou 4f85aa21c6 org-list: fix a small error when guessing blank lines before items
* lisp/org-list.el: search blank lines down to the end of the item
  instead of stopping at the item, in order to possibly match such
  lines within the item.
2011-07-26 17:46:55 +02:00
Bastien Guerry f0e4deb077 org-latex: allow `org-export-latex-href-format' to have only one "%s"
This is useful when you want to use \url{link} instead of the default
\href{link}{path}.

Thanks to Henri-Paul Indiogine for bringing this up.

* org-latex.el (org-export-latex-href-format): docstring fix
to reflect the fact that you can use only one "%s".
(org-export-latex-links): allow `org-export-latex-href-format'
to have only one "%s".
2011-07-26 13:22:38 +02:00
Carsten Dominik 30dccb04bf Add key and documentation for `org-copy-visible'.
* lisp/org.el (org-org-menu): Add `org-copy-visible' to the menu.
* doc/org.texi (Visibility cycling): Document `org-copy-visible'.
* doc/orgcard.tex: Document `org-copy-visible'.
2011-07-26 12:09:50 +02:00
Carsten Dominik 7f742f12cf Add `org-copy-visible' command proposed by Florian Beck
* lisp/org.el (org-copy-visible): New command.
2011-07-26 11:53:13 +02:00
Bastien Guerry c222e8f134 org-capture: Fix order of template sequences.
* org-capture.el (org-capture-templates): docstring fix.
* org.texi (Template expansion): order template sequences in
the proper order.

Thanks to Philipp Möller for this fix.
2011-07-25 23:08:45 +02:00
Eric Schulte b1724e02fb adding a function for inspecting code block information e.g., header arguments
* lisp/ob.el (org-babel-view-src-block-info): New function to inspect code blocks.
* lisp/ob-keys.el (org-babel-key-bindings): Key bindings for org-babel-view-src-block-info.
* doc/orgcard.tex: Documentation of new Babel function.
2011-07-25 10:50:56 -06:00
Bastien Guerry 07a2f48209 Merge branch 'master' of orgmode.org:org-mode 2011-07-25 15:45:01 +02:00
Bastien Guerry bbb2ef510a org-exp: Handle recursively included setup files correctly.
* org-exp.el (org-infile-export-plist): Handle recursively
included setup files.  The value of the last included file
always takes precedence over previous values.

Thanks to Stefan Vollmar for signaling this bug.
2011-07-25 15:44:22 +02:00
Nicolas Goaziou ee3ea164c9 Keep point in the same category when updating a time-stamp
* lisp/org.el (org-timestamp-change): keep point in the same category
  when updating a time-stamp. This requires to be careful, as,
  depending on the locale, name of day might change of length during
  the process.
2011-07-25 11:37:45 +02:00
Nicolas Goaziou 3b5132bf8f org-footnote: fix bug when inserting a footnote in a non-Org buffer
* lisp/org-footnote.el (org-footnote-create-definition): when skipping
  already written footnotes definition, the algorithme would assume
  each one was only one-line long.
2011-07-25 11:26:06 +02:00
Bastien Guerry 642c666766 Merge branch 'master' of orgmode.org:org-mode 2011-07-25 00:55:18 +02:00
Bastien Guerry 829e226536 org-table: fix another bug in duration computation.
* org-table.el (org-table-eval-formula): Fix bug when a
formula "range" is just one cell.
(org-table-time-string-to-seconds): don't check whether
we manipulate a string.
2011-07-25 00:55:04 +02:00
Litvinov Sergey 6b6ab13810 Awk can be called with no in-file: and no :stdin 2011-07-24 14:05:55 -06:00
Bastien Guerry cb973614bd Merge branch 'master' of orgmode.org:org-mode 2011-07-24 20:44:01 +02:00
Bastien Guerry 53da4c15a9 Fix handling of duration for complex range formulas.
Thanks to Christian Moe for signaling this bug.
2011-07-24 20:31:38 +02:00
Nicolas Goaziou ba092ec08d Do not add an extraneous blank lines when parsing lists
* lisp/org-exp.el (org-export-mark-list-end,
  org-export-mark-list-properties): don't remove the ending regexp
  when it consists in blank lines.
* lisp/org-list.el (org-list-parse-list): ditto, but remove it
  completely when it isn't made of blank lines (i.e. during export process).
2011-07-24 20:03:30 +02:00
Bastien Guerry ecd2a41ecc org-table: use HH:MM:SS as the standard display of durations.
(org-table-time-seconds-to-string): Uniformize the display of
durations, always return HH:MM:SS.  Also display negative time
correctly.
2011-07-24 18:40:30 +02:00
Bastien Guerry 9a6a1b6a04 (org-table-time-string-to-seconds): also match negative time values. 2011-07-24 18:32:51 +02:00
Bastien Guerry 9c5a8ab295 org-table: match either HH:MM:SS or HH:MM (instead of MM:SS).
* org-table.el (org-table-time-string-to-seconds): match
either HH:MM:SS or HH:MM (instead of MM:SS).

Thanks to Gustav Wikström for suggesting this change.
2011-07-24 18:19:17 +02:00
Bastien Guerry 88eada52a6 org: allow relative time in `org-add-planning-info'.
(org-deadline, org-schedule): Improve docstrings.
(org-add-planning-info): Allow relative time like "-2d" or
"++2w" for the TIME argument.

The user can now call `org-schedule' and `org-deadline'
and use "+1d" to say that the task must be scheduled one
day later than today, or "++1d" to say that the task must
be scheduled one day later than the current SCHEDULED date,
if any.

This also works in agenda: you can select several entries
and reschedule them to +2d.

Thanks to Memnon Anon for insisting an finding a solution
for this!
2011-07-24 18:08:24 +02:00
Bastien Guerry 6808a1a1c0 org-agenda: fix two minor docstring typos. 2011-07-24 17:17:10 +02:00
Bastien Guerry 162080f5f8 org.el: tiny typo in docstring. 2011-07-24 16:44:48 +02:00
Bastien Guerry eaafa42948 New hook `org-ctrl-c-ctrl-c-final-hook'.
* org.el (org-ctrl-c-ctrl-c-final-hook): New hook to be run
when `org-ctrl-c-ctrl-c' cannot do anything useful in the
given context.

Thanks to Paul Sexton for this idea.
2011-07-24 16:12:47 +02:00
Bastien Guerry 2f1fbc58be org-html: add divs for pre/postamble defined in a new variable.
`org-export-html-divs' contains '("preamble" "content" "postamble")
and is used to define the <div "%s"> for this parts of the HTML file.

This commit also obsolete some variables that are not useful anymore
as the file time-stamp can (should) be inserted through the postamble
or the preamble instead.

Thanks to Sébastian Vauban for a preliminary version of this patch!

* org-html.el (org-export-html-with-timestamp)
(org-export-html-html-helper-timestamp): These are obsolete
variables as of Org version 7.7 as you can already export the
timestamp from the preamble or the postamble.
(org-export-html-before-content-div): Delete variable.
(org-export-html-content-div): obsolete variable as of 7.7.
(org-export-html-divs): New variable to define divs used in
HTML export.
(org-export-as-html): Now the preamble and the postamble are
surrounded by a <div ...>.  The name of the div is defined
through `org-export-html-divs'.
2011-07-23 19:09:07 +02:00
Bastien Guerry 4a6a317443 org-exp-blocks: minor fix: use <br/> instead of </br>. 2011-07-23 17:35:36 +02:00
Bastien Guerry ee5eb944e0 org-table: Throw an error when replacing invalid references.
* org-table.el (org-table-eval-formula): Throw an error when
trying to replace complex range with invalid references.

Thanks to Ken Williams for pointing this out.
2011-07-23 17:23:19 +02:00
Nicolas Goaziou ad3563e1c4 org-macs: macro org-with-limited-levels' also sets outline-regexp'
* lisp/org-macs.el (org-with-limited-levels): some functions, like
  `org-back-to-heading', being deeply based on outline-mode, still
  refer to `outline-regexp' instead of `org-outline-regexp'.
2011-07-23 10:13:07 +02:00
Bastien Guerry de27fab99a org.el: remove one trailing whitespace. 2011-07-22 11:21:29 +02:00
Bastien Guerry 7c8db0fa34 org-refile: exclude current (sub)heading(s) even if they start with a TODO keyword.
(org-get-heading): New optional argument to return heading
with no TODO keyword.
(org-refile-get-location): Use this new argument.
2011-07-22 11:20:53 +02:00
Bastien Guerry 07d42cbee6 org-refile: exclude current heading and subheadings from targets
* org.el (org-refile-get-targets): new optional argument
`excluded-entries' to exclude entries from the targets.
(org-refile-get-location): From an org-mode buffer, exclude
current heading and subheadings from the list of targets when
org-refile-use-cache is nil.

Also remove some trailing whitespaces.

Thanks to Jason Dunsmore for this idea.
2011-07-22 11:20:35 +02:00
Bastien Guerry bd01d9bf83 Revert "Fix bug with TODO states changes modifying scheduling of next headline"
This reverts commit fd0f8e10d1.
2011-07-22 09:24:28 +02:00
Nicolas Goaziou 6b38912771 Fix small mistake
* lisp/org.el (org-imenu-get-tree): note to self: headlines start at bol.
2011-07-21 20:40:58 +02:00
Eric Schulte 4f094db113 fixed self-proclaimed file name in ob-maxima
* lisp/ob-maxima.el: Fixed self-proclaimed file name.
2011-07-21 11:11:33 -06:00
Eric Schulte 4b6bfab817 ob: only call copy-seq on proper lists
* lisp/ob.el (org-babel-sha1-hash): Only call copy-seq on proper
  lists.
2011-07-21 11:05:33 -06:00
Nicolas Goaziou 4fd9989b58 Fix archiving bug introduced by last commit
* lisp/org.el (org-kill-is-subtree-p): matched string needs to start
  at bol.
2011-07-21 16:53:50 +02:00
Nicolas Goaziou 5b39df0523 Remove inline tasks from subtrees yanking
* lisp/org.el (org-paste-subtree, org-kill-is-subtree-p,
  org-yank-folding-would-swallow-text, org-yank-generic): use
  `org-with-limited-levels' macro.
2011-07-21 13:47:55 +02:00
Nicolas Goaziou 71f654a182 org-macs: org-with-limited-levels also change org-outline-regexp-at-bol
* lisp/org-macs.el (org-with-limited-levels): also modify, when
  appropriate, `org-outline-regexp-at-bol'
2011-07-21 13:45:56 +02:00
Bastien Guerry 74a4f97108 Revert "org.el: exclude current heading from the refile table."
This reverts commit 651a537e49.
2011-07-21 12:28:57 +02:00
Bastien Guerry 26b084d3b5 Merge branch 'master' of orgmode.org:org-mode 2011-07-21 12:28:43 +02:00
Bastien Guerry 0625a74b08 org-agenda.el (org-agenda-prefix-format): improve docstring.
Thanks to Tassilo for pointing at this.
2011-07-21 12:16:36 +02:00
Nicolas Goaziou fd0f8e10d1 Fix bug with TODO states changes modifying scheduling of next headline
* lisp/org.el (org-timestamp-change): some locales don't use the same
  length for date abbreviations. Set a marker at origin in case length
  of new timestamp is different.

Thanks to Tom for analyzing this.
2011-07-21 11:48:35 +02:00
Nicolas Goaziou d8bd43ed5f Avoid getting inline tasks when using imenu
* lisp/org.el (org-imenu-get-tree): browse only true headlines.
2011-07-21 01:43:29 +02:00
Nicolas Goaziou 0b4b66b302 org-archive: error when buffer isn't visiting a file
* lisp/org-archive.el (org-archive-subtree): while it might be
  possible to archive an headline of a temporary buffer (i.e. not
  visiting a file), it wouldn't be really sensical.
2011-07-21 00:43:52 +02:00
Nicolas Goaziou 26ba1b3680 org-archive: fix archiving from an indirect buffer
* lisp/org-archive.el (org-extract-archive-file,
  org-extract-archive-heading, org-archive-subtree): buffer-file-name
  is nil in an indirect buffer. Thus,
  use (buffer-file-name (buffer-base-buffer)), which will, in any
  case, return the file-name.

Thanks to Ilya Shlyakhter for reporting and analyzing this.
2011-07-21 00:23:23 +02:00
Bastien Guerry 5e33df46a4 Revert "org-capture: require dired since org-capture might use `dired-buffers'"
This reverts commit f3e563476b.
2011-07-19 18:41:21 +02:00
Bastien Guerry 4670e95458 Merge branch 'master' of orgmode.org:org-mode 2011-07-19 18:34:02 +02:00
Bastien Guerry 3482284bbd Make sure :html-pre/postamble can insert the output of a custom function.
This function must have no argument and must output a string to be inserted
in the HTML export.

Thanks to Sander Boer for pointing at this.
2011-07-19 18:33:53 +02:00
Bastien Guerry f3e563476b org-capture: require dired since org-capture might use `dired-buffers' 2011-07-19 18:27:11 +02:00
Nicolas Goaziou d883d0b01d org-capture: fix error with %F and dired not loaded
* lisp/org-capture.el (org-capture): if dired isn't loaded,
  `dired-buffers' isn't defined, and %F will fail.

Thanks to Puneeth Chaganti for reporting this.
2011-07-19 17:49:37 +02:00
Eric Schulte 8d27bf40d3 ob-java: don't create empty package directories
* lisp/ob-java.el (org-babel-execute:java): Don't create empty package
  directories.
2011-07-19 08:45:49 -06:00
Eric Schulte 0b9cc74c56 ob: replaced call to defunct function `org-babel-result-hash'
* lisp/ob.el (org-babel-execute-src-block): Replaced call to defunct
  function `org-babel-result-hash'.
2011-07-19 07:25:35 -06:00
Bastien Guerry 1895a334f8 Merge branch 'master' of orgmode.org:org-mode 2011-07-19 14:48:43 +02:00
Nicolas Goaziou ed685f8a7e org-footnote: in Message mode, do not allow footnotes in headers
* lisp/org-footnote.el (org-footnote-in-valid-context-p): avoid cited
  lines and headers in message-mode.
(org-footnote-at-reference-p): remove check for cited lines, this is
now handled by the previous function. Refactor.
2011-07-19 12:52:06 +02:00
Bastien Guerry 09859b303d org-agenda.el (org-agenda-bulk-custom-functions): minor docstring fix. 2011-07-19 11:35:41 +02:00
Bastien Guerry ce2a33104b org.el: (org-do-emphasis-faces): docstring fix. 2011-07-19 11:25:45 +02:00
Nicolas Goaziou 819fbec641 org-capture: %F is directory when capture starts in a dired buffer
* lisp/org-capture.el (org-capture): if no file is associated to
  current buffer, check dired buffer and try to retreive a possibly
  directory associated.
2011-07-19 08:56:10 +02:00
Bastien Guerry 08fc6384bc org.el (org-outline-regexp): Turn into a defvar.
`org-outline-regexp' ought to be a defconst but is let-binded
in some places -- e.g. see the macro `org-with-limited-levels'
and this produces misleading warnings.

Thanks to Matthew Sauer for reporting this.
2011-07-19 02:00:50 +02:00
Eric Schulte 8854497c35 ob-exp: on export resolve hashes in the current (not original) file buffer
* lisp/ob-exp.el (org-babel-exp-results): Resolve hashes in the
  current (not original) file buffer.
* lisp/ob.el (org-babel-current-result-hash): More informative name,
  and remove useless optional argument.
2011-07-18 17:08:37 -06:00