Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: Gnorb and org-refile-use-outline-path
Date: Mon, 12 Nov 2018 11:46:26 -0800	[thread overview]
Message-ID: <87ftw63wq5.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87efbtzce0.fsf@web.de>

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> > (let ((org-refile-use-outline-path
>> >        (if (eq gnorb-gnus-refile-use-outline-path 'use-org-value-maybe)
>> >            (or org-refile-use-outline-path 'file)
>> >          gnorb-gnus-refile-use-outline-path)))
>> >   code...)
>> >
>
>> Huh. That looks like a lot of work
>
> Not really.  What is really nontrivial work is to find out all places
> where you need to bind `org-refile-use-outline-path'.

Well that's not too hard, there are only four spots, I think.

> Then factor the
>
> (if (eq gnorb-gnus-refile-use-outline-path 'use-org-value-maybe)
>     (or org-refile-use-outline-path 'file)
>   gnorb-gnus-refile-use-outline-path)

> part into a defun `gnorb-get-gnus-refile-use-outline-path', and all you
> have to do is to bind `org-refile-use-outline-path' to
> (gnorb-get-gnus-refile-use-outline-path) instead of
> gnorb-gnus-refile-use-outline-path in all those places.

This should work fine, right?

#+begin_src elisp
(let ((org-refile-use-outline-path
       (if (eq gnorb-gnus-refile-use-outline-path 'org)
	   org-refile-use-outline-path
	 gnorb-gnus-refile-use-outline-path)))
  ...)
#+end_src

Then default the gnorb option to 'org.

> If you had to treat several variables this way, it would be better to
> define a macro `gnorb-with-org-bindings' that expands into a `let'.  But
> that's still a small and trivial change.

Yup, I'll leave that for later.

Thanks,
Eric




  reply	other threads:[~2018-11-12 19:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06  5:02 Michael Heerdegen
2018-11-06  6:19 ` Eric Abrahamsen
2018-11-06 23:45   ` Michael Heerdegen
2018-11-07  4:45     ` Eric Abrahamsen
2018-11-07  5:39       ` Michael Heerdegen
2018-11-07  6:32         ` Eric Abrahamsen
2018-11-07  6:57           ` Michael Heerdegen
2018-11-08 17:35             ` Eric Abrahamsen
2018-11-08 17:43               ` Eric Abrahamsen
2018-11-09  2:43                 ` Michael Heerdegen
2018-11-09 19:24                   ` Eric Abrahamsen
2018-11-10  6:15                     ` Michael Heerdegen
2018-11-12 19:46                       ` Eric Abrahamsen [this message]
2018-11-13  5:57                         ` Michael Heerdegen
2018-11-13 19:22                           ` Eric Abrahamsen
2018-11-14  6:03                             ` Michael Heerdegen
2018-11-16 21:39                               ` Eric Abrahamsen
2018-11-17 14:43                                 ` Michael Heerdegen
2018-11-17 18:50                                   ` Eric Abrahamsen

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

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

  git send-email \
    --in-reply-to=87ftw63wq5.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.org \
    /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.
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 NNTP newsgroup(s).