Commit Graph

517 Commits

Author SHA1 Message Date
Ihor Radchenko 18fbb9985f
Honor `display-buffer-alist' when creating dialogues
* lisp/org-macs.el (org-display-buffer-split): New function to display
just the new buffer and current buffer visible in the frame.  To be
used as `display-buffer' ACTION parameter.
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
(org-agenda-fit-window-to-buffer):
(org-agenda-prepare-window):
(org-agenda-switch-to):
* lisp/org-capture.el (org-capture-place-template):
* lisp/org-goto.el (org-goto-location):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org.el (org-tree-to-indirect-buffer):
(org-fast-todo-selection):
(org-add-log-note):
(org-fast-tag-selection):
(org-submit-bug-report):
* lisp/ox.el (org-export--dispatch-ui): Get rid of calling
`delete-other-windows' manually.  Instead, make use of
`org-display-buffer-slip' + `pop-to-buffer'/`display-buffer'.  This
way, user overrides in `display-buffer-alist' are honored.
* lisp/org-plot.el (org-plot/gnuplot):
* lisp/org.el (org-offer-links-in-entry): When `delete-other-windows'
cannot be avoided, make it ignore errors in the frames where
displaying a lone window is forbidden.
2024-04-07 13:34:13 +03:00
Ihor Radchenko 9f4064e68e
org-capture-templates: Document %^{prompt}X %-escape syntax
* lisp/org-capture.el (org-capture-templates):
* doc/org-manual.org (Template expansion): Document the supported
custom prompt syntax.

Link: https://old.reddit.com/r/orgmode/comments/1bfgzsz/format_timestamp_after_capture_by_prompt/
2024-03-16 12:18:17 +03:00
Ihor Radchenko af9100382c
Never pass error message verbatim as the first argument for `message'/`error'
* lisp/org-capture.el (org-capture-store-last-position):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org.el (org-open-file): Avoid (error string) code pattern.
Instead use (error "%s" string).  (error string) is erroneous when
STRING contains %-specs.

Reported-by: Corwin Kerr <corwin@corwinkerr.com>
Link: https://orgmode.org/list/beceaf05-ae15-487b-864b-2e23a33a3884@app.fastmail.com
2024-02-25 13:15:04 +03:00
Ihor Radchenko 24ce9abce7
org-capture-set-target-location: Fix `pcase' conditions
* lisp/org-capture.el (org-capture-set-target-location): Do not demand
file path to be a string in capture targets.  Other non-string values
are also allowed and checked in `org-capture-expand-file' that is
called later.

This commit fixes the changes introduced in 0a58a53ed.

Reported-by: Derek Chen-Becker <derek@chen-becker.org>
Link: https://orgmode.org/list/CAMbmz5nnXY1V1cPObfdw9wyM_GbiuYQ5_rksJ6gcO3Af+HOmSQ@mail.gmail.com
2024-02-23 15:51:11 +03:00
Ihor Radchenko aa3724dbde
org-capture: Obsolete `org-capture-bookmark' in favor of `org-bookmark-names-plist'
* lisp/org-capture.el (org-capture-bookmark):
* lisp/org-compat.el (org-capture-bookmark): Mark obsolete.
* lisp/org-capture.el (org-capture-store-last-position): Add comment
about obsoletion.
* doc/org-manual.org (Using capture): Mention
`org-bookmark-names-plist' instead of `org-capture-bookmark'.

