emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14430: closed ([PATCH] Desktop restore runs mark a


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14430: closed ([PATCH] Desktop restore runs mark activation hooks when it shouldn't)
Date: Mon, 10 Mar 2014 02:20:02 +0000

Your message dated Sun, 09 Mar 2014 22:19:20 -0400
with message-id <address@hidden>
and subject line Re: bug#14430: [PATCH] Desktop restore runs mark activation 
hooks when it shouldn't
has caused the debbugs.gnu.org bug report #14430,
regarding [PATCH] Desktop restore runs mark activation hooks when it shouldn't
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14430: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14430
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] Desktop restore runs mark activation hooks when it shouldn't Date: Mon, 20 May 2013 19:06:43 -0700 (PDT)
Delete your .emacs.desktop, and put in init.el:

(desktop-save-mode 1)
(add-hook 'deactivate-mark-hook (lambda () (setq cursor-type t)))
(add-hook 'activate-mark-hook (lambda () (setq cursor-type 'bar)))

Start Emacs 24.3, open a file, press C-SPC C-g, then exit Emacs and save the 
desktop, then restart Emacs. Notice that the cursor type is now a bar, not a 
block. It should be a block.

The attached patch fixes it. It could be fixed without patching set-mark, by 
conditionally calling deactivate-mark in desktop-create-buffer after calling 
set-mark, but that's a hack; the mark shouldn't be activated in the first 
place. Besides that, I need a dont-activate option for set-mark in some of my 
other code, so this bug gives me an excuse to add it.

The attached patch relies on the fix for bug 13027, which was reportedly 
applied last November, but didn't make it into 24.3, so either apply that to 
24.3, or use the current development version, but I haven't tried the latter.

Attachment: restoremarkbug.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#14430: [PATCH] Desktop restore runs mark activation hooks when it shouldn't Date: Sun, 09 Mar 2014 22:19:20 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> (desktop-save-mode 1)
> (add-hook 'deactivate-mark-hook (lambda () (setq cursor-type t)))
> (add-hook 'activate-mark-hook (lambda () (setq cursor-type 'bar)))

> Start Emacs 24.3, open a file, press C-SPC C-g, then exit Emacs and save the
> desktop, then restart Emacs. Notice that the cursor type is now a bar,
> not a block. It should be a block.

I installed a patch which makes desktop not run (de)activate-mark hooks.

> The attached patch fixes it. It could be fixed without patching set-mark, by
> conditionally calling deactivate-mark in desktop-create-buffer after calling
> set-mark, but that's a hack; the mark shouldn't be activated in the first

Instead, I simply use move-marker on mark-marker.


        Stefan


=== modified file 'lisp/desktop.el'
--- lisp/desktop.el     2014-02-22 02:10:49 +0000
+++ lisp/desktop.el     2014-03-10 02:17:20 +0000
@@ -1382,18 +1382,19 @@
          (when desktop-buffer-mark
            (if (consp desktop-buffer-mark)
                (progn
-                 (set-mark (car desktop-buffer-mark))
+                  (move-marker (mark-marker) (car desktop-buffer-mark))
+                  ;; FIXME: Should we call (de)activate-mark instead?
                  (setq mark-active (car (cdr desktop-buffer-mark))))
-             (set-mark desktop-buffer-mark)))
+              (move-marker (mark-marker) desktop-buffer-mark)))
          ;; Never override file system if the file really is read-only marked.
          (when desktop-buffer-read-only (setq buffer-read-only 
desktop-buffer-read-only))
          (dolist (this desktop-buffer-locals)
            (if (consp this)
-               ;; an entry of this form `(symbol . value)'
+               ;; An entry of this form `(symbol . value)'.
                (progn
                  (make-local-variable (car this))
                  (set (car this) (cdr this)))
-             ;; an entry of the form `symbol'
+             ;; An entry of the form `symbol'.
              (make-local-variable this)
              (makunbound this))))))))
 



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]