From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark E. Shoulson" Subject: Re: org-pop-mode Date: Wed, 18 Mar 2020 16:05:53 -0400 Message-ID: References: <7d38c66d-6ea5-ff8f-ee39-142c8dbdcd18@kli.org> <87wo7hzd7g.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50439) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEewu-0003c7-HM for emacs-orgmode@gnu.org; Wed, 18 Mar 2020 16:05:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEewt-00045A-7W for emacs-orgmode@gnu.org; Wed, 18 Mar 2020 16:05:56 -0400 Received: from pi.meson.org ([96.56.207.26]:53598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jEews-0003o5-Nh for emacs-orgmode@gnu.org; Wed, 18 Mar 2020 16:05:55 -0400 Received: from nagas.meson.org (nagas [192.168.2.101]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by pi.meson.org (Postfix) with ESMTPS id 7D814220096 for ; Wed, 18 Mar 2020 16:05:53 -0400 (EDT) In-Reply-To: <87wo7hzd7g.fsf@alphapapa.net> Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org On 3/18/20 3:15 PM, Adam Porter wrote: > "Mark E. Shoulson" writes: > >> This is something I've wanted for years in org-mode, but which in some >> ways could actually be _offensive_ to its ideals. If you're an >> outline purist, look away. >> >> ... >> >> So, I present a pre-alpha version, >> https://gist.github.com/clsn/09ac4b098b6ad7366bb5e0bc88882d5f of >> org-pop-mode. To "pop" back up, create a headline at the level you're >> popping back to, and give it a tag of "contd", and the headline text >> should not be something important. Instructions and explanations are >> in the comments of the file (the part about installing from MELPA is a >> lie, though). >> >> Any feedback? > Hi Mark, > > Indeed, this is something that is frequently asked about. I probably > wouldn't use it myself, but it looks like you've done a good job on it. > Here is some feedback: > > 1. I'd suggest a more descriptive name, especially if you plan to > publish it to MELPA. org-pop doesn't seem to convey anything about wha= t > it does. :) Heh; fair enough.=C2=A0 The filename originally was "org-level-end.el", I= =20 think; I started using the catchier "org-pop" because... well, it was=20 catchier.=C2=A0 It made sense in my mind, in the "push"/"pop" sense used = with=20 stacks in programming, that you "push" to a deeper level and this=20 library would allow you to "pop" back up to a higher one.=C2=A0 I'll see = if I=20 can think of something better, thanks. > 2. In the code, I saw you comment about cl-flet, and I see you using > fset and unwind-protect in the org-pop-with-continuations macro. > Instead, use cl-letf with symbol-function, like: > > (cl-letf* (((symbol-function 'foo) > #'my-foo) > ((symbol-function 'bar) > (lambda () > ...))) > BODY) > > See also Nic Ferrier's package, noflet. I'll take a look, thanks.=C2=A0 It's questionable whether I really should= =20 even be messing about with that macro anyway.=C2=A0 I must have removed t= he=20 comments, but I had a whole thing there about how I had been trying with=20 cl-letf and/or cl-flet and it didn't work. Thing is, cl-flet, according=20 to the docs, (info:cl#Function Bindings) is strictly *lexical* binding,=20 which is not going to cut it.=C2=A0 cl-letf might be different; the docs = are=20 different about it, but I am pretty sure I tried it and it didn't work,=20 or didn't work "enough of the time."=C2=A0 But maybe I had it wrong, and=20 maybe noflet will succeed. Thanks! ~mark