From c7cf0ebc24d66371c8d48ad72f65e72a2a027f06 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 8 Jan 2013 15:27:18 +0100 Subject: [PATCH] Merge Org 7.9.3 (commit 31c1aea) --- doc/misc/ChangeLog | 12 + doc/misc/org.texi | 57 ++- etc/ORG-NEWS | 51 +++ etc/refcards/orgcard.pdf | Bin 118624 -> 118630 bytes etc/refcards/orgcard.tex | 6 +- lisp/ChangeLog | 402 +++++++++++++++++++ lisp/org/ob-eval.el | 60 +-- lisp/org/ob-exp.el | 1 - lisp/org/ob.el | 14 +- lisp/org/org-agenda.el | 214 ++++++---- lisp/org/org-ascii.el | 12 +- lisp/org/org-capture.el | 2 +- lisp/org/org-clock.el | 21 +- lisp/org/org-colview.el | 2 +- lisp/org/org-compat.el | 70 +++- lisp/org/org-crypt.el | 4 +- lisp/org/org-docbook.el | 17 +- lisp/org/org-element.el | 10 +- lisp/org/org-exp.el | 5 +- lisp/org/org-faces.el | 3 + lisp/org/org-html.el | 18 +- lisp/org/org-icalendar.el | 5 +- lisp/org/org-id.el | 2 +- lisp/org/org-inlinetask.el | 3 + lisp/org/org-install.el | 6 +- lisp/org/org-jsinfo.el | 2 +- lisp/org/org-latex.el | 2 +- lisp/org/org-list.el | 18 +- lisp/org/org-lparse.el | 4 +- lisp/org/org-macs.el | 9 + lisp/org/org-mobile.el | 31 +- lisp/org/org-odt.el | 21 +- lisp/org/org-protocol.el | 6 +- lisp/org/org-publish.el | 2 +- lisp/org/org-src.el | 76 ++-- lisp/org/org-table.el | 12 +- lisp/org/org-version.el | 4 +- lisp/org/org.el | 787 ++++++++++++++++++++----------------- 38 files changed, 1329 insertions(+), 642 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 68b0c31916d..08e8cc3614a 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,15 @@ +2013-01-08 Bastien Guerry + + * org.texi (Pushing to MobileOrg): Add footnote about using + symbolic links in `org-directory'. + (Timestamps, Deadlines and scheduling): Use `diary-float' instead + of the now obsolete alias `org-float'. + (TODO basics): Add `org-use-fast-todo-selection' to the variable + index. Fix description of TODO keywords cycling. + (Advanced features): Add missing argument for @item. + (Storing searches): Add index entries and a note about + *-tree agenda views. + 2013-01-06 Andreas Schwab * autotype.texi: Remove undefined command @subtitlefont. diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 47ee0954671..3540ac8592a 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -2,7 +2,7 @@ @c %**start of header @setfilename ../../info/org @settitle The Org Manual -@set VERSION 7.9.2 (GNU Emacs 24.3) +@set VERSION 7.9.3 (GNU Emacs 24.3) @c Use proper quote and backtick for code sections in PDF output @c Cf. Texinfo manual 14.2 @@ -3747,6 +3747,8 @@ The most important commands to work with TODO entries are: @table @kbd @orgcmd{C-c C-t,org-todo} @cindex cycling, of TODO states +@vindex org-use-fast-todo-selection + Rotate the TODO state of the current item among @example @@ -3754,14 +3756,19 @@ Rotate the TODO state of the current item among '--------------------------------' @end example -The same rotation can also be done ``remotely'' from the timeline and -agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}). +If TODO keywords have fast access keys (see @ref{Fast access to TODO +states}), you will be prompted for a TODO keyword through the fast selection +interface; this is the default behavior when +@var{org-use-fast-todo-selection} is @code{non-nil}. + +The same rotation can also be done ``remotely'' from the timeline and agenda +buffers with the @kbd{t} command key (@pxref{Agenda commands}). @orgkey{C-u C-c C-t} -Select a specific keyword using completion or (if it has been set up) -the fast selection interface. For the latter, you need to assign keys -to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for -more information. +When TODO keywords have no selection keys, select a specific keyword using +completion; otherwise force cycling through TODO states with no prompt. When +@var{org-use-fast-todo-selection} is set to @code{prefix}, use the fast +selection interface. @kindex S-@key{right} @kindex S-@key{left} @@ -5512,7 +5519,7 @@ example with optional time @example * 22:00-23:00 The nerd meeting on every 2nd Thursday of the month - <%%(org-float t 4 2)> + <%%(diary-float t 4 2)> @end example @item Time/Date range @@ -5850,7 +5857,7 @@ entries. Org mode will issue early and late warnings based on the assumption that the timestamp represents the @i{nearest instance} of the repeater. However, the use of diary sexp entries like @c -@code{<%%(org-float t 42)>} +@code{<%%(diary-float t 42)>} @c in scheduling and deadline timestamps is limited. Org mode does not know enough about the internals of each sexp function to issue early and @@ -6539,7 +6546,7 @@ suggestion.} for capturing new material. @table @kbd @orgcmd{C-c c,org-capture} Call the command @code{org-capture}. Note that this keybinding is global and -not active by default; you need to install it. If you have templates +not active by default: you need to install it. If you have templates @cindex date tree defined @pxref{Capture templates}, it will offer these templates for selection or use a new Org outline node as the default template. It will @@ -8621,6 +8628,13 @@ buffer, or a sparse tree (the latter covering of course only the current buffer). @kindex C-c a C @vindex org-agenda-custom-commands +@cindex agenda views, main example +@cindex tags, as an agenda view +@cindex todo, as an agenda view +@cindex tags-todo +@cindex todo-tree +@cindex occur-tree +@cindex tags-tree Custom commands are configured in the variable @code{org-agenda-custom-commands}. You can customize this variable, for @@ -8681,6 +8695,9 @@ additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa, Peter, or Kim) as additional tag to match. @end table +Note that the @code{*-tree} agenda views need to be called from an +Org buffer as they operate on the current buffer only. + @node Block agenda, Setting Options, Storing searches, Custom agenda views @subsection Block agenda @cindex block agenda @@ -16537,14 +16554,18 @@ to the directory @code{org-mobile-directory}. By default this list contains all agenda files (as listed in @code{org-agenda-files}), but additional files can be included by customizing @code{org-mobile-files}. File names will be staged with paths relative to @code{org-directory}, so all files should be -inside this directory. The push operation also creates a special Org file -@file{agendas.org} with all custom agenda view defined by the -user@footnote{While creating the agendas, Org mode will force ID properties -on all referenced entries, so that these entries can be uniquely identified -if @i{MobileOrg} flags them for further action. If you do not want to get -these properties in so many entries, you can set the variable -@code{org-mobile-force-id-on-agenda-items} to @code{nil}. Org mode will then -rely on outline paths, in the hope that these will be unique enough.}. +inside this directory@footnote{Symbolic links in @code{org-directory} need to +have the same name than their targets.}. + +The push operation also creates a special Org file @file{agendas.org} with +all custom agenda view defined by the user@footnote{While creating the +agendas, Org mode will force ID properties on all referenced entries, so that +these entries can be uniquely identified if @i{MobileOrg} flags them for +further action. If you do not want to get these properties in so many +entries, you can set the variable @code{org-mobile-force-id-on-agenda-items} +to @code{nil}. Org mode will then rely on outline paths, in the hope that +these will be unique enough.}. + Finally, Org writes the file @file{index.org}, containing links to all other files. @i{MobileOrg} first reads this file from the server, and then downloads all agendas and Org files listed in it. To speed up the download, diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index a84165a0f74..e0f8812ab1d 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -1,10 +1,61 @@ ORG NEWS -- history of user-visible changes. -*- org -*- +#+LINK: doc http://orgmode.org/worg/doc.html#%s + Copyright (C) 2012-2013 Free Software Foundation, Inc. See the end of the file for license conditions. Please send Org bug reports to emacs-orgmode@gnu.org. +* Version 7.9.3 + +** New option [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]] + +[[doc::org-use-tag-inheritance][org-use-tag-inheritance]] controls whether tags are inherited when +org-tags-view is called (either in =tags=, =tags-tree= or =tags-todo= +agenda views.) + +When generating other agenda types such as =agenda=, =todo= and +=todo-tree=, tags inheritance is not used when selecting the entries +to display. Still, you might want to have all tag information correct +in the agenda buffer, e.g. for tag filtering. In that case, add the +agenda type to this variable. + +Setting this variable to nil should considerably speeds up the agenda +generation. + +Note that the default was to display inherited tags in the agenda +lines even if `org-use-tag-inheritance' was nil. The default is now +to *never* display inherited tags in agenda lines, but to /know/ about +them when the agenda type is listed in [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]]. + +** New default value nil for [[doc::org-agenda-dim-blocked-tasks][org-agenda-dim-blocked-tasks]] + +Using `nil' as the default value speeds up the agenda generation. You +can hit `#' (or `C-u #') in agenda buffers to temporarily dim (or turn +invisible) blocked tasks. + +** New speedy keys for [[doc::org-speed-commands-default][org-speed-commands-default]] + +You can now use `:' (instead of `;') for setting tags---this is +consistent with using the `:' key in agenda view. + +You can now use `=' for [[doc::org-columns][org-columns]]. + +** =org-float= is now obsolete, use =diary-float= instead +** No GPL manual anymore + +There used to be a GPL version of the Org manual, but this is not the +case anymore, the Free Software Foundation does not permit this. + +The GNU FDL license is now included in the manual directly. + +** Enhanced compatibility with Emacs 22 and XEmacs + +Thanks to Achim for his work on enhancing Org's compatibility with +various Emacsen. Things may not be perfect, but Org should work okay +in most environments. + * Version 7.9.2 ** New ELPA repository for Org packages diff --git a/etc/refcards/orgcard.pdf b/etc/refcards/orgcard.pdf index ccc02ae7968f9d1078a739a0be1ca8237a0d8b2e..8fc57d9c6d80311b379f36d0ef305cd489a9e5b7 100644 GIT binary patch delta 8916 zcmV;_A}ihCo(JZh2aqKKHXxIsBqxzhynkN%GQjGX^B|yDjmS00O%ucQ&B%$^`@Y0= zo#so1>%2x~jgws@HUSZtVaP#ToJ8|!!GMeaH?%R~sxBx9&zo+_V#7u* z>CksZg879!Y3WDqtU%D34LiARxqoC&?}o6Q8VwT%c`%5Ti+Z&xV1ye+2`Q~Nt0Lov zgob{GpRtoPkFzFWx&d-rqL!RxH7vKgK!*?u5$@2J={U+5>bPJ^gm1YdqOxdmu7De= zX+_Fz875>bV3qwU#VAM=%9{mT7YnMqL%Nd_c-DqsPm88v*jB_$v}&gVDu1^&S|YfA zFwV#dtvP=)LQRmyYy^yjb*Uv?mna6ZU){h6%)Wz#D>$Nbxf0shqBxQ=jTT*gY1W%A z2$UDKM6t;bbw@;~(!4d*1Q;{bR9W>g{i20Qu*u4$023Ty{4A|%j;O}#VI%eTZ>=xh zeg6#?-bq02n}u+nKR0K-xPR{l_orU*c3syD{H`}VugfN`o09wKS4mpy_=+^Iz~s?M z5)z{FXT#FROv-UxRDbU|^NB=~N zP9(Tk7d5sL4F5)%&bP*!SFbOu_h(;zb)jjdcE{Qq18M}Y=PdwY0xmRt|C)v?%q(<< zw1lDbr>${mHdeyon}1vnQpbAk2P1-~q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r z-5!b)?{tFHFkq=8dSN_(OPi>zkf52>fu8lC4}}q?Znc5K#Zz zWKES(A9X19@pqJlp3lQ9-ax|v8GCbcF8Y>BlZ)u8VQdKYQYGN2G02ak`$3>{^f_0zQS5Azo~zdD(|D&zdzAI?avMa)N#SRsn7ziO%T7y`X+zpBp- zLsV}&<#5u&{0!<#>dtLVf(ED?(r^*?-!)y3tHO87MYsA|L8F-J=~e4)%DYq;lVEg} zINhsd1ZZ3-g?(4>Yf0X*D+!G5(!|c?31H1(|4f}J7^`IBDgT8m{6u3V_sfSjy$~ku zD8}_YQk-ixw!Ynr3y0xvTMB`F+446k8w%nHpH69-d`cJPX420cRBIv)5*Vb!1LA@t zUw)lJ@1vIUhA0%TY4}%&8iSK3fM-TcG|Bn7bQt3B@*Dxq@u;>rV?H`Rp=s|m=zVqv zWr_3*eDQxjdVKGTrlgRXcBx*QJ&}@?N^3Z@fRZ7Ji=-!g`8?VjZ4Rb^5OU;EyXr4T zz?$?ML=iM9Ufm)(#Gk^JgjKUSTQ)>f_=nkLqW=wro|W)?e}p(Mm!t6dmSzVq zi3L4WE;g00RWVh2e{Ed7)WkS3sXM?n@WQR5&fLCu5W0aHr)<0B=&g-R^QN>?i(@36 ztY^NdU>r4?*|x%*5;hU)h|(`$c>wmM%}~8>lXl^uO2qGAN$^T?@=FRxa7gp>b4YPYa!T=W z^74rD@Q9EL{lAGZ5}OhbWaDN_&cVf%o;U-|1x{$~kG&0WCq%ACLT%=WG$~n@zX&~X z5F1t)YoAUR!HQP|^gId8|2I?3M;8DO2D)M1@UQAgc38Jr(JG7nQQS9tyBMWPfc7)nS$kd>=j Ty5uZ0(N}gP8X9R;8KnOKvYP + + * org-compat.el (org-define-obsolete-function-alias) + (org-define-obsolete-variable-alias): Introduce new compatibility + macros to obsolete functions and variables. + + * org-agenda.el, org-clock.el, org-id.el, org-lparse.el, + org-protocol.el org.el: Use + `org-define-obsolete-{function,variable}-alias' instead of + `define-obsolate{function,variable}-alias'. + + * org-faces.el: Define face alias mode-line for XEmacs (it's + called modeline there). + + * org-compat.el (org-condition-case-unless-debug): Do not use + defalias for special forms, the Emacs 22 byte-compiler does not + recognize them correctly when compiling macros. Use a macro + instead and rely on macro expansion. That however makes the + decision at compile time, which should be acceptable in this case + since it only affects debugging. + + * org-compat.el (org-no-popups): New wrapper macro which let-binds + the correct variables to suppress popup windows depending on the + Emacs version in use. This is a compile-time decision when + byte-compiling. + + * org.el (org-get-location, org-switch-to-buffer-other-window): + Use the wrapper `org-no-popups´ to let-bind the correct variables + for suppression of popup windows. + + * org-compat.el (user-error): Defalias to `error´ for Emacsen that + don't have it. + + * org-agenda.el (org-agenda-write): Use org-called-interactively-p + instead of called-interactively-p. + + * org.el (org-find-invisible-foreground): Do not use the value of + variables `default-frame-alist´, `initial-frame-alist´ and + `window-system-default-frame-alist´ when their symbol is not + bound. + +2013-01-08 Bastien Guerry + + * org-agenda.el (org-agenda-finalize): Don't remove tag alignment + depending on `org-prefix-has-tag', this should depend on + `org-agenda-remove-tags'. + + * org-agenda.el (org-agenda-finalize): Downcase tags when readding + them after agenda generation. + + * org.el (org-setup-filling): Set `auto-fill-inhibit-regexp' from + `org-outline-regexp'. + + * org-agenda.el (org-agenda-use-tag-inheritance): Fix custom + definition. + + * org.el (org-entry-get): Speed up by let-binding some variables + only if needed. Also fix a bug: consider an empty drawer as no + drawer. + + * 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-change-all-lines): Get local tags only. + (org-agenda-use-tag-inheritance): New option. + (org-agenda-finalize): When `org-agenda-use-tag-inheritance' + is non-nil, possibly reset tags in the agenda buffer. + (org-agenda-check-type): Enhance docstring. + + * org.el (org-use-tag-inheritance): Fix typo in docstring. + + * org-agenda.el (org-float): Don't alias `org-float'. + + * org.el (org-scan-tags): The skipper already checks for archived + entries. + + * org.el (org-refresh-properties): Rename from + `org-refresh-effort-properties' and use two new parameters. + (org-agenda-prepare-buffers): Use `org-refresh-properties'. + Also refresh the 'org-appt-warntime text property. + + * org-clock.el (org-clock-in): Use the renamed defun. + + * org-icalendar.el (org-icalendar-print-entries): Refresh the + 'org-appt-warntime property. + (org-icalendar-print-entries): Do not use `org-entry-get' to get + the "APPT_WARNTIME" property value. + + * org-agenda.el (org-agenda-get-timestamps) + (org-agenda-get-sexps, org-agenda-get-deadlines) + (org-agenda-get-scheduled): Ditto. + + * org.el (org-adaptive-fill-function): Fix checking of + post-affiliated. + (org-id-link-to-org-use-id): Fix compiler warning. + + * org-agenda.el (org-agenda-format-item): Do not use + org-get-effort to get the effort text property. + (org-agenda-get-sexps): Use `org-back-to-heading' when setting + the tags. + + * org-clock.el (org-clock-in): Refresh effort properties. + + * org.el (org-refresh-effort-properties): New defun. + (org-get-effort): Delete. + (org-set-effort): Set the 'org-effort text property. + (org-property-next-allowed-value): Ditto. + (org-agenda-prepare-buffers): Refresh effort properties. + + * org.el (org-read-date): Let-bind `mouse-autoselect-window' to + nil so that the mouse doesn't jump when the option is set to t + globally. + + * org-agenda.el (org-agenda-dim-blocked-tasks): Default to nil. + (org-agenda-dim-blocked-tasks): Make interactive and allow an + optional parameter 'invisible to hide blocked tasks instead of + just dimming them. + (org-agenda-mode-map): Bind `org-agenda-dim-blocked-tasks' to + "#". + + * org-agenda.el (org-agenda-finalize): Don't try to align tags + when there are no tags. Only try to draw the habit consistency + graph when there is a habit in the buffer. Only mark clocking + task when there is one. + + * org.el (org-adaptive-fill-function): DTRT in `message-mode'. + + * org.el (org-get-priority): Save match data even when using + `org-get-priority-function'. + + * org-mobile.el (org-mobile-create-index-file): Possibly + normalize `org-todo-keywords'. + + * org-mobile.el (org-mobile-push): Use the correct agenda + buffer names. + + * org.el (org-store-link): Use `org-id-link-to-org-use-id' instead + of the obsolete variable name. + + * org.el (org-fontify-meta-lines-and-blocks-1): Fix bug when + fontifying keywords with no value. + + * org.el (org-goto-auto-isearch): Enhance docstring. + (org-goto-map): Make a defun, so that the customized value of + org-goto-auto-isearch is correctly initialized. + (org-goto): Initialize the keymap with `org-goto-map'. + (org-get-location): Use *Org Help* as a temporary buffer. + Tell whether auto-isearch is on or off. + + * org-exp.el (org-export-as-org): Remove useless argument. + + * org-docbook.el (org-export-as-docbook-batch) + (org-export-region-as-docbook, org-export-as-docbook-pdf): Fix + the number of arguments. + (org-export-as-docbook): Remove useless argument. + + * org.el (org-speed-commands-default): Use ":" instead of ";" for + `org-set-tags-command', which is consistent with ":" in agenda + view. Use "=" for `org-columns". + + * org.el (org-sparse-tree): Fix redundant information in prompt. + + * org-exp.el (org-export-string): Fix number of arguments passed + to the org-export-as-* functions. + + * org-latex.el (org-export-as-latex): Fix typo in docstring. + + * org-list.el (org-cycle-include-plain-lists): Docstring + enhancement. + + * org.el (org-fontify-meta-lines-and-blocks-1): Fix fontification + bug when fontifying a keyword with no associated value. + (org-cycle-internal-local): Don't run hooks when cycling a plain + list before first headline. + (org-ctrl-c-ctrl-c): Throw a user error when trying to toggle a + blocked checkbox. + (org-indent-line): Fix table formulas indenting. + + * org-agenda.el (org-agenda-open-link): Fix bug when no link is + matched. Return a message instead of an error. + + * org-agenda.el (org-agenda-priority): Remove useless parameter + and fix showing priority in agenda buffers. + + * org-macs.el (org-with-buffer-modified-unmodified): New macro. + + * org.el (org-entry-blocked-p): Use the new macro. + + * org-src.el (org-edit-src-exit): Don't comma-escape the content + of a fixed width region. + + * org.el (org-blocker-hook): Update the docstring to mention that + functions in this hook should not modify the buffer. + (org-trigger-hook): Small docstring fix. + (org-entry-blocked-p): Use `with-buffer-modified-unmodified' + so that the function never modifies the buffer. + + * org-agenda.el (org-agenda-open-link): Allow to open an internal + link by using the new `org-offer-links-in-entry' function. + + * org.el (org-offer-links-in-entry): Do not open the link directly + through `org-open-link-from-string', only offer to select a link + and return a cons with the link (as a string) and the end of + entry. + (org-open-at-point): Use `org-offer-links-in-entry' correctly. + + * org.el (org-cycle-internal-local): Fix bug: allow headings with + leading blank characters. + + * org-clock.el (org-clock-persist): Docstring fix: document the + 'history value. + + * org.el (org-insert-link): Fix bug when inserting links to + headlines containing the ">" character. + + * org-crypt.el (org-at-encrypted-entry-p): Fix search boundary. + + * org-compat.el (org-delete-directory): New compatibility function + for Emacs 22, where `delete-directory' does not support recursive + deletion. + + * org-odt.el (org-odt-cleanup-xml-buffers): Use the new + compatibility function. + + * org.el (org-table-map-tables): Fix allowed blocks. + (org-edit-special): Fix regression: allow editing HTML and + LaTeX source blocks again. + + * org-src.el (org-edit-src-code): Ditto. + + * org.el (org-nonsticky-props): Add `htmlize-link'. + + * org.el (org-nonsticky-props): Add `htmlize-link'. + + * org.el (org-edit-special): Don't edit in verbatim blocks. + + * org-src.el (org-edit-src-code): Ditto. + + * org-table.el (org-table-fedit-lisp-indent) + (orgtbl-self-insert-command): Use `org-delete-backward-char' + instead of `backward-delete-char'. + + * org.el (org-delete-backward-char, org-delete-char): Save match + data. + + * org-src.el (org-edit-src-code): Fix another bug about editing + special blocks "example" and "verbatim". + + * org.el (org-structure-template-alist): Add verbatim. + (org-edit-special): Fix bug about editing special blocks + "example" and "verbatim". + + * org.el (org-delete-backward-char, org-delete-char): Save match + data (`delete-backward-char' and `delete-char' don't.) + (org-enable-table-editor, org-insert-heading) + (org-remove-timestamp-with-keyword, org-self-insert-command): + Use `delete-backward-char' instead of `backward-delete-char'. + + * org-table.el (org-table-fedit-lisp-indent) + (orgtbl-self-insert-command): Ditto. + + * org-latex.el (org-export-latex-subcontent): Ditto. + + * org-clock.el (org-clocktable-write-default): Ditto. + + * org-ascii.el (org-export-ascii-preprocess): Ditto. + + * org.el (org-todo): Ignore the comment string when changing the + TODO state of a headline. + + * org.el (org-edit-special): Fix docstring. + (org-in-src-block-p): Small enhancement. + + * org-publish.el (org-publish-org-to): Call `org-export-as-*' + functions with the correct list of arguments. + + * org-html.el (org-export-as-html): Delete obsolete arg `hidden'. + (org-export-as-html-and-open, org-export-as-html-batch) + (org-export-region-as-html): Don't use obsolete arg. + + * org-ascii.el (org-export-as-ascii): Delete obsolete arg + `hidden'. + (org-export-as-ascii-to-buffer): Don't use obsolete arg. + + * org.el (org-in-fixed-width-region-p): Save match data. + (org-in-src-block-p): Use case-folding for searching the block + boundaries. + (org-activate-plain-links, org-activate-angle-links) + (org-activate-bracket-links): Prevent link activation in + source code blocks. + + * org-odt.el (org-odt-cleanup-xml-buffers): Fix Emacs Bug#13197 by + setting the correct buffer before marking it unmodified to + silently kill him. + + * org.el (org-set-font-lock-defaults): Don't activate links in + source code blocks and fixed-width regions. + + * org-agenda.el (org-agenda-finalize): Fix links activation. + + * org.el (org-open-at-point): Throw the correct error on + non-links. Use `user-error' instead of `error'. + + * org.el (org-in-fixed-width-region-p): Define before use. + + * org-src.el (org-in-src-block-p): Declare function. + + * org-compat.el: Fix bug: don't use `eval-when-compile' when + aliasing `user-error'. + + * org-agenda.el (org-agenda-skip): Only check if point is + inside a code block, not at a code block. + + * org.el (org-in-fixed-width-region-p): Rewrite using + org-element.el. + + * org.el (org-fill-paragraph): Fill correctly in source code + block. + + * org.el (org-in-fixed-width-region-p): New function. + (org-edit-special): Fix bug: make sure to DTRT in every + special environment. Also use the new function to check + against fixed-width environment. + + * org-src.el (org-edit-src-code): Check if we are in a source code + block with `org-in-src-block-p'. Slightly reformat the docstring. + + * org.el (org-in-src-block-p): Return t when point is at the + #+BEGIN_SRC/#+END_SRC lines unless the new optional parameter + 'inside is set to t. + + * ob-exp.el (obe-marker): Delete useless var. + + * org-src.el (org-edit-src-code): Fix bug triggered by the sexp + (copy-marker nil) on Emacs <24.1. + +2013-01-08 Dmitry Antipov + + * org-agenda.el (org-agenda-get-restriction-and-command): Use + `point-marker'. + + * org-capture.el (org-capture-place-template): Ditto. + + * org-colview-xemacs.el (org-dblock-write:columnview): Ditto. + + * org-colview.el (org-dblock-write:columnview): Ditto. + + * org-mobile.el (org-mobile-locate-entry): Ditto. + + * org-table.el (org-table-convert-region): Ditto. + + * org.el (org-update-statistics-cookies): Ditto. + +2013-01-08 Eric Schulte + + * org-exp.el (org-export-string): Pass the dir option on through + to any subsequent export functions. + +2013-01-08 Henning Weiss (tiny change) + + * org-mobile.el (org-mobile-sumo-agenda-command): Remove match + description from block agendas when they have a title. + +2013-01-08 Jambunathan K + + * org-odt.el (org-export-as-odt-batch): Init `org-odt-zip-dir'. + Fix Emacs Bug#13254. + + * org-odt.el (org-odt-format-org-link): Add check for presence of + description in headline links. + +2013-01-08 Michael Albinus + + * ob.el (org-babel-temp-file): Fix setting of + `temporary-file-directory' on remote hosts. + + * ob-eval.el (org-babel-shell-command-on-region): Use + `process-file' instead of `call-process-region'. The latter one + does not work on remote hosts. + +2013-01-08 Michael Gauland (tiny change) + + * org-src.el: Create a marker to pass to copy-marker. + +2013-01-08 Nicolas Goaziou + + * org.el (org-setup-filling): Ignore `auto-fill-inhibit-regexp'. + The idea behind this is that `org-adaptive-fill-function' already + determines which lines should be filled. + + * org.el (org-fill-paragraph): Small refactoring. + + * org-element.el (org-element--parse-elements) + (org-element-at-point): Fix parsing of a list in a block in a + list. + +2013-01-08 Sebastien Vauban + + * org.el (org-copy-subtree, org-paste-subtree): Fix whitespace + handling when copying/pasting a subtree. + 2013-01-07 Glenn Morris * progmodes/compile.el (compilation-parse-errors): diff --git a/lisp/org/ob-eval.el b/lisp/org/ob-eval.el index 607109e735d..5884d33d786 100644 --- a/lisp/org/ob-eval.el +++ b/lisp/org/ob-eval.el @@ -30,6 +30,7 @@ (eval-when-compile (require 'cl)) (defvar org-babel-error-buffer-name "*Org-Babel Error Output*") +(declare-function org-babel-temp-file "ob-core" (prefix &optional suffix)) (defun org-babel-eval-error-notify (exit-code stderr) "Open a buffer to display STDERR and a message with the value of EXIT-CODE." @@ -134,15 +135,19 @@ specifies the value of ERROR-BUFFER." current-prefix-arg shell-command-default-error-buffer t))) - (let ((error-file - (if error-buffer - (make-temp-file - (expand-file-name "scor" - (if (featurep 'xemacs) - (temp-directory) - temporary-file-directory))) - nil)) + (let ((input-file (org-babel-temp-file "input-")) + (error-file (if error-buffer (org-babel-temp-file "scor-") nil)) + (shell-file-name + (if (file-executable-p + (concat (file-remote-p default-directory) shell-file-name)) + shell-file-name + "/bin/sh")) exit-status) + ;; There is an error in `process-file' when `error-file' exists. + ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this + ;; workaround for now. + (unless (file-remote-p default-directory) + (delete-file error-file)) (if (or replace (and output-buffer (not (or (bufferp output-buffer) (stringp output-buffer))))) @@ -151,12 +156,14 @@ specifies the value of ERROR-BUFFER." ;; Don't muck with mark unless REPLACE says we should. (goto-char start) (and replace (push-mark (point) 'nomsg)) + (write-region start end input-file) + (delete-region start end) (setq exit-status - (call-process-region start end shell-file-name t - (if error-file - (list output-buffer error-file) - t) - nil shell-command-switch command)) + (process-file shell-file-name input-file + (if error-file + (list output-buffer error-file) + t) + nil shell-command-switch command)) ;; It is rude to delete a buffer which the command is not using. ;; (let ((shell-buffer (get-buffer "*Shell Command Output*"))) ;; (and shell-buffer (not (eq shell-buffer (current-buffer))) @@ -175,14 +182,14 @@ specifies the value of ERROR-BUFFER." (progn (setq buffer-read-only nil) (delete-region (max start end) (point-max)) (delete-region (point-min) (min start end)) + (write-region (point-min) (point-max) input-file) + (delete-region (point-min) (point-max)) (setq exit-status - (call-process-region (point-min) (point-max) - shell-file-name t - (if error-file - (list t error-file) - t) - nil shell-command-switch - command))) + (process-file shell-file-name input-file + (if error-file + (list t error-file) + t) + nil shell-command-switch command))) ;; Clear the output buffer, then run the command with ;; output there. (let ((directory default-directory)) @@ -192,11 +199,11 @@ specifies the value of ERROR-BUFFER." (setq default-directory directory)) (erase-buffer))) (setq exit-status - (call-process-region start end shell-file-name nil - (if error-file - (list buffer error-file) - buffer) - nil shell-command-switch command))) + (process-file shell-file-name nil + (if error-file + (list buffer error-file) + buffer) + nil shell-command-switch command))) ;; Report the output. (with-current-buffer buffer (setq mode-line-process @@ -230,6 +237,9 @@ specifies the value of ERROR-BUFFER." ;; (kill-buffer buffer) )))) + (when (and input-file (file-exists-p input-file)) + (delete-file input-file)) + (when (and error-file (file-exists-p error-file)) (if (< 0 (nth 7 (file-attributes error-file))) (with-current-buffer (get-buffer-create error-buffer) diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el index c62a6a8211d..37a9f71cf59 100644 --- a/lisp/org/ob-exp.el +++ b/lisp/org/ob-exp.el @@ -28,7 +28,6 @@ (eval-when-compile (require 'cl)) -(defvar obe-marker nil) (defvar org-current-export-file) (defvar org-babel-lob-one-liner-regexp) (defvar org-babel-ref-split-regexp) diff --git a/lisp/org/ob.el b/lisp/org/ob.el index 7a9cd0d4bfb..724571481f7 100644 --- a/lisp/org/ob.el +++ b/lisp/org/ob.el @@ -2547,18 +2547,14 @@ Emacs shutdown.")) Passes PREFIX and SUFFIX directly to `make-temp-file' with the value of `temporary-file-directory' temporarily set to the value of `org-babel-temporary-directory'." - (if (file-remote-p default-directory) - (make-temp-file - (concat (file-remote-p default-directory) - (expand-file-name - prefix temporary-file-directory) - nil suffix)) - (let ((temporary-file-directory + (let ((temporary-file-directory + (if (file-remote-p default-directory) + (concat (file-remote-p default-directory) "/tmp") (or (and (boundp 'org-babel-temporary-directory) (file-exists-p org-babel-temporary-directory) org-babel-temporary-directory) - temporary-file-directory))) - (make-temp-file prefix nil suffix)))) + temporary-file-directory)))) + (make-temp-file prefix nil suffix))) (defun org-babel-remove-temporary-directory () "Remove `org-babel-temporary-directory' on Emacs shutdown." diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index e6e6166ffe2..d74444c5a8e 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -840,7 +840,7 @@ entry, the rest of the entry will not be searched." :group 'org-agenda-daily/weekly :type 'boolean) -(defcustom org-agenda-dim-blocked-tasks t +(defcustom org-agenda-dim-blocked-tasks nil "Non-nil means dim blocked tasks in the agenda display. This causes some overhead during agenda construction, but if you have turned on `org-enforce-todo-dependencies', @@ -857,6 +857,7 @@ that is blocked because of checkboxes will never be made invisible, it will only be dimmed." :group 'org-agenda-daily/weekly :group 'org-agenda-todo-list + :version "24.3" :type '(choice (const :tag "Do not dim" nil) (const :tag "Dim to a gray face" t) @@ -889,7 +890,7 @@ you want to use two-columns display (see `org-agenda-menu-two-columns')." :version "24.1" :type 'boolean) -(define-obsolete-variable-alias 'org-agenda-menu-two-column 'org-agenda-menu-two-columns "24.3") +(org-define-obsolete-variable-alias 'org-agenda-menu-two-column 'org-agenda-menu-two-columns "24.3") (defcustom org-agenda-menu-two-columns nil "Non-nil means, use two columns to show custom commands in the dispatcher. @@ -899,7 +900,7 @@ to nil." :version "24.1" :type 'boolean) -(define-obsolete-variable-alias 'org-finalize-agenda-hook 'org-agenda-finalize-hook "24.3") +(org-define-obsolete-variable-alias 'org-finalize-agenda-hook 'org-agenda-finalize-hook "24.3") (defcustom org-agenda-finalize-hook nil "Hook run just before displaying an agenda buffer. The buffer is still writable when the hook is called. @@ -1651,6 +1652,23 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour." :group 'org-agenda-line-format :type 'boolean) +(defcustom org-agenda-use-tag-inheritance '(todo search timeline agenda) + "List of agenda view types where to use tag inheritance. + +In tags/tags-todo/tags-tree agenda views, tag inheritance is +controlled by `org-use-tag-inheritance'. In other agenda types, +`org-use-tag-inheritance' is not used when selecting the agenda +entries, but you may want the agenda to use the inherited tags +anyway, e.g. for later tag filtering. + +The default value reset tags in every agenda type. Setting this +option to nil will speed up non-tags agenda view a lot. + +Allowed value are 'todo, 'search, 'timeline and 'agenda." + :version "24.3" + :group 'org-agenda + :type '(repeat (symbol :tag "Agenda type"))) + (defcustom org-agenda-hide-tags-regexp nil "Regular expression used to filter away specific tags in agenda views. This means that these tags will be present, but not be shown in the agenda @@ -2012,6 +2030,7 @@ The following commands are available: (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile) (org-defkey org-agenda-mode-map "m" 'org-agenda-bulk-mark) (org-defkey org-agenda-mode-map "*" 'org-agenda-bulk-mark-all) +(org-defkey org-agenda-mode-map "#" 'org-agenda-dim-blocked-tasks) (org-defkey org-agenda-mode-map "%" 'org-agenda-bulk-mark-regexp) (org-defkey org-agenda-mode-map "u" 'org-agenda-bulk-unmark) (org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-unmark-all) @@ -2664,7 +2683,7 @@ L Timeline for current buffer # List stuck projects (!=configure) (add-text-properties (match-beginning 2) (match-end 2) '(face bold) header)) header))) - (setq header-end (move-marker (make-marker) (point))) + (setq header-end (point-marker)) (while t (setq custom1 custom) (when (eq rmheader t) @@ -3194,7 +3213,7 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write." (kill-buffer (current-buffer)) (message "Plain text written to %s" file)))))))) (set-buffer (or agenda-bufname - (and (called-interactively-p 'any) (buffer-name)) + (and (org-called-interactively-p 'any) (buffer-name)) org-agenda-buffer-name))) (when open (org-open-file file))) @@ -3514,13 +3533,16 @@ generating a new one." (save-excursion (let ((inhibit-read-only t)) (goto-char (point-min)) - (while (org-activate-bracket-links (point-max)) - (add-text-properties (match-beginning 0) (match-end 0) - '(face org-link))) - (while (org-activate-plain-links (point-max)) - (add-text-properties (match-beginning 0) (match-end 0) - '(face org-link))) - (org-agenda-align-tags) + (save-excursion + (while (org-activate-bracket-links (point-max)) + (add-text-properties (match-beginning 0) (match-end 0) + '(face org-link)))) + (save-excursion + (while (org-activate-plain-links (point-max)) + (add-text-properties (match-beginning 0) (match-end 0) + '(face org-link)))) + (unless (eq org-agenda-remove-tags t) + (org-agenda-align-tags)) (unless org-agenda-with-colors (remove-text-properties (point-min) (point-max) '(face nil)))) (if (and (boundp 'org-agenda-overriding-columns-format) @@ -3533,20 +3555,34 @@ generating a new one." (when org-agenda-fontify-priorities (org-agenda-fontify-priorities)) (when (and org-agenda-dim-blocked-tasks org-blocker-hook) - (org-agenda-dim-blocked-tasks)) + (org-agenda-dim-blocked-tasks)) ;; We need to widen when `org-agenda-finalize' is called from ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in') - (save-restriction - (widen) - (org-agenda-mark-clocking-task)) + (when org-clock-current-task + (save-restriction + (widen) + (org-agenda-mark-clocking-task))) (when org-agenda-entry-text-mode (org-agenda-entry-text-hide) (org-agenda-entry-text-show)) - (if (functionp 'org-habit-insert-consistency-graphs) + (if (and (functionp 'org-habit-insert-consistency-graphs) + (save-excursion (next-single-property-change (point-min) 'org-habit-p))) (org-habit-insert-consistency-graphs)) + (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) + (when (delq nil (mapcar (lambda (tp) (org-agenda-check-type nil tp)) + org-agenda-use-tag-inheritance)) + (let (mrk) + (save-excursion + (goto-char (point-min)) + (while (equal (forward-line) 0) + (when (setq mrk (or (get-text-property (point) 'org-hd-marker) + (get-text-property (point) 'org-hd-marker))) + (put-text-property (point-at-bol) (point-at-eol) + 'tags (org-with-point-at mrk + (delete-dups + (mapcar 'downcase (org-get-tags-at)))))))))) (let ((inhibit-read-only t)) (run-hooks 'org-agenda-finalize-hook)) - (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter)) (org-agenda-filter-apply org-agenda-tag-filter 'tag)) (when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter)) @@ -3607,15 +3643,18 @@ generating a new one." ((equal p h) 'bold))) (overlay-put ov 'org-type 'org-priority))))) -(defun org-agenda-dim-blocked-tasks () +(defun org-agenda-dim-blocked-tasks (&optional invisible) + (interactive "P") "Dim currently blocked TODO's in the agenda display." + (message "Dim or hide blocked tasks...") (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo) (delete-overlay o))) (overlays-in (point-min) (point-max))) (save-excursion (let ((inhibit-read-only t) (org-depend-tag-blocked nil) - (invis (eq org-agenda-dim-blocked-tasks 'invisible)) + (invis (or (not (null invisible)) + (eq org-agenda-dim-blocked-tasks 'invisible))) org-blocked-by-checkboxes invis1 b e p ov h l) (goto-char (point-min)) @@ -3636,7 +3675,8 @@ generating a new one." (if invis1 (overlay-put ov 'invisible t) (overlay-put ov 'face 'org-agenda-dimmed-todo-face)) - (overlay-put ov 'org-type 'org-blocked-todo))))))) + (overlay-put ov 'org-type 'org-blocked-todo)))))) + (message "Dim or hide blocked tasks...done")) (defvar org-agenda-skip-function nil "Function to be called at each match during agenda construction. @@ -3656,7 +3696,7 @@ A good way to set it is through options in `org-agenda-custom-commands'.") Also moves point to the end of the skipped region, so that search can continue from there." (let ((p (point-at-bol)) to) - (when (org-in-src-block-p) (throw :skip t)) + (when (org-in-src-block-p t) (throw :skip t)) (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) (get-text-property p :org-archived) (org-end-of-subtree t) @@ -4405,7 +4445,7 @@ in `org-agenda-text-search-extra-files'." (setq marker (org-agenda-new-marker (point)) category (org-get-category) category-pos (get-text-property (point) 'org-category-position) - tags (org-get-tags-at (point)) + tags (org-get-tags-at nil t) txt (org-agenda-format-item "" (buffer-substring-no-properties @@ -5229,7 +5269,7 @@ the documentation of `org-diary'." category-pos (get-text-property (point) 'org-category-position) txt (org-trim (buffer-substring (match-beginning 2) (match-end 0))) - tags (org-get-tags-at (point)) + tags (org-get-tags-at nil t) txt (org-agenda-format-item "" txt category tags t) priority (1+ (org-get-priority txt)) todo-state (org-get-todo-state)) @@ -5389,7 +5429,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? clockp (and org-agenda-include-inactive-timestamps (or (string-match org-clock-string tmp) (string-match "]-+\\'" tmp))) - warntime (org-entry-get (point) "APPT_WARNTIME") + warntime (get-text-property (point) 'org-appt-warntime) donep (member todo-state org-done-keywords)) (if (or scheduledp deadlinep closedp clockp (and donep org-agenda-skip-timestamp-if-done)) @@ -5408,7 +5448,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? (assoc (point) deadline-position-alist)) (throw :skip nil)) (setq hdmarker (org-agenda-new-marker) - tags (org-get-tags-at)) + tags (org-get-tags-at nil t)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq head (or (match-string 1) "")) (setq txt (org-agenda-format-item @@ -5458,10 +5498,9 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? (setq marker (org-agenda-new-marker beg) category (org-get-category beg) category-pos (get-text-property beg 'org-category-position) - tags (save-excursion (org-backward-heading-same-level 0) - (org-get-tags-at)) + tags (save-excursion (org-back-to-heading t) (org-get-tags-at nil t)) todo-state (org-get-todo-state) - warntime (org-entry-get (point) "APPT_WARNTIME") + warntime (get-text-property (point) 'org-appt-warntime) extra nil) (dolist (r (if (stringp result) @@ -5510,7 +5549,6 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? (org-no-warnings (let ((calendar-date-style 'european) (european-calendar-style t)) (diary-date day month year mark)))) -(defalias 'org-float 'diary-float) ;; Define the` org-class' function (defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks) @@ -5629,7 +5667,7 @@ please use `org-class' instead." (setq txt org-agenda-no-heading-message) (goto-char (match-beginning 0)) (setq hdmarker (org-agenda-new-marker) - tags (org-get-tags-at)) + tags (org-get-tags-at nil t)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq txt (match-string 1)) (when extra @@ -5833,13 +5871,13 @@ See also the user option `org-agenda-clock-consistency-checks'." (not (= diff 0)))) (setq txt nil) (setq category (org-get-category) - warntime (org-entry-get (point) "APPT_WARNTIME") + warntime (get-text-property (point) 'org-appt-warntime) category-pos (get-text-property (point) 'org-category-position)) (if (not (re-search-backward "^\\*+[ \t]+" nil t)) (setq txt org-agenda-no-heading-message) (goto-char (match-end 0)) (setq pos1 (match-beginning 0)) - (setq tags (org-get-tags-at pos1)) + (setq tags (org-get-tags-at pos1 t)) (setq head (buffer-substring-no-properties (point) (progn (skip-chars-forward "^\r\n") @@ -5923,7 +5961,7 @@ FRACTION is what fraction of the head-warning time has passed." (match-string 1) d1 'past show-all (current-buffer) pos) diff (- d2 d1) - warntime (org-entry-get (point) "APPT_WARNTIME")) + warntime (get-text-property (point) 'org-appt-warntime)) (setq pastschedp (and todayp (< diff 0))) (setq did-habit-check-p nil) ;; When to show a scheduled item in the calendar: @@ -5969,7 +6007,7 @@ FRACTION is what fraction of the head-warning time has passed." pastschedp)) (setq mm (assoc pos1 deadline-position-alist))) (throw :skip nil))) - (setq tags (org-get-tags-at)) + (setq tags (org-get-tags-at nil t)) (setq head (buffer-substring-no-properties (point) (progn (skip-chars-forward "^\r\n") (point)))) @@ -6051,7 +6089,7 @@ FRACTION is what fraction of the head-warning time has passed." (setq txt org-agenda-no-heading-message) (goto-char (match-beginning 0)) (setq hdmarker (org-agenda-new-marker (point))) - (setq tags (org-get-tags-at)) + (setq tags (org-get-tags-at nil t)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq head (match-string 1)) (let ((remove-re @@ -6212,12 +6250,7 @@ Any match of REMOVE-RE will be removed from TXT." (match-string 2 txt)) t t txt)))) (when (derived-mode-p 'org-mode) - (setq effort - (condition-case nil - (org-get-effort - (or (get-text-property 0 'org-hd-marker txt) - (get-text-property 0 'org-marker txt))) - (error nil))) + (setq effort (ignore-errors (get-text-property 0 'org-effort txt))) (when effort (setq neffort (org-duration-string-to-minutes effort) effort (setq effort (concat "[" effort "]"))))) @@ -6735,7 +6768,8 @@ in the file. Otherwise, restriction will be to the current subtree." (defun org-agenda-check-type (error &rest types) "Check if agenda buffer is of allowed type. -If ERROR is non-nil, throw an error, otherwise just return nil." +If ERROR is non-nil, throw an error, otherwise just return nil. +Allowed types are 'agenda 'timeline 'todo 'tags 'search." (if (not org-agenda-type) (error "No Org agenda currently displayed") (if (memq org-agenda-type types) @@ -7669,7 +7703,7 @@ When called with a prefix argument, include all archive files as well." ""))) (force-mode-line-update)) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-agenda-post-command-hook 'org-agenda-update-agenda-type "24.3") (defun org-agenda-update-agenda-type () @@ -7890,29 +7924,45 @@ If this information is not given, the function uses the tree at point." (unless no-update (org-agenda-redo)))) (defun org-agenda-open-link (&optional arg) - "Follow the link in the current line, if any. -This looks for a link in the displayed line in the agenda. It also looks -at the text of the entry itself." + "Open the link(s) in the current entry, if any. +This looks for a link in the displayed line in the agenda. +It also looks at the text of the entry itself." (interactive "P") (let* ((marker (or (org-get-at-bol 'org-hd-marker) (org-get-at-bol 'org-marker))) (buffer (and marker (marker-buffer marker))) (prefix (buffer-substring - (point-at-bol) (point-at-eol)))) + (point-at-bol) (point-at-eol))) + (lkall (org-offer-links-in-entry buffer marker arg prefix)) + (lk (car lkall)) + (lkend (cdr lkall)) + trg) (cond - (buffer + ((and buffer (stringp lk)) (with-current-buffer buffer - (save-excursion - (save-restriction - (widen) - (goto-char marker) - (org-offer-links-in-entry arg prefix))))) + (setq trg (and (string-match org-bracket-link-regexp lk) + (match-string 1 lk))) + (if (or (not trg) (string-match org-any-link-re trg)) + (save-excursion + (save-restriction + (widen) + (goto-char marker) + (when (search-forward lk nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point)))) + ;; This is an internal link, widen the buffer + (switch-to-buffer-other-window buffer) + (widen) + (goto-char marker) + (when (search-forward lk nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point))))) ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)")) (save-excursion (beginning-of-line 1) (looking-at (concat ".*?\\(" org-bracket-link-regexp "\\)")))) (org-open-link-from-string (match-string 1))) - (t (error "No link to open here"))))) + (t (message "No link to open here"))))) (defun org-agenda-copy-local-variable (var) "Get a variable from a referenced buffer and install it here." @@ -8313,35 +8363,37 @@ If FORCE-TAGS is non nil, the car of it returns the new tags." (interactive) (org-agenda-priority 'down)) -(defun org-agenda-priority (&optional force-direction show) +(defun org-agenda-priority (&optional force-direction) "Set the priority of line at point, also in Org-mode file. This changes the line at point, all other lines in the agenda referring to -the same tree node, and the headline of the tree node in the Org-mode file." +the same tree node, and the headline of the tree node in the Org-mode file. +Called with a universal prefix arg, show the priority instead of setting it." (interactive "P") - (if (equal force-direction '(4)) (setq show t)) - (unless org-enable-priority-commands - (error "Priority commands are disabled")) - (org-agenda-check-no-diary) - (let* ((marker (or (org-get-at-bol 'org-marker) - (org-agenda-error))) - (hdmarker (org-get-at-bol 'org-hd-marker)) - (buffer (marker-buffer hdmarker)) - (pos (marker-position hdmarker)) - (inhibit-read-only t) - newhead) - (org-with-remote-undo buffer - (with-current-buffer buffer - (widen) - (goto-char pos) - (org-show-context 'agenda) - (save-excursion - (and (outline-next-heading) - (org-flag-heading nil))) ; show the next heading - (funcall 'org-priority force-direction show) - (end-of-line 1) - (setq newhead (org-get-heading))) - (org-agenda-change-all-lines newhead hdmarker) - (beginning-of-line 1)))) + (if (equal force-direction '(4)) + (org-show-priority) + (unless org-enable-priority-commands + (error "Priority commands are disabled")) + (org-agenda-check-no-diary) + (let* ((marker (or (org-get-at-bol 'org-marker) + (org-agenda-error))) + (hdmarker (org-get-at-bol 'org-hd-marker)) + (buffer (marker-buffer hdmarker)) + (pos (marker-position hdmarker)) + (inhibit-read-only t) + newhead) + (org-with-remote-undo buffer + (with-current-buffer buffer + (widen) + (goto-char pos) + (org-show-context 'agenda) + (save-excursion + (and (outline-next-heading) + (org-flag-heading nil))) ; show the next heading + (funcall 'org-priority force-direction) + (end-of-line 1) + (setq newhead (org-get-heading))) + (org-agenda-change-all-lines newhead hdmarker) + (beginning-of-line 1))))) ;; FIXME: should fix the tags property of the agenda line. (defun org-agenda-set-tags (&optional tag onoff) diff --git a/lisp/org/org-ascii.el b/lisp/org/org-ascii.el index cf3f2d14d1d..c5a4b3775e8 100644 --- a/lisp/org/org-ascii.el +++ b/lisp/org/org-ascii.el @@ -131,7 +131,7 @@ utf8 Use all UTF-8 characters") "Call `org-export-as-ascii` with output to a temporary buffer. No file is created. The prefix ARG is passed through to `org-export-as-ascii'." (interactive "P") - (org-export-as-ascii arg nil nil "*Org ASCII Export*") + (org-export-as-ascii arg nil "*Org ASCII Export*") (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window "*Org ASCII Export*"))) @@ -183,23 +183,19 @@ in a window. A non-interactive call will only return the buffer." (goto-char end) (set-mark (point)) ;; to activate the region (goto-char beg) - (setq rtn (org-export-as-ascii - nil nil ext-plist - buffer body-only)) + (setq rtn (org-export-as-ascii nil ext-plist buffer body-only)) (if (fboundp 'deactivate-mark) (deactivate-mark)) (if (and (org-called-interactively-p 'any) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) ;;;###autoload -(defun org-export-as-ascii (arg &optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-ascii (arg &optional ext-plist to-buffer body-only pub-dir) "Export the outline as a pretty ASCII file. If there is an active region, export only the region. The prefix ARG specifies how many levels of the outline should become underlined headlines, default is 3. Lower levels will become bulleted -lists. When HIDDEN is non-nil, don't display the ASCII buffer. -EXT-PLIST is a property list with external parameters overriding +lists. EXT-PLIST is a property list with external parameters overriding org-mode's default settings, but still inferior to file-local settings. When TO-BUFFER is non-nil, create a buffer with that name and export to that buffer. If TO-BUFFER is the symbol diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index 366dced717c..c888536b385 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el @@ -979,7 +979,7 @@ it. When it is a variable, retrieve the value. Return whatever we get." (show-all) (goto-char (org-capture-get :pos)) (org-set-local 'org-capture-target-marker - (move-marker (make-marker) (point))) + (point-marker)) (org-set-local 'outline-level 'org-outline-level) (let* ((template (org-capture-get :template)) (type (org-capture-get :type))) diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index 9ff0ff3e6de..32cfa9ae913 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -35,6 +35,7 @@ (declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) (declare-function notifications-notify "notifications" (&rest params)) (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label)) +(declare-function org-refresh-properties "org" (dprop tprop)) (defvar org-time-stamp-formats) (defvar org-ts-what) (defvar org-frame-title-format-backup frame-title-format) @@ -159,12 +160,15 @@ the clock can be resumed from that point." The clock is resumed when Emacs restarts. When this is t, both the running clock, and the entire clock history are saved. When this is the symbol `clock', only the -running clock is saved. +running clock is saved. When this is the symbol `history', only +the clock history is saved. -When Emacs restarts with saved clock information, the file containing the -running clock as well as all files mentioned in the clock history will -be visited. -All this depends on running `org-clock-persistence-insinuate' in .emacs" +When Emacs restarts with saved clock information, the file containing +the running clock as well as all files mentioned in the clock history +will be visited. + +All this depends on running `org-clock-persistence-insinuate' in your +Emacs initialization file." :group 'org-clock :type '(choice (const :tag "Just the running clock" clock) @@ -201,7 +205,7 @@ file name play this sound file. If not possible, fall back to beep" (const :tag "Standard beep" t) (file :tag "Play sound file"))) -(define-obsolete-variable-alias 'org-clock-modeline-total +(org-define-obsolete-variable-alias 'org-clock-modeline-total 'org-clock-mode-line-total "24.3") (defcustom org-clock-mode-line-total 'auto @@ -1078,6 +1082,7 @@ time as the start time \(see `org-clock-continuously' to make this the default behavior.)" (interactive "P") (setq org-clock-notification-was-shown nil) + (org-refresh-properties org-effort-property 'org-effort) (catch 'abort (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) (org-clocking-p))) @@ -1199,7 +1204,7 @@ make this the default behavior.)" (setq org-clock-start-time (apply 'encode-time (org-parse-time-string (match-string 1)))) - (setq org-clock-effort (org-get-effort)) + (setq org-clock-effort (get-text-property (point) 'org-effort)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start)))) ((eq org-clock-in-resume 'auto-restart) @@ -1219,7 +1224,7 @@ make this the default behavior.)" (beginning-of-line 1) (org-indent-line-to (- (org-get-indentation) 2))) (insert org-clock-string " ") - (setq org-clock-effort (org-get-effort)) + (setq org-clock-effort (get-text-property (point) 'org-effort)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start))) (setq org-clock-start-time diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index 30adf6a3f72..5a59196baa1 100644 --- a/lisp/org/org-colview.el +++ b/lisp/org/org-colview.el @@ -1243,7 +1243,7 @@ PARAMS is a property list of parameters: :skip-empty-rows When t, skip rows where all specifiers other than ITEM are empty. :format When non-nil, specify the column view format to use." - (let ((pos (move-marker (make-marker) (point))) + (let ((pos (point-marker)) (hlines (plist-get params :hlines)) (vlines (plist-get params :vlines)) (maxlevel (plist-get params :maxlevel)) diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index bc13fa2c737..687b81fd882 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -169,6 +169,24 @@ If DELETE is non-nil, delete all those overlays." (set-buffer-modified-p modified-p)) (decompose-region beg end))) +(defmacro org-define-obsolete-function-alias (o-name c-name when &optional doc) + "Reconcile the two-argument form of +`define-obsolete-function-alias' in XEmacs/Emacs 22 with the 3-4 +argument form in Emacs 23 and later." + (if (or (featurep 'xemacs) + (< emacs-major-version 23)) + `(define-obsolete-function-alias ,o-name ,c-name) + `(define-obsolete-function-alias ,o-name ,c-name ,when ,doc))) + +(defmacro org-define-obsolete-variable-alias (o-name c-name when &optional doc) + "Reconcile the two-argument form of +`define-obsolete-variable-alias' in XEmacs/Emacs 22 with the 3-4 +argument form in Emacs 23 and later." + (if (or (featurep 'xemacs) + (< emacs-major-version 23)) + `(define-obsolete-variable-alias ,o-name ,c-name) + `(define-obsolete-variable-alias ,o-name ,c-name ,when ,doc))) + ;; Miscellaneous functions (defun org-add-hook (hook function &optional append local) @@ -195,9 +213,8 @@ passed through to `fit-window-to-buffer'. If SHRINK-ONLY is set, call ignored in this case." (cond ((if (fboundp 'window-full-width-p) (not (window-full-width-p window)) - (> (frame-width) (window-width window))) - ;; do nothing if another window would suffer - ) + ;; do nothing if another window would suffer + (> (frame-width) (window-width window)))) ((and (fboundp 'fit-window-to-buffer) (not shrink-only)) (fit-window-to-buffer window max-height min-height)) ((fboundp 'shrink-window-if-larger-than-buffer) @@ -257,7 +274,6 @@ Works on both Emacs and XEmacs." (when (boundp 'zmacs-regions) (setq zmacs-regions t))))) - ;; Invisibility compatibility (defun org-remove-from-invisibility-spec (arg) @@ -372,6 +388,20 @@ TIME defaults to the current time." (time-to-seconds (or time (current-time))) (float-time time))) +;; `user-error' is only available from 24.2.50 on +(unless (fboundp 'user-error) + (defalias 'user-error 'error)) + +(defmacro org-no-popups (&rest body) + "Suppress popup windows. +Let-bind some variables to nil around BODY to achieve the desired +effect, which variables to use depends on the Emacs version." + (if (org-version-check "24.2.50" "" :predicate) + `(let (pop-up-frames display-buffer-alist) + ,@body) + `(let (pop-up-frames special-display-buffer-names special-display-regexps special-display-function) + ,@body))) + (if (fboundp 'string-match-p) (defalias 'org-string-match-p 'string-match-p) (defun org-string-match-p (regexp string &optional start) @@ -384,7 +414,7 @@ TIME defaults to the current time." (save-match-data (apply 'looking-at args)))) - ; XEmacs does not have `looking-back'. +;; XEmacs does not have `looking-back'. (if (fboundp 'looking-back) (defalias 'org-looking-back 'looking-back) (defun org-looking-back (regexp &optional limit greedy) @@ -435,12 +465,34 @@ With two arguments, return floor and remainder of their quotient." ;; `condition-case-unless-debug' has been introduced in Emacs 24.1 ;; `condition-case-no-debug' has been introduced in Emacs 23.1 -(defalias 'org-condition-case-unless-debug +(defmacro org-condition-case-unless-debug (var bodyform &rest handlers) + (declare (debug condition-case) (indent 2)) (or (and (fboundp 'condition-case-unless-debug) - 'condition-case-unless-debug) + `(condition-case-unless-debug ,var ,bodyform ,@handlers)) (and (fboundp 'condition-case-no-debug) - 'condition-case-no-debug) - 'condition-case)) + `(condition-case-no-debug ,var ,bodyform ,@handlers)) + `(condition-case ,var ,bodyform ,@handlers))) + +;; RECURSIVE has been introduced with Emacs 23.2. +;; This is copying and adapted from `tramp-compat-delete-directory' +(defun org-delete-directory (directory &optional recursive) + "Compatibility function for `delete-directory'." + (if (null recursive) + (delete-directory directory) + (condition-case nil + (funcall 'delete-directory directory recursive) + ;; This Emacs version does not support the RECURSIVE flag. We + ;; use the implementation from Emacs 23.2. + (wrong-number-of-arguments + (setq directory (directory-file-name (expand-file-name directory))) + (if (not (file-symlink-p directory)) + (mapc (lambda (file) + (if (eq t (car (file-attributes file))) + (org-delete-directory file recursive) + (delete-file file))) + (directory-files + directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) + (delete-directory directory))))) ;;;###autoload (defmacro org-check-version () diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el index fdfd1d326da..2dfc4addcc2 100644 --- a/lisp/org/org-crypt.el +++ b/lisp/org/org-crypt.el @@ -1,6 +1,6 @@ ;;; org-crypt.el --- Public key encryption for org-mode entries -;; Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. +;; Copyright (C) 2007-2013 Free Software Foundation, Inc. ;; Emacs Lisp Archive Entry ;; Filename: org-crypt.el @@ -258,7 +258,7 @@ See `org-crypt-disable-auto-save'." (save-excursion (org-back-to-heading t) (search-forward "-----BEGIN PGP MESSAGE-----" - (save-excursion (org-end-of-subtree t)) t)))) + (save-excursion (outline-next-heading)) t)))) (defun org-crypt-use-before-save-magic () "Add a hook to automatically encrypt entries before a file is saved to disk." diff --git a/lisp/org/org-docbook.el b/lisp/org/org-docbook.el index ba03e3160b1..5253d9100a5 100644 --- a/lisp/org/org-docbook.el +++ b/lisp/org/org-docbook.el @@ -274,14 +274,14 @@ For example: $ emacs --batch --load=$HOME/lib/emacs/org.el --visit=MyOrgFile.org --funcall org-export-as-docbook-batch" - (org-export-as-docbook 'hidden)) + (org-export-as-docbook)) ;;;###autoload (defun org-export-as-docbook-to-buffer () "Call `org-export-as-docbook' with output to a temporary buffer. No file is created." (interactive) - (org-export-as-docbook nil nil "*Org DocBook Export*") + (org-export-as-docbook nil "*Org DocBook Export*") (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window "*Org DocBook Export*"))) @@ -334,17 +334,14 @@ in a window. A non-interactive call will only return the buffer." (goto-char end) (set-mark (point)) ;; To activate the region (goto-char beg) - (setq rtn (org-export-as-docbook - nil nil - buffer body-only)) + (setq rtn (org-export-as-docbook nil buffer body-only)) (if (fboundp 'deactivate-mark) (deactivate-mark)) (if (and (org-called-interactively-p 'any) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) ;;;###autoload -(defun org-export-as-docbook-pdf (&optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-docbook-pdf (&optional ext-plist to-buffer body-only pub-dir) "Export as DocBook XML file, and generate PDF file." (interactive "P") (if (or (not org-export-docbook-xslt-proc-command) @@ -360,8 +357,7 @@ in a window. A non-interactive call will only return the buffer." (org-combine-plists (org-default-export-plist) ext-plist (org-infile-export-plist)))) - (docbook-buf (org-export-as-docbook hidden ext-plist - to-buffer body-only pub-dir)) + (docbook-buf (org-export-as-docbook ext-plist to-buffer body-only pub-dir)) (filename (buffer-file-name docbook-buf)) (base (file-name-sans-extension filename)) (fofile (concat base ".fo")) @@ -398,8 +394,7 @@ in a window. A non-interactive call will only return the buffer." (defvar org-heading-keyword-regexp-format) ; defined in org.el ;;;###autoload -(defun org-export-as-docbook (&optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-docbook (&optional ext-plist to-buffer body-only pub-dir) "Export the current buffer as a DocBook file. If there is an active region, export only the region. When HIDDEN is obsolete and does nothing. EXT-PLIST is a diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 6b2a83de8bd..c8096aa3963 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -3808,7 +3808,8 @@ Elements are accumulated into ACC." 'section)) (plain-list 'item) (table 'table-row)) - (org-element-property :structure element) + (and (memq type '(item plain-list)) + (org-element-property :structure element)) granularity visible-only element)) ;; ELEMENT has contents. Parse objects inside, if ;; GRANULARITY allows it. @@ -4249,8 +4250,11 @@ first element of current section." (plain-list (setq special-flag 'item struct (org-element-property :structure element))) - (table (setq special-flag 'table-row)) - (otherwise (setq special-flag nil))) + (item (setq special-flag nil)) + (property-drawer + (setq special-flag 'node-property struct nil)) + (table (setq special-flag 'table-row struct nil)) + (otherwise (setq special-flag nil struct nil))) (setq end cend) (goto-char cbeg))))))))))) diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el index 1cf4cb5e054..82b9003e4fd 100644 --- a/lisp/org/org-exp.el +++ b/lisp/org/org-exp.el @@ -3047,12 +3047,11 @@ to the value of `temporary-file-directory'." (eval ;; convert to fmt -- mimicking `org-run-like-in-org-mode' (list 'let org-local-vars (list (intern (format "org-export-as-%s" fmt)) - nil nil nil ''string t)))) + nil nil ''string t dir)))) (delete-file tmp-file)))) ;;;###autoload -(defun org-export-as-org (arg &optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-org (arg &optional ext-plist to-buffer body-only pub-dir) "Make a copy with not-exporting stuff removed. The purpose of this function is to provide a way to export the source Org file of a webpage in Org format, but with sensitive and/or irrelevant diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index 80e81349f6a..606db0814c2 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el @@ -44,6 +44,9 @@ (set-face-doc-string new-face docstring))))) (put 'org-copy-face 'lisp-indent-function 2) +(when (featurep 'xemacs) + (put 'mode-line 'face-alias 'modeline)) + (defgroup org-faces nil "Faces in Org-mode." :tag "Org Faces" diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el index 91df2ebcc4e..493d8a28afb 100644 --- a/lisp/org/org-html.el +++ b/lisp/org/org-html.el @@ -328,7 +328,7 @@ You can also customize this for each buffer, using something like * @licstart The following is the entire license notice for the * JavaScript code in %PATH. * - * Copyright (C) 2012 MathJax + * Copyright (C) 2012-2013 MathJax * * Licensed under the Apache License, Version 2.0 (the \"License\"); * you may not use this file except in compliance with the License. @@ -793,7 +793,7 @@ If there is an active region, export only the region. The prefix ARG specifies how many levels of the outline should become headlines. The default is 3. Lower levels will become bulleted lists." (interactive "P") - (org-export-as-html arg 'hidden) + (org-export-as-html arg) (org-open-file buffer-file-name) (when org-export-kill-product-buffer-when-displayed (kill-buffer (current-buffer)))) @@ -806,14 +806,14 @@ emacs --batch --load=$HOME/lib/emacs/org.el --eval \"(setq org-export-headline-levels 2)\" --visit=MyFile --funcall org-export-as-html-batch" - (org-export-as-html org-export-headline-levels 'hidden)) + (org-export-as-html org-export-headline-levels)) ;;;###autoload (defun org-export-as-html-to-buffer (arg) "Call `org-export-as-html` with output to a temporary buffer. No file is created. The prefix ARG is passed through to `org-export-as-html'." (interactive "P") - (org-export-as-html arg nil nil "*Org HTML Export*") + (org-export-as-html arg nil "*Org HTML Export*") (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window "*Org HTML Export*"))) @@ -865,9 +865,7 @@ in a window. A non-interactive call will only return the buffer." (goto-char end) (set-mark (point)) ;; to activate the region (goto-char beg) - (setq rtn (org-export-as-html - nil nil ext-plist - buffer body-only)) + (setq rtn (org-export-as-html nil ext-plist buffer body-only)) (if (fboundp 'deactivate-mark) (deactivate-mark)) (if (and (org-called-interactively-p 'any) (bufferp rtn)) (switch-to-buffer-other-window rtn) @@ -1171,14 +1169,12 @@ OPT-PLIST is the export options list." (defvar org-heading-keyword-regexp-format) ; defined in org.el ;;;###autoload -(defun org-export-as-html (arg &optional hidden ext-plist - to-buffer body-only pub-dir) +(defun org-export-as-html (arg &optional ext-plist to-buffer body-only pub-dir) "Export the outline as a pretty HTML file. If there is an active region, export only the region. The prefix ARG specifies how many levels of the outline should become headlines. The default is 3. Lower levels will become bulleted -lists. HIDDEN is obsolete and does nothing. -EXT-PLIST is a property list with external parameters overriding +lists. EXT-PLIST is a property list with external parameters overriding org-mode's default settings, but still inferior to file-local settings. When TO-BUFFER is non-nil, create a buffer with that name and export to that buffer. If TO-BUFFER is the symbol diff --git a/lisp/org/org-icalendar.el b/lisp/org/org-icalendar.el index f13f46d68b9..12cd0584fa0 100644 --- a/lisp/org/org-icalendar.el +++ b/lisp/org/org-icalendar.el @@ -327,6 +327,7 @@ When COMBINE is non nil, add the category to each line." tmp pri categories location summary desc uid alarm alarm-time (sexp-buffer (get-buffer-create "*ical-tmp*"))) (org-refresh-category-properties) + (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime) (save-excursion (goto-char (point-min)) (while (re-search-forward re1 nil t) @@ -357,7 +358,7 @@ When COMBINE is non nil, add the category to each line." (org-id-get-create) (or (org-id-get) (org-id-new))) categories (org-export-get-categories) - alarm-time (org-entry-get nil "APPT_WARNTIME") + alarm-time (get-text-property (point) 'org-appt-warntime) alarm-time (if alarm-time (string-to-number alarm-time) 0) alarm "" deadlinep nil scheduledp nil) @@ -676,7 +677,7 @@ a time), or the day by one (if it does not contain a time)." (setq fmt (if have-time (replace-regexp-in-string "%Z" org-icalendar-timezone - org-icalendar-date-time-format) + org-icalendar-date-time-format t) ";VALUE=DATE:%Y%m%d")) (concat keyword (format-time-string fmt time (and (org-icalendar-use-UTC-date-timep) diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index 6e865b50c2c..5d8e5b0dcf9 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el @@ -83,7 +83,7 @@ :tag "Org ID" :group 'org) -(define-obsolete-variable-alias +(org-define-obsolete-variable-alias 'org-link-to-org-use-id 'org-id-link-to-org-use-id "24.3") (defcustom org-id-link-to-org-use-id nil "Non-nil means storing a link to an Org file will use entry IDs. diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el index 3748d392b38..43913acacde 100644 --- a/lisp/org/org-inlinetask.el +++ b/lisp/org/org-inlinetask.el @@ -75,6 +75,9 @@ ;; Also, if you want to use refiling and archiving for inline tasks, ;; The END line must be present to make things work properly. ;; +;; Note that you should not try to use inline tasks within plain list, +;; visibility cycling is known to be problematic when doing so. +;; ;; This package installs one new command: ;; ;; C-c C-x t Insert a new inline task with END line diff --git a/lisp/org/org-install.el b/lisp/org/org-install.el index a31d8b79209..aca019fb823 100644 --- a/lisp/org/org-install.el +++ b/lisp/org/org-install.el @@ -1,8 +1,10 @@ -;;; org-install.el --- autogenerated file, do not edit +;;; org-install.el --- backward compatibility file for obsolete configuration ;; ;;; Code: (warn "The file org-install is obsolete. -Please change your configuration to (require 'org) instead.") +It is provided here so that (require 'org-install) does not +trigger an error for users with obsolete Emacs configuration. +You can safely remove (require 'org-install) from your config.") (provide 'org-install) diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el index 9a4046fff8b..08c01108b98 100644 --- a/lisp/org/org-jsinfo.el +++ b/lisp/org/org-jsinfo.el @@ -112,7 +112,7 @@ means to use the maximum value consistent with other options." * @licstart The following is the entire license notice for the * JavaScript code in %SCRIPT_PATH. * - * Copyright (C) 2012 Sebastian Rose + * Copyright (C) 2012-2013 Sebastian Rose * * * The JavaScript code in this tag is free software: you can diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el index 490a49d06e0..609bcbee103 100644 --- a/lisp/org/org-latex.el +++ b/lisp/org/org-latex.el @@ -872,7 +872,7 @@ no LaTeX header. When BODY-ONLY is set, don't produce the file header and footer, simply return the content of \\begin{document}...\\end{document}, without even the \\begin{document} and \\end{document} commands. -when PUB-DIR is set, use this as the publishing directory." +When PUB-DIR is set, use this as the publishing directory." (interactive "P") (when (and (not body-only) arg (listp arg)) (setq body-only t)) (run-hooks 'org-export-first-hook) diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el index d80e1717ce0..78cb2a621c7 100644 --- a/lisp/org/org-list.el +++ b/lisp/org/org-list.el @@ -144,15 +144,15 @@ item. When the cursor is on an outline heading, plain lists are treated as text. This is the most stable way of handling this, which is why it is the default. -When this is the symbol `integrate', then during cycling, plain -list items will *temporarily* be interpreted as outline headlines -with a level given by 1000+i where i is the indentation of the -bullet. This setting can lead to strange effects when switching -visibility to `children', because the first \"child\" in a -subtree decides what children should be listed. If that first -\"child\" is a plain list item with an implied large level -number, all true children and grand children of the outline -heading will be exposed in a children' view." +When this is the symbol `integrate', then integrate plain list +items when cycling, as if they were children of outline headings. + +This setting can lead to strange effects when switching visibility +to `children', because the first \"child\" in a subtree decides +what children should be listed. If that first \"child\" is a +plain list item with an implied large level number, all true +children and grand children of the outline heading will be +exposed in a children' view." :group 'org-plain-lists :type '(choice (const :tag "Never" nil) diff --git a/lisp/org/org-lparse.el b/lisp/org/org-lparse.el index 11711353ff7..e9fbbea586e 100644 --- a/lisp/org/org-lparse.el +++ b/lisp/org/org-lparse.el @@ -1718,7 +1718,7 @@ information." (org-lparse-end-paragraph) (org-lparse-end-list-item (or type "u"))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-lparse-preprocess-after-blockquote-hook 'org-lparse-preprocess-after-blockquote "24.3") @@ -1736,7 +1736,7 @@ information." (format "ORG-%s-END %s" (upcase (match-string 2)) (match-string 3))) t t)))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-lparse-strip-experimental-blocks-maybe-hook 'org-lparse-strip-experimental-blocks-maybe "24.3") diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 04e26708d69..a44bdbe30fd 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -126,6 +126,15 @@ Also, do not record undo information." (org-move-to-column ,col))))) (def-edebug-spec org-preserve-lc (body)) +;; Copied from bookmark.el +(defmacro org-with-buffer-modified-unmodified (&rest body) + "Run BODY while preserving the buffer's `buffer-modified-p' state." + (org-with-gensyms (was-modified) + `(let ((,was-modified (buffer-modified-p))) + (unwind-protect + (progn ,@body) + (set-buffer-modified-p ,was-modified))))) + (defmacro org-without-partial-completion (&rest body) `(if (and (boundp 'partial-completion-mode) partial-completion-mode diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el index 3f41d45f511..d2e7c217f76 100644 --- a/lisp/org/org-mobile.el +++ b/lisp/org/org-mobile.el @@ -304,12 +304,13 @@ Also exclude files matching `org-mobile-files-exclude-regexp'." ;;;###autoload (defun org-mobile-push () - "Push the current state of Org affairs to the WebDAV directory. + "Push the current state of Org affairs to the target directory. This will create the index file, copy all agenda files there, and also create all custom agenda views, for upload to the mobile phone." (interactive) (let ((a-buffer (get-buffer org-agenda-buffer-name))) - (let ((org-agenda-buffer-name "*SUMO*") + (let ((org-agenda-curbuf-name org-agenda-buffer-name) + (org-agenda-buffer-name "*SUMO*") (org-agenda-tag-filter org-agenda-tag-filter) (org-agenda-redo-command org-agenda-redo-command)) (save-excursion @@ -329,15 +330,17 @@ create all custom agenda views, for upload to the mobile phone." (org-mobile-create-index-file) (message "Writing checksums...") (org-mobile-write-checksums) - (run-hooks 'org-mobile-post-push-hook)))) + (run-hooks 'org-mobile-post-push-hook))) + (setq org-agenda-buffer-name org-agenda-curbuf-name + org-agenda-this-buffer-name org-agenda-curbuf-name)) (redraw-display) - (when (and a-buffer (buffer-live-p a-buffer)) + (when (buffer-live-p a-buffer) (if (not (get-buffer-window a-buffer)) - (kill-buffer a-buffer) - (let ((cw (selected-window))) - (select-window (get-buffer-window a-buffer)) - (org-agenda-redo) - (select-window cw))))) + (kill-buffer a-buffer) + (let ((cw (selected-window))) + (select-window (get-buffer-window a-buffer)) + (org-agenda-redo) + (select-window cw))))) (message "Files for mobile viewer staged")) (defvar org-mobile-before-process-capture-hook nil @@ -417,7 +420,8 @@ agenda view showing the flagged items." (target-file (expand-file-name org-mobile-index-file org-mobile-directory)) file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds) - + (when (stringp (car def-todo)) + (setq def-todo (list (cons 'sequence def-todo)))) (org-agenda-prepare-buffers (mapcar 'car files-alist)) (setq done-kwds (org-uniquify org-done-keywords-for-agenda)) (setq todo-kwds (org-delete-all @@ -536,7 +540,7 @@ The table of checksums is written to the file mobile-checksums." (t (cons (car x) (cons "" (cdr x)))))) org-agenda-custom-commands))) (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo))) - thelist new e key desc type match settings cmds gkey gdesc gsettings cnt) + thelist atitle new e key desc type match settings cmds gkey gdesc gsettings cnt) (cond ((eq org-mobile-agendas 'custom) (setq thelist custom-list)) @@ -588,12 +592,13 @@ The table of checksums is written to the file mobile-checksums." (setq cnt 0) (while (setq e (pop cmds)) (setq type (car e) match (nth 1 e) settings (nth 2 e)) + (setq atitle (if (string= "" gdesc) match gdesc)) (setq settings (append gsettings settings)) (setq settings (cons (list 'org-agenda-title-append (concat "KEYS=" gkey "#" (number-to-string (setq cnt (1+ cnt))) - " TITLE: " gdesc " " match "")) + " TITLE: " atitle "")) settings)) (push (list type match settings) new))))) (and new (list "X" "SUMO" (reverse new) @@ -983,7 +988,7 @@ is currently a noop.") (goto-char (point-max)) (newline) (goto-char (point-max)) - (move-marker (make-marker) (point))))) + (point-marker)))) (let ((file (match-string 1 link)) (path (match-string 2 link))) (setq file (org-link-unescape file)) diff --git a/lisp/org/org-odt.el b/lisp/org/org-odt.el index 028554f5821..b5f6e21c0c2 100644 --- a/lisp/org/org-odt.el +++ b/lisp/org/org-odt.el @@ -439,14 +439,14 @@ values. See Info node `(emacs) File Variables'." "meta.xml" "styles.xml"))) ;; kill all xml buffers (mapc (lambda (file) - (let ((buf (find-file-noselect - (expand-file-name file org-odt-zip-dir) t))) - (when (buffer-name buf) - (set-buffer-modified-p nil) - (kill-buffer buf)))) + (with-current-buffer + (find-file-noselect + (expand-file-name file org-odt-zip-dir) t) + (set-buffer-modified-p nil) + (kill-buffer))) xml-files)) ;; delete temporary directory. - (delete-directory org-odt-zip-dir t))))) + (org-delete-directory org-odt-zip-dir t))))) (org-condition-case-unless-debug err (prog1 (progn ,@body) (funcall --cleanup-xml-buffers)) @@ -474,7 +474,7 @@ emacs --batch --load=$HOME/lib/emacs/org.el --eval \"(setq org-export-headline-levels 2)\" --visit=MyFile --funcall org-export-as-odt-batch" - (org-lparse-batch "odt")) + (org-odt-cleanup-xml-buffers (org-lparse-batch "odt"))) ;;; org-export-as-odt ;;;###autoload @@ -1727,6 +1727,7 @@ ATTR is a string of other attributes of the a element." ((and (string= type "") (or (not thefile) (string= thefile "")) (plist-get org-lparse-opt-plist :section-numbers) + (get-text-property 0 'org-no-description fragment) (setq sec-frag fragment) (or (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag) (and (setq sec-frag @@ -1756,7 +1757,11 @@ ATTR is a string of other attributes of the a element." (when (not (member type '("" "file"))) (setq thefile (concat type ":" thefile))) - (let ((org-odt-suppress-xref nil)) + (let ((org-odt-suppress-xref + ;; Typeset link to headlines with description, as a + ;; regular hyperlink. + (and (string= type "") + (not (get-text-property 0 'org-no-description fragment))))) (org-odt-format-link (org-xml-format-desc desc) thefile attr))))))) diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el index 18c6d6d70a4..fd84e62c003 100644 --- a/lisp/org/org-protocol.el +++ b/lisp/org/org-protocol.el @@ -128,15 +128,15 @@ (filename &optional up)) (declare-function server-edit "server" (&optional arg)) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-protocol-unhex-compound 'org-link-unescape-compound "2011-02-17") -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-protocol-unhex-string 'org-link-unescape "2011-02-17") -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-protocol-unhex-single-byte-sequence 'org-link-unescape-single-byte-sequence "2011-02-17") diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el index 1388df47d97..20c6a6860aa 100644 --- a/lisp/org/org-publish.el +++ b/lisp/org/org-publish.el @@ -577,7 +577,7 @@ PUB-DIR is the publishing directory." (setq export-buf-or-file (funcall (intern (concat "org-export-as-" format)) (plist-get plist :headline-levels) - nil plist nil + plist nil (plist-get plist :body-only) pub-dir)) (when (and (bufferp export-buf-or-file) diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 6dbf6d67fc5..221ae367c87 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el @@ -39,6 +39,8 @@ (declare-function org-do-remove-indentation "org" (&optional n)) (declare-function org-at-table.el-p "org" ()) +(declare-function org-in-src-block-p "org" (&optional inside)) +(declare-function org-in-block-p "org" (names)) (declare-function org-get-indentation "org" (&optional line)) (declare-function org-switch-to-buffer-other-window "org" (&rest args)) (declare-function org-pop-to-buffer-same-window @@ -201,41 +203,39 @@ There is a mode hook, and keybindings for `org-edit-src-exit' and `org-edit-src-save'") (defun org-edit-src-code (&optional context code edit-buffer-name) - "Edit the source CODE example at point. -The example is copied to a separate buffer, and that buffer is -switched to the correct language mode. When done, exit with -\\[org-edit-src-exit]. This will remove the original code in the -Org buffer, and replace it with the edited version. An optional -argument CONTEXT is used by \\[org-edit-src-save] when calling -this function. See `org-src-window-setup' to configure the -display of windows containing the Org buffer and the code -buffer." + "Edit the source CODE block at point. +The code is copied to a separate buffer and the appropriate mode +is turned on. When done, exit with \\[org-edit-src-exit]. This will +remove the original code in the Org buffer, and replace it with the +edited version. An optional argument CONTEXT is used by \\[org-edit-src-save] +when calling this function. See `org-src-window-setup' to configure +the display of windows containing the Org buffer and the code buffer." (interactive) - (unless (eq context 'save) - (setq org-edit-src-saved-temp-window-config (current-window-configuration))) - (let* ((mark (and (org-region-active-p) (mark))) - (case-fold-search t) - (info - ;; If the src region consists in no lines, we insert a blank - ;; line. - (let* ((temp (org-edit-src-find-region-and-lang)) - (beg (nth 0 temp)) - (end (nth 1 temp))) - (if (>= end beg) temp - (goto-char beg) - (insert "\n") - (org-edit-src-find-region-and-lang)))) - (full-info (org-babel-get-src-block-info 'light)) - (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive - (beg (make-marker)) - ;; Move marker with inserted text for case when src block is - ;; just one empty line, i.e. beg == end. - (end (copy-marker nil t)) - (allow-write-back-p (null code)) - block-nindent total-nindent ovl lang lang-f single lfmt buffer msg - begline markline markcol line col transmitted-variables) - (if (not info) - nil + (if (not (org-in-block-p '("src" "example" "latex" "html"))) + (user-error "Not in a source code or example block") + (unless (eq context 'save) + (setq org-edit-src-saved-temp-window-config (current-window-configuration))) + (let* ((mark (and (org-region-active-p) (mark))) + (case-fold-search t) + (info + ;; If the src region consists in no lines, we insert a blank + ;; line. + (let* ((temp (org-edit-src-find-region-and-lang)) + (beg (nth 0 temp)) + (end (nth 1 temp))) + (if (>= end beg) temp + (goto-char beg) + (insert "\n") + (org-edit-src-find-region-and-lang)))) + (full-info (org-babel-get-src-block-info 'light)) + (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive + (beg (make-marker)) + ;; Move marker with inserted text for case when src block is + ;; just one empty line, i.e. beg == end. + (end (copy-marker (make-marker) t)) + (allow-write-back-p (null code)) + block-nindent total-nindent ovl lang lang-f single lfmt buffer msg + begline markline markcol line col transmitted-variables) (setq beg (move-marker beg (nth 0 info)) end (move-marker end (nth 1 info)) msg (if allow-write-back-p @@ -244,7 +244,7 @@ buffer." "Exit with C-c ' (C-c and single quote)") code (or code (buffer-substring-no-properties beg end)) lang (or (cdr (assoc (nth 2 info) org-src-lang-modes)) - (nth 2 info)) + (nth 2 info)) lang (if (symbolp lang) (symbol-name lang) lang) single (nth 3 info) block-nindent (nth 5 info) @@ -633,7 +633,8 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"." (unless (org-bound-and-true-p org-edit-src-from-org-mode) (error "This is not a sub-editing buffer, something is wrong")) (widen) - (let* ((beg org-edit-src-beg-marker) + (let* ((fixed-width-p (string-match "Fixed Width" (buffer-name))) + (beg org-edit-src-beg-marker) (end org-edit-src-end-marker) (ovl org-edit-src-overlay) (bufstr (buffer-string)) @@ -670,7 +671,8 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"." (goto-char (point-max)) (insert "\\n"))) (goto-char (point-min)) (if (looking-at "\\s-*") (replace-match " "))) - (when (org-bound-and-true-p org-edit-src-from-org-mode) + (when (and (org-bound-and-true-p org-edit-src-from-org-mode) + (not fixed-width-p)) (org-escape-code-in-region (point-min) (point-max)) (setq delta (+ delta (save-excursion diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index b024770ce78..00b2eb4d028 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -509,10 +509,10 @@ nil When nil, the command tries to be smart and figure out the re) (goto-char beg) (beginning-of-line 1) - (setq beg (move-marker (make-marker) (point))) + (setq beg (point-marker)) (goto-char end) (if (bolp) (backward-char 1) (end-of-line 1)) - (setq end (move-marker (make-marker) (point))) + (setq end (point-marker)) ;; Get the right field separator (unless separator (goto-char beg) @@ -1895,7 +1895,7 @@ it can be edited in place." (if (and (boundp 'font-lock-mode) font-lock-mode) (font-lock-fontify-block)))) (t - (let ((pos (move-marker (make-marker) (point))) + (let ((pos (point-marker)) (coord (if (eq org-table-use-standard-references t) (concat (org-number-to-letters (org-table-current-column)) @@ -3219,7 +3219,7 @@ Parameters get priority." (let ((key (org-table-current-field-formula 'key 'noerror)) (eql (sort (org-table-get-stored-formulas 'noerror) 'org-table-formula-less-p)) - (pos (move-marker (make-marker) (point))) + (pos (point-marker)) (startline 1) (wc (current-window-configuration)) (sel-win (selected-window)) @@ -3580,7 +3580,7 @@ With prefix ARG, apply the new formulas to the table." (beginning-of-line 1) (insert ind)) (goto-char (point-max)) - (backward-delete-char 1))) + (org-delete-backward-char 1))) (goto-char beg)) (t nil)))) @@ -4235,7 +4235,7 @@ overwritten, and the table is not marked as requiring realignment." (looking-at "[^|\n]* +|")) (let (org-table-may-need-update) (goto-char (1- (match-end 0))) - (backward-delete-char 1) + (org-delete-backward-char 1) (goto-char (match-beginning 0)) (self-insert-command N)) (setq org-table-may-need-update t) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index de434885b12..796d79ffa34 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-release "7.9.2+")) + (let ((org-release "7.9.3+")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-git-version "7.9.2+-GNU-Emacs-24-3 (commit 488eea)")) + (let ((org-git-version "7.9.3+-GNU-Emacs-24-3 (commit 31c1aeab)")) org-git-version)) ;;;###autoload (defvar org-odt-data-dir "/usr/share/emacs/etc/org" diff --git a/lisp/org/org.el b/lisp/org/org.el index d4120b4224e..32ed13fc1a3 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -1219,7 +1219,15 @@ See also the QUOTE keyword." :type 'boolean) (defcustom org-goto-auto-isearch t - "Non-nil means typing characters in `org-goto' starts incremental search." + "Non-nil means typing characters in `org-goto' starts incremental search. +When nil, you can use these keybindings to navigate the buffer: + + q Quit the org-goto interface + n Go to the next visible heading + p Go to the previous visible heading + f Go one heading forward on same level + b Go one heading backward on same level + u Go one heading up" :group 'org-edit-structure :type 'boolean) @@ -2236,8 +2244,9 @@ Lisp variable `org-state'." (defvar org-blocker-hook nil "Hook for functions that are allowed to block a state change. -Each function gets as its single argument a property list, see -`org-trigger-hook' for more information about this list. +Functions in this hook should not modify the buffer. +Each function gets as its single argument a property list, +see `org-trigger-hook' for more information about this list. If any of the functions in this hook returns nil, the state change is blocked.") @@ -2245,8 +2254,8 @@ is blocked.") (defvar org-trigger-hook nil "Hook for functions that are triggered by a state change. -Each function gets as its single argument a property list with at least -the following elements: +Each function gets as its single argument a property list with at +least the following elements: (:type type-of-change :position pos-at-entry-start :from old-state :to new-state) @@ -2979,7 +2988,7 @@ When nil, only the tags directly given in a specific line apply there. This may also be a list of tags that should be inherited, or a regexp that matches tags that should be inherited. Additional control is possible with the variable `org-tags-exclude-from-inheritance' which gives an -explicit list of tags to be excluded from inheritance., even if the value of +explicit list of tags to be excluded from inheritance, even if the value of `org-use-tag-inheritance' would select it for inheritance. If this option is t, a match early-on in a tree can lead to a large @@ -3952,7 +3961,7 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables." (beginning-of-line 1) (when (and (looking-at org-table-line-regexp) ;; Exclude tables in src/example/verbatim/clocktable blocks - (not (org-in-block-p '("src" "example")))) + (not (org-in-block-p '("src" "example" "verbatim" "clocktable")))) (save-excursion (funcall function)) (or (looking-at org-table-line-regexp) (forward-char 1))) @@ -5007,13 +5016,15 @@ The following commands are available: (defun org-find-invisible-foreground () (let ((candidates (remove "unspecified-bg" - (list - (face-background 'default) - (face-background 'org-default) - (cdr (assoc 'background-color default-frame-alist)) - (cdr (assoc 'background-color initial-frame-alist)) - (cdr (assoc 'background-color window-system-default-frame-alist)) - (face-foreground 'org-hide))))) + (nconc + (list (face-background 'default) + (face-background 'org-default)) + (mapcar + (lambda (alist) + (when (boundp alist) + (cdr (assoc 'background-color (symbol-value alist))))) + '(default-frame-alist initial-frame-alist window-system-default-frame-alist)) + (list (face-foreground 'org-hide)))))) (car (remove nil candidates)))) (defun org-current-time () @@ -5284,7 +5295,7 @@ will be prompted for." (and move (backward-char 1)))) (defconst org-nonsticky-props - '(mouse-face highlight keymap invisible intangible help-echo org-linked-text)) + '(mouse-face highlight keymap invisible intangible help-echo org-linked-text htmlize-link)) (defsubst org-rear-nonsticky-at (pos) (add-text-properties (1- pos) pos (list 'rear-nonsticky org-nonsticky-props))) @@ -5293,12 +5304,13 @@ will be prompted for." "Run through the buffer and add overlays to links." (catch 'exit (let (f) - (when (re-search-forward (concat org-plain-link-re) limit t) + (when (and (re-search-forward (concat org-plain-link-re) limit t) + (not (org-in-src-block-p))) (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (setq f (get-text-property (match-beginning 0) 'face)) - (if (or (eq f 'org-tag) - (and (listp f) (memq 'org-tag f))) - nil + (unless (or (org-in-src-block-p) + (eq f 'org-tag) + (and (listp f) (memq 'org-tag f))) (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight 'face 'org-link @@ -5410,9 +5422,9 @@ by a #." '(font-lock-fontified t invisible t) '(font-lock-fontified t face org-document-info-keyword))) (add-text-properties - (match-beginning 6) (match-end 6) + (match-beginning 6) (1+ (match-end 6)) (if (string-equal dc1 "+title:") - '(font-lock-fontified t face org-document-title) + '(font-lock-fontified t face org-document-title) '(font-lock-fontified t face org-document-info)))) ((or (equal dc1 "+results") (member dc1 '("+begin:" "+end:" "+caption:" "+label:" @@ -5437,7 +5449,8 @@ by a #." (defun org-activate-angle-links (limit) "Run through the buffer and add overlays to links." - (if (re-search-forward org-angle-link-re limit t) + (if (and (re-search-forward org-angle-link-re limit t) + (not (org-in-src-block-p))) (progn (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (add-text-properties (match-beginning 0) (match-end 0) @@ -5465,7 +5478,8 @@ by a #." (defun org-activate-bracket-links (limit) "Run through the buffer and add overlays to bracketed links." - (if (re-search-forward org-bracket-link-regexp limit t) + (if (and (re-search-forward org-bracket-link-regexp limit t) + (not (org-in-src-block-p))) (let* ((help (concat "LINK: " (org-match-string-no-properties 1))) ;; FIXME: above we should remove the escapes. @@ -6254,11 +6268,7 @@ in special contexts. (setq has-children (org-list-has-child-p (point) struct))) (org-back-to-heading) (setq eoh (save-excursion (outline-end-of-heading) (point))) - (setq eos (save-excursion - (org-end-of-subtree t) - (unless (eobp) - (skip-chars-forward " \t\n")) - (if (eobp) (point) (1- (point))))) + (setq eos (save-excursion (1- (org-end-of-subtree t t)))) (setq has-children (or (save-excursion (let ((level (funcall outline-level))) @@ -6283,7 +6293,8 @@ in special contexts. (cond ((= eos eoh) ;; Nothing is hidden behind this heading - (run-hook-with-args 'org-pre-cycle-hook 'empty) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'empty)) (message "EMPTY ENTRY") (setq org-cycle-subtree-status nil) (save-excursion @@ -6296,7 +6307,8 @@ in special contexts. (not (setq children-skipped org-cycle-skip-children-state-if-no-children)))) ;; Entire subtree is hidden in one line: children view - (run-hook-with-args 'org-pre-cycle-hook 'children) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'children)) (if (org-at-item-p) (org-list-set-item-visibility (point-at-bol) struct 'children) (org-show-entry) @@ -6324,24 +6336,28 @@ in special contexts. (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil))) (setq org-cycle-subtree-status 'children) - (run-hook-with-args 'org-cycle-hook 'children)) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'children))) ((or children-skipped (and (eq last-command this-command) (eq org-cycle-subtree-status 'children))) ;; We just showed the children, or no children are there, ;; now show everything. - (run-hook-with-args 'org-pre-cycle-hook 'subtree) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'subtree)) (outline-flag-region eoh eos nil) (message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-status 'subtree) - (run-hook-with-args 'org-cycle-hook 'subtree)) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'subtree))) (t ;; Default action: hide the subtree. (run-hook-with-args 'org-pre-cycle-hook 'folded) (outline-flag-region eoh eos t) (message "FOLDED") (setq org-cycle-subtree-status 'folded) - (run-hook-with-args 'org-cycle-hook 'folded))))) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'folded)))))) ;;;###autoload (defun org-global-cycle (&optional arg) @@ -6745,42 +6761,47 @@ Optional arguments START and END can be used to limit the range." (defvar org-goto-window-configuration nil) (defvar org-goto-marker nil) -(defvar org-goto-map - (let ((map (make-sparse-keymap))) - (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command mouse-drag-region universal-argument org-occur)) cmd) - (while (setq cmd (pop cmds)) - (substitute-key-definition cmd cmd map global-map))) - (suppress-keymap map) - (org-defkey map "\C-m" 'org-goto-ret) - (org-defkey map [(return)] 'org-goto-ret) - (org-defkey map [(left)] 'org-goto-left) - (org-defkey map [(right)] 'org-goto-right) - (org-defkey map [(control ?g)] 'org-goto-quit) - (org-defkey map "\C-i" 'org-cycle) - (org-defkey map [(tab)] 'org-cycle) - (org-defkey map [(down)] 'outline-next-visible-heading) - (org-defkey map [(up)] 'outline-previous-visible-heading) - (if org-goto-auto-isearch - (if (fboundp 'define-key-after) - (define-key-after map [t] 'org-goto-local-auto-isearch) - nil) - (org-defkey map "q" 'org-goto-quit) - (org-defkey map "n" 'outline-next-visible-heading) - (org-defkey map "p" 'outline-previous-visible-heading) - (org-defkey map "f" 'outline-forward-same-level) - (org-defkey map "b" 'outline-backward-same-level) - (org-defkey map "u" 'outline-up-heading)) - (org-defkey map "/" 'org-occur) - (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) - (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) - (org-defkey map "\C-c\C-f" 'outline-forward-same-level) - (org-defkey map "\C-c\C-b" 'outline-backward-same-level) - (org-defkey map "\C-c\C-u" 'outline-up-heading) - map)) +(defvar org-goto-map) +(defun org-goto-map () + "Set the keymap `org-goto'." + (setq org-goto-map + (let ((map (make-sparse-keymap))) + (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command + mouse-drag-region universal-argument org-occur)) + cmd) + (while (setq cmd (pop cmds)) + (substitute-key-definition cmd cmd map global-map))) + (suppress-keymap map) + (org-defkey map "\C-m" 'org-goto-ret) + (org-defkey map [(return)] 'org-goto-ret) + (org-defkey map [(left)] 'org-goto-left) + (org-defkey map [(right)] 'org-goto-right) + (org-defkey map [(control ?g)] 'org-goto-quit) + (org-defkey map "\C-i" 'org-cycle) + (org-defkey map [(tab)] 'org-cycle) + (org-defkey map [(down)] 'outline-next-visible-heading) + (org-defkey map [(up)] 'outline-previous-visible-heading) + (if org-goto-auto-isearch + (if (fboundp 'define-key-after) + (define-key-after map [t] 'org-goto-local-auto-isearch) + nil) + (org-defkey map "q" 'org-goto-quit) + (org-defkey map "n" 'outline-next-visible-heading) + (org-defkey map "p" 'outline-previous-visible-heading) + (org-defkey map "f" 'outline-forward-same-level) + (org-defkey map "b" 'outline-backward-same-level) + (org-defkey map "u" 'outline-up-heading)) + (org-defkey map "/" 'org-occur) + (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) + (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) + (org-defkey map "\C-c\C-f" 'outline-forward-same-level) + (org-defkey map "\C-c\C-b" 'outline-backward-same-level) + (org-defkey map "\C-c\C-u" 'outline-up-heading) + map))) (defconst org-goto-help - "Browse buffer copy, to find location or copy text. Just type for auto-isearch. -RET=jump to location [Q]uit and return to previous location + "Browse buffer copy, to find location or copy text.%s +RET=jump to location C-g=quit and return to previous location \[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur") (defvar org-goto-start-pos) ; dynamically scoped parameter @@ -6806,6 +6827,7 @@ in the indirect buffer and expose the headline hierarchy above. With a prefix argument, use the alternative interface: e.g. if `org-goto-interface' is 'outline use 'outline-path-completion." (interactive "P") + (org-goto-map) (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level)))) (org-refile-use-outline-path t) (org-refile-target-verify-function nil) @@ -6838,48 +6860,46 @@ With a prefix argument, use the alternative interface: e.g. if "Let the user select a location in the Org-mode buffer BUF. This function uses a recursive edit. It returns the selected position or nil." - (let ((isearch-mode-map org-goto-local-auto-isearch-map) - (isearch-hide-immediately nil) - (isearch-search-fun-function - (lambda () 'org-goto-local-search-headings)) - (org-goto-selected-point org-goto-exit-command) - (pop-up-frames nil) - (special-display-buffer-names nil) - (special-display-regexps nil) - (special-display-function nil)) - (save-excursion - (save-window-excursion - (delete-other-windows) - (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) - (org-pop-to-buffer-same-window - (condition-case nil - (make-indirect-buffer (current-buffer) "*org-goto*") - (error (make-indirect-buffer (current-buffer) "*org-goto*")))) - (with-output-to-temp-buffer "*Help*" - (princ help)) - (org-fit-window-to-buffer (get-buffer-window "*Help*")) - (setq buffer-read-only nil) - (let ((org-startup-truncated t) - (org-startup-folded nil) - (org-startup-align-all-tables nil)) - (org-mode) - (org-overview)) - (setq buffer-read-only t) - (if (and (boundp 'org-goto-start-pos) - (integer-or-marker-p org-goto-start-pos)) - (let ((org-show-hierarchy-above t) - (org-show-siblings t) - (org-show-following-heading t)) - (goto-char org-goto-start-pos) - (and (outline-invisible-p) (org-show-context))) - (goto-char (point-min))) - (let (org-special-ctrl-a/e) (org-beginning-of-line)) - (message "Select location and press RET") - (use-local-map org-goto-map) - (recursive-edit) - )) - (kill-buffer "*org-goto*") - (cons org-goto-selected-point org-goto-exit-command))) + (org-no-popups + (let ((isearch-mode-map org-goto-local-auto-isearch-map) + (isearch-hide-immediately nil) + (isearch-search-fun-function + (lambda () 'org-goto-local-search-headings)) + (org-goto-selected-point org-goto-exit-command)) + (save-excursion + (save-window-excursion + (delete-other-windows) + (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) + (org-pop-to-buffer-same-window + (condition-case nil + (make-indirect-buffer (current-buffer) "*org-goto*") + (error (make-indirect-buffer (current-buffer) "*org-goto*")))) + (with-output-to-temp-buffer "*Org Help*" + (princ (format help (if org-goto-auto-isearch + " Just type for auto-isearch." + " n/p/f/b/u to navigate, q to quit.")))) + (org-fit-window-to-buffer (get-buffer-window "*Org Help*")) + (setq buffer-read-only nil) + (let ((org-startup-truncated t) + (org-startup-folded nil) + (org-startup-align-all-tables nil)) + (org-mode) + (org-overview)) + (setq buffer-read-only t) + (if (and (boundp 'org-goto-start-pos) + (integer-or-marker-p org-goto-start-pos)) + (let ((org-show-hierarchy-above t) + (org-show-siblings t) + (org-show-following-heading t)) + (goto-char org-goto-start-pos) + (and (outline-invisible-p) (org-show-context))) + (goto-char (point-min))) + (let (org-special-ctrl-a/e) (org-beginning-of-line)) + (message "Select location and press RET") + (use-local-map org-goto-map) + (recursive-edit))) + (kill-buffer "*org-goto*") + (cons org-goto-selected-point org-goto-exit-command)))) (defvar org-goto-local-auto-isearch-map (make-sparse-keymap)) (set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map) @@ -7382,12 +7402,7 @@ even level numbers will become the next higher odd number." ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2)))))) (max 1 (+ level (or change 0))))) -(if (boundp 'define-obsolete-function-alias) - (if (or (featurep 'xemacs) (< emacs-major-version 23)) - (define-obsolete-function-alias 'org-get-legal-level - 'org-get-valid-level) - (define-obsolete-function-alias 'org-get-legal-level - 'org-get-valid-level "23.1"))) +(org-define-obsolete-function-alias 'org-get-legal-level 'org-get-valid-level "23.1") (defvar org-called-with-limited-levels nil) ;; Dynamically bound in ;; ̀org-with-limited-levels' @@ -7672,7 +7687,6 @@ useful if the caller implements cut-and-paste as copy-then-paste-then-cut." (if (org-called-interactively-p 'any) (org-back-to-heading nil) ; take what looks like a subtree (org-back-to-heading t)) ; take what is really there - (org-back-over-empty-lines) (setq beg (point)) (skip-chars-forward " \t\r\n") (save-match-data @@ -7682,7 +7696,6 @@ useful if the caller implements cut-and-paste as copy-then-paste-then-cut." (org-forward-heading-same-level (1- n) t) (error nil)) (org-end-of-subtree t t)) - (org-back-over-empty-lines) (setq end (point)) (goto-char beg0) (when (> end beg) @@ -7773,7 +7786,6 @@ the inserted text when done." (delete-region (point-at-bol) (point))) ;; Paste (beginning-of-line (if (bolp) 1 2)) - (unless for-yank (org-back-over-empty-lines)) (setq beg (point)) (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) (insert-before-markers txt) @@ -8630,6 +8642,24 @@ call CMD." (put-text-property beg end 'org-category-position beg) (goto-char pos))))))) +(defun org-refresh-properties (dprop tprop) + "Refresh buffer text properties. +DPROP is the drawer property and TPROP is the corresponding text +property to set." + (let ((case-fold-search t) + (inhibit-read-only t) p) + (org-unmodified + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (re-search-forward (concat "^[ \t]*:" dprop ": +\\(.*\\)[ \t]*$") nil t) + (setq p (org-match-string-no-properties 1)) + (save-excursion + (org-back-to-heading t) + (put-text-property + (point-at-bol) (point-at-eol) tprop p)))))))) + ;;;; Link Stuff @@ -8723,7 +8753,7 @@ type. For a simple example of an export function, see `org-bbdb.el'." (push (list type follow export) org-link-protocols))) (defvar org-agenda-buffer-name) ; Defined in org-agenda.el -(defvar org-link-to-org-use-id) ; Defined in org-id.el +(defvar org-id-link-to-org-use-id) ; Defined in org-id.el ;;;###autoload (defun org-store-link (arg) @@ -8839,13 +8869,13 @@ For file links, arg negates `org-context-in-file-links'." "::" (match-string 1)) link cpltxt)) ((and (featurep 'org-id) - (or (eq org-link-to-org-use-id t) + (or (eq org-id-link-to-org-use-id t) (and (org-called-interactively-p 'any) - (or (eq org-link-to-org-use-id 'create-if-interactive) - (and (eq org-link-to-org-use-id + (or (eq org-id-link-to-org-use-id 'create-if-interactive) + (and (eq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) (not custom-id)))) - (and org-link-to-org-use-id (org-entry-get nil "ID")))) + (and org-id-link-to-org-use-id (org-entry-get nil "ID")))) ;; We can make a link using the ID. (setq link (condition-case nil (prog1 (org-id-store-link) @@ -9318,10 +9348,11 @@ Use TAB to complete link prefixes, then RET for type-specific completion support ;; URL-like link, normalize the use of angular brackets. (setq link (org-remove-angle-brackets link))) - ;; Check if we are linking to the current file with a search option - ;; If yes, simplify the link by using only the search option. + ;; Check if we are linking to the current file with a search + ;; option If yes, simplify the link by using only the search + ;; option. (when (and buffer-file-name - (string-match "^file:\\(.+?\\)::\\([^>]+\\)" link)) + (string-match "^file:\\(.+?\\)::\\(.+\\)" link)) (let* ((path (match-string 1 link)) (case-fold-search nil) (search (match-string 2 link))) @@ -9652,7 +9683,13 @@ application the system uses for this file type." org-angle-link-re "\\|" "[ \t]:[^ \t\n]+:[ \t]*$"))) (not (get-text-property (point) 'org-linked-text))) - (or (org-offer-links-in-entry arg) + (or (let* ((lkall (org-offer-links-in-entry (current-buffer) (point) arg)) + (lk (car lkall)) + (lkend (cdr lkall))) + (when lk + (prog1 (search-forward lk nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point)))) (progn (require 'org-attach) (org-attach-reveal 'if-exists)))) ((run-hook-with-args-until-success 'org-open-at-point-functions)) ((and (org-at-timestamp-p t) @@ -9695,12 +9732,13 @@ application the system uses for this file type." (throw 'match t)) (save-excursion - (when (or (org-in-regexp org-angle-link-re) - (and (goto-char (car (org-in-regexp org-plain-link-re))) - (save-match-data (not (looking-back "\\[\\["))))) - (setq type (match-string 1) - path (org-link-unescape (match-string 2))) - (throw 'match t))) + (let ((plinkpos (org-in-regexp org-plain-link-re))) + (when (or (org-in-regexp org-angle-link-re) + (and plinkpos (goto-char (car plinkpos)) + (save-match-data (not (looking-back "\\[\\["))))) + (setq type (match-string 1) + path (org-link-unescape (match-string 2))) + (throw 'match t)))) (save-excursion (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ \t]*$")) (setq type "tags" @@ -9713,7 +9751,7 @@ application the system uses for this file type." path (match-string 1)) (throw 'match t))) (unless path - (error "No link found")) + (user-error "No link found")) ;; switch back to reference buffer ;; needed when if called in a temporary buffer through @@ -9847,68 +9885,67 @@ application the system uses for this file type." (move-marker org-open-link-marker nil) (run-hook-with-args 'org-follow-link-hook))) -(defun org-offer-links-in-entry (&optional nth zero) - "Offer links in the current entry and follow the selected link. -If there is only one link, follow it immediately as well. -If NTH is an integer, immediately pick the NTH link found. +(defun org-offer-links-in-entry (buffer marker &optional nth zero) + "Offer links in the current entry and return the selected link. +If there is only one link, return it. +If NTH is an integer, return the NTH link found. If ZERO is a string, check also this string for a link, and if -there is one, offer it as link number zero." - (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" - "\\(" org-angle-link-re "\\)\\|" - "\\(" org-plain-link-re "\\)")) - (cnt ?0) - (in-emacs (if (integerp nth) nil nth)) - have-zero end links link c) - (when (and (stringp zero) (string-match org-bracket-link-regexp zero)) - (push (match-string 0 zero) links) - (setq cnt (1- cnt) have-zero t)) +there is one, return it." + (with-current-buffer buffer (save-excursion - (org-back-to-heading t) - (setq end (save-excursion (outline-next-heading) (point))) - (while (re-search-forward re end t) - (push (match-string 0) links)) - (setq links (org-uniquify (reverse links)))) - - (cond - ((null links) - (message "No links")) - ((equal (length links) 1) - (setq link (list (car links)))) - ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth))) - (setq link (list (nth (if have-zero nth (1- nth)) links)))) - (t ; we have to select a link - (save-excursion - (save-window-excursion - (delete-other-windows) - (with-output-to-temp-buffer "*Select Link*" - (mapc (lambda (l) - (if (not (string-match org-bracket-link-regexp l)) - (princ (format "[%c] %s\n" (incf cnt) - (org-remove-angle-brackets l))) - (if (match-end 3) - (princ (format "[%c] %s (%s)\n" (incf cnt) - (match-string 3 l) (match-string 1 l))) - (princ (format "[%c] %s\n" (incf cnt) - (match-string 1 l)))))) - links)) - (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) - (message "Select link to open, RET to open all:") - (setq c (read-char-exclusive)) - (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) - (when (equal c ?q) (error "Abort")) - (if (equal c ?\C-m) - (setq link links) - (setq nth (- c ?0)) - (if have-zero (setq nth (1+ nth))) - (unless (and (integerp nth) (>= (length links) nth)) - (error "Invalid link selection")) - (setq link (list (nth (1- nth) links)))))) - (if link - (let ((buf (current-buffer))) - (dolist (l link) - (org-open-link-from-string l in-emacs buf)) - t) - nil))) + (save-restriction + (widen) + (goto-char marker) + (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" + "\\(" org-angle-link-re "\\)\\|" + "\\(" org-plain-link-re "\\)")) + (cnt ?0) + (in-emacs (if (integerp nth) nil nth)) + have-zero end links link c) + (when (and (stringp zero) (string-match org-bracket-link-regexp zero)) + (push (match-string 0 zero) links) + (setq cnt (1- cnt) have-zero t)) + (save-excursion + (org-back-to-heading t) + (setq end (save-excursion (outline-next-heading) (point))) + (while (re-search-forward re end t) + (push (match-string 0) links)) + (setq links (org-uniquify (reverse links)))) + (cond + ((null links) + (message "No links")) + ((equal (length links) 1) + (setq link (car links))) + ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth))) + (setq link (nth (if have-zero nth (1- nth)) links))) + (t ; we have to select a link + (save-excursion + (save-window-excursion + (delete-other-windows) + (with-output-to-temp-buffer "*Select Link*" + (mapc (lambda (l) + (if (not (string-match org-bracket-link-regexp l)) + (princ (format "[%c] %s\n" (incf cnt) + (org-remove-angle-brackets l))) + (if (match-end 3) + (princ (format "[%c] %s (%s)\n" (incf cnt) + (match-string 3 l) (match-string 1 l))) + (princ (format "[%c] %s\n" (incf cnt) + (match-string 1 l)))))) + links)) + (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) + (message "Select link to open, RET to open all:") + (setq c (read-char-exclusive)) + (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) + (when (equal c ?q) (error "Abort")) + (if (equal c ?\C-m) + (setq link links) + (setq nth (- c ?0)) + (if have-zero (setq nth (1+ nth))) + (unless (and (integerp nth) (>= (length links) nth)) + (error "Invalid link selection")) + (setq link (nth (1- nth) links))))) + (cons link end)))))) ;; Add special file links that specify the way of opening @@ -9930,12 +9967,6 @@ there is one, offer it as link number zero." '(add-hook 'org-export-preprocess-before-normalizing-links-hook 'org-remove-file-link-modifiers)) -;;;; Time estimates - -(defun org-get-effort (&optional pom) - "Get the effort estimate for the current entry." - (org-entry-get pom org-effort-property)) - ;;; File search (defvar org-create-file-search-functions nil @@ -11259,8 +11290,7 @@ This function can be used in a hook." " +" t))) (defcustom org-structure-template-alist - '( - ("s" "#+BEGIN_SRC ?\n\n#+END_SRC" + '(("s" "#+BEGIN_SRC ?\n\n#+END_SRC" "\n\n") ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE" "\n?\n") @@ -11268,6 +11298,8 @@ This function can be used in a hook." "\n?\n") ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE" "\n?\n") + ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM" + "\n?\n") ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER" "
\n?\n
") ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX" @@ -11283,8 +11315,7 @@ This function can be used in a hook." ("i" "#+INDEX: ?" "#+INDEX: ?") ("I" "#+INCLUDE: %file ?" - "") - ) + "")) "Structure completion elements. This is a list of abbreviation keys and values. The value gets inserted if you type `<' followed by the key and then press the completion key, @@ -11439,7 +11470,8 @@ For calling through lisp, arg is also interpreted in the following way: cl (if (outline-invisible-p) (org-end-of-subtree nil t)))) (if (equal arg '(16)) (setq arg 'nextset)) (let ((org-blocker-hook org-blocker-hook) - (case-fold-search nil)) + commentp + case-fold-search) (when (equal arg '(64)) (setq arg nil org-blocker-hook nil)) (when (and org-blocker-hook @@ -11449,6 +11481,9 @@ For calling through lisp, arg is also interpreted in the following way: (save-excursion (catch 'exit (org-back-to-heading t) + (when (looking-at (concat "^\\*+ " org-comment-string)) + (org-toggle-comment) + (setq commentp t)) (if (looking-at org-outline-regexp) (goto-char (1- (match-end 0)))) (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)")) (looking-at "\\(?: *\\|[ \t]*$\\)")) @@ -11624,7 +11659,8 @@ For calling through lisp, arg is also interpreted in the following way: (and (looking-at " ") (just-one-space)))) (when org-trigger-hook (save-excursion - (run-hook-with-args 'org-trigger-hook change-plist))))))))) + (run-hook-with-args 'org-trigger-hook change-plist))) + (when commentp (org-toggle-comment)))))))) (defun org-block-todo-from-children-or-siblings-or-parent (change-plist) "Block turning an entry into a TODO, using the hierarchy. @@ -11765,15 +11801,16 @@ changes because there are unchecked boxes in this entry." (defun org-entry-blocked-p () "Is the current entry blocked?" - (if (org-entry-get nil "NOBLOCKING") - nil ;; Never block this entry - (not - (run-hook-with-args-until-failure - 'org-blocker-hook - (list :type 'todo-state-change - :position (point) - :from 'todo - :to 'done))))) + (org-with-buffer-modified-unmodified + (if (org-entry-get nil "NOBLOCKING") + nil ;; Never block this entry + (not + (run-hook-with-args-until-failure + 'org-blocker-hook + (list :type 'todo-state-change + :position (point) + :from 'todo + :to 'done)))))) (defun org-update-statistics-cookies (all) "Update the statistics cookie, either from TODO or from checkboxes. @@ -11785,7 +11822,7 @@ This should be called with the cursor in a line with a statistics cookie." (org-map-entries 'org-update-parent-todo-statistics)) (if (not (org-at-heading-p)) (org-update-checkbox-count) - (let ((pos (move-marker (make-marker) (point))) + (let ((pos (point-marker)) end l1 l2) (ignore-errors (org-back-to-heading t)) (if (not (org-at-heading-p)) @@ -12666,7 +12703,7 @@ D Show deadlines and scheduled items between a date range." (let (ans kwd value ts-type) (setq type (or type org-sparse-tree-default-date-type)) (setq org-ts-type type) - (message "Sparse tree: [r]egexp [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n [d]eadlines [b]efore-date [a]fter-date [D]ates range\n [c]ycle through date types: %s" + (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n [d]eadlines [b]efore-date [a]fter-date [D]ates range\n [c]ycle through date types: %s" (cond ((eq type 'all) "all timestamps") ((eq type 'scheduled) "only scheduled") ((eq type 'deadline) "only deadline") @@ -12981,9 +13018,9 @@ and by additional input from the age of a schedules or deadline entry." (defun org-get-priority (s) "Find priority cookie and return priority." - (if (functionp org-get-priority-function) - (funcall org-get-priority-function) - (save-match-data + (save-match-data + (if (functionp org-get-priority-function) + (funcall org-get-priority-function) (if (not (string-match org-priority-regexp s)) (* 1000 (- org-lowest-priority org-default-priority)) (* 1000 (- org-lowest-priority @@ -13113,18 +13150,9 @@ headlines matching this string." (or (not todo-only) (and (member todo org-not-done-keywords) (or (not org-agenda-tags-todo-honor-ignore-options) - (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))))) - - ;; Extra check for the archive tag - ;; FIXME: Does the skipper already do this???? - (or - (not (member org-archive-tag tags-list)) - ;; we have an archive tag, should we use this anyway? - (or (not org-agenda-skip-archived-trees) - (and (eq action 'agenda) org-agenda-archives-mode)))) + (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))))) ;; select this headline - (cond ((eq action 'sparse-tree) (and org-highlight-sparse-tree-matches @@ -14276,6 +14304,9 @@ When INCREMENT is non-nil, set the property to the next allowed value." existing nil nil "" nil cur)))))) (unless (equal (org-entry-get nil prop) val) (org-entry-put nil prop val)) + (save-excursion + (org-back-to-heading t) + (put-text-property (point-at-bol) (point-at-eol) 'org-effort val)) (message "%s is now %s" prop val))) (defun org-at-property-p () @@ -14454,26 +14485,27 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy." ;; We need a special property. Use `org-entry-properties' to ;; retrieve it, but specify the wanted property (cdr (assoc property (org-entry-properties nil 'special property))) - (let* ((range (org-get-property-block)) - (props (list (or (assoc property org-file-properties) - (assoc property org-global-properties) - (assoc property org-global-properties-fixed)))) - (ap (lambda (key) - (when (re-search-forward - (org-re-property key) (cdr range) t) - (setq props - (org-update-property-plist - key - (if (match-end 1) - (org-match-string-no-properties 1) "") - props))))) - val) - (when (and range (goto-char (car range))) - (funcall ap property) - (goto-char (car range)) - (while (funcall ap (concat property "+"))) - (setq val (cdr (assoc property props))) - (when val (if literal-nil val (org-not-nil val))))))))) + (let ((range (org-get-property-block))) + (when (and range (not (eq (car range) (cdr range)))) + (let* ((props (list (or (assoc property org-file-properties) + (assoc property org-global-properties) + (assoc property org-global-properties-fixed)))) + (ap (lambda (key) + (when (re-search-forward + (org-re-property key) (cdr range) t) + (setq props + (org-update-property-plist + key + (if (match-end 1) + (org-match-string-no-properties 1) "") + props))))) + val) + (goto-char (car range)) + (funcall ap property) + (goto-char (car range)) + (while (funcall ap (concat property "+"))) + (setq val (cdr (assoc property props))) + (when val (if literal-nil val (org-not-nil val)))))))))) (defun org-property-or-variable-value (var &optional inherit) "Check if there is a property fixing the value of VAR. @@ -14996,7 +15028,8 @@ completion." (interactive) (unless (org-at-property-p) (error "Not at a property")) - (let* ((key (match-string 2)) + (let* ((prop (car (save-match-data (org-split-string (match-string 1) ":")))) + (key (match-string 2)) (value (match-string 3)) (allowed (or (org-property-get-allowed-values (point) key) (and (member value '("[ ]" "[-]" "[X]")) @@ -15015,6 +15048,10 @@ completion." (org-indent-line) (beginning-of-line 1) (skip-chars-forward " \t") + (when (equal prop org-effort-property) + (save-excursion + (org-back-to-heading t) + (put-text-property (point-at-bol) (point-at-eol) 'org-effort nval))) (run-hook-with-args 'org-property-changed-functions key nval))) (defun org-find-olp (path &optional this-buffer) @@ -15060,7 +15097,7 @@ only headings." (setq lmin (1+ flevel) lmax (+ lmin (if org-odd-levels-only 1 0))) (setq end (save-excursion (org-end-of-subtree t t)))) (when (org-at-heading-p) - (move-marker (make-marker) (point)))))))) + (point-marker))))))) (defun org-find-exact-headline-in-buffer (heading &optional buffer pos-only) "Find node HEADING in BUFFER. @@ -15307,6 +15344,7 @@ user." (setcar (nthcdr 1 org-defdecode) 59) (setq org-def (apply 'encode-time org-defdecode) org-defdecode (decode-time org-def))))) + (mouse-autoselect-window nil) ; Don't let the mouse jump (calendar-frame-setup nil) (calendar-setup nil) (calendar-move-hook nil) @@ -16966,6 +17004,8 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (widen) (setq bmp (buffer-modified-p)) (org-refresh-category-properties) + (org-refresh-properties org-effort-property 'org-effort) + (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime) (setq org-todo-keywords-for-agenda (append org-todo-keywords-for-agenda org-todo-keywords-1)) (setq org-done-keywords-for-agenda @@ -17758,7 +17798,7 @@ BEG and END default to the buffer boundaries." (list 'org-display-inline-remove-overlay)) (push ov org-inline-image-overlays))))))))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-display-inline-modification-hook 'org-display-inline-remove-overlay "24.3") (defun org-display-inline-remove-overlay (ov after beg end &optional len) @@ -18053,7 +18093,7 @@ BEG and END default to the buffer boundaries." ("c" . org-cycle) ("C" . org-shifttab) (" " . org-display-outline-path) - (":" . org-columns) + ("=" . org-columns) ("Outline Structure Editing") ("U" . org-shiftmetaup) ("D" . org-shiftmetadown) @@ -18078,7 +18118,7 @@ BEG and END default to the buffer boundaries." ("1" . (org-priority ?A)) ("2" . (org-priority ?B)) ("3" . (org-priority ?C)) - (";" . org-set-tags-command) + (":" . org-set-tags-command) ("e" . org-set-effort) ("E" . org-inc-effort) ("W" . (lambda(m) (interactive "sMinutes before warning: ") @@ -18138,7 +18178,7 @@ If not, return to the original position and throw an error." (defvar org-table-auto-blank-field) ; defined in org-table.el (defvar org-speed-command nil) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-speed-command-default-hook 'org-speed-command-activate "24.3") (defun org-speed-command-activate (keys) @@ -18151,7 +18191,7 @@ Use `org-speed-commands-user' for further customization." (cdr (assoc keys (append org-speed-commands-user org-speed-commands-default))))) -(define-obsolete-function-alias +(org-define-obsolete-function-alias 'org-babel-speed-command-hook 'org-babel-speed-command-activate "24.3") (defun org-babel-speed-command-activate (keys) @@ -18296,25 +18336,26 @@ front of the next \"|\" separator, to keep the table aligned. The table will still be marked for re-alignment if the field did fill the entire column, because, in this case the deletion might narrow the column." (interactive "p") - (org-check-before-invisible-edit 'delete-backward) - (if (and (org-table-p) - (eq N 1) - (string-match "|" (buffer-substring (point-at-bol) (point))) - (looking-at ".*?|")) - (let ((pos (point)) - (noalign (looking-at "[^|\n\r]* |")) - (c org-table-may-need-update)) - (backward-delete-char N) - (if (not overwrite-mode) - (progn - (skip-chars-forward "^|") - (insert " ") - (goto-char (1- pos)))) - ;; noalign: if there were two spaces at the end, this field - ;; does not determine the width of the column. - (if noalign (setq org-table-may-need-update c))) - (backward-delete-char N) - (org-fix-tags-on-the-fly))) + (save-match-data + (org-check-before-invisible-edit 'delete-backward) + (if (and (org-table-p) + (eq N 1) + (string-match "|" (buffer-substring (point-at-bol) (point))) + (looking-at ".*?|")) + (let ((pos (point)) + (noalign (looking-at "[^|\n\r]* |")) + (c org-table-may-need-update)) + (backward-delete-char N) + (if (not overwrite-mode) + (progn + (skip-chars-forward "^|") + (insert " ") + (goto-char (1- pos)))) + ;; noalign: if there were two spaces at the end, this field + ;; does not determine the width of the column. + (if noalign (setq org-table-may-need-update c))) + (backward-delete-char N) + (org-fix-tags-on-the-fly)))) (defun org-delete-char (N) "Like `delete-char', but insert whitespace at field end in tables. @@ -18323,25 +18364,26 @@ front of the next \"|\" separator, to keep the table aligned. The table will still be marked for re-alignment if the field did fill the entire column, because, in this case the deletion might narrow the column." (interactive "p") - (org-check-before-invisible-edit 'delete) - (if (and (org-table-p) - (not (bolp)) - (not (= (char-after) ?|)) - (eq N 1)) - (if (looking-at ".*?|") - (let ((pos (point)) - (noalign (looking-at "[^|\n\r]* |")) - (c org-table-may-need-update)) - (replace-match (concat - (substring (match-string 0) 1 -1) - " |")) - (goto-char pos) - ;; noalign: if there were two spaces at the end, this field - ;; does not determine the width of the column. - (if noalign (setq org-table-may-need-update c))) - (delete-char N)) - (delete-char N) - (org-fix-tags-on-the-fly))) + (save-match-data + (org-check-before-invisible-edit 'delete) + (if (and (org-table-p) + (not (bolp)) + (not (= (char-after) ?|)) + (eq N 1)) + (if (looking-at ".*?|") + (let ((pos (point)) + (noalign (looking-at "[^|\n\r]* |")) + (c org-table-may-need-update)) + (replace-match (concat + (substring (match-string 0) 1 -1) + " |")) + (goto-char pos) + ;; noalign: if there were two spaces at the end, this field + ;; does not determine the width of the column. + (if noalign (setq org-table-may-need-update c))) + (delete-char N)) + (delete-char N) + (org-fix-tags-on-the-fly)))) ;; Make `delete-selection-mode' work with org-mode and orgtbl-mode (put 'org-self-insert-command 'delete-selection t) @@ -18956,15 +18998,22 @@ See the individual commands for more information." (org-table-paste-rectangle) (org-paste-subtree arg))) +(defsubst org-in-fixed-width-region-p () + "Is point in a fixed-width region?" + (save-match-data + (eq 'fixed-width (org-element-type (org-element-at-point))))) + (defun org-edit-special (&optional arg) "Call a special editor for the stuff at point. When at a table, call the formula editor with `org-table-edit-formulas'. -When at the first line of an src example, call `org-edit-src-code'. -When in an #+include line, visit the include file. Otherwise call -`ffap' to visit the file at point." +When in a source code block, call `org-edit-src-code'. +When in a fixed-width region, call `org-edit-fixed-width-region'. +When in an #+include line, visit the included file. +On a link, call `ffap' to visit the link at point. +Otherwise, return a user error." (interactive) ;; possibly prep session before editing source - (when arg + (when (and (org-in-src-block-p) arg) (let* ((info (org-babel-get-src-block-info)) (lang (nth 0 info)) (params (nth 2 info)) @@ -18977,16 +19026,17 @@ When in an #+include line, visit the include file. Otherwise call (beginning-of-line 1) (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ \t]*.*?file=\"\\)\\([^\"\n>]+\\)")) (find-file (org-trim (match-string 1)))) - ((org-edit-src-code)) - ((org-edit-fixed-width-region)) - ((org-at-table.el-p) - (org-edit-src-code)) ((or (org-at-table-p) (save-excursion (beginning-of-line 1) (let ((case-fold-search )) (looking-at "[ \t]*#\\+tblfm:")))) (call-interactively 'org-table-edit-formulas)) - (t (call-interactively 'ffap)))) + ((or (org-in-block-p '("src" "example" "latex" "html")) + (org-at-table.el-p)) + (org-edit-src-code)) + ((org-in-fixed-width-region-p) (org-edit-fixed-width-region)) + ((org-at-regexp-p org-any-link-re) (call-interactively 'ffap)) + (t (user-error "No special environment to edit here")))) (defvar org-table-coordinate-overlays) ; defined in org-table.el (defun org-ctrl-c-ctrl-c (&optional arg) @@ -19103,8 +19153,10 @@ This command does many different things, depending on context: (org-list-struct-fix-ind struct parents) (setq block-item (org-list-struct-fix-box struct parents prevs orderedp))) - (org-list-struct-apply-struct struct old-struct) - (org-update-checkbox-count-maybe) + (if (equal struct old-struct) + (user-error "Cannot toggle this checkbox (unchecked subitems?)") + (org-list-struct-apply-struct struct old-struct) + (org-update-checkbox-count-maybe)) (when block-item (message "Checkboxes were removed due to unchecked box at line %d" @@ -20238,13 +20290,19 @@ and end of string." "Is S an ID created by UUIDGEN?" (string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s))) -(defun org-in-src-block-p nil - "Whether point is in a code source block." - (let (ov) - (when (setq ov (overlays-at (point))) - (memq 'org-block-background - (overlay-properties - (car ov)))))) +(defun org-in-src-block-p (&optional inside) + "Whether point is in a code source block. +When INSIDE is non-nil, don't consider we are within a src block +when point is at #+BEGIN_SRC or #+END_SRC." + (let ((case-fold-search t) ov) + (or (and (setq ov (overlays-at (point))) + (memq 'org-block-background + (overlay-properties (car ov)))) + (and (not inside) + (save-match-data + (save-excursion + (beginning-of-line) + (looking-at ".*#\\+\\(begin\\|end\\)_src"))))))) (defun org-context () "Return a list of contexts of the current cursor position. @@ -20587,9 +20645,8 @@ return nil." "Switch to buffer in a second window on the current frame. In particular, do not allow pop-up frames. Returns the newly created buffer." - (let (pop-up-frames special-display-buffer-names special-display-regexps - special-display-function) - (apply 'switch-to-buffer-other-window args))) + (org-no-popups + (apply 'switch-to-buffer-other-window args))) (defun org-combine-plists (&rest plists) "Create a single property list from all plists in PLISTS. @@ -20768,6 +20825,7 @@ hierarchy of headlines by UP levels before marking the subtree." (t (beginning-of-line 0) (while (and (not (bobp)) + (not (looking-at org-table-line-regexp)) (not (looking-at org-drawer-regexp)) ;; When point started in an inline task, do not move ;; above task starting line. @@ -20898,6 +20956,7 @@ hierarchy of headlines by UP levels before marking the subtree." '(org-fill-paragraph-separate-nobreak-p org-fill-line-break-nobreak-p))))) (org-set-local 'fill-paragraph-function 'org-fill-paragraph) + (org-set-local 'auto-fill-inhibit-regexp nil) (org-set-local 'adaptive-fill-function 'org-adaptive-fill-function) (org-set-local 'normal-auto-fill-function 'org-auto-fill-function) (org-set-local 'comment-line-break-function 'org-comment-line-break-function)) @@ -20920,48 +20979,54 @@ hierarchy of headlines by UP levels before marking the subtree." "Compute a fill prefix for the current line. Return fill prefix, as a string, or nil if current line isn't meant to be filled." - (org-with-wide-buffer - (unless (and (derived-mode-p 'message-mode) (not (message-in-body-p))) - ;; FIXME: This is really the job of orgstruct++-mode - (let* ((p (line-beginning-position)) - (element (save-excursion (beginning-of-line) - (org-element-at-point))) - (type (org-element-type element)) - (post-affiliated - (save-excursion - (goto-char (org-element-property :begin element)) - (while (looking-at org-element--affiliated-re) (forward-line)) - (point)))) - (unless (< p post-affiliated) - (case type - (comment (looking-at "[ \t]*# ?") (match-string 0)) - (footnote-definition "") - ((item plain-list) - (make-string (org-list-item-body-column post-affiliated) ? )) - (paragraph - ;; Fill prefix is usually the same as the current line, - ;; except if the paragraph is at the beginning of an item. - (let ((parent (org-element-property :parent element))) - (cond ((eq (org-element-type parent) 'item) - (make-string (org-list-item-body-column - (org-element-property :begin parent)) - ? )) - ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) - (match-string 0)) - (t "")))) - (comment-block - ;; Only fill contents if P is within block boundaries. - (let* ((cbeg (save-excursion (goto-char post-affiliated) - (forward-line) - (point))) - (cend (save-excursion - (goto-char (org-element-property :end element)) - (skip-chars-backward " \r\t\n") - (line-beginning-position)))) - (when (and (>= p cbeg) (< p cend)) - (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) - (match-string 0) - "")))))))))) + (let (prefix) + (when (and (derived-mode-p 'message-mode) (message-in-body-p)) + (save-excursion + (beginning-of-line) + (cond ((looking-at message-cite-prefix-regexp) + (setq prefix (match-string-no-properties 0))) + ((looking-at org-outline-regexp) + (setq prefix ""))))) + (or prefix + (org-with-wide-buffer + (let* ((p (line-beginning-position)) + (element (save-excursion (beginning-of-line) (org-element-at-point))) + (type (org-element-type element)) + (post-affiliated + (save-excursion + (goto-char (org-element-property :begin element)) + (while (looking-at org-element--affiliated-re) (forward-line)) + (point)))) + (unless (< p post-affiliated) + (case type + (comment (looking-at "[ \t]*# ?") (match-string 0)) + (footnote-definition "") + ((item plain-list) + (make-string (org-list-item-body-column post-affiliated) ? )) + (paragraph + ;; Fill prefix is usually the same as the current line, + ;; except if the paragraph is at the beginning of an item. + (let ((parent (org-element-property :parent element))) + (cond ((eq (org-element-type parent) 'item) + (make-string (org-list-item-body-column + (org-element-property :begin parent)) + ? )) + ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) + (match-string 0)) + (t "")))) + (comment-block + ;; Only fill contents if P is within block boundaries. + (let* ((cbeg (save-excursion (goto-char post-affiliated) + (forward-line) + (point))) + (cend (save-excursion + (goto-char (org-element-property :end element)) + (skip-chars-backward " \r\t\n") + (line-beginning-position)))) + (when (and (>= p cbeg) (< p cend)) + (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) + (match-string 0) + ""))))))))))) (declare-function message-goto-body "message" ()) (defvar message-cite-prefix-regexp) ; From message.el @@ -20981,12 +21046,12 @@ width for filling. For convenience, when point is at a plain list, an item or a footnote definition, try to fill the first paragraph within." - ;; Falls back on message-fill-paragraph when necessary (interactive) (if (and (derived-mode-p 'message-mode) (or (not (message-in-body-p)) (save-excursion (move-beginning-of-line 1) (looking-at message-cite-prefix-regexp)))) + ;; First ensure filling is correct in message-mode. (let ((fill-paragraph-function (cadadr (assoc 'fill-paragraph-function org-fb-vars))) (fill-prefix (cadadr (assoc 'fill-prefix org-fb-vars))) @@ -21003,6 +21068,8 @@ a footnote definition, try to fill the first paragraph within." ;; the buffer. In that case, ignore filling. (if (< (point) (org-element-property :begin element)) t (case (org-element-type element) + ;; Use major mode filling function is src blocks. + (src-block (org-babel-do-key-sequence-in-edit-buffer (kbd "M-q"))) ;; Align Org tables, leave table.el tables as-is. (table-row (org-table-align) t) (table -- 2.39.2