Reported-by: Tim Wichmann <schwurg@arcor.de>
Link: https://orgmode.org/list/87bk8r2ig1.fsf@localhost
2024-02-09 17:47:57 +01:00
Ihor Radchenko 8ccda1737b
fixup! org-capture-set-target-location: Improve error reporting for malformed target
Reported-by: Zhitao <zhitaao.gong@gmail.com>
Link: https://orgmode.org/list/CACcmFoCvtyGBKR7mTjdQOd-w82wz-xcavnpEVT=6mFOWpo1T1w@mail.gmail.com
2024-02-06 20:02:40 +01:00
Ihor Radchenko 0a58a53eda
org-capture-set-target-location: Improve error reporting for malformed target
* lisp/org-capture.el (org-capture-set-target-location): Tighten
matching the template target location when the location value is not
properly formatted.
2024-02-04 14:47:23 +01:00
Ihor Radchenko 78dc58508d
Obsolete org-switch-to-buffer-other-window and org-no-popups
* lisp/org-compat.el (org-switch-to-buffer-other-window):
(org-no-popups): Move from org-macs.el and mark obsolete.
* lisp/ob-lilypond.el (org-babel-lilypond-execute-tangled-ly):
(org-babel-lilypond-mark-error-line):
* lisp/ol.el (org-insert-link):
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
(org-agenda-prepare-window):
(org-agenda-goto):
(org-agenda-open-link):
(org-agenda-clock-goto):
(org-agenda-diary-entry-in-org-file):
(org-agenda-add-entry-to-org-agenda-diary-file):
(org-agenda-show-the-flagging-note):
* lisp/org-attach.el (org-attach):
* lisp/org-capture.el (org-capture-place-template):
(org-capture-fill-template):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-macs.el (org-mks):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org-table.el (org-table-edit-field):
(org-table-edit-formulas):
(org-table-show-reference):
* lisp/org.el (org-fast-todo-selection):
(org-add-log-note):
(org-fast-tag-selection):
* lisp/ox.el (org-export-stack-view):
(org-export--dispatch-ui): Use `switch-to-buffer-other-window'.
* etc/ORG-NEWS (Org mode no longer disallows configuring
~display-buffer-alist~ to open Org popups in other frame): Document
the breaking change.

Reported-by: Jan Seeger
Link: https://orgmode.org/list/87pmr3mfq3.fsf@localhost
2024-01-24 15:00:26 +01:00
Kyle Meyer 72a2db86d9 Merge branch 'bugfix' 2024-01-06 16:02:02 -05:00
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
Kenny Ballou ac8b925407
lisp/org-capture.el: use `org-store-link' for %K values
* org-capture.el (org-capture-fill-template): fill %K values using link
value from `org-store-link', which respects `org-id-link-to-use-id'.
* doc/ORG-NEWS: (Template variable expansion %K) Document new behavior.

Reported-by: Nathaniel W Griswold <nate@manicmind.earth>
Signed-off-by: Kenny Ballou <kb@devnulllabs.io>
Link: https://list.orgmode.org/EF459D47-FCA4-4A18-AFC7-3E62159F186C@manicmind.earth/

TINYCHANGE
2023-12-12 13:43:03 +01:00
Kyle Meyer 1e353648ef Merge branch 'bugfix' 2023-12-04 23:33:47 -05:00
Stefan Kangas dc1230a3b5 Backport commit 5f923ff1a from Emacs
; Fix typos
5f923ff1a6a8a9ff6f06dc49c8e0e2ceee111567
Stefan Kangas
Sun Dec 3 23:31:30 2023 +0100
2023-12-04 23:23:45 -05:00
Ihor Radchenko 3c29e77b51
* lisp/org-capture.el: Fix malformed declare form 2023-10-02 14:19:43 +03:00
Ihor Radchenko 5e378a6e13
org-capture-template-contexts: Improve docstring
* lisp/org-capture.el (org-capture-templates-contexts): Clarify that
function context definition is not a cons cell using example.
2023-08-05 09:53:13 +03:00
Ihor Radchenko f93d855c51
Prefer `forward-line' over `beginning-of-line'
The latter is much slower.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225#98
2023-07-01 14:36:14 +03:00
Ihor Radchenko bc29f5de41
org-element: New `org-element-*property*' functions
* lisp/org-element.el (org-element-begin):
(org-element-end):
(org-element-contents-begin):
(org-element-contents-end):
(org-element-post-affiliated):
(org-element-post-blank): New functions for fast access to frequently
used element properties.  The functions are `setf'-able.

