Commit Graph

11030 Commits

Author SHA1 Message Date
Kyle Meyer b4b6584eea org-agenda-Quit: Remove unnecessary function calls
* lisp/org-agenda.el (org-agenda-Quit): Remove unnecessary function calls.

- org-agenda-Quit turns off column view if it is active, instead of
  killing the agenda buffer, so there is no need to call
  org-columns-remove-overlays when killing the buffer.
- org-agenda-reset-markers is already called when the kill-buffer-hook
  is run.
2015-01-03 12:15:58 +01:00
Kyle Meyer 722a574d88 org-agenda-exit: Check column view
* lisp/org-agenda.el (org-agenda-exit): Exit column view before trying to
  exit agenda.

Running org-agenda-exit in column view deleted all buffers loaded by the
agenda, but it didn't actually exit the agenda because, if the agenda is
in column view, org-agenda-Quit turns off column view instead of killing
the agenda.  So org-agenda-exit should either just quit column view if
it is active (and not delete the loaded buffers or quit the agenda) or
make sure that the agenda is not in column view before killing it.
Since org-agenda-Quit and org-agenda-quit already do the former, make
org-agenda-exit completely exit the agenda regardless of whether it is
in column view.
2015-01-03 12:15:54 +01:00
Kyle Meyer 424eb55263 org-agenda: Fix exiting function docstrings
* lisp/org-agenda.el (org-agenda-Quit):
* lisp/org-agenda.el (org-agenda-quit):
* lisp/org-agenda.el (org-agenda-exit): Correct and expand docstrings.
2015-01-03 12:15:50 +01:00
Nicolas Goaziou 10954832e5 ox-ascii: Handle (custom-)id links to unnumbered headlines
* lisp/ox-ascii.el (org-ascii--describe-links): When a headline is
  unnumbered, refer to its title instead of dropping the ball.
2015-01-01 21:37:35 +01:00
Nicolas Goaziou 8b0823b3e0 ox-ascii: Handle custom export functions for links
* lisp/ox-ascii.el (org-ascii-link): Obey to export function provided
  through `org-add-link-type'.
(org-ascii--describe-links): Do not turn links above into notes.
2015-01-01 21:28:02 +01:00
Nicolas Goaziou 44744bba2c org-table: Fix freeze with invalid hline reference
* lisp/org-table.el (org-table-find-row-type): Don't end up on the
  last hline, which doesn't exist, per
  e793158bc8.

Reported-by: Artis Rozentāls <artis.rozentals@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93654>
2014-12-30 22:37:44 +01:00
Rasmus 9528bef2a8 Merge branch 'include' 2014-12-24 18:43:34 +01:00
Nicolas Goaziou 52638c17e5 Fix typo
* lisp/org.el (org-outline-level): Fix typo.
2014-12-24 17:28:48 +01:00
Rasmus 130dcdb0cb ox.el: Infer :minlevel for INCLUDE-keywords
* ox.el (org-export-expand-include-keyword): Infer :minlevel for
included Org documents if not set explicitly.
* test-ox.el (org-export-expand-include-keyword): Add tests for inferred :minlevel.
2014-12-24 12:44:51 +01:00
rasmus 7509d6d721 ox.el: Fix footnote-bug in #+INCLUDE-keyword
* ox.el (org-export--prepare-file-contents): Preserve footnotes
when using the LINES argument.  New optional argument FOOTNOTES.
 (org-export-expand-include-keyword): New optional argument
 FOOTNOTES.
* test-ox.el (test-org-export/expand-include): Add test for INCLUDE
  with :lines and footnotes.
2014-12-24 11:58:50 +01:00
Nicolas Goaziou 4947d25c7c ob-core: Add safety test for results keyword value
* lisp/ob-core.el (org-babel-results-keyword): Add safety test.  Fix
  docstring.
2014-12-24 10:35:20 +01:00
Nicolas Goaziou be05318515 ob-core: Fix docstring
* lisp/ob-core.el (org-babel-results-keyword): NAME cannot be used for
  results, as it is a reserved affiliated keyword.
2014-12-24 10:29:44 +01:00
Nicolas Goaziou c6d9a4ec22 Fix false positive SCHEDULED lines in sparse tree
* lisp/org.el (org-check-before-date, org-check-after-date,
  org-check-dates-range): Make sure we're really at a timestamp before
  validating the entry.

Reported-by: James Harkins <jamshark70@qq.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93126>
2014-12-23 12:22:16 +01:00
Nicolas Goaziou f0a13a09d8 Implement `org-at-planning-p'
* lisp/org.el (org-at-planning-p): New function.
* testing/lisp/test-org.el (test-org/at-planning-p): New test.
2014-12-23 12:14:40 +01:00
Nicolas Goaziou 1c5014740e Compare `org-current-level' and `org-outline-level'
* lisp/org.el (org-outline-level, org-current-level): Update
  docstrings to insist on the difference between the two functions.
