GNU bug report logs - #24036
25.0.95; Prevent warnings when opening files during desktop restore

Previous Next

Package: emacs;

Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>

Date: Wed, 20 Jul 2016 13:59:02 UTC

Severity: wishlist

Found in version 25.0.95

Done: Kaushal Modi <kaushal.modi <at> gmail.com>

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 24036 in the body.
You can then email your comments to 24036 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#24036; Package emacs. (Wed, 20 Jul 2016 13:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kaushal Modi <kaushal.modi <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 20 Jul 2016 13:59:02 GMT) Full text and rfc822 format available.

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

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>,
 Juanma Barranquero <lekktu <at> gmail.com>, 
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: 25.0.95; Prevent warnings when opening files during desktop restore
Date: Wed, 20 Jul 2016 13:58:15 +0000
[Message part 1 (text/plain, inline)]
Hi,

This bug report is more like a minor enhancement in the process of file
restoration during desktop-restore.

@Juanma, Stefan: I am copying you guys to review this as this section of
desktop.el has commits made by you the most. (PS: vc-region-history is
awesome!)

I use the *Messages* buffer at startup as a check that everything's good in
my config.

But as I use desktop save/restore in my workflow, I also get stuff like

Note: file is write protected [2 times]
<something else>
Note: file is write protected [19 times]
<something else>
Note: file is write protected
<something else>
Note: file is write protected [3 times]

Finally after much digging I had figured out that it is
`desktop-restore-file-buffer` that is causing this.

I understand that "file is write protected" and other warning are useful to
the user when they are doing find-file interactively. But in this scenario,
they just add clutter in the *Messages* buffer and provide no useful debug
info.

The patch that I am proposing in this report has been living in my emacs
config since Nov 2014! and I have not seen a single bad side-effect of
that. I hope this get merged into the master.

===== patch start
From e5fdf14a387248c282abd94effe7f97be51340b5 Mon Sep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi <at> gmail.com>
Date: Wed, 20 Jul 2016 09:50:38 -0400
Subject: [PATCH] No find-file warnings during desktop-restore

* lisp/desktop.el (desktop-restore-file-buffer): Do not print warnings
  when files are being opened during desktop restore.
---
 lisp/desktop.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/desktop.el b/lisp/desktop.el
index 1f460b7..df4ff55 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1402,7 +1402,7 @@ desktop-restore-file-buffer
  (or coding-system-for-read
     (cdr (assq 'buffer-file-coding-system
        desktop-buffer-locals))))
-       (buf (find-file-noselect buffer-filename)))
+       (buf (find-file-noselect buffer-filename :nowarn)))
   (condition-case nil
       (switch-to-buffer buf)
     (error (pop-to-buffer buf)))
-- 
2.6.0.rc0.24.gec371ff
===== patch end


In GNU Emacs 25.0.95.11 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
 of 2016-06-29
Repository revision: 6192b6c3a4374b2cb6e02ca865e1899a04a7f7dc
Windowing system distributor 'The X.Org Foundation', version 11.0.60900000
System Description: Red Hat Enterprise Linux Workstation release 6.6
(Santiago)

Thanks!
-- 

Kaushal Modi
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24036; Package emacs. (Thu, 21 Jul 2016 21:01:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>,
 "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Re: 25.0.95;
 Prevent warnings when opening files during desktop restore
Date: Thu, 21 Jul 2016 17:02:07 -0400
> -       (buf (find-file-noselect buffer-filename)))
> +       (buf (find-file-noselect buffer-filename :nowarn)))

Fine by me,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24036; Package emacs. (Thu, 21 Jul 2016 23:41:02 GMT) Full text and rfc822 format available.

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

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu <at> gmail.com>,
 "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Re: 25.0.95;
 Prevent warnings when opening files during desktop restore
Date: Thu, 21 Jul 2016 23:40:07 +0000
[Message part 1 (text/plain, inline)]
Thanks!

Can you please commit it to master when you get a chance?

On Thu, Jul 21, 2016, 5:00 PM Stefan Monnier <monnier <at> iro.umontreal.ca>
wrote:

> > -       (buf (find-file-noselect buffer-filename)))
> > +       (buf (find-file-noselect buffer-filename :nowarn)))
>
> Fine by me,
>
>
>         Stefan
>
-- 

Kaushal Modi
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24036; Package emacs. (Fri, 22 Jul 2016 18:50:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>,
 "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Re: 25.0.95;
 Prevent warnings when opening files during desktop restore
Date: Fri, 22 Jul 2016 14:49:00 -0400
> Can you please commit it to master when you get a chance?

Done,


        Stefan




Reply sent to Kaushal Modi <kaushal.modi <at> gmail.com>:
You have taken responsibility. (Fri, 22 Jul 2016 19:58:02 GMT) Full text and rfc822 format available.

Notification sent to Kaushal Modi <kaushal.modi <at> gmail.com>:
bug acknowledged by developer. (Fri, 22 Jul 2016 19:58:02 GMT) Full text and rfc822 format available.

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

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, 24036-done <at> debbugs.gnu.org
Cc: Juanma Barranquero <lekktu <at> gmail.com>
Subject: Re: 25.0.95;
 Prevent warnings when opening files during desktop restore
Date: Fri, 22 Jul 2016 19:57:09 +0000
[Message part 1 (text/plain, inline)]
Thanks!

On Fri, Jul 22, 2016 at 2:49 PM Stefan Monnier <monnier <at> iro.umontreal.ca>
wrote:

> > Can you please commit it to master when you get a chance?
>
> Done,
>
-- 

Kaushal Modi
[Message part 2 (text/html, inline)]

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

This bug report was last modified 9 years and 3 days ago.

Previous Next


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