From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/88239 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnorb and org-refile-use-outline-path Date: Mon, 12 Nov 2018 11:46:26 -0800 Message-ID: <87ftw63wq5.fsf@ericabrahamsen.net> References: <8736sebxyt.fsf@web.de> <87o9b2wwvr.fsf@ericabrahamsen.net> <87k1lpixdm.fsf@web.de> <875zx9wl65.fsf@ericabrahamsen.net> <87tvkt1m6b.fsf@web.de> <87in19s8i2.fsf@ericabrahamsen.net> <87va59s7ci.fsf@web.de> <87bm6zscab.fsf@ericabrahamsen.net> <874lcrsbw8.fsf@ericabrahamsen.net> <87in17nf69.fsf@web.de> <875zx6njfj.fsf@ericabrahamsen.net> <87efbtzce0.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542051940 26368 195.159.176.226 (12 Nov 2018 19:45:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2018 19:45:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+M36449@lists.math.uh.edu Mon Nov 12 20:45:36 2018 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMI9O-0006gj-90 for ding-account@gmane.org; Mon, 12 Nov 2018 20:45:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.90_1) (envelope-from ) id 1gMIAb-0006C7-Sm; Mon, 12 Nov 2018 13:46:49 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gMIAR-00069H-Vc for ding@lists.math.uh.edu; Mon, 12 Nov 2018 13:46:40 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gMIAQ-0004pN-Ev for ding@lists.math.uh.edu; Mon, 12 Nov 2018 13:46:39 -0600 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMIAP-0006I3-7A for ding@gnus.org; Mon, 12 Nov 2018 20:46:37 +0100 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gMI8F-0005Of-8G for ding@gnus.org; Mon, 12 Nov 2018 20:44:23 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:ZoNjhiHCTwyj7eLvSShIR8ljaKY= X-Spam-Score: -1.1 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:88239 Archived-At: Michael Heerdegen writes: > Eric Abrahamsen 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