Commit graph

1218 commits

Author SHA1 Message Date
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
Carsten Dominik 016bfaefd5 Move entity search to later in the fontification 2010-05-17 18:39:26 +02:00
Carsten Dominik 7f86e0dedb Display entites as UTF8 characters
Based on code by Eric Schulte
2010-05-16 07:46:37 +02:00
David Maus d090a9d858 Remove ID property in clone template 2010-05-15 01:03:15 +02:00
Carsten Dominik 9a1612410f LaTeX Export: Fix problem with alignment specs that contain a comma 2010-05-14 14:27:35 +02:00
Carsten Dominik 3f74a69f91 Fix minor bug 2010-05-14 09:07:46 +02:00
Carsten Dominik 256b0dc88a Fix whitespace problem with in-buffer settings 2010-05-14 07:53:03 +02:00
Carsten Dominik 650a416935 Define variable 2010-05-13 23:05:11 +02:00
Carsten Dominik f3b5524a2e Make C-M-a and C-M-e do the right thing in Org-mode
The commands now move back to the heading, and to the end of the
subtree, respectively.

Proposed by Lennard Borgmann.
2010-05-13 08:59:39 +02:00
Carsten Dominik a95427de18 New %T escape for note headings
Patch by Richard Riley.
2010-05-13 07:49:42 +02:00
Carsten Dominik e21d08ae35 Improve org-file-apps docstring
Patch by Jan Böker.
2010-05-13 07:19:24 +02:00
Carsten Dominik 90c37b3f4a Fix empty line display after property visibility 2010-05-12 15:56:46 +02:00
Carsten Dominik 33fba09ddb Match also image paths relative to home
Baoqui Cui writes:

> "robut@iinet.net.au" <robut@iinet.net.au> writes:
>
> I very much like the idea of native inline image display in Org-mode but  can't
> seem to make it work.
>
> Given a 6.36 snapshot or 6.36 release and these org file contents
>
> * Test image
> Test image
> [[Screenshot.png]]
>
>
> I hoped org would display that image after C-c C-x C-v. Rather Org-mode returns
> "No images to display inline".
>
> I've tried different ways of linking that image, different image formats,
> relative vs complete paths, and my regular .emacs vs  a near empty one and
> always the same result. If I toggle iimage-mode the image displays fine per se
> but does not affect how Org-mode works.
>
> Seems clear I am missing something simple. What?
>
> I like the idea of inline image display too, but hit the similar
> problems.  After reading the code in org.el, I found that the inline
> image file link has to start with either "file:" or "./".
>
> For example, the following two links are OK:
>
>   [[file:~/images/myImage.png]]
>   [[./figures/org-mode-unicorn.svg]]
>
> but the following two are not:
>
>   [[Screenshot.png]]
>   [[~/images/myImage.png]]
>
> Here is a small patch that seems to work well for me, but I'd like
> Carsten to check whether it may break anything
2010-05-12 14:51:42 +02:00
Carsten Dominik 1444920253 Improve inline image display 2010-05-12 14:38:30 +02:00
Carsten Dominik 3d8b6de2ad Free up the `C-c C-v' key for Org Babel
TODO sparse trees are also accessible with `C-c / t'.
2010-05-12 08:04:27 +02:00