Commit Graph

514 Commits

Author SHA1 Message Date
Kyle Meyer 4349402f3f Merge branch 'maint' 2020-05-12 22:47:05 -04:00
Kyle Meyer 7684b59c78 colview: Display active time stamps as inactive
* lisp/org-colview.el (org-columns--displayed-value): Convert active
time stamp values to inactive time stamps to avoid duplicate entries
in the agenda.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
tests.
2020-05-12 22:44:57 -04:00
Kyle Meyer b171ff02f6 Merge branch 'maint' 2020-05-05 22:38:00 -04:00
Kyle Meyer 8368c38e01 Autoload dynamic block definitions
* lisp/org-clock.el:
* lisp/org-colview.el: Autoload call to org-dynamic-block-define.

The dynamic block dispatcher added in 34b71a0ca (Add a dispatcher
command for inserting dynamic blocks, 2018-12-23) offers an entry for
"clocktable" and "columnview" only after the corresponding library is
loaded.  However, before that commit, the autoloaded org-clock-report
and org-columns-insert-dblock commands were accessible via plain key
bindings.  Restore the ability to access these commands before the
associated library is loaded.

Reported-by: Axel Kielhorn <org-mode@axelkielhorn.de>
<3CE37EF0-6C7A-4CC0-AFEE-2B82296D63E1@axelkielhorn.de>
2020-05-05 22:31:43 -04:00
Bastien fae16ed8f5 Add `generated-autoload-file' buffer local variable
* lisp/org.el:
* lisp/org-num.el:
* lisp/org-macs.el:
* lisp/org-list.el:
* lisp/org-lint.el:
* lisp/org-keys.el:
* lisp/org-goto.el:
* lisp/org-duration.el:
* lisp/org-compat.el:
* lisp/org-colview.el:
* lisp/org-capture.el:
* lisp/org-agenda.el:
* lisp/ol.el: Add `generated-autoload-file' buffer local variable.

This is needed when compiling Org files within GNU Emacs.
2020-02-18 23:37:24 +01:00
Bastien 055742562c org-colview.el: Allow text rescaling
* lisp/org-colview.el (org-columns-header-line-remap): New
variable.
(org-columns--display-here): Don't rigidly inherit the :height
from the default face, allow text-scale-* to also rescale the
temporary column view header-line.
(org-columns-remove-overlays): If
`org-columns-header-line-remap' is non-nil, remove the
header-line face relative remapping.

* etc/ORG-NEWS (Allow text rescaling in column view): Document
the ability to scale text in column view.

Thanks to Marco Wahl for this suggestion.
2020-02-17 13:59:19 +01:00
Marco Wahl 1e55b18198 org-colview: Fix org-agenda-columns-active
* lisp/org-colview.el (org-agenda-columns): Set
  org-agenda-columns-active when columns get activated.
2020-01-27 23:39:25 +01:00
Kyle Meyer 93c11da002 Merge branch 'maint' 2020-01-01 13:39:26 -05:00
Kyle Meyer ff5fc050d3 Update copyright year to 2020 2020-01-01 13:38:46 -05:00
Marco Wahl b8f43ecbf4 org,colview: Quit column-view with C-c C-c. manual,news: Update
* lisp/org-colview.el (org-columns-toggle-or-columns-quit): New
  function.  Takes the place of removed function
  org-columns-set-tags-or-toggle.
2019-12-04 23:36:33 +01:00
Kyle Meyer c7c04b0447 Merge branch 'maint' 2019-08-18 17:44:08 -04:00
Paul Eggert 74bf99502d Backport commit 988e37fa0 from Emacs
* lisp/org-agenda.el (org-agenda-get-timestamps, org-agenda-get-progress)
(org-agenda-show-clocking-issues):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-clock.el (org-clock-get-sum-start):
* lisp/org.el (org-current-time, org-store-link)
(org-read-date, org-read-date-display)
(org-display-custom-time, org-timestamp-to-time)
Simplify use of encode-time.
* lisp/org-clock.el (org-clock-in, org-clock-update-time-maybe):
* lisp/org-colview.el (org-columns--age-to-minutes):
* lisp/org-macs.el (org-2ft):
* lisp/org.el (org-get-scheduled-time, org-get-deadline-time)
(org-add-planning-info, org-time-string-to-absolute)
(org-closest-date):
Use org-time-string-to-time instead of doing it by hand with
encode-time.
* lisp/org.el (org-read-date): Avoid extra trip through encode-time.

Simplify use of encode-time
988e37fa0f922b852715671d59a0e3f682373411
Paul Eggert
Sun Feb 10 23:54:35 2019 -0800

Note(km): org-current-time has been modified to use org-time-subtract
and org-time-less-p for backward compatibility.  Some changes from
988e37fa0 have been dropped to keep encode-time's call compatible with
older Emacsen.
2019-08-18 17:36:13 -04:00
Carsten Dominik 6dda536f9f Clear up unclear setting of columns format for the agenda
* lisp/org.el (org-columns-default-format-for-agenda): New option.

* lisp/org-colview.el (org-overriding-columns-format): Updated documentation.
(org-agenda-columns): `Use org-columns-default-format-for-agenda'