2014-12-23 11:12:00 +01:00
Nicolas Goaziou 6dcaafff3e Tiny refactoring
* lisp/org.el (org-current-level): Tiny refactoring.
2014-12-22 00:09:08 +01:00
Nicolas Goaziou c5ba48072c Fix typo
* lisp/org.el (org-re-timestamp): Fix typo introduced in
  eae19b1284.
2014-12-21 23:39:38 +01:00
Nicolas Goaziou eae19b1284 Fix default value in `org-sparse-tree-default-date-type'
* lisp/org.el (org-sparse-tree-default-date-type): Use new default
  value instead of the undocumented previous one.  Fix docstring, too.
(org-sparse-tree): Apply change to previous variable.
(org-re-timestamp): Apply change to previous variable.  Refactor code.
2014-12-21 23:20:14 +01:00
Nicolas Goaziou 6f5bd30f0b org-entities: Remove `replace-amp'
* lisp/org-entities.el (replace-amp): Remove function.

The function is unused throughout the code base and is in the wrong
namespace.
2014-12-21 22:34:03 +01:00
Nicolas Goaziou 7dc8a1b362 Move `org-do-sort' into "org-table.el"
* lisp/org.el (org-do-sort): Remove function.

* lisp/org-table.el (org-table--do-sort): New function.
(org-table-sort-lines): Use new function.

`org-do-sort' is really a helper function for `org-table-sort-lines',
which applies exclusively on tables.
2014-12-21 22:23:11 +01:00
Nicolas Goaziou 4a214a0647 `org-outline-level' ignores narrowing
* lisp/org.el (org-outline-level): Ignore narrowing.  Refactor to be
  slightly faster.
2014-12-21 22:14:26 +01:00
Rasmus 077a24b8d0 ox-html.el: Trim list items
* ox-html.el (org-html-format-list-item): Trim contents to avoid
  spurious space.
2014-12-20 23:32:44 +01:00
Nicolas Goaziou 442216871a Fix `org-log-beginning' on empty entries
* lisp/org.el (org-log-beginning): Check for the need to insert
  a drawer in all cases.

Suggested-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/93538>
2014-12-20 21:59:51 +01:00
Nicolas Goaziou 13711d4583 Fix table sorting with ?F key
* lisp/org.el (org-do-sort): Properly reverse results when ?F and
  a compare function is provided.  Small refactoring.

* testing/lisp/test-org-table.el (test-org-table/sort-lines): New
  test.
2014-12-20 21:29:51 +01:00
Jon Snader 71b098702c org.el: Implement user-defined table sorting
* lisp/org.el (org-do-sort): Implement the ?f and ?F sorting options
  to allow user-defined table sorting.  Update the DOC string.

