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: Tue, 27 Dec 2022 16:34:55 +0000	[thread overview]
Message-ID: <87cz8424b4.fsf@localhost> (raw)
In-Reply-To: <76ED509D-E464-4B3E-B751-B233340B2E94@gmail.com>

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>


  reply	other threads:[~2022-12-27 16:36 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 [this message]
2023-01-06 18:51   ` Sterling Hooten
2023-01-11  9:58     ` Ihor Radchenko

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=87cz8424b4.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).