* doc/org-manual.org (Using Column View in the Agenda): Fix the
description how to set the columns format for agenda views.
2019-08-16 09:34:55 +02:00
Nicolas Goaziou 273910d36c Merge branch 'maint' 2019-03-21 22:16:02 +01:00
Nicolas Goaziou 0ff705fac7 org-colview: Fix out of range error when hscroll is greater than header
* lisp/org-colview.el (org-columns-hscroll-title): Fix out of range
  error when hscroll is greater than header.
2019-03-21 22:15:04 +01:00
Nicolas Goaziou a486d9cbd7 Move link-related core functions out of "org.el"
* contrib/lisp/org-wl.el (org-wl-store-link-message):
* lisp/Makefile (clean-install):
* lisp/ob-core.el (org-link-bracket-re):
(org-babel-open-src-block-result):
(org-babel-read-element):
(org-babel-read-link):
(org-babel-result-end):
* lisp/ob-tangle.el (org-link-bracket-re):
(org-babel-tangle-single-block):
(org-link-analytic-bracket-re):
(org-babel-detangle):
(org-babel-tangle-jump-to-org):
* lisp/ol.el:
* lisp/org-agenda.el (org-agenda-get-some-entry-text):
(org-diary):
(org-agenda-format-item):
(org-agenda-open-link):
(org-agenda-switch-to):
(org-agenda-to-appt):
* lisp/org-bbdb.el (org-bbdb-store-link):
* lisp/org-bibtex.el (org-bibtex-store-link):
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-clock.el (org-clocktable-write-default):
(org-clock-get-table-data):
* lisp/org-compat.el (org-doi-server-url):
(org-email-link-description-format):
(org-make-link-description-function):
(org-from-is-user-regexp):
(org-descriptive-links):
(org-url-hexify-p):
(org-context-in-file-links):
(org-keep-stored-link-after-insertion):
(org-display-internal-link-with-indirect-buffer):
(org-confirm-shell-link-function):
(org-confirm-shell-link-not-regexp):
(org-confirm-elisp-link-function):
(org-confirm-elisp-link-not-regexp):
(org-file-complete-link):
(org-email-link-description):
(org-make-link-string):
(org-store-link-props):
(org-add-link-props):
(org-make-link-regexps):
(org-angle-link-re):
(org-plain-link-re):
(org-bracket-link-regexp):
(org-bracket-link-analytic-regexp):
(org-any-link-re):
* lisp/org-docview.el (org-docview-store-link):
(org-docview-complete-link):
* lisp/org-element.el (org-element-link-parser):
* lisp/org-eshell.el (org-eshell-store-link):
* lisp/org-eww.el (org-eww-store-link):
(org-eww-copy-for-org-mode):
* lisp/org-footnote.el (org-footnote-next-reference-or-definition):
* lisp/org-gnus.el (org-gnus-article-link):
(org-gnus-store-link):
* lisp/org-id.el (org-id-store-link):
* lisp/org-info.el (org-info-store-link):
* lisp/org-irc.el (org-irc-erc-store-link):
* lisp/org-mhe.el (org-mhe-store-link):
* lisp/org-pcomplete.el (pcomplete/org-mode/searchhead):
* lisp/org-protocol.el (org-protocol-do-capture):
* lisp/org-rmail.el (org-rmail-store-link):
* lisp/org-w3m.el (org-w3m-store-link):
(org-w3m-copy-for-org-mode):
2019-03-10 18:00:27 +01:00
Nicolas Goaziou 87a00b3595 Merge branch 'maint' 2019-02-25 13:47:40 +01:00
Nicolas Goaziou d437c1b5de Move obsolete function alias into "org-compat.el" 2019-02-25 13:46:41 +01:00
Allen Li cc020dbe4d Fix buffer local org-agenda-overriding-columns-format bug
* doc/org-manual.org (Using Column View in the Agenda): Updated
  reference to variable.
