From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id COGnNywCr17IBQAA0tVLHw (envelope-from ) for ; Sun, 03 May 2020 17:41:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QAi9MTYCr14rEwAA1q6Kng (envelope-from ) for ; Sun, 03 May 2020 17:41:10 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A1B0B943EC8 for ; Sun, 3 May 2020 17:41:09 +0000 (UTC) Received: from localhost ([::1]:32982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVIc1-0005nq-Kx for larch@yhetil.org; Sun, 03 May 2020 13:41:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVIbd-0005nh-8j for emacs-orgmode@gnu.org; Sun, 03 May 2020 13:40:45 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:40604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVIbc-0006wm-G1 for emacs-orgmode@gnu.org; Sun, 03 May 2020 13:40:44 -0400 Received: by mail-qt1-x843.google.com with SMTP id e17so12107481qtp.7 for ; Sun, 03 May 2020 10:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:message-id:date:mime-version; bh=rcYOruagneLM5LuLOaA7wm1bWyMGrBCKxl/YZIh7M3s=; b=f7huOWmOiYOx7vutM8RQr/4YuqPwnzGosuGbRCsNyJum6m/dcI3MjOP9xRq0NGjPmj f/YV0aszrEiQHOML6EJ9e6kTaJnLG8dcnBAGght2HabB9sizqVPcnjpVY3h9/iJVM+92 1fWvlKr1y+9HNyP0P0+Zl0muVKGPm3fIcaH4h40o3yEf6ufcI8vDpSZbS5c3g3CLWivd gFWrTMlGrajqS1antcpo5AhUoAZ5VKu8ECL79QI0lSwLSDmK8o/rT2lemke/6VG7PdEt c2cVMQfxZqnmXZJPOC077JBT4VIvq7ylzRUbWOhSAKFbRXk+WT402is32OrSXL12STM0 tGcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:message-id:date :mime-version; bh=rcYOruagneLM5LuLOaA7wm1bWyMGrBCKxl/YZIh7M3s=; b=VfFrBM1JnjMwdGMO2lyizjTUTpxb0QSHjir2Q7F+s6W2FgvcYcg6Yb/8qcrnHxfWJ5 fZnVFjcjA9JzRz80q+3BosbsqJX9tT+2RAPFQ7qjnJj7spFC4Xek89i+Rvmm6PCfDyC5 mIx3k2ftSP0fFp8XmFrDLGuxahxhq8edp4eLFf7a+Fmq17tPupO8s/LZ9sjLBwJ/BwED xPmV1ruh0BZxHt+mkJCXTV14F9XIe9vhnV+rQPMuAkkbnlj7lomJ0LuupaWL8aMcnkHQ 8cTUW3+I8Xqi97Yp6JhpLxhyK8jUG09XSPASWF0ld2jD10x/3LGLzoC2vOLCXxHUYxTx QPzw== X-Gm-Message-State: AGi0PuYSZOZJnXHUrExwu+Va73JwtZIwAHLbpfbJ65GIrZSU8X2NNHT6 08WxuAWZ2JvPt3WY93oJ/1OnZphn X-Google-Smtp-Source: APiQypJpmnUaj6niSjCz+KmVc7+K3pL3ZNenP0Up3e8U92u2ye/cmd2bB99dR0/LvTtJeacdrDBCew== X-Received: by 2002:ac8:4e88:: with SMTP id 8mr13491105qtp.82.1588527642810; Sun, 03 May 2020 10:40:42 -0700 (PDT) Received: from laptop ([2601:8b:c300:1024:86c6:b3c8:8509:5fff]) by smtp.gmail.com with ESMTPSA id c4sm8038104qkf.120.2020.05.03.10.40.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2020 10:40:42 -0700 (PDT) User-agent: mu4e 1.3.9; emacs 28.0.50 From: No Wayman To: emacs-orgmode@gnu.org Subject: [PATCH] Allow org-capture-mode-hook to access org-capture-current-plist [9.3.6 (release_9.3.6-443-g0e8aff @ /home/n/.emacs.d/straight/build/org/)] Message-ID: <87r1w07w86.fsf@gmail.com> Date: Sun, 03 May 2020 13:40:41 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::843; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.71 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=f7huOWmO; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-1.71 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49382544767756]; DWL_DNSWL_FAIL(0.00)[gmail.com:server fail,2001:470:142::17:server fail]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; FREEMAIL_FROM(0.00)[gmail.com]; HAS_ATTACHMENT(0.00)[]; TO_DN_NONE(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.14), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; FROM_NEQ_ENVFROM(0.00)[iarchivedmywholelife@gmail.com,emacs-orgmode-bounces@gnu.org]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: lP6lTS0E1R8K --=-=-= Content-Type: text/plain; format=flowed I'm proposing the following trivial patch to bring more consistency to org-capture-mode's hooks. By setting org-capture-current-plist before invoking org-capture-mode in the capture buffer, users can access the same variable in org-capture-mode-hook as they would in org-capture-before-finalize-hook and org-capture-prepare-finalize-hook. org-capture-after-finalize-hook is the only outlier, but that makes sense as the capture buffer is no longer current when it runs. ~ Nicholas Vollmer --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Allow-org-capture-mode-hook-to-access-org-capture-cu.patch Content-Description: set-org-capture-current-plist-before-org-capture-mode-hook-run >From 0e8affeaea6034655bbd53faa412eed0826a7933 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Sun, 3 May 2020 13:20:05 -0400 Subject: [PATCH] Allow org-capture-mode-hook to access org-capture-current-plist Set buffer local org-capture-current-plist before putting capture buffer in org-capture-mode. Allows hook functions to access the buffer local version on the plist (consistent with before/prepare-finalize hooks). --- lisp/org-capture.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index d292defd6..f650c5473 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1128,8 +1128,8 @@ may have been stored before." (`plain (org-capture-place-plain-text)) (`item (org-capture-place-item)) (`checkitem (org-capture-place-item))) - (org-capture-mode 1) - (setq-local org-capture-current-plist org-capture-plist)) + (setq-local org-capture-current-plist org-capture-plist) + (org-capture-mode 1)) (defun org-capture-place-entry () "Place the template as a new Org entry." -- 2.26.2 --=-=-=--