From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yury G. Kudryashov" Subject: Edit whole session with org-edit-src-edit Date: Sun, 08 Oct 2017 18:58:49 -0400 Message-ID: <87vajpl00m.fsf@urkud.name> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1KXK-0007RT-6x for emacs-orgmode@gnu.org; Sun, 08 Oct 2017 18:59:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1KXH-0008Vg-5Y for emacs-orgmode@gnu.org; Sun, 08 Oct 2017 18:59:06 -0400 Received: from mail.urkud.name ([188.166.0.33]:36250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1KXG-0008VK-RV for emacs-orgmode@gnu.org; Sun, 08 Oct 2017 18:59:03 -0400 Received: from natdell.urkud.name (c-73-175-94-59.hsd1.pa.comcast.net [73.175.94.59]) by mail.urkud.name (Postfix) with ESMTPSA id 817491F56D for ; Mon, 9 Oct 2017 01:59:00 +0300 (MSK) 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 Hello, I want to use orgmode for literate programming with Coq. I like the "edit in major mode" org-edit-src-edit feature, but it exports only the current src block to the temprorary buffer, so it's impossible to debug the file in the temporary buffer using coq-mode (proofgeneral) "phrase by phrase" execution. I think that some other languages may have similar problems. Say, code completion works better, if the whole file is available. I propose the following feature: 1. When the temporary buffer is created, - the whole session (or all the code with that will go to one file when tangling) is written to the buffer; - all the code except for the current block is marked as read-only. 2. When writing the temporary buffer back to the main file, drop the read-only regions. An even more useful (though may be harder to implement) version: 1. When the temporary buffer is created, - then whole session is written to the temporary buffer; - before each block, a commented line with some meta-data (original buffer, line range, src-block #+NAME attribute) is inserted; - these commented lines are made read-only, while the blocks are left read-write. 2. When writing back, each block is rewritten. This way a user may have file headers (#include in C/C++, imports in Python etc) in one #src block, and easily modify it while editing some "main" code in a temporary buffer. Unfortunately, I'm new to (e)lisp, so I'm not sure whether I'll manage to implement these features myself. -- Sincerely yours, Yury G. Kudryashov