[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FR] Please add writing to existing heading in org-bibtex
From: |
Ihor Radchenko |
Subject: |
Re: [FR] Please add writing to existing heading in org-bibtex |
Date: |
Tue, 27 Dec 2022 16:34:55 +0000 |
Sterling Hooten <hooten@gmail.com> writes:
> The default behavior of org-bibtex-write is to insert a new
> heading with the bibliographic data in the properties. But an
> alternative workflow would just update the properties of the heading at
> point, rather than creating a new one. The below patch is a simple
> implementation I’ve been using for a month. Would it be possible to
> integrate this upstream?
Yes. It will make sense.
> -(defun org-bibtex-write ()
> - "Insert a heading built from the first element of `org-bibtex-entries'."
> +(defun org-bibtex-write (&optional no-new)
> + "Insert a heading built from the first element of `org-bibtex-entries'.
> With non-nil optional NO-NEW write to heading at point instead of creating
> new."
Please put the second sentence on a separate line. By convention, first
line is a short description of the command and should not exceed 80
symbols. See
https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html
Also, it will be a good idea to write heading at point when the command
is called with prefix argument (C-u).
> + ;; SWH 2022-11-22 changes to allow for writing heading at point instead of
> inserting new.
Please prepare a proper patch with CHANGELOG entry.
This comment is not how we make changes in Org.
See https://orgmode.org/worg/org-contribute.html#first-patch
> (interactive)
You can change the interactive form to allow prefix argument.
See
https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>