Update all the relevant code in Org to use the new functions instead
of genetic property queries.
2023-07-01 14:35:43 +03:00
Ihor Radchenko 81a7e8c836
org-element-lineage: Allow TYPES to be a symbol
* lisp/org-element-ast.el (org-element-lineage): Allow TYPES argument
to be a symbol.
* lisp/ox-ascii.el (org-ascii--current-text-width):
(org-ascii-format-inlinetask-default):
(org-ascii-section):
* lisp/ox-beamer.el (org-beamer--format-block):
* lisp/ox-html.el (org-html-section):
(org-html-table-cell):
(org-html-table-row):
* lisp/ox-latex.el (org-latex-table-cell):
(org-latex-table-row):
* lisp/ox-odt.el (org-odt-headline):
(org-odt-table-style-spec):
(org-odt-get-table-cell-styles):
(org-odt-table-cell):
(org-odt-table-row):
* lisp/ox-org.el (org-org-section):
* lisp/ox-publish.el (org-publish-collect-index):
* lisp/ox-texinfo.el (org-texinfo--get-node):
(org-texinfo-section):
(org-texinfo-table-row):
* lisp/ox.el (org-export--skip-p):
(org-export-get-node-property):
(org-export-table-cell-borders):
(org-export-table-row-in-header-p):
(org-export-table-row-number):
(org-export-collect-headlines): Update all the callers.
2023-07-01 14:35:43 +03:00
Ihor Radchenko a7d1dfa171
Use `org-element-type-p'
Use `org-element-type-p' across Org source, except some tests, where `eq' can
produce more meaningful failure explanations.
2023-07-01 14:35:35 +03:00
Ihor Radchenko 94c2c8d929
Inhibit error when saving bookmarks with `debug-on-error' set to non-nil
* lisp/org-capture.el (org-capture-store-last-position):
* lisp/org-refile.el (org-refile): Use `condition-case' instead of
`with-demoted-errors' when saving bookmarks.  We intent to suppress
errors completely here (116c09053), even when `debug-on-error' is set.
`with-demoted-errors' does trigger error in such scenario, unlike
explicit `condition-case' clause.

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/875y7d7jlr.fsf@gmail.com
2023-06-24 15:05:12 +03:00
Tim Visher bea9fca183
org-capture.el: Allow `(here)' as a template target
* lisp/org-capture.el (org-capture-set-target-location): Allow
`(here)' as a template target in addition to `here'.
(org-capture-templates): Update the docstring, describing the new
target.
* doc/org-manual.org (Template elements): Add `(here)' target
documentation
* etc/ORG-NEWS (Capture templates now support ~(here)~ as a target):
Document the new feature.

Templates had no user accessible way to target the current location
directly from a capture template. Attempting to directly utilize the
behavior accessible through a 0 prefix arg exposed the inconsistent
treatment of the `:target` property in
`org-capture`. `org-capture-set-target-location` understood that it
could be both a symbol and a list, while `org-capture` itself required
it to be a list through its use of `car`.

This change opts to make `org-capture-set-target-location` more
liberal in what it accepts rather than making `org-capture` agree that
targets can be lists. This is because the manual implies, especially
in the `(clock)' entry, that targets are expected to be lists even if
they are meant as specific points.

TINYCHANGE
2023-06-22 13:14:12 +03:00
Ihor Radchenko 989cc51499
Prefer "timestamp" over "time-stamp"
* lisp/org.el (org-time-stamp-formats):
(org-timestamp-formats):
(org-time-stamp-rounding-minutes):
(org-timestamp-rounding-minutes):
(org-time-stamp-custom-formats):
(org-timestamp-custom-formats):
(org-time-stamp):
(org-timestamp):
(org-time-stamp-inactive):
(org-timestamp-inactive):
(org-insert-time-stamp):
(org-insert-timestamp):
(org-toggle-time-stamp-overlays):
(org-toggle-timestamp-overlays):
(org-time-stamp-to-now):
(org-timestamp-to-now):
* lisp/ox.el (org-export-time-stamp-file):
(org-export-timestamp-file): Rename using "timestamp" term, keeping
the old name as alias.
* doc/org-manual.org: Update all the uses, adding #+findex and
 #+vindex entries.  Keep the alias names for searchability.

Adjust all the callers.

The following "time-stamp" uses are unchanged:
1. `org-time-stamp-format' where obsolete and _different_ function
   `org-timestamp-format' still exists.
2. :time-stamp-file property in export INFO plist.  Changing this
   would be breaking.
