emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [bug] org-edit-src-code auto-save glitch
Date: Tue, 9 Apr 2013 19:08:38 -0700	[thread overview]
Message-ID: <alpine.OSX.2.00.1304091907470.8695@charles-berrys-macbook.local> (raw)
In-Reply-To: <87wqsbmn4f.fsf@bzg.ath.cx>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 198 bytes --]

On Tue, 9 Apr 2013, Bastien wrote:

> hi Charles,
>
> can you provide a patch for this?
>
> http://orgmode.org/worg/org-contribute.html#sec-5
>
> Thanks,
>
> -- 
> Bastien
>

Attached.

HTH,

Chuck

[-- Attachment #2: patch file --]
[-- Type: TEXT/PLAIN, Size: 2097 bytes --]

From 48de75ed0a78573a5beb32138608ae3784d0f47b Mon Sep 17 00:00:00 2001
From: cberry <ccberry@ucsd.edu>
Date: Tue, 9 Apr 2013 19:05:17 -0700
Subject: [PATCH] Auto Saving: Uncouple src block from global auto-saving

* lisp/org-src.el (org-edit-src-code): Transmit (possibly file local)
org-edit-src-auto-save-idle-delay to edit buffer and use it to enable
auto saving of the edit buffer.

Fixes auto-saving of all src edit buffers.

TINYCHANGE
---
 lisp/org-src.el |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index d294796..5ca08c9 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -278,7 +278,9 @@ the display of windows containing the Org buffer and the code buffer."
 	       ,(or (nth 4 info) org-coderef-label-format))
 	      (org-edit-src-beg-marker ,beg)
 	      (org-edit-src-end-marker ,end)
-	      (org-edit-src-block-indentation ,block-nindent)))
+	      (org-edit-src-block-indentation ,block-nindent)
+	      (org-edit-src-auto-save-idle-delay 
+	       ,org-edit-src-auto-save-idle-delay)))
       (if (and mark (>= mark beg) (<= mark (1+ end)))
 	  (save-excursion (goto-char (min mark end))
 			  (setq markline (org-current-line)
@@ -351,7 +353,7 @@ the display of windows containing the Org buffer and the code buffer."
 	(org-src-mode)
 	(set-buffer-modified-p nil)
 	(setq buffer-file-name nil)
-	(when auto-save-default
+	(when  (< 0 org-edit-src-auto-save-idle-delay)
 	  (setq buffer-auto-save-file-name
 		(concat (make-temp-name "org-src-")
 			(format-time-string "-%Y-%d-%m") ".txt")))
@@ -376,8 +378,8 @@ the display of windows containing the Org buffer and the code buffer."
 				       (string-match "\*Org Src" (buffer-name b)))
 				     (buffer-list))))
 			 (cancel-timer org-edit-src-code-timer)
-			 (setq org-edit-src-code-timer)))))))))
-	t)))
+		 	 (setq org-edit-src-code-timer)))))))))
+      t)))
 
 (defun org-edit-src-continue (e)
   "Continue editing source blocks." ;; Fixme: be more accurate
-- 
1.7.10.2 (Apple Git-33)


  reply	other threads:[~2013-04-10  2:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 19:18 [bug] org-edit-src-code auto-save glitch Charles Berry
2013-04-07 20:42 ` Bastien
2013-04-09 20:51   ` Charles C. Berry
2013-04-09 21:04     ` Bastien
2013-04-10  2:08       ` Charles C. Berry [this message]
2013-04-16  8:42         ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.00.1304091907470.8695@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).