* lisp/org-agenda.el (org-agenda-finalize): Set buffer local variable
  instead.
* lisp/org-colview.el (org-overriding-columns-format): Renamed.
(org-agenda-overriding-columns-format): Renamed.
(org-local-columns-format): New buffer local variable.
(org-columns-edit-value): Updated reference to variable.
(org-columns-next-allowed-value): Updated reference to variable.
(org-agenda-columns): Updated reference to variable.

Setting org-agenda-overriding-columns-format as a buffer local value
interferes with how it is used as a dynamically scoped var, so use a
separate variable for buffer local setting.
2019-02-25 13:41:40 +01:00
Kyle Meyer f362df7eb7 Merge branch 'maint' 2019-02-12 19:55:26 -05:00
Kyle Meyer 6a5be09c1d Restore some current-time to nil changes
* lisp/org-colview.el (org-columns-compute-all):
* lisp/org-timer.el (org-timer-start):
(org-timer-pause-or-continue):
(org-timer-seconds):
* lisp/org.el (org-read-date-analyze): Favor nil argument to
explicitly passing current-time result to float-time and decode-time.

Most of these "(current-time) => nil" changes were made in the Emacs
codebase, but we stayed with the original state because we relied on
explicitly overriding current-time in the tests.  As of the last
commit, we no longer need to do this and can use org-test-at-time
instead.
2019-02-12 19:46:03 -05:00
Kyle Meyer ba321d0e44 Merge branch 'maint' 2019-01-13 15:14:37 -05:00
Kyle Meyer 6df3e8880e Partially revert backport of c75f505de
* lisp/org-colview.el (org-columns-compute-all):
* lisp/org-timer.el (org-timer-start):
(org-timer-pause-or-continue):
(org-timer-seconds):
(org-timer-set-timer):
* lisp/org.el (org-read-date-analyze): Restore use of `current-time`
for testing purposes.

