Commit Graph

34 Commits

Author SHA1 Message Date
Martin Kampas 37e468cf16
org-bibtex-yank: Allow to populate existing item
Align with `org-bibtex-create'.

* lisp/ol-bibtex.el (org-bibtex-write):
* lisp/ol-bibtex.el (org-bibtex-yank): New optional argument
UPDATE-HEADING to update heading at point instead of creating a new
heading.
(org-bibtex-create): Rename NONEW argument to UPDATE-HEADING.
* etc/ORG-NEWS (~org-bibtex-yank~ accepts a prefix argument):
(New optional argument =UPDATE-HEADING= for ~org-bibtex-yank~):
Announce the change.

Link: https://list.orgmode.org/orgmode/4868155.GXAFRqVoOG@gt1/
2024-02-25 11:50:38 +03:00
Rick Lupton 95554543b9
org-id.el: Add search strings, inherit parent IDs
* lisp/ol.el (org-store-link): Refactor org-id links to use standard
`org-store-link-functions'.
(org-link-search): Create new headings at appropriate level.
(org-link-precise-link-target): New function extracting logic to
identify a precise link target, e.g. a heading, named object, or text
search.
(org-link-try-link-store-functions): Extract logic to call external
link store functions. Pass them a new `interactive?' argument.
* lisp/ol-bbdb.el (org-bbdb-store-link):
* lisp/ol-bibtex.el (org-bibtex-store-link):
* lisp/ol-docview.el (org-docview-store-link):
* lisp/ol-eshell.el (org-eshell-store-link):
* lisp/ol-eww.el (org-eww-store-link):
* lisp/ol-gnus.el (org-gnus-store-link):
* lisp/ol-info.el (org-info-store-link):
* lisp/ol-irc.el (org-irc-store-link):
* lisp/ol-man.el (org-man-store-link):
* lisp/ol-mhe.el (org-mhe-store-link):
* lisp/ol-rmail.el (org-rmail-store-link): Accept optional arg.
* lisp/org-id.el (org-id-link-consider-parent-id): New option to allow
a parent heading with an id to be considered as a link target.
(org-id-link-use-context): New option to add context to org-id links.
(org-id-get): Add optional `inherit' argument which considers parents'
IDs if the current entry does not have one.
(org-id-store-link): Consider IDs of parent headings as link targets
when current heading has no ID and `org-id-link-consider-parent-id' is
set.  Add a search string to the link when enabled.
(org-id-store-link-maybe): Function set as :store option for custom id
link property. Move logic from `org-store-link' here to determine when
an org-id link should be stored using `org-id-store-link'.
(org-id-open): Recognise search strings after "::" in org-id links.
* lisp/org-lint.el: Add checker for "::" in ID properties.
* testing/lisp/test-ol.el: Add tests for
`org-link-precise-link-target' and `org-id-store-link' functions,
testing new options.
* doc/org-manual.org: Update documentation about links.
* etc/ORG-NEWS: Document changes and new options.

These feature allows for more precise links when using org-id to link to
org headings, without requiring every single headline to have an id.

Link: https://list.orgmode.org/118435e8-0b20-46fd-af6a-88de8e19fac6@app.fastmail.com/
2024-02-24 15:56:44 +03: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
Ihor Radchenko 34ee6f1a21
Merge branch 'bugfix' 2023-08-13 19:24:50 +03:00
Ihor Radchenko 99cc9619c5
org-bibtex-yank: Fix bibtex parser not initialized in temp buffer
* lisp/ol-bibtex.el (org-bibtex-yank): Make sure that we parse bibtex
entry from the kill ring in a `bibtex-mode' buffer.  Otherwise,
calling `org-bibtex-read' (that calls `bibtex-parse-entry') may err
because some Bibtex parser variables are not initialized.