* lisp/org-table (org-table-sort-lines): Add the GETKEY-FUNC and
  COMPARE-FUNC optional parameters and pass them to the call to
  `org-do-sort'.  Update the DOC string.

* doc/org.texi (org-table-sort-lines): Update documentation to reflect
  the addition of the ?f and ?F options.

This patch implements user-defined extraction and comparison functions
for table sorting.  Thanks to Nicolas Goaziou for helpful suggestions.

This patch was discussed on the Org Mode mailing list:
http://article.gmane.org/gmane.emacs.orgmode/93334
2014-12-20 20:36:57 +01:00
Toby S. Cubitt 54dfb86719 org-archive.el: Add command to archive entries with timestamps before today
* lisp/org-archive.el (org-archive-all-old): archive all entries with
  timestamps prior to today.
  (org-archive-subtree): double prefix argument invokes
  org-archive-all-old.
  (org-archive-all-matches, org-archive-all-done): factor out common
  code into org-archive-all-matches.
2014-12-17 00:08:39 +01:00
Nicolas Goaziou a949b23aa6 Merge branch 'master' of orgmode.org:org-mode 2014-12-16 23:55:56 +01:00
Nicolas Goaziou c1558d34d7 Fix low-high estimates
* doc/org.texi (Column attributes): Emphasize estimates format.
  Document degenerate case of plain numbers.
* lisp/org-colview.el (org-columns-compute): Properly sum estimates.
(org-columns-string-to-number): Recognize estimates containing an
unit.
(org-estimate-mean-and-var, org-estimate-print): Allow numbers as
a degenerate case of estimates.

Reported-by: yary <not.com@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93505>
2014-12-16 23:53:15 +01:00
Alan Schmitt 57b76e2771 org.el: Allow calendars to be in their own frame
* lisp/org.el (org-read-date): Create and delete frames if
`calendar-setup' is set to 'calendar-only.
2014-12-16 19:09:22 +01:00
Nicolas Goaziou 389274c1c4 Fix `org-hide-archived-subtrees'
* lisp/org.el (org-hide-archived-subtrees): Prevent an error when END
  argument doesn't match the end of a subtree.  Prevent false
  positives.  Also, archive tag is case-sensitive.
2014-12-16 10:28:34 +01:00
Nicolas Goaziou eac147621e Fix 434103
* lisp/org.el (org-log-into-drawer): Fix
  04f6830a46e54db23afbe3c94de38a22c3.
2014-12-15 13:07:10 +01:00
Nathaniel Flath 90c047d2ff org-table.el: org-table-recalculate is quieter
* lisp/org-table.el (org-table-recalculate): Removed message for start of
processing.  When ALL is t, messages are printed at most once per second.

TINYCHANGE
2014-12-14 22:06:25 +01:00
Nathaniel Flath 2945c1e8c5 org-table.el: org-table-recalculate early returns
* lisp/org-table.el (org-table-recalculate): Add early return.

TINYCHANGE
2014-12-14 22:06:20 +01:00
Nicolas Goaziou e990bedc51 Change default value for `org-clock-into-drawer'
* lisp/org-clock.el (org-clock-into-drawer): Update docstring.  Change
  default value.
