all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Save undo history after org-edit-src-save.
@ 2012-01-23 22:05 Peter Danenberg
  2012-01-24 14:00 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Danenberg @ 2012-01-23 22:05 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

It's been irritating me that after saving an edit buffer, the undo
history disappears; the attached patch restores the undo history.

[-- Attachment #2: org-edit-src-save-with-undo-history.patch --]
[-- Type: text/plain, Size: 842 bytes --]

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 8cdf81e..e85e04e 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -661,7 +661,7 @@ the language, a switch telling if the content should be in a single line."
       (setq org-edit-src-saved-temp-window-config nil))))
 
 (defmacro org-src-in-org-buffer (&rest body)
-  `(let ((p (point)) (m (mark)) msg)
+  `(let ((p (point)) (m (mark)) (ul buffer-undo-list) msg)
      (save-window-excursion
        (org-edit-src-exit 'save)
        ,@body
@@ -670,6 +670,7 @@ the language, a switch telling if the content should be in a single line."
 	   (let ((org-src-window-setup 'current-window))
 	     (org-edit-src-code 'save))
 	 (org-edit-src-code 'save)))
+     (setq buffer-undo-list ul)
      (push-mark m 'nomessage)
      (goto-char (min p (point-max)))
      (message (or msg ""))))

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Save undo history after org-edit-src-save.
  2012-01-23 22:05 [PATCH] Save undo history after org-edit-src-save Peter Danenberg
@ 2012-01-24 14:00 ` Bastien
  2012-01-24 18:57   ` Peter Danenberg
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2012-01-24 14:00 UTC (permalink / raw)
  To: Peter Danenberg; +Cc: emacs-orgmode

Hi Peter,

Peter Danenberg <pcd@roxygen.org> writes:

> It's been irritating me that after saving an edit buffer, the undo
> history disappears; the attached patch restores the undo history.

Applied.

Next time, please provide a full patch (with an Emacs ChangeLog 
message) with git format-patch.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Save undo history after org-edit-src-save.
  2012-01-24 14:00 ` Bastien
@ 2012-01-24 18:57   ` Peter Danenberg
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Danenberg @ 2012-01-24 18:57 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Thanks, Bastien! Just found the "Preferred way of submitting patches"
document.

Quoth Bastien on Prickle-Prickle, the 24th of Chaos:
> Hi Peter,
> 
> Peter Danenberg <pcd@roxygen.org> writes:
> 
> > It's been irritating me that after saving an edit buffer, the undo
> > history disappears; the attached patch restores the undo history.
> 
> Applied.
> 
> Next time, please provide a full patch (with an Emacs ChangeLog 
> message) with git format-patch.
> 
> Thanks,
> 
> -- 
>  Bastien
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-24 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23 22:05 [PATCH] Save undo history after org-edit-src-save Peter Danenberg
2012-01-24 14:00 ` Bastien
2012-01-24 18:57   ` Peter Danenberg

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.