emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Sterling Hooten <hooten@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [FR] Please add writing to existing heading in org-bibtex
Date: Wed, 11 Jan 2023 09:58:39 +0000	[thread overview]
Message-ID: <87r0w1fl4g.fsf@localhost> (raw)
In-Reply-To: <0FD9DD13-EA96-440E-B873-571DA364B274@gmail.com>

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	other threads:[~2023-01-11  9:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 16:24 [FR] Please add writing to existing heading in org-bibtex Sterling Hooten
2022-12-27 16:34 ` Ihor Radchenko
2023-01-06 18:51   ` Sterling Hooten
2023-01-11  9:58     ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0w1fl4g.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=hooten@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).