GNU bug report logs - #19058
[PATCH] Desktop restore fails to run mark activation hooks when it should

Previous Next

Package: emacs;

Reported by: Kelly Dean <kelly <at> prtime.org>

Date: Sat, 15 Nov 2014 08:05:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19058 in the body.
You can then email your comments to 19058 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19058; Package emacs. (Sat, 15 Nov 2014 08:05:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kelly Dean <kelly <at> prtime.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 15 Nov 2014 08:05:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kelly Dean <kelly <at> prtime.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Desktop restore fails to run mark activation hooks when it
 should
Date: Sat, 15 Nov 2014 06:56:28 +0000
[Message part 1 (text/plain, inline)]
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.4, open a file, press C-SPC, then exit Emacs and save the desktop, then restart Emacs. Notice that the cursor type is now a block, not a bar. It should be a bar.

This bug wasn't in 24.3, and is the opposite of bug 14430. The fix for this new bug is the same patch that I already sent on May 20, 2013 for that bug (my patch fixed that bug without introducing this new bug). That patch wasn't accepted, and instead this new bug and a FIXME comment were introduced into desktop.el for 24.4.

This new bug could be fixed without applying that patch by instead applying second-restoremarkbug.bad-patch that's attached to this message (conditionally calling activate-mark as the new FIXME proposes), but that's a hack that invites future bugs when somebody modifies set-mark and forgets to correspondingly modify the code in desktop-create-buffer that duplicates the functionality of set-mark. The right fix is to not duplicate the functionality of set-mark, and instead just call set-mark and tell it whether to call activate-mark, as my original patch did.

I've been asked to not send any more patches to apply to Emacs, but this new patch is just to point out what NOT to apply, so I trust it's ok to send it.

Of course, nobody besides me cares about this bug, but its existence serves as a convenient excuse for me to ask Stefan to please add the dont-activate option to set-mark so I don't have to maintain it anymore in my personal patches. ;-)
[second-restoremarkbug.bad-patch (application/octet-stream, attachment)]

Reply sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
You have taken responsibility. (Fri, 21 Nov 2014 18:03:01 GMT) Full text and rfc822 format available.

Notification sent to Kelly Dean <kelly <at> prtime.org>:
bug acknowledged by developer. (Fri, 21 Nov 2014 18:03:03 GMT) Full text and rfc822 format available.

Message #10 received at 19058-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Kelly Dean <kelly <at> prtime.org>
Cc: 19058-done <at> debbugs.gnu.org
Subject: Re: bug#19058: [PATCH] Desktop restore fails to run mark activation
 hooks when it should
Date: Fri, 21 Nov 2014 13:02:53 -0500
> Of course, nobody besides me cares about this bug, but its existence serves
> as a convenient excuse for me to ask Stefan to please add the dont-activate
> option to set-mark so I don't have to maintain it anymore in my personal
> patches. ;-)

But if you call set-mark and a non-nil dont-activate argument, you get
the same as (move-marker (mark-marker) <foo>), so this arg only makes
sense in the case where you dynamically want to choose whether to
activate the mark or not, which is very rare.

So I installed a patch that just calls activate-mark.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 20 Dec 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 188 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.