Commit graph

1232 commits

Author SHA1 Message Date
Eric Schulte 6da29f1519 integrating org-babel into org.el 2010-06-23 13:41:20 -07:00
Carsten Dominik 80bcadf605 Fix behavior of org-timestamp-change for explicit number of day changes
* lisp/org.el (org-timestamp-change): New optional argument UPDOWN.
Use this to identify calls from org-timestamp-up/down, so that we can
skip by rounding minutes in this case.
(org-timestamp-up):
(org-timestamp-down):
(org-timestamp-up-day):
(org-timestamp-down-day): Call org-timestamp-change with the
updown argument.

This function used to look only if there was a prefix argument in the
current interactive call.  Now we have an explicit marker indicating
that the function is called from the updown commands.
2010-06-22 16:14:55 +02:00
Carsten Dominik 0c4e2ab0ed Add autoloads for org-capture 2010-06-22 14:29:13 +02:00
Carsten Dominik 1d52e54efd New capture system org-capture
* lisp/org-agenda.el (org-agenda-action): Make `c' key call org-capture.
* lisp/org-capture.el: New file.
* lisp/org-compat.el (org-get-x-clipboard): Function moved here from
remember.el.
* lisp/org-mks.el: New file
* lisp/org.el (org-set-regexps-and-options): Allow statistic cookies as
part of complex headlines.
(org-find-olp): New argument THIS-BUFFER.  When set, assume that the
OLP does not contain a file name.
2010-06-22 14:19:18 +02:00
Carsten Dominik eade8e6fa3 Revert "* lisp/org-agenda.el (org-agenda-get-deadlines):"
This reverts commit 14b689946d.

See discussion in

   http://thread.gmane.org/gmane.emacs.orgmode/26154/focus=26400
2010-06-21 15:18:36 +02:00
Carsten Dominik 42ea7d35b7 No longer define comments in the syntax table
* lisp/org.el (org-mode): Set `comment-start' instead of changing the
syntax of the `#' character.

Leo writes:

> Setting a comment starter without a corresponding comment ender is
> problematic and the # creeps in mysteriously under auto-fill. For
> example, in my current running emacs, this happens almost certainly in
> all org files that has # in their header. The only (temporary) solution
> seems to reboot emacs (which is painful and disruptive).
>
> If you try eval (forward-comment 1) at the beginning of an org file that
> has some "#+..." it will move to the end of file (the whole file is
> regarded as one single comment). So when auto-fill a long text, it will
> find the common prefix to be #.
>
> In addition, I don't think org mode has clear comment syntax or ideas on
> what to do with it.
>
> I can't see any gain from (modify-syntax-entry ?# "<") so I am proposing
> removing it entirely and get rid of this mysterious and annoying bug
> once and for all.
>
> The attached patch may (though I think it is quite safe) cause some bugs
> but those will be fixable unlike the one mentioned above.
>
> Best wishes,
>
> Leo
2010-06-18 09:10:44 +02:00
Bastien Guerry cdee45fa21 org.el (org-display-inline-images): allow more characters for image filenames.
Thanks to gregory@dynapse.com (Gregory J. Grubbs) for this patch.
2010-06-16 16:27:17 +02:00
Bastien Guerry 14b689946d * lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled):
* lisp/org.el (org-time-string-to-seconds):
For deadline and scheduled agenda display ignore the cyclic repeater
when calculating how many days late the task is.  If you have a weekly
task and miss the date the agenda view will show more than a week late
now instead of resetting on the cyclic repeating date.  This makes it
much more obvious when you missed a repeating task after the repeater.

Thanks to Bernt Hansen for this patch.
2010-06-16 16:12:31 +02:00
Mikael Fornius 8759a77a39 Do not fontify subscripts of property keys.
* org.el (org-raise-scripts): Do not fontify sub/superscripts of text
with face `org-special-keyword'. Makes property keys as :LAST_REPEAT:
display correctly.
2010-06-16 02:17:06 -04:00
Mikael Fornius 4de326196a Use save-match-data macro instead of let.
* org.el (org-at-property-p): Use save-match-data macro instead of let.
2010-06-16 02:17:06 -04:00
Mikael Fornius 2560f72c33 Removed unused test function.
* org.el (test): Removed unused test function.
2010-06-16 02:17:06 -04:00
Martin Pohlack d18653505d Add modification hook for inline images
This patch adds a modification hook to remove inline-image overlays if
the underlying text is modified.  This prevents blind editing of text
behind images.
2010-06-16 02:17:05 -04:00
Christian Egli 020bb514a4 Integrate org-taskjuggler in the rest of org-mode 2010-06-08 09:20:32 +02:00
Eric Schulte cdc70ed68d color indented babel strings -- srcname, source, results, result, and call 2010-06-07 18:10:47 -07:00
Carsten Dominik b27c1c5113 Fix whitespace problems 2010-06-07 08:35:10 +02:00
Carsten Dominik 0d0dc0acb4 Do not format sub- and superscripts in links
* lisp/org.el (org-raise-scripts): Do not act in links.