(org-clock-jump-to-current-clock): Properly find current clock drawer,
if any.
(org-clock-find-position): Tiny fix.
(org-clock-out): Properly check if clock and log drawers are the same.
(org-clock-find-position, org-clock-out,
(org-clock-remove-empty-clock-drawer): Use new function.
2014-12-14 18:22:31 +01:00
Nicolas Goaziou 43410304f6 Function `org-log-into-drawer' returns a string or nil
* lisp/org.el (org-log-into-drawer): Update docstring.  Function
  returns a string or nil, not t anymore.
(org-mode-flyspell-verify): Small refactoring.
2014-12-14 18:21:42 +01:00
Nicolas Goaziou aa0bfcdcdb Merge branch 'maint'
Conflicts:
	lisp/ob-core.el
2014-12-14 09:41:38 +01:00
Nicolas Goaziou 89a0acc75e ob-core: Source blocks are case-insensitive
* lisp/ob-core.el (org-babel-map-src-blocks,
  org-babel-map-inline-src-blocks): Make sure to ignore case when
  looking for source blocks.

Reported-by: Christopher Genovese <genovese@cmu.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/93454>
2014-12-14 09:39:08 +01:00
Nicolas Goaziou d0c14a12fd ob-core: Tiny fix
* lisp/ob-core.el (org-babel-active-location-p): Use appropriate
  accessor.
2014-12-14 09:36:50 +01:00
Eric Abrahamsen 94c1099dab Use `org-log-into-drawer' in `org-log-beginning'
* lisp/org.el (org-log-beginning): Use existing function for
  discovering the log specification.
2014-12-14 09:13:29 +01:00
Nicolas Goaziou 4f7b6ccf39 Merge branch 'maint' 2014-12-13 22:57:35 +01:00
Nicolas Goaziou dbc988e272 ox-md: Correctly export footnote references
* lisp/ox-md.el (md): Do not ignore footnote references.

Footnotes do not exist in Markdown syntax, but we can fallback on
HTML.

Reported-by: Vasilij Schneidermann <v.schneidermann@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93447>
2014-12-13 22:55:45 +01:00
Aaron Ecay b8d790a076 org-table: introduce an upper bound on `org-table-convert-region-max-lines'.
* lisp/org-table.el (org-table-convert-region-max-lines): New
defcustom.
(org-table-convert-region): Use it.

This is useful primarily for babel results.  If a large table-like
object is returned by a code block, this function will become bogged
down in trying to read it, and hang emacs (necessitating a C-g).  This
situation most commonly arises when a :results none header has been
omitted.  With the patch, the user will not experience a hang, but
rather an error message.
2014-12-11 23:51:57 -05:00
Aaron Ecay 7c86747881 org-src: add a note about bogosity of read-only overlays
* lisp/org-src.el (org-src--make-source-overlay): Add a TODO comment.
2014-12-11 23:48:27 -05:00
Aaron Ecay 398286a00c org-src: fix two bugs
* lisp/org-src.el (org-src--edit-buffer): Construe equality for
markers properly.
(org-edit-src-save): Place point properly when writing back changes.

Thanks to Vikas Rawal for reporting:
<http://mid.gmane.org/C8148BF2-87AF-44A4-B103-6BD338DA8D96@agrarianresearch.org>
2014-12-11 23:34:35 -05:00
Aaron Ecay 9db1f7af78 ox-beamer: Don’t auto-label allowframebreaks frames; beamer forbids it.
* lisp/ox-beamer.el (org-beamer--format-frame): Don’t give a label if
allowframebreaks” is set.
2014-12-10 17:03:38 -05:00
Aaron Ecay f12e3d4589 org-table: various small fixes
* lisp/org-table.el (org-table-rewrite-old-row-references): Rename function.
(org-table-eval-formula): Update caller.
(org-table--to-generic-cell): Fix typo in string constant.
(orgtbl-to-orgtbl): Properly respect params argument.
2014-12-10 17:03:38 -05:00
Aaron Ecay 53771153a2 org-entities.el: Add safe predicates to defcustoms.
* lisp/org-entities.el (org-entities--user-safe-p): New function.
(org-entities-ascii-explanatory, org-entities-user): Add :safe predicates.
2014-12-10 17:03:38 -05:00
Aaron Ecay 2cb1324bfb ob-latex: Use htlatex by default if available.
* lisp/ob-latex.el (org-babel-latex-htlatex): Set to “htlatex” by
default.
(org-babel-execute:latex): Update to match new default.
2014-12-10 17:03:38 -05:00
Oleh Krehel 433b66f2c7 org-src: allow `org-babel-edit-prep:.*' to mark region
* lisp/org-src.el (org-edit-src-code): Let `deactivate-mark' nil.

<http://permalink.gmane.org/gmane.emacs.orgmode/93053>
2014-12-09 17:26:02 +01:00
Kyle Meyer 5d25e6e68e org-todo-yesterday: Ignore `org-use-effective-time'
* lisp/org.el (org-todo-yesterday):
* lisp/org-agenda.el (org-agenda-todo-yesterday): Ignore global
`org-use-effective-time' value.

Otherwise, if `org-use-effective-time' being nil,
`org-extend-today-until' will not be considered, resulting in the
current time being used instead of 23:59 yesterday.

Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93224>
2014-12-09 10:25:24 +01:00