From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: access a let* value whe ndefining a function? Date: Tue, 23 Oct 2018 13:40:19 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ce27ae0578e8dade" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gF0ef-0008A3-EB for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 13:39:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gF0ee-0004xE-KQ for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 13:39:45 -0400 Received: from mail-it1-x130.google.com ([2607:f8b0:4864:20::130]:37006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gF0ee-0004uw-Bm for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 13:39:44 -0400 Received: by mail-it1-x130.google.com with SMTP id e74-v6so3194996ita.2 for ; Tue, 23 Oct 2018 10:39:43 -0700 (PDT) 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.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --000000000000ce27ae0578e8dade Content-Type: text/plain; charset="UTF-8" Hey, I guess this is OT. I'm trying to advice org-mime-org-buffer-htmlize so that it returns to the org buffer when its done. I want to do something like this: (let ((thisbuffer (current-buffer)) (advice-add 'mu4e-sent-handler :after (lambda (docid props) (switch-to-buffer thisbuffer) (advice-remove 'mu4e-sent-handler 'om-sent-advice) ) '((name . 'om-sent-advice))) but by the time the hook is run, the (let) has long since lapsed, and thisbuffer is no longer defined. Can I force evaluation of the variable during definition? Thanks, m --000000000000ce27ae0578e8dade Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey, I guess this is OT.
<= br>
I'm trying to advice org-mime-org-buffer-htmlize so that = it returns to the org buffer when its done. I want to do something like thi= s:

(let ((thisbuffer (current-buffer))
=C2=A0(advice-add
=C2=A0=C2=A0=C2=A0=C2=A0 'mu4e-sent-handler
= =C2=A0=C2=A0=C2=A0=C2=A0 :after (lambda (docid props)
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (switch-to-buf= fer thisbuffer)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (advice-remove 'mu4e-sent-handler 'om-sent= -advice)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ) '((name . 'om-sent-advice)))
<= br>
but by the time the hook is run, the (let) has long since lap= sed, and thisbuffer is no longer defined. Can I force evaluation of the var= iable during definition?

Thanks,
m
--000000000000ce27ae0578e8dade--