In these spots, we call (current-time) so that it can be overriden in
tests.  Add a comment about this in the cases that don't have one.
2019-01-13 12:43:04 -05:00
Paul Eggert eb10ad9360 Backport commit c75f505de from Emacs
* lisp/org-agenda.el (org-agenda-to-appt):
* lisp/org-clock.el (org-clock-resolve-clock)
(org-clock-resolve, org-resolve-clocks-if-idle):
* lisp/org-colview.el (org-columns-edit-value, org-columns)
(org-agenda-columns):
* lisp/org-element.el (org-element--cache-interrupt-p)
(org-element--cache-sync):
* lisp/org-habit.el (org-habit-get-faces)
(org-habit-insert-consistency-graphs):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-timer.el ((org-timer-show-remaining-time):
* lisp/org.el (org-babel-load-file, org-current-time)
(org-today, org-auto-repeat-maybe)
(org-small-year-to-year, org-goto-calendar):
* lisp/ox.el (org-export-insert-default-template):
Use nil instead of (current-time) where either will do, as nil is
a bit more efficient and should have less timing error.

Prefer nil to (current-time) when either works
c75f505dea6a560b825384cf3d277690f86840bf
Paul Eggert
Fri Oct 20 19:42:23 2017 -0700

Note(km): The changes that will reverted in the next commit have been
dropped from the ChangeLog entries above.
2019-01-13 12:43:03 -05:00
stardiviner 34b71a0ca9 Add a dispatcher command for inserting dynamic blocks
* lisp/org.el (org-dynamic-block-insert-dblock,
  org-dynamic-block-alist, org-dynamic-block-functions,
  org-dynamic-block-types, org-dynamic-block-define,
  org-dynamic-block-function): New variables, New functions.

* lisp/org-keys.el (org-dynamic-block-insert-dblock): Add binding for
  the function.
(org-clock-report, org-columns-insert-dblock): Remove function
keybindings. Mark them as obsolete.

* doc/org-manual.org (Dynamic Blocks): : Add manual for dispatch
command `org-dynamic-block-insert-dblock'.

* testing/lisp/test-org-clock.el: New test.
2019-01-02 15:55:51 +01:00
Nicolas Goaziou 1aaee28545 org-colview: Re-apply `org-columns-compact-links' removal
* lisp/org-colview.el (org-columns--displayed-value): Do not call
  removed function.
2019-01-01 17:19:49 +01:00
Bastien 7a22b8f93b Merge branch 'maint' 2019-01-01 11:54:01 +01:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Nicolas Goaziou 6aa7c798d5 Merge branch 'master' into next 2018-12-19 22:39:24 +01:00
Nicolas Goaziou 2d9b08b897 org-colview: Remove asterisks from ITEM in Agenda mode
* lisp/org-colview.el (org-columns--displayed-value): Add new optional
  argument.
(org-columns--collect-values): Use new argument when called from
Agenda mode.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2018-12/msg00040.html>
2018-12-18 12:07:43 +01:00
Nicolas Goaziou 9c3a9a9687 Merge branch 'master' into next 2018-12-18 11:10:38 +01:00
Nicolas Goaziou 4f0d8a008f org-colview: Improve docstring
* lisp/org-colview.el (org-dblock-write:columnview): Improve docstring.
2018-12-18 11:08:48 +01:00
Nicolas Goaziou 045cfce67a Merge branch 'master' into next 2018-12-18 09:54:51 +01:00
Nicolas Goaziou 13f299fe8b org-colview: Fix docstrings
* lisp/org-colview.el (org-columns--overlay-text):
(org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Fix docstrings.
2018-12-18 09:54:24 +01:00
Nicolas Goaziou df7b8cdf70 org-colview: Remove `org-columns-compact-links'
* lisp/org-colview.el (org-columns--displayed-value): Use
  `org-link-display-format' instead.
2018-12-02 14:03:53 +01:00
Benjamin Motz 3cb4ffe957 org-colview: Add property :exclude-tags to column view table
* lisp/org-colview.el (org-columns--capture-view): Add parameter.
(org-dblock-write:columnview): Add new property.
* doc/org-manual.org (Capturing column view): Document feature.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
  test.

This addition allows to specify a list of tags to exclude from column
view tables.

TINYCHANGE
2018-10-03 18:44:34 +02:00
Nicolas Goaziou fc5ee0f87b org-colview: Plain numbers are minutes instead of hours
* lisp/org-colview.el (org-columns--summary-apply-times): Use the same
  rule as everywhere else in Org.
* doc/org-manual.org (Column attributes): Document change.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00294.html>
2018-10-03 18:44:34 +02:00
Nicolas Goaziou 445dc6af6f org-colview: Do not move point when initializing columns
* lisp/org-colview.el (org-columns): Do not move point.

Reported-by: Benjamin Motz <benni.motz@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00040.html>
2018-07-07 09:27:04 +02:00
Aaron Ecay 7106eab974 Many small code improvements
* lisp/org-capture.el (org-capture-member): Make obsolete; the old
definition was identical to ‘org-capture-get’ anyway.
(org-capture-mode-map): Move the calls to ‘define-key’ up to where the
variable is defined.
(org-capture-mode-hook): Small docstring tweak.
(org-capture-mode): Fix typo in mode lighter.
(org-capture-set-target-location, org-capture-place-item):
(org-capture-place-plain-text, org-capture-narrow):
(org-capture-empty-lines-after):
(org-capture-import-remember-templates): ‘if’ without else -> ‘when’
* lisp/org-colview.el (org-columns-edit-value): Change an error to a
user-error.
(org-columns-uncompile-format): Improve docstring.
* lisp/org-compat.el (org-remove-from-invisibility-spec): Make
obsolete, the underlying emacs function exists since 1997, commit 31aa282e.
(org-in-invisibility-spec-p, org-count-lines): ‘if’ without else -> ‘when’.
* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-entities.el (org-entities-create-table):
* lisp/org-list.el (org-insert-item):
* lisp/org-macs.el (org-with-point-at, org-base-buffer):
(org-preserve-local-variables, org-overlay-display):
(org-overlay-before-string): ‘if’ without else -> ‘when’.
* lisp/org-eshell.el (org-eshell-open): Fix docstring typo.
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/language):
(pcomplete/org-mode/file-option/startup):
(pcomplete/org-mode/file-option/options):
(pcomplete/org-mode/file-option/infojs_opt):
(pcomplete/org-mode/link, pcomplete/org-mode/tex):
(pcomplete/org-mode/todo, pcomplete/org-mode/searchhead):
(pcomplete/org-mode/tag, pcomplete/org-mode/prop): Avoid the formerly
misspelled ‘pcomplete-uniqify-list’ function.  It has a defalias in
emacs >= 27; we add our own for older emacsen.
(pcomplete/org-mode/file-option/bind): ‘if’ without else -> ‘when’.
* lisp/org-protocol.el (org-protocol-capture):
(org-protocol-convert-query-to-plist): ‘if’ without else -> ‘when’.
(org-protocol-do-capture): Pacify byte compiler, simplify conditional
logic.
* lisp/org-table.el (org-table-create-with-table.el): Simplify conditional
logic.
(org-table-create, org-table-convert-region, org-table-next-field):
(org-table-beginning-of-field, org-table-end-of-field):
* lisp/org-w3m.el (org-w3m-copy-for-org-mode): ‘if’ without else ->
‘when’.
* lisp/org.el (org-babel-do-load-languages, org-previous-link):
(org-refile): Use ‘(foo ...)’ instead of ‘(funcall 'foo ...)’.
(org-add-log-note): Convert a long cond into a cl-case.
(org-priority): Improve docstring, show a deprecation warning if the
‘show’ argument is passed (which was previously silently ignored).
Also, use ?\s instead of ?\ as a character literal for space.
(org-fast-tag-insert): Fix docstring typo.
(org-fill-element): ‘if’ without else -> ‘when’.
(org-on-target-p): Remove ancient compatibility alias.
2018-05-10 04:22:30 +01:00
Nicolas Goaziou 9d8aade7ec Mark `org-with-silent-modifications' as obsolete
* lisp/org-clock.el (org-clock-sum):
* lisp/org-colview.el (org-columns--display-here):
(org-columns-remove-overlays):
(org-columns-quit):
(org-columns-edit-value):
(org-columns--compute-spec):
(org-columns-compute-all):
(org-agenda-colview-compute):
* lisp/org-indent.el (org-indent-remove-properties):
(org-indent-add-properties):
* lisp/org.el (org-sort-entries):
(org-refresh-properties):
(org-refresh-category-properties):
(org-refresh-stats-properties):
(org-agenda-prepare-buffers): Do not use
`org-with-silent-modifications'.
2018-04-29 12:02:01 +02:00
Nicolas Goaziou eab65c9cf8 Fix colview-related failing tests
* lisp/org-compat.el (org-line-number-display-width): New function.
* lisp/org-colview.el (org-columns--display-here-title): Use new
  function.
2018-04-28 02:17:44 +02:00
Bastien 8cdefed80b org-colview.el: Possibly take linum-offset into account
* lisp/org-colview.el (org-columns--display-here-title):
Possibly take linum-offset into account.

Thanks to Eric S Fraga for reporting this.
2018-04-27 00:44:55 +02:00
Nicolas Goaziou 4d152b994e Rewrite tags setting functions
* lisp/org.el (org-setting-tags): Remove variable.
(org-set-tags-command): Change signature.  For interactive use only.
(org-set-tags-to): Remove function.
(org-align-all-tags): Remove function.
(org-align-tags): New function.
(org-set-tags): Change signature.  For non-interactive use only.
(org-promote):
(org-demote):
(org-refile):
(org-todo):
(org-priority):
(org-toggle-tag):
(org-entry-put):
(org-fix-tags-on-the-fly):
(org-ctrl-c-ctrl-c):
(org-delete-indentation):
(org-return):
(org-kill-line): Apply signature change.  Use new functions.
* lisp/ox-beamer.el (org-beamer-property-changed):
(org-beamer-select-environment): Apply signature change.  Use new
functions.
* testing/lisp/test-org-archive.el (test-org-archive/to-archive-sibling):
  Update test.
* testing/lisp/test-org.el (test-org/set-tags): Add tests.
(test-org/set-tags-command): New test.
(test-org/set-tags-to): Remove test.
2018-04-20 10:51:21 +02:00
Nicolas Goaziou da26490208 org-colview: Fix typo in docstring
* lisp/org-colview.el (org-columns-summary-types): Fix typo.
2018-02-10 14:03:59 +01:00
Nicolas Goaziou 0155441358 Merge branch 'maint' 2018-01-19 18:22:00 +01:00
Tim Landscheidt b289a65be7 Use https for links to orgmode.org
TINYCHANGE
2018-01-19 18:14:58 +01:00
Kyle Meyer d94f7024bc Merge branch 'maint' 2018-01-07 00:28:35 -05:00
Kyle Meyer 3e1641ef0a Update copyright years 2018-01-07 00:27:54 -05:00
Bastien 8983ac917b org-colview: Allow to filter by tags/property when capturing colview
* org-colview.el (org-columns--capture-view): New
argument "match" to filter out unmatched entries.
(org-dblock-write:columnview): Use the new argument.

Thanks to Thierry Stoehr for proposing this.
2017-12-29 18:18:14 +01:00
Nicolas Goaziou 259656a76e Merge branch 'maint' 2017-12-03 09:03:37 +01:00