Reported-by: J. G. <jerzor@pacbell.net>
Link: https://orgmode.org/list/1939460027.3272000.1691771671040@mail.yahoo.com
2023-08-13 19:21:48 +03:00
Ihor Radchenko ac0042184e
org-bibtex-headline-format-function: Factor out lambda default value
* lisp/ol-bibtex.el (org-bibtex-headline-format-default): New function
to be used as the default value of
`org-bibtex-headline-format-function'.
(org-bibtex-headline-format-function): Update the default value.

Link: https://orgmode.org/list/87edl71tyu.fsf@localhost
2023-07-25 13:50:09 +03:00
Rudolf Adamkovič 4f6bf89547
Fix BibTeX spelled as Bibtex
* lisp/ol-bibtex.el: Spell BibTeX correctly
* etc/ORG-NEWS (Org-BibTeX -- major improvements): Spell BibTeX correctly
2023-03-07 14:06:01 +01: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
Kyrylo Simonov 00778ce2a6
Fix missing customization groups
* lisp/ob-tangle.el (org-babel-tangle): Add missing group definition.
(org-babel-post-tangle-hook):
(org-babel-pre-tangle-hook):
(org-babel-tangle-body-hook):
(org-babel-tangle-finished-hook):
(org-babel-tangle-comment-format-beg):
(org-babel-tangle-comment-format-end):
(org-babel-tangle-uncomment-comments):
(org-babel-process-comment-text):
(org-babel-tangle-default-file-mode): Move under `org-babel-tangle'
group.
* lisp/ol-bbdb.el (org-bbdb-anniversaries): Move under `org-agenda'
instead of a non-existent `org-bbdb'.
* lisp/ol-bibtex.el (org-bibtex): Add missing group definition.
* lisp/ol-gnus.el (org-gnus-no-server): Move under group
`org-link-follow' instead of a non-existent `org-gnus'.
* lisp/org-plot.el (org-plot): Add missing group definition.
* lisp/org.el (org-startup): Add missing group definition.
* lisp/ox-latex.el (org-latex-pdf-process): Move under
`org-export-latex' instead of a non-existent `org-export-pdf'.
* lisp/ox-man.el (org-man-pdf-process): Remove reference to
non-existent group `org-export-pdf'.

TINYCHANGE
2022-11-16 09:59:44 +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 5ba90e161b
org-bibtex-import-from-file: Improve performance
* lisp/ol-bibtex.el (org-bibtex-put): Add new optional argument to
insert node property at point directly, without leveraging
`org-set-property'.  Add docstring.
(org-bibtex-write): Insert headline properties directly.  Add new
optional argument to suppress indentation.  Do not use `length' to
check if `org-bibtex-entries' list empty---`length' is too slow on
large lists.
(org-bibtex-import-from-file): Postpone indentation after all the
entries are imported.
* lisp/org.el (org-indent-region): Use cache.
2022-08-27 12:09:31 +08:00
Ihor Radchenko 1344376d69
Merge branch 'bugfix' 2022-02-05 19:19:49 +08:00
Ihor Radchenko 7543da991f
org-bibtex-read: Fix regression from f7d6db1bf
* lisp/ol-bibtex.el (org-bibtex-read): Make sure that the return value
is the updated `org-bibtex-entries'.  Document the return value
requirement.  The assumption about the return value is used by
`org-bibtex-yank'.

Fixes https://list.orgmode.org/86zgn689m5.fsf@krailli2.fritz.box/T/#u
2022-02-05 19:17:58 +08:00
Ihor Radchenko 7f6b6e4891
Merge branch 'bugfix' 2022-01-30 16:52:15 +08:00
Ihor Radchenko dd6486a070
Make sure that declarative defvars do not set variable value
* lisp/ob-tangle.el (org-id-link-to-org-use-id):
* lisp/org-agenda.el (org-agenda-overriding-header): Do not try set
value of a variable defined elsewhere.  This may interfere with custom
interface.  See
https://list.orgmode.org/orgmode/871r19ryxb.fsf@localhost/

