emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Mikhail Skorzhinskii <mskorzhinskiy@eml.cc>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] org-refile.el: show refile targets with doc. title
Date: Sat, 28 May 2022 10:33:51 +0800	[thread overview]
Message-ID: <87a6b2e67k.fsf@localhost> (raw)
In-Reply-To: <e7bd98501eeceab2ef4c43be09df9c2b9b9c1a50.camel@eml.cc>

Mikhail Skorzhinskii <mskorzhinskiy@eml.cc> writes:

> Thank you for reviewing the changes. Sorry for the sloppy patch, I've
> retested everything and added a few additional fixes, there were more
> problems.

Thanks! And sorry for the slow review. Your email was lost near the tail
of the todo list.

> I've added a couple of test cases too. (BTW, test framework is awesome
> and really easy to use!)

Great!

> * lisp/org-refile.el (org-refile-use-outline-path): add an option 'title
> * lisp/org-refile.el (org-refile-get-targets): start refile target
> outline with document title (#+title) instead of file name

Note that changes like this should be detailed in etc/ORG-NEWS

> -	  (const :tag "Start with buffer name" buffer-name)))
> +	  (const :tag "Start with buffer name" buffer-name)
> +	  (const :tag "Start with document title" title)))

You also need to document the new option in the docstring.
  
> +  ;; When `org-refile-use-outline-path' is `title' and document do not
> +  ;; have an extracted document title, return just the file name
> +  (should
> +   (org-test-with-temp-text-in-file "* H1"
> +     (let* ((filename (buffer-file-name))
> +            (org-refile-use-outline-path 'title)
> +            (org-refile-targets `(((,filename) :level . 1))))
> +       (member (file-name-nondirectory filename)
> +               (mapcar #'car (org-refile-get-targets)))))))

It would also make sense to add a test when document is a temporary
buffer without filename and also does not contain a title.

Finally, your patch is exceeding 15LOC. You need to do copyright
paperwork to get the patch merged. See
https://orgmode.org/worg/org-contribute.html#copyright

Best,
Ihor


  reply	other threads:[~2022-05-28  2:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-25 15:23 [PATCH] org-refile.el: show refile targets with doc. title Mikhail Skorzhinskii
2021-12-26 13:59 ` Ihor Radchenko
2021-12-28 11:59   ` Mikhail Skorzhinskii
2022-05-28  2:33     ` Ihor Radchenko [this message]
2022-08-30 13:53       ` Mikhail Skorzhisnkii

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=87a6b2e67k.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mskorzhinskiy@eml.cc \
    /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).