all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kelly Dean <kellydeanch@yahoo.com>
To: 13951@debbugs.gnu.org
Subject: bug#13951: [PATCH] desktop mode corrupts restored registers
Date: Wed, 13 Mar 2013 21:31:45 -0700 (PDT)	[thread overview]
Message-ID: <1363235505.53343.YahooMailClassic@web141101.mail.bf1.yahoo.com> (raw)

[-- 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\""))))
 

             reply	other threads:[~2013-03-14  4:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14  4:31 Kelly Dean [this message]
2013-03-26  3:39 ` bug#13951: [PATCH] desktop mode corrupts restored registers Stefan Monnier

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

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

  git send-email \
    --in-reply-to=1363235505.53343.YahooMailClassic@web141101.mail.bf1.yahoo.com \
    --to=kellydeanch@yahoo.com \
    --cc=13951@debbugs.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 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.