emacs-orgmode
[Top][All Lists]
Advanced

[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: Wed, 11 Jan 2023 09:58:39 +0000

Sterling Hooten <hooten@gmail.com> writes:

> Thanks for the instructions, this is my first patch.
>
> I think calling  `nonew’ invalidates the argument `no-indent’ as 
> `org-bibtex-put’ eventually 
> calls `org-entry-put’ which uses `org-indent-line’. I’m not sure what’s the 
> best way to handle that.

You are indeed right.
I suggest doing the following:
1. Change the function definition to (&optional arg no-indent nonew)
2. With C-u prefix ARG or ARG = 'new, update heading at point
3. When ARG is not C-u and not 'new, treat it as non-nil no-indent in
   the past
   "22.12 Prefix Command Arguments" section of Elisp manual might be
   helpful to understand how to check C-u programmatically.
4. If NO-INDENT or NONEW arguments are non-nil, use them unconditionally
   regardless of the value of ARG

This way, the previous usage of the function will be the least affected.

> diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
> index d4e9b4368..8eab4cae2 100644
> --- a/etc/ORG-NEWS
> +++ b/etc/ORG-NEWS
> @@ -513,6 +513,10 @@ use =attachment:= style links instead of the standard 
> =file:= link type.

If you can, please create a proper patch with commit message, as
suggested in https://orgmode.org/worg/org-contribute.html#commit-messages

You can also refer to
https://orgmode.org/worg/org-contribute.html#org8a3a431

> +*** ~org-bibtex-write~ can now write to heading at point with optional 
> interactive argument
> +
> +Previously, a new heading was created. Now with argument =nonew= the
> +bibtex data will be added to properties of heading at point.

Please use double space between sentences. It is our convention. See
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/doc/Documentation_Standards.org
 
 

-- 
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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]