all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13951: [PATCH] desktop mode corrupts restored registers
@ 2013-03-14  4:31 Kelly Dean
  2013-03-26  3:39 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Kelly Dean @ 2013-03-14  4:31 UTC (permalink / raw)
  To: 13951

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

Put in your init.el just (desktop-save-mode 1)
Delete your .emacs.desktop if you already have one.

Start Emacs 24.3, open any file foo, then do point-to-register, and use register a. Leave foo open, and open any file bar in the same window so foo is no longer displayed, then do point-to-register, and use register b. Leave bar open, and open any file baz in the same window. Then do list-registers, and you get the right thing: register a points to foo, and b to bar.

Then close Emacs, answer yes to save the desktop, then start Emacs again. Do list-registers. Register b has the right position but the wrong buffer (baz), and register a either has the same problem (if the position was different from the position of b) or has a marker in no buffer (if the position happened to be the same as the position of b). The bug is caused by trying to convert the saved buffer name to a buffer before the buffer itself has been recreated after restarting Emacs.

The attached desktopregisterbug.patch fixes it.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: desktopregisterbug.patch --]
[-- Type: text/x-diff; name="desktopregisterbug.patch", Size: 387 bytes --]

--- emacs-24.3/lisp/desktop.el
+++ emacs-24.3/lisp/desktop.el
@@ -771,7 +771,7 @@
        (cons nil (concat "(let ((mk (make-marker)))"
 			 " (add-hook 'desktop-delay-hook"
 			 " (list 'lambda '() (list 'set-marker mk "
-			 pos " (get-buffer " buf ")))) mk)"))))
+			 pos " '(get-buffer " buf ")))) mk)"))))
     (t					 ; save as text
      (cons 'may "\"Unprintable entity\""))))
 

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

end of thread, other threads:[~2013-03-26  3:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-14  4:31 bug#13951: [PATCH] desktop mode corrupts restored registers Kelly Dean
2013-03-26  3:39 ` Stefan Monnier

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.