Commit Graph

35 Commits

Author SHA1 Message Date
Po Lu 9f1d6dfd73 Backport commit 8e1c56ae4 from Emacs
; Add 2024 to copyright years
8e1c56ae46754dd7baedff49a464f078f0e9912d
Po Lu
Tue Jan 2 09:47:10 2024 +0800
2024-01-06 15:48:23 -05:00
Eli Zaretskii e0815d7545 Backport commit cae528457 from Emacs
; Add 2023 to copyright years.
cae528457cb862dc886a34240c9d4c73035b6659
Eli Zaretskii
Sun Jan 1 05:31:12 2023 -0500
2023-01-01 12:44:47 -05:00
Ihor Radchenko e81a094383
Assert all the Org files to load the same Org version
* lisp/org-compat.el (org-assert-version): New macro comparing Org
version at compile time and laod time.

Add `org-assert-version' call to all files:

* lisp/org-macs.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-cycle.el:
* lisp/org-datetree.el:
* lisp/org-duration.el:
* lisp/org-element.el (avl-tree):
* lisp/org-entities.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-fold-core.el:
* lisp/org-fold.el:
* lisp/org-footnote.el:
* lisp/org-goto.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-keys.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-macro.el:
* lisp/org-mobile.el:
* lisp/org-mouse.el:
* lisp/org-num.el:
* lisp/org-pcomplete.el:
* lisp/org-persist.el:
* lisp/org-plot.el:
* lisp/org-protocol.el:
* lisp/org-refile.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-tempo.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-beamer.el:
* lisp/ox-html.el:
* lisp/ox-icalendar.el:
* lisp/ox-koma-letter.el:
* lisp/ox-latex.el:
* lisp/ox-man.el:
* lisp/ox-md.el:
* lisp/ox-odt.el:
* lisp/ox-org.el:
* lisp/ox-publish.el:
* lisp/ox-texinfo.el:
* lisp/ox.el:
2022-09-04 12:24:55 +08:00
Ignacio Casso f9ea6c61ed
Use `set-default-toplevel-value' in `defcustom' setters
* lisp/ob-lilypond.el (org-babel-lilypond-commands):
* lisp/ob-shell.el (org-babel-shell-names):
* lisp/org-capture.el (org-capture-templates):
* lisp/org-clock.el (org-clock-ask-before-exiting):
* lisp/org-duration.el (org-duration-units):
* lisp/org-faces.el (org-set-tag-faces):
* lisp/org-footnote.el (org-footnote-section):
* lisp/org-list.el (org-plain-list-ordered-item-terminator):
(org-list-allow-alphabetical):
* lisp/org.el (org-babel-do-load-languages):
(org-set-modules):
(org-export-backends):
(org-use-fast-todo-selection):
(org-enforce-todo-dependencies):
(org-enforce-todo-checkbox-dependencies):
(org-display-custom-times):
(org-set-packages-alist):
(org-set-emph-re):
* lisp/ox-odt.el (org-odt-schema-dir): Use
`set-default-toplevel-value' instead of `set' or `set-default' in
`defcustom' :set argument.

This commit fixes a bug that occurred when using an autoload function
inside a let-binding for a custom variable when the feature defining
both the function and the custom variable had not been loaded yet.

See bug#54399 and
https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00085.html,
https://lists.gnu.org/archive/html/emacs-orgmode/2022-06/msg00226.html
2022-06-14 21:54:45 +08:00
Kyle Meyer aae2ac3a68 Merge branch 'bugfix' 2022-01-01 15:21:37 -05:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Ihor Radchenko e70a8aac59
Use org-element-cache in place of text property cache in agenda
* lisp/org-agenda.el (org-agenda-skip): Use
`org-in-archived-heading-p' and `org-in-commented-heading-p' in place
of text property cache.

(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): Do not use text property cache in favour of
Org API functions.  The API functions use cache now.

* lisp/org-clock.el (org-element--cache-active-p): Declare function to
suppress compiler warning.

(org-clock-in): Do not use text property cache when element cache is
active.

* lisp/org-duration.el (org-duration-to-minutes): Do not change match
data.  It is needed to not break agenda---agenda relies on match data
not being altered.

* lisp/org.el (org-run-like-in-org-mode): Use element cache.
(org-refresh-category-properties): Use element cache.
(org-make-tags-matcher, org-agenda-prepare-buffers): Do not rely on
text property cache.

* testing/lisp/test-org.el (test-org/refresh-category-properties): Do
not use text property cache.
2021-10-16 23:50:21 +08:00
Kyle Meyer 273391c978 duration: Avoid recursive load error
* lisp/org-duration.el (org-duration-units): Guard against recursive
load error when org-duration-units is set via the Customize interface
before org-duration is loaded.

This follows the same approach used by erc-nickserv-identify-mode in
the Emacs repository.

Reported-by: Mario Bourgoin <m.bourgoin@gmail.com>
Ref: https://orgmode.org/list/CAM0Tqh+u+L+UgZizJrH+a+W7Lo1stPJgTsRABxD3HobOnOCrNA@mail.gmail.com
2021-01-04 00:30:00 -05:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05: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 6a1f6ee1f8 Tiny formatting fixes
* lisp/ox.el (org-export-table-dimensions):
* lisp/ox-texinfo.el (org-texinfo-template):
* lisp/ox-md.el (org-md-link):
* lisp/ox-icalendar.el (org-icalendar-use-UTC-date-time-p):
* lisp/ox-ascii.el (org-ascii-fixed-width):
* lisp/org.el (org-context):
* lisp/org-table.el (org-table-eval-formula)
(org-table-export):
* lisp/org-refile.el:
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data):
* lisp/org-num.el (org-num):
* lisp/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org-macro.el (org-macro):
* lisp/org-lint.el (org-lint):
* lisp/org-keys.el (org-keys):
* lisp/org-duration.el:
* lisp/org-clock.el (org-clock-get-last-clock-out-time)
(org-clock-update-mode-line, org-find-open-clocks):
* lisp/org-agenda.el (org-diary)
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)
(org-agenda-highlight-todo, org-cmp-alpha)
(org-agenda-filter-by-category):
* lisp/ol.el (org-link-expand-abbrev, ol):
* lisp/ol-docview.el (ol-docview):
* lisp/ol-bibtex.el (org-execute-file-search-in-bibtex)
(org-bibtex, org-bibtex-read):
* lisp/ol-bbdb.el (org-bbdb-anniversary-description):
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org):
* lisp/ob-table.el (org-babel-table-truncate-at-newline):
* lisp/ob-stan.el:
* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar):
* lisp/ob-sql.el:
* lisp/ob-shen.el:
* lisp/ob-shell.el (org-babel-prep-session:shell)
(org-babel-prep-session:shell):
* lisp/ob-sed.el (org-babel-execute:sed)
(org-babel-execute:sed):
* lisp/ob-screen.el:
* lisp/ob-sass.el:
* lisp/ob-ruby.el (org-babel-prep-session:ruby)
(org-babel-prep-session:ruby):
* lisp/ob-ref.el (org-babel-ref-resolve, ob-ref):
* lisp/ob-python.el (org-babel-prep-session:python)
(org-babel-prep-session:python):
* lisp/ob-plantuml.el:
* lisp/ob-picolisp.el:
* lisp/ob-perl.el:
* lisp/ob-org.el:
* lisp/ob-octave.el (org-babel-prep-session:octave)
(org-babel-prep-session:octave)
(org-babel-octave-evaluate-session):
* lisp/ob-ocaml.el:
* lisp/ob-mscgen.el (org-babel-execute:mscgen)
(org-babel-execute:mscgen):
* lisp/ob-maxima.el:
(ob-maxima):
* lisp/ob-matlab.el:
* lisp/ob-makefile.el:
* lisp/ob-lua.el (org-babel-prep-session:lua)
(org-babel-prep-session:lua):
* lisp/ob-lisp.el:
* lisp/ob-ledger.el:
* lisp/ob-latex.el (org-babel-expand-body:latex)
(org-babel-expand-body:latex, ob-latex):
* lisp/ob-js.el:
* lisp/ob-java.el:
* lisp/ob-io.el (org-babel-prep-session:io)
(org-babel-prep-session:io):
* lisp/ob-hledger.el:
* lisp/ob-haskell.el:
* lisp/ob-groovy.el (org-babel-groovy-wrapper-method)
(org-babel-groovy-evaluate):
* lisp/ob-gnuplot.el:
* lisp/ob-fortran.el (org-babel-expand-body:fortran)
(org-babel-expand-body:fortran):
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-exp.el (ob-exp):
* lisp/ob-eval.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-ebnf.el:
* lisp/ob-dot.el:
* lisp/ob-ditaa.el:
* lisp/ob-css.el:
* lisp/ob-core.el (org-babel-put-rownames):
* lisp/ob-coq.el:
* lisp/ob-comint.el:
* lisp/ob-calc.el:
* lisp/ob-awk.el:
* lisp/ob-asymptote.el:
* lisp/ob-abc.el:
* lisp/ob-R.el (org-babel-prep-session:R): Formatting fixes.
2020-02-18 22:57:37 +01:00
Nicolas Goaziou 2fde90aa2e org-duration: Read and write duration in compact form
* lisp/org-duration.el (org-duration-format): Add `compact' symbol.
(org-duration-set-regexps): Make white space between duration parts
optional
(org-duration-from-minutes): Handle `compact' symbol.
* testing/lisp/test-org-duration.el (test-org-duration/from-minutes):
(test-org-duration/p): Add tests.
2020-01-04 18:39:05 +01:00
Kyle Meyer ff5fc050d3 Update copyright year to 2020 2020-01-01 13:38:46 -05:00
Paul Eggert a6cead0d21 Backport commit 476066e89 from Emacs
* lisp/org-clock.el (org-clock-out):
* lisp/org.el (org-evaluate-time-range):
Avoid double-rounding of time-related values.  Simplify.
* lisp/org-clock.el (org-resolve-clocks-if-idle):
Use time-since instead of open-coding most of it.
* lisp/org-agenda.el (org-agenda-show-clocking-issues):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-table.el (org-table-sum):
* lisp/org.el (org-babel-load-file, org-2ft, org-time-stamp)
(org-read-date-analyze, org-time-stamp-to-now):
Simplify.

Note(km): Many of the changes from 476066e89 have been dropped for
compatibility with older Emacsen.

Avoid some double-rounding of Lisp timestamps
476066e89d6f0bb87220da690b8a476bf9655b80
Paul Eggert
Fri Feb 22 18:33:57 2019 -0800
2019-03-03 22:49:42 -05:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +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
Nicolas Goaziou 1992394148 org-duration: Remove unnecessary declaration 2017-12-15 23:23:49 +01:00
Nicolas Goaziou 5e30bbcd34 Silence byte-compiler 2017-12-15 23:21:15 +01:00
Nicolas Goaziou 46124812d2 Fix function declarations
Fixes: 29722
2017-12-15 22:24:44 +01:00
Nicolas Goaziou 263a0cf00e Fix defcustom type
* lisp/org-agenda.el (org-agenda-custom-commands-local-options):
* lisp/org-duration.el (org-duration-units):
* lisp/org.el (org-occur-case-fold-search): Remove spurious quote.

Fixes: 29694

lignes
2017-12-14 00:40:27 +01:00
Glenn Morris eb8c088995 Backport commit 26d58f0c5 from Emacs
; Standardize license notices
26d58f0c5865c9132e2fc559e061ef704a086d30
Glenn Morris
Fri Sep 29 12:49:19 2017 -0400
2017-10-01 19:53:04 -04:00
Kyle Meyer e4a0fd6b02 Adjust the license link in new lisp/*.el files
Emacs's bc511a64f6d made tree-wide changes to prefer https to http.
For Org, this resulted in the header of every lisp/*.el file being
changed.  Make the same changes in lisp/*.el files that were added
since Org version 9.0.10 (the last version that was synced with
Emacs).
2017-09-17 01:15:11 -04:00
Nicolas Goaziou 91a76063d8 org-duration: Fix `org-duration-to-minutes' with the empty string
* lisp/org-duration.el (org-duration-to-minutes): Accept the empty
  string.

* testing/lisp/test-org-duration.el (test-org-duration/to-minutes):
  Add test.

For backward compatibility with `org-duration-string-to-minutes'
accept the empty string as a duration.
2017-09-07 15:20:26 +02:00
Nicolas Goaziou 0fe685f119 org-duration: Fix copyright 2017-07-14 10:30:02 +02:00
Nicolas Goaziou 2371548c2a org-duration: Limit rounding errors when computing a duration
* lisp/org-duration.el (org-duration-from-minutes): Limit rounding
  errors.
2017-06-14 09:59:14 +02:00
Nicolas Goaziou b60edc480d org-duration: Small docstring improvement
* lisp/org-duration.el (org-duration-format): Remove ambiguous
  reference to a "next smallest unit".  Reword REQUIRED? description.
2017-04-29 10:37:39 +02:00
Nicolas Goaziou 72fc2d3928 org-duration: Clarify a docstring
* lisp/org-duration.el (org-duration-format): Clarify `h:mm:ss' and
  `h:mm' values.

Reported-by: Malcolm Purvis <malcolm@purvis.id.au>
<http://permalink.gmane.org/gmane.emacs.orgmode/112280>
2017-03-17 08:59:09 +01:00
Nicolas Goaziou 9263bf5766 org-duration: `org-duration-to-minutes' accepts plain numbers
* lisp/org-duration.el (org-duration-to-minutes): Accept plain numbers
  for backward compatibility with `org-hh:mm-string-to-minutes'.

* testing/lisp/test-org-duration.el (test-org-duration/to-minutes):
  Add test.

Reported-by: Dale <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/112290>
2017-02-23 12:46:37 +01:00
Nicolas Goaziou b1353cb6f8 org-duration: Fix bug with decimal units
* lisp/org-duration.el (org-duration-to-minutes): Fix bug where the
  same unit with a decimal unit would be matched multiple times.
* testing/lisp/test-org-duration.el (test-org-duration/to-minutes):
  Fix test.
2017-02-22 19:34:44 +01:00
Nicolas Goaziou b712c4f77a org-duration: Improve docstring
* lisp/org-duration.el (org-duration-format): Clarify docstring.
2017-02-22 11:51:44 +01:00
Nicolas Goaziou add0be3093 org-duration: Tolerate leading and trailing blanks in durations
* lisp/org-duration.el (org-duration--h:mm-re):
(org-duration--h:mm:ss-re): Tolerate leading in trailing blanks.
Change into a defconst.
(org-duration-set-regexps): Tolerate leading in trailing blanks.

Reported-by: Detlef Steuer <steuer@unibw-hamburg.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/112111>
2017-02-14 09:58:26 +01:00
Nicolas Goaziou 08dedfc9f0 org-duration: Fix typo 2017-02-13 14:57:06 +01:00
Nicolas Goaziou 4a2e5e0ed0 org-duration: Fix typos 2017-02-13 14:56:07 +01:00
Nicolas Goaziou f2fa092079 org-duration: Implement duration library
* lisp/org-duration.el: New file.
2017-02-13 14:39:33 +01:00