3. ORG-NEWS remains unchanged.
2023-04-30 13:48:52 +02:00
Ihor Radchenko b34bdc8719
org-capture-finalize: Do not save new file with :no-save aborted capture
* lisp/org-capture.el (org-capture-finalize): Do not save the newly
created file buffer when the capture is aborted and org-capture is not
asked to save upon capture.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add test.
2023-01-22 13:49:07 +03: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
Stefan Kangas 92a40cf7a1 Backport commit 9292f595a from Emacs
; Fix typos
9292f595a71870eec1ffdfd187b859cc990c2f0b
Stefan Kangas
Sat Dec 31 12:43:32 2022 +0100
2022-12-31 18:11:46 -05:00
Stefan Kangas c8ad9e4b28 Backport commit 8617edfff from Emacs
; Fix typos
8617edfffd07eb80561b4de6a37c5b0b5f442e07
Stefan Kangas
Wed Nov 30 16:59:41 2022 +0100
2022-11-30 17:19:12 -05:00
Ihor Radchenko 5a10517d02
Add missing :package-version tags in changed `defcustom'
* lisp/ob-clojure.el (ob-clojure-babashka-command):
(ob-clojure-nbb-command):
* lisp/ob-exp.el (org-babel-exp-code-template):
* lisp/ob-latex.el (org-babel-latex-pdf-svg-process):
* lisp/org-agenda.el (org-agenda-show-outline-path):
* lisp/org-capture.el (org-capture-templates):
* lisp/org-clock.el (org-clocktable-defaults):
* lisp/org-persist.el (org-persist-directory):
(org-persist-remote-files):
(org-persist-default-expiry):
* lisp/org-refile.el (org-refile-use-outline-path):
* lisp/org-src.el (org-src-lang-modes):
* lisp/org.el (org-resource-download-policy):
(org-safe-remote-resources):
(org-time-stamp-custom-formats):
(org-property-separators):
(org-preview-latex-process-alist):
(org-structure-template-alist):
* lisp/ox-latex.el (org-latex-inline-image-rules):
(org-latex-src-block-backend):
(org-latex-engraved-options):
(org-latex-engraved-theme):
* lisp/ox-md.el (org-md-toplevel-hlevel):
* lisp/ox-texinfo.el (org-texinfo-with-latex): Add :package-version
keywords to the new custom options, and those with the value or
meaning changed.
2022-11-13 15:29:15 +08:00
Nicholas Vollmer 7f3a6cf6e7
org-capture: Add template hook properties
* lisp/org-capture.el (org-capture-templates): Document template hook properties.
(org-capture-finalize): Execute :prepare/:before/:after-finalize functions.
(org-capture-place-template): Execute :hook functions.

* doc/org-manual.org: Document template hook properties.

* etc/ORG-NEWS: Add news entry for template hook properties.

* testing/lisp/test-org-capture.el: Add tests for template hook properties.
2022-10-07 13:38:52 +08:00
Ihor Radchenko 224708323e
org-clock: Do not assume that clock is always inside capture buffer
* lisp/org-capture.el (org-capture): Store the clock marker in `org-capture-clock-was-started'.
(org-capture-clock-was-started): Document that the variable holds
clock marker.
(org-capture-finalize): Check the stored value of the clock marker
when deciding if the currently running clock has been started by
capture.

Reported-by: Bernt Hansen <bernt@norang.ca>
Link: https://orgmode.org/list/878rza7c0w.fsf@localhost
2022-10-06 16:00:59 +08:00
Kyle Meyer 95a4c59bfe compat: Add compatibility wrapper for format-prompt
* lisp/org-compat.el (org-format-prompt): New compatibility
function.
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-refile.el (org-refile-get-location): Use org-format-prompt.

Prefer a wrapper to inlining compatibility kludges.

This is a follow-up to the port of Emacs's 664094222.
2022-10-04 18:38:25 -04:00
Kyle Meyer 42c418693f Merge branch 'km/from-emacs-master' 2022-10-04 18:37:42 -04:00
Stefan Kangas c2c8e66e5d Backport commit b7e867b84 from Emacs
Make point-at-eol and point-at-bol obsolete
b7e867b841f47dcff3aeaef9b5608a237386ce70
Stefan Kangas
Tue Aug 23 04:54:57 2022 +0200

