From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.bugs Subject: bug#19058: [PATCH] Desktop restore fails to run mark activation hooks when it should Date: Sat, 15 Nov 2014 06:56:28 +0000 Message-ID: <8102.44637909836$1416038742@news.gmane.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1416038742 8885 80.91.229.3 (15 Nov 2014 08:05:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2014 08:05:42 +0000 (UTC) To: 19058@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 15 09:05:33 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XpYMM-0006tr-Q7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Nov 2014 09:05:31 +0100 Original-Received: from localhost ([::1]:39406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpYMM-0003yP-1D for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Nov 2014 03:05:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpYM4-0003xN-Ra for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 03:05:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpYLu-0006aa-M0 for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 03:05:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpYLu-0006a4-J6 for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 03:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XpYLu-0005av-0S for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 03:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kelly Dean Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Nov 2014 08:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19058 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141603865021312 (code B ref -1); Sat, 15 Nov 2014 08:05:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Nov 2014 08:04:10 +0000 Original-Received: from localhost ([127.0.0.1]:33177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpYL4-0005XZ-2u for submit@debbugs.gnu.org; Sat, 15 Nov 2014 03:04:10 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59744) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpXTW-0003By-4C for submit@debbugs.gnu.org; Sat, 15 Nov 2014 02:08:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpXTL-0000nq-Nd for submit@debbugs.gnu.org; Sat, 15 Nov 2014 02:08:49 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:49083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpXTL-0000ng-KG for submit@debbugs.gnu.org; Sat, 15 Nov 2014 02:08:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpXTB-0001yH-4b for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 02:08:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpXT1-0000h3-0G for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 02:08:29 -0500 Original-Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:58263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpXT0-0000gv-Pp for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 02:08:18 -0500 Original-Received: from mfilter36-d.gandi.net (mfilter36-d.gandi.net [217.70.178.167]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 6B2EFA80C4 for ; Sat, 15 Nov 2014 08:08:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter36-d.gandi.net Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter36-d.gandi.net (mfilter36-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Nes9sK0fbs8e for ; Sat, 15 Nov 2014 08:08:17 +0100 (CET) X-Originating-IP: 73.169.42.166 Original-Received: from localhost (c-73-169-42-166.hsd1.co.comcast.net [73.169.42.166]) (Authenticated sender: kelly@prtime.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A6383A80BE for ; Sat, 15 Nov 2014 08:08:15 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Sat, 15 Nov 2014 03:04:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96049 --=-=-= Content-Type: text/plain 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. ;-) --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=second-restoremarkbug.bad-patch Content-Transfer-Encoding: base64 RG9uJ3QgYXBwbHkgdGhpcyBwYXRjaCEgSXQncyB0aGUgd3JvbmcgZml4IGZvciB0aGUgYnVnLgoK LS0tIGVtYWNzLTI0LjQvbGlzcC9kZXNrdG9wLmVsCisrKyBlbWFjcy0yNC40L2xpc3AvZGVza3Rv cC5lbApAQCAtMTQxMyw4ICsxNDEzLDcgQEAKICAgICAgICAgICAgIChpZiAoY29uc3AgZGVza3Rv cC1idWZmZXItbWFyaykKICAgICAgICAgICAgICAgICAocHJvZ24KICAgICAgICAgICAgICAgICAg IChtb3ZlLW1hcmtlciAobWFyay1tYXJrZXIpIChjYXIgZGVza3RvcC1idWZmZXItbWFyaykpCi0g ICAgICAgICAgICAgICAgICA7OyBGSVhNRTogU2hvdWxkIHdlIGNhbGwgKGRlKWFjdGl2YXRlLW1h cmsgaW5zdGVhZD8KLSAgICAgICAgICAgICAgICAgIChzZXRxIG1hcmstYWN0aXZlIChjYXIgKGNk ciBkZXNrdG9wLWJ1ZmZlci1tYXJrKSkpKQorICAgICAgICAgICAgICAgICAgKGlmIChjYXIgKGNk ciBkZXNrdG9wLWJ1ZmZlci1tYXJrKSkgKGFjdGl2YXRlLW1hcmsgJ25vLXRtbSkpKQogICAgICAg ICAgICAgICAobW92ZS1tYXJrZXIgKG1hcmstbWFya2VyKSBkZXNrdG9wLWJ1ZmZlci1tYXJrKSkp CiAJICA7OyBOZXZlciBvdmVycmlkZSBmaWxlIHN5c3RlbSBpZiB0aGUgZmlsZSByZWFsbHkgaXMg cmVhZC1vbmx5IG1hcmtlZC4KIAkgICh3aGVuIGRlc2t0b3AtYnVmZmVyLXJlYWQtb25seSAoc2V0 cSBidWZmZXItcmVhZC1vbmx5IGRlc2t0b3AtYnVmZmVyLXJlYWQtb25seSkpCg== --=-=-=--