(org-agenda-restrict):
* lisp/ol-bibtex.el (org-bibtex-description): Remove incorrect
comments.
2022-01-30 16:46:12 +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 abe7222ed8
Add declares to suppress compiler warnings 2021-10-17 00:01:56 +08:00
Bastien 806ac1b7f6 *el: Fix indentation 2021-09-29 09:22:47 +02:00
Bastien 3d35718bad Merge branch 'bugfix' 2021-09-26 08:57:27 +02:00
Ihor Radchenko f7d6db1bf6 org-bibtex-read: Do not add nil when there is no entry at point
* lisp/ol-bibtex.el (org-bibtex-read): Previously, when there is no
entry at point, `nil' would be added to `org-bibtex-entries' causing
errors later, i.e. upon calling org-bibtex-write.  Now, nil is never
pushed to `org-bibtex-entries'.

Fixes https://orgmode.org/list/874kd3288n.fsf@yandex.com
2021-09-26 08:57:16 +02:00
Eric S Fraga d1900adfbe ol-bibtex: Added url and doi as optional entries for BiBTeX export
* lisp/ol-bibtex.el: :doi and :url entries added to optional list of
entries to export to BiBTeX when present in the properties.

* etc/ORG-NEWS: added news item noting this change.
2021-07-01 23:15:22 +02:00
Stefan Kangas 2e1c984153 Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05:00
Kyle Meyer d7d714c7d5 Silence byte-compiler in Emacs repo
These show up in the Emacs repo (before and after the latest sync in
f22856a5c5), but for an unknown reason do not show up with `make
compile' or `make single' in the Org repo.

All of these functions are autoloaded.
2020-12-13 13:56:29 -05:00
Stefan Kangas ddcccbc012 Backport commit 78eacf31e from Emacs
; Fix many typos in symbols in docs and comments
78eacf31e8fe182801ad1943fac717b75fcf286b
Stefan Kangas
Fri Oct 2 13:29:45 2020 +0200
2020-10-04 15:06:39 -04:00
Bastien Guerry c7a86a43ae Merge branch 'maint' 2020-06-05 10:40:14 +02:00
Bastien Guerry fa4dddf8d2 Fix broken links
* lisp/org.el:
* lisp/ol-bibtex.el:
* etc/ORG-NEWS (org-capture.el is now the default capture system):
* doc/org-manual.org (Cache results of evaluation): Fix broken links.
2020-06-05 10:39:52 +02:00
Nicolas Goaziou f4bed78a19 Move custom links to new tooling
* contrib/lisp/ol-bookmark.el (org-bookmark-open):
* contrib/lisp/ol-elisp-symbol.el (elisp-symbol-open):
* contrib/lisp/ol-git-link.el (org-gitbare-open):
(org-git-open):
* contrib/lisp/ol-man.el (org-man-open):
* contrib/lisp/ol-mew.el (org-mew-open):
* contrib/lisp/ol-notmuch.el (org-notmuch-open):
(org-notmuch-search-open):
(org-notmuch-tree-open):
* contrib/lisp/ol-vm.el (org-vm-open):
(org-vm-imap-open):
* contrib/lisp/ol-wl.el (org-wl-open):
* contrib/lisp/org-mac-link.el (org-mac-together-item-open):
(org-mac-addressbook-item-open):
(org-mac-skim-open):
(org-mac-acrobat-open):
(org-mac-outlook-message-open):
(org-mac-evernote-note-open):
(org-devonthink-item-open):
(org-mac-message-open):
* contrib/lisp/org-mairix.el (org-mairix-open):
* lisp/ol-bbdb.el (org-bbdb-export):
(org-bbdb-open):
* lisp/ol-bibtex.el (org-bibtex-open):
* lisp/ol-docview.el (org-docview-open):
* lisp/ol-eshell.el (org-eshell-open):
* lisp/ol-eww.el ("eww"):
* lisp/ol-gnus.el (org-gnus-open):
* lisp/ol-info.el (org-info-open):
* lisp/ol-irc.el (org-irc-visit):
* lisp/ol-mhe.el (org-mhe-open):
* lisp/ol-rmail.el ("rmail"):
(org-rmail-open):
* lisp/ol.el (org-link--open-doi):
(org-link--open-elisp):
(org-link--open-help):
(org-link--open-shell):
* lisp/org-id.el (org-id-open):
* testing/lisp/test-ox.el (test-org-export/custom-protocol-maybe): Use
new tooling.
* doc/org-manual.org (Adding Hyperlink Types): Adapt example.
2020-02-19 18:42:50 +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
Kyle Meyer ff5fc050d3 Update copyright year to 2020 2020-01-01 13:38:46 -05:00
Nicolas Goaziou 499c0a50cc Prefix link-related libraries filenames with "ol"
* lisp/org.el (org-modules): Update provided symbols.
2019-03-10 18:00:36 +01:00
Renamed from lisp/org-bibtex.el (Browse further)