Matt Lundin writes:

> Git commit 70d24c5d03 causes underscores
> in hyperlinks to display parts of link and description as subscripts.
> E.g., this link...
>
> [[http://www.samplepage.com/an_underscore][Some description words]]
>
> ...displays the word "Some" in the description as a subscript. With M-x
> visible-mode, the substring "underscore][Some" is displayed as a
> subscript.
2010-06-07 05:54:41 +02:00
Carsten Dominik 28babd4dff Better recognizing of source code snippets
* lisp/org.el (org-edit-special): Make sure source code editing goes
before table formula editing.
* lisp/org-table.el (org-table-fedit-map): "C-c '" will now also exit
the formula editor.
2010-06-06 12:51:27 +02:00
Carsten Dominik f70956ff5a Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-06-04 21:02:41 +02:00
Eric Schulte c2c3e98004 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-06-04 07:31:58 -06:00
Carsten Dominik 1eb974ed62 Fix problem with calendar popping up in a different frame
* lisp/org.el (org-read-date): Bind `calendar-setup' to nil for the
scope of this command.
2010-06-04 12:57:39 +02:00
Carsten Dominik 420dd96768 Fix the date prompt for american-style dates
* lisp/org.el (org-read-date-analyze): Fix regular expression for
matching american dates

Daniel E. Doherty writes:

> In playing around with the date prompt (C-.), I ran across the following
> puzzling behavior from rather simple inputs.
>
> I entered the following on June 1, 2010.  Here is a date entered as
> "3/15": <2011-03-15 Tue>.  It interpreted it as the upcoming March 15 as
> expected.
>
> But here is a date entered as "5/21": <2021-06-05 Sat>.  Note how it
> interpreted the "21" as the year 2021, not at all what I expected from
> the documentation or the analogous "3/15" example.
>
> Maybe there is some underlying logic here that I'm not getting.  Perhaps
> it has to do with how 2-digit years are interpreted?
>
> What's going on here?  I am using org-version 6.36trans on emacs 23.1.

What was going on here is that the regular expression for matching
american-style dates was wrong.  It was looking for month numbers in
the second field and day numbers in the first field - wrong, of
course.
2010-06-04 12:35:41 +02:00
Carsten Dominik 6bad6fc737 Fix some issues in the entity and subscript code
* lisp/org-macs.el (org-rm-props): Add org-emphasis to the properties
that must be removed.
* lisp/org.el (org-do-emphasis-faces): Add org-emphasis property to
items that have emphasis done wit font-lock.
(org-fontify-entities): Do not do anything in commented lines.
(org-unfontify-region): Decompose the region as well, because we do
composition during font-lock.
(org-raise-scripts): Do nothing inside an emphasis string.

Reported by Eric Fraga in http://article.gmane.org/gmane.emacs.orgmode/25940
2010-06-04 08:25:50 +02:00
Carsten Dominik 0618aeafb3 Make raising and lowering not mess up table alignment
* lisp/org-compat.el (org-string-match-p):
(org-looking-at-p): New functions.
* lisp/org-table.el (org-table-align): Handle raised text with
invisible characters.
* lisp/org.el (org-script-display): Add raise properties for tables.
(org-raise-scripts): Handle raising differently inside tables.

Pretty display of subscripts and superscripts no longer messes up
table alignment.  This is achieved by two things:

1. Inside tables, the raised characters are not made smaller, they
   remains at the same size.  Instead they are raise/lowered more, by
   a full half character height to still be clearly readable as
   subscript or superscript.

2. The invisible characters are taken into account when computing the
   field width.
2010-06-03 10:24:04 +02:00
Carsten Dominik fd1d2992f6 Make it possible to protect hidden subtrees to be killed by `C-k'
* lisp/org.el (org-ctrl-k-protect-subtree): New option.
(org-kill-line): Protect hidden subtrees if the user wants it.
* doc/org.texi (Headlines): Mention the special behavior of C-k
in headlines.

Scott Otterson writes:

> For what must be the dozenth time, I've just accidentally deleted a
> large tree by typing C-k while in a headline.
>
> This is really easy to do because emacs users have "C-k deletes to the
> end of the line" worn deeply into their neural pathways -- it's so
> automatic for me that the keystroke is close to subconscious.  A
> mistaken C-k is especially hard to detect because org-mode displays
> the result exactly like what your subconscious expects, that is, a
> collapsed headline is deleted to the end -- and the tree underneath is
> wiped out with no noticeable warning.
>
> Feature request: add an option preventing tree deletion with C-k
> without user confirmation.  Actually, I'd like an option to prevent it
> period.
>
> If this option is already in there, then you're encouraged to tell me
> to RTFM.  But then also please tell me where it is, because I can't
> find it.

Carsten replies

> This is now possible due to the variable
> `org-ctrl-k-protect-subtree'.  But I predict that you are going to set
> it to nil again soon :D
2010-06-03 00:18:44 +02:00
Carsten Dominik 70d24c5d03 Implement pretty display of sub- and superscripts.
* doc/org.texi (Subscripts and superscripts): Document that `C-c C-x \'
will also format sub and superscripts.
* doc/orgcard.tex: Document that `C-c C-x \'
will also format sub and superscripts.
* lisp/org.el (org-use-sub-superscripts):
(org-pretty-entities-include-sub-superscripts): Move here from
org-exp.el.
(org-set-regexps-and-options): Parse subscript option and set
`org-use-sub-superscripts' as a local variable.
(org-match-sexp-depth):
(org-create-multibrace-regexp):
(org-match-substring-regexp):
(org-match-substring-with-braces-regexp): Moved here from org-exp.el
(org-set-font-lock-defaults): Call `org-raise-scripts'.
(org-remove-font-lock-display-properties): New function.
(org-unfontify-region): Call
`org-remove-font-lock-display-properties'.
(org-script-display): New constant.
(org-raise-scripts): New function.

When turning on entity display with `C-c C-x \', sub- and superscripts
will also be displayed in a smaller font, and raised/lowered.
2010-06-03 00:06:19 +02:00
Eric Schulte c4d385681f make org-show-block-all interactive as is org-hide-block-all 2010-06-02 15:03:53 -06:00
Carsten Dominik bc53b3da3b Minor fixes
* lisp/org-latex.el (org-export-latex-fontify): Avoid fontifying
several stars in a row.
* lisp/org.el (org-emphasis-alist): Mention
`org-export-docbook-emphasis-alist' in the docstring.
2010-06-01 09:43:03 +02:00
Carsten Dominik d34786f227 Move a function to org.el
* lisp/org.el (org-find-olp): Move the function here, from org-mobile.el
2010-05-31 18:57:01 +02:00
David Maus 963f830b2e Escape percent character.
* org.el (org-fixup-message-id-for-http): Escape percent
character.
2010-05-28 15:46:32 -06:00
Carsten Dominik e90fe668ac Rename org-beamer-settings-template
* lisp/org-beamer.el (org-insert-beamer-options-template):
Renamed from `org-beamer-settings-template'.
2010-05-28 17:34:01 +02:00
Carsten Dominik e7a3e1a223 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-05-28 09:18:37 +02:00
Carsten Dominik 4917ae9362 Fix typo
* lisp/org.el (org-show-context): Fix typo
2010-05-28 08:16:39 +02:00
Carsten Dominik a9a5e6b848 Fix id creation bug when remember is called from agenda
* lisp/org.el (org-store-link): Don't call org-store-link
interactively when called through remember from the agenda

Samuel Wales writes:

> For months, I found ID properties where they didn't belong.
> Finally I found that they are added when I do M-x
> org-remember in an agenda buffer, to the headline under
> point.  Feels like a bug.  [...]
2010-05-28 08:15:49 +02:00
David Maus 5349014e82 org.el: Remove duplicate code in `org-clone-subtree-with-time-shift'.
Operating on the clone (e.g. remove/recreated ID property) is
independent on whether the subtree is cloned with time shift or not.
2010-05-26 22:54:29 -06:00
Tassilo Horn 54d513ee0c org.el (org-agenda-file-p): New predicate function.
The new function `org-agenda-file-p' checks if a given file is an org
agenda file.  Such a function is very useful in hooks, for example if
you want to export agenda files automatically when saving:

(defun th-org-mode-init ()
  ;; Update appointments and export to iCalendar when saving.
  (when (org-agenda-file-p)
    (add-hook 'after-save-hook 'th-org-agenda-to-appt t t)
    (add-hook 'after-save-hook 'org-export-icalendar-this-file t t)))
(add-hook 'org-agenda-mode-hook 'th-org-agenda-mode-init)
2010-05-26 22:46:34 -06:00
Eric Schulte 2b08e18b93 added indent macro declaration to `org-save-outline-visibility' 2010-05-26 19:44:29 -06:00
Matt Lundin bb912d6d7c Fix org-refile-cache-check-set
Org-refile-cache fails when org-refile-use-outline-path is set to file.
Specifically, org-refile-cache-check-set throws a markerp error when it
encounters file targets, since they have nil instead a marker object.
This patch applies the test only to targets with markers (i.e.,
headings).
2010-05-26 14:14:47 -06:00
Matt Lundin 4c6012f831 Don't build org-refile-cache if org-refile-use-cache is nil
The function org-get-refile-targets was building org-refile-cache even
if org-refile-use-cache was set to nil. This caused every refile
attempt to call org-refile-cache-clear and to produce the message
"Refile cache has been cleared."
2010-05-26 14:11:04 -06:00
John Wiegley 7e2158651d Added forward var decl to quiet compiler warning
* lisp/org.el (org-property-drawer-re): Forward declaration to avoid
  compiler warning.
2010-05-21 13:39:34 -04:00
John Wiegley a0a5b10f7a Revert "org.el (org-remove-inline-images): Call `clear-image-cache'."
This reverts commit 0c42220ca0.
2010-05-21 05:01:39 -04:00
Carsten Dominik 67331a2de0 Document the match groups of org-emph-re 2010-05-21 09:26:04 +02:00
Russell Adams 0c42220ca0 org.el (org-remove-inline-images): Call `clear-image-cache'. 2010-05-20 18:10:45 -04:00
Carsten Dominik 7403cb1992 Hide subtree before exposing the headings with `C-c C-k'
Proposed by Ali Tofigh.

Now `C-c C-k' always creates the same view, independent of what the
subtree visibility was before.
2010-05-20 08:51:54 +02:00
David Maus 6f1bd65fb6 Remove empty property drawers in cloned subtrees. 2010-05-20 07:59:18 +02:00
David Maus c1751071fc Provide customization variable `org-clone-delete-id'.
When non-nil, clones of a subtree don't inherit the ID property.
Otherwise they do and it will be set to a new unique identifier.
2010-05-20 07:59:06 +02:00
David Maus 9f9d129a00 Maybe create ID property in cloned subtrees. 2010-05-20 07:58:42 +02:00
Carsten Dominik 5eb7bf8a03 Add Anthony Lander's org-mac-link-grabber.el 2010-05-19 23:49:40 +02:00
Carsten Dominik d180631686 Fix empty-line problem after repeating entry
Tom writes:

> if I have a heading like this:
>
>
> ** TODO test task
> stuff
>  SCHEDULED: <2010-05-15 Sat 07:35 +1d>
>
>
> Then an empty line is inserted below the heading (before "stuff") if
> org-indent-mode is on and logging is set like this:
>
>
> (setq org-log-repeat nil)
> (setq org-log-done 'time)
>
>
>
> I tested it with a clean config using only the settings above.
2010-05-19 18:03:50 +02:00
Bastien Guerry 0515ae29c0 Fix `org-refile-cache-get' error.
This patch fixes the problem first reported by Tassilo Horn in
[mid:87y6fhxc47.fsf@thinkpad.tsdh.de].  Problem was that
`org-refile-cache-get' returned an invalid refile target table after
the refile cache was cleared.
2010-05-19 11:37:08 +02:00
Carsten Dominik 679e3b7f03 Implement caching of refile targets 2010-05-17 19:27:08 +02:00