From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: PATCH: Display point of code block point when confirming evaluation Date: Sat, 07 Dec 2019 09:26:57 +0200 Message-ID: <87sglwoata.fsf@iki.fi> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51439) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idUUg-0004dl-OW for emacs-orgmode@gnu.org; Sat, 07 Dec 2019 02:27:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idUUf-0004Wl-2I for emacs-orgmode@gnu.org; Sat, 07 Dec 2019 02:27:10 -0500 Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:58454 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1idUUe-0004Ja-P9 for emacs-orgmode@gnu.org; Sat, 07 Dec 2019 02:27:08 -0500 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1idUUa-000y9t-QP for emacs-orgmode@gnu.org; Sat, 07 Dec 2019 08:27:04 +0100 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Greetings. Please find attached a patch that adds the point of the source code block to the message shown to user when confirming the evaluation of the block. In large org-files, I have often trouble figuring out which code block Org is confirming me to evaluate when exporting. This is especially true when I have set 'cache: yes'. When something changes in code, these blocks need to be re-evaluated during export, but the '#results:' of these blocks are not changed. Therefore, on the next export I will be asked again, unless I find the block and evaluate it by hand myself. This patch adds the 'start' element of source block info at the end of the confirmation message. Jarmo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-core.el-Display-block-point-during-evaluation-con.patch Content-Description: point in confirm >From aaa68af8a7710ffe2c61fc45edf2ff377438cd32 Mon Sep 17 00:00:00 2001 From: Jarmo Hurri Date: Sat, 7 Dec 2019 09:14:34 +0200 Subject: [PATCH] ob-core.el: Display block point during evaluation confirmation * lisp/ob-core.el (org-babel-confirm-evaluate): Display code block point when querying confirmation of evaluation. This addresses the problem of finding the block currently evaluated. --- lisp/ob-core.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index f877ff51b..7ba9894e6 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -277,7 +277,8 @@ environment, to override this check." (let* ((evalp (org-babel-check-confirm-evaluate info)) (lang (nth 0 info)) (name (nth 4 info)) - (name-string (if name (format " (%s) " name) " "))) + (name-string (if name (format " (%s) " name) " ")) + (start (nth 5 info))) (pcase evalp (`nil nil) (`t t) @@ -285,11 +286,11 @@ environment, to override this check." (and (not (bound-and-true-p org-babel-confirm-evaluate-answer-no)) (yes-or-no-p - (format "Evaluate this %s code block%son your system? " - lang name-string))) + (format "Evaluate this %s code block%son your system (point %d)? " + lang name-string start))) (progn - (message "Evaluation of this %s code block%sis aborted." - lang name-string) + (message "Evaluation of this %s code block%sis aborted (point %d)." + lang name-string start) nil))) (x (error "Unexpected value `%s' from `org-babel-check-confirm-evaluate'" x))))) -- 2.21.0 --=-=-=--