[ km: This was independently covered on the main branch with
  e73c5b7d0.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2022-10-04 17:18:04 -04:00
Stefan Kangas c7e1bbfd1c Backport commit 664094222 from Emacs
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-refile.el (org-refile-get-location): Prefer format-prompt
when it is fboundp.

Use format-prompt for many more prompts
66409422214a0a90e1d2a12ef2c4ebf86f2c01a9
Stefan Kangas
Tue Oct 5 03:44:56 2021 +0200
2022-10-04 16:27:45 -04:00
Ihor Radchenko 9db57aee3e
Do not use visual `current-indentation' when we need real values
* lisp/org-macs.el (org-current-text-indentation): New macro
calculating the real text indentation disregarding buffer visibility.
(org-do-remove-indentation):
* lisp/org-src.el (org-src--edit-element):
* lisp/org.el (org-indent-line):
(org-indent-region):
(org-toggle-fixed-width):
(org-comment-or-uncomment-region):
* lisp/ox.el (org-export-expand-include-keyword): Use
`org-current-text-indentation' instead of `current-indentation' and
`org-current-text-column' instead of `current-column' when we need
real text values but not visible values.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56837

Reported-by: tony aldon <tony.aldon.adm@gmail.com>
Link: https://orgmode.org/list/87k0h49s7z.fsf@localhost
2022-10-04 15:21:20 +08:00
Ihor Radchenko e73c5b7d0d
Fix Emacs 29 compiler warnings
* lisp/oc-basic.el (org-cite-basic--parse-bibliography): Do not use
obsolete `buffer-file-name' generalized variable.  Prefer
`set-visited-file-name'.
* lisp/ol-bibtex.el (org-indent-region): Declare function.
(org-bibtex-import-from-file): Remove unused variable.
* lisp/ol.el (org-link--decode-compound): Use `ash' instead of
obsolete `lsh'.
* lisp/org-macs.el: Do no use obsolete generalized variable
`buffer-string'.
* lisp/org-plot.el (org-plot/redisplay-img-in-buffer):
* lisp/org.el (image-flush):
(org-display-inline-images): Use `image-flush' instead of obsolete
`image-refresh'.
* lisp/ox.el (org-export-to-file): Quote ' in the docstring.

All other changes are changing obsolete `point-at-bol' and
`point-at-eol' to `line-beginning-position' and `line-end-position'.
2022-09-06 20:50:59 +08: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
Ihor Radchenko 2ea0830f07
org-capture-kill: Fix capture boundaries when deleting empty lines above
* lisp/org-capture.el (org-capture-place-entry):
(org-capture-place-item):
(org-capture-place-table-line):
(org-capture-place-plain-text): Store beginning of the capture region
as marker.  This will make the ORIGIN move if
`org-capture-empty-lines-before` has to add/remove lines.

Fixes https://orgmode.org/list/CAGyCDkPos+W_MEJffSZga83NsOLZx2XGTYEmSGQuHQvS-sNa8A@mail.gmail.com
2022-07-31 13:05:16 +08:00
Paul Eggert 6013cb161d Fix doc string quoting problems with '
The Emacs doc string convention is to document values as-is when that
is clear, and surrounded by `single quotes' otherwise. For example, a
doc string "(a b c)" stands for a list of symbols, and the doc string
"`a'" stands for a single symbol. The doc string "\\=`a" is typically
not correct for that single symbol, because that is equivalent to
"(quote a)" and the typical intent is to talk about the symbol, not
about the Lisp quoting construct.  One needs "\\=`X" only when talking
about something intended to be equivalent to "(quote X)", as in the
doc string "(provide \\='org-xyz)".
2022-07-25 13:10:29 -07:00
Max Nikulin ae1db7df39
Use `org-encode-time' helper macro
* lisp/ol.el (org-store-link):
* lisp/org-agenda.el (org-agenda-get-timestamps)
(org-agenda-get-progress, agenda-bulk-action):
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-clock.el (org-clock-get-sum-start)
(org-clock-special-range, org-clocktable-shift)
(org-clocktable-steps):
* lisp/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org-datetree.el (org-datetree-find-iso-week-create)
(org-datetree-insert-line):
* lisp/org-element.el (org-element-timestamp-interpreter):
* lisp/org-macro.el (org-macro--vc-modified-time):
* lisp/org-macs.el (org-matcher-time):
* lisp/org.el (org-current-time, org-current-effective-time)
(org-add-planning-info, org-read-date, org-read-date-display)
(org-read-date-analyze, org-eval-in-calendar)
(org-calendar-select, org-display-custom-time)
(org-calendar-select-mouse, org-time-string-to-time)
(org-time-from-absolute, org-at-clock-log-p)
(org-date-from-calendar, org-get-cursor-date)
(org-timestamp-to-time):
* testing/lisp/test-org-clock.el (org-test-clock-create-timestamp):
* lisp/ox-icalendar.el (org-icalendar-convert-timestamp):
Avoid direct calls of `encode-time', use `org-encode-time' instead.

Org supports Emacs-26, but the recommended way to call `encode-time'
changed in Emacs-27.  In Emacs-29 DST and TZ elements of the single list
arguments became optional.  In Org it is still convenient to call the
function with separate arguments without explicit DST and TZ arguments.
The `org-encode-time' should mitigate attempts to modernize Org code
directly in the Emacs repository.
2022-07-17 16:40:18 +08:00
Stefan Kangas 13d97ee18c
Prefer "website" to "homepage"
Emacs now advises using "website" (instead of "homepage") and
consequently to use the "URL" comment header instead of "Homepage".

* README:
* README_ELPA:
* doc/org-guide.org (Creating Footnotes):
* doc/org-manual.org (Creating Footnotes):
* etc/styles/README (URL): Prefer "website" to "homepage".

* lisp/*.el:
* mk/org-fixup.el: Replace the "Homepage" header comment with "URL".
2022-06-26 10:10:48 +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
Ihor Radchenko 0e7033e0ca
org-capture: Expand sexps in template with Org mode being active
* lisp/org-capture.el (org-capture-fill-template): Enable `org-mode'
in the temporary template expansion buffer.  Update docstring
accordingly.
(org-capture-templates): Clarify that %(sexp) expansion happens in a
temporary Org mode buffer.

Fixes https://orgmode.org/list/CABUh-776V-_+_JAZwcKQm9ATcs0WUV9SmGwjooGFbt=CtwQj8g@mail.gmail.com
2022-06-09 16:12:38 +08:00
Ihor Radchenko d6bae908f3
Fix macro indentation and re-indent code misindented by nameless
* lisp/org-fold-core.el (org-fold-core-cycle-over-indirect-buffers):
(org-fold-core-ignore-modifications):
(org-fold-core-ignore-fragility-checks):
* lisp/org-macs.el (org-element-with-disabled-cache): Fix incorrect
indentation declare statement.  Body-only macros should use (indent 0)
to avoid indenting first line differently from other body.
* lisp/org-capture.el:
* lisp/org-clock.el:
* lisp/org-fold-core.el:
* lisp/org-fold.el:
* lisp/org-id.el:
* lisp/org-list.el:
* lisp/org-macs.el:
* lisp/org.el: Reindent.

Reported in https://orgmode.org/list/CAKJdtO_Z4LBGek3SUc6-a_Z0-dDd6L26_YfMYpZTn7F92uxXJQ@mail.gmail.com
2022-05-14 16:58:35 +08:00
Ihor Radchenko cd83606cfd
org-fold: Handle indirect buffer visibility 2022-04-25 19:39:55 +08:00
Ihor Radchenko fa7530c7b4
Rename old function call to use org-fold 2022-04-25 19:39:53 +08:00
Kyle Meyer 91681fc033 Merge branch 'bugfix' 2022-03-02 23:04:59 -05:00
Stefan Monnier 668205f769 Backport commit d52c929e3 from Emacs
* lisp/org-refile.el (org-refile):
* lisp/org-capture.el (org-capture-store-last-position):
Pass `format` arg to `with-demoted-errors`.

(with-demoted-errors): Warn on missing `format` arg
d52c929e31f60ff0462371bfe27ebd479e3e82bd
Stefan Monnier
Fri Feb 4 19:39:53 2022 -0500

[km] with-demoted-errors has had a format argument since Emacs 24.4.
     Passing it avoids an error when compiling with Emacs's current
     master (bug#54225).  Once that bug is resolved, it will prevent a
     warning.
2022-03-02 23:02:50 -05:00
Mark A. Hershberger 1537bb4029
Fix signature for org-element-at-point 2022-01-12 22:26:10 +08:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Bastien 806ac1b7f6 *el: Fix indentation 2021-09-29 09:22:47 +02:00