all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Eli Zaretskii <eliz@gnu.org>
Cc: 27210@debbugs.gnu.org, ambrevar@gmail.com
Subject: bug#27210: 25.2; Recovering loaddefs.el with desktop-mode hangs when linum is on
Date: Sat, 03 Jun 2017 19:07:31 -0400	[thread overview]
Message-ID: <874lvw1xho.fsf@users.sourceforge.net> (raw)
In-Reply-To: <877f0s26j9.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 03 Jun 2017 15:52:10 -0400")

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

npostavs@users.sourceforge.net writes:

> Because the hidden "F1" frame clearly isn't actually visible (and we
> don't need to show line numbers on it).  But that just triggers
> Bug#26912 "desktop-clear with emacs as daemon results in error on C-x 5
> 0" even without desktop-clear, so it's not an acceptable solution by
> itself at least.

I've expanded on this approach, it seems to work, though it's possible
I'm overlooking some other place that assumes the initial frame is
visible.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 2651 bytes --]

From 129862e0621bf16e20ecc433e427b66626ba9bb8 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Sat, 3 Jun 2017 17:59:17 -0400
Subject: [PATCH v1] Make the initial frame invisible when in daemon mode
 (Bug#27210)

* src/emacs.c (main): When starting as a daemon, add `daemonp'
parameter to the initial frame.
* src/frame.c (make_initial_frame): Set the initial frame as
nonvisible when running in daemon mode.
(other_frames): Return true if one of the other frames has a non-nil
`daemonp' frame parameter.
(delete_frame): Don't allow deleting a frame with a `daemonp'
parameter.
---
 src/emacs.c | 3 +++
 src/frame.c | 9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/emacs.c b/src/emacs.c
index 49ebb81767..04bdf9ecdb 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1170,6 +1170,8 @@ main (int argc, char **argv)
 #endif /* MSDOS */
       if (dname_arg)
 	daemon_name = xstrdup (dname_arg);
+      Fmodify_frame_parameters (Qnil, Fcons (Fcons (Qdaemonp, Fdaemonp ()),
+                                             Fframe_parameters (Qnil)));
     }
 
 #if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC \
@@ -2486,6 +2488,7 @@ syms_of_emacs (void)
   DEFSYM (Qrisky_local_variable, "risky-local-variable");
   DEFSYM (Qkill_emacs, "kill-emacs");
   DEFSYM (Qkill_emacs_hook, "kill-emacs-hook");
+  DEFSYM (Qdaemonp, "daemonp");
 
 #ifndef CANNOT_DUMP
   defsubr (&Sdump_emacs);
diff --git a/src/frame.c b/src/frame.c
index 4d17a071dc..4c670b5c7a 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -903,7 +903,7 @@ make_initial_frame (void)
   tty_frame_count = 1;
   fset_name (f, build_pure_c_string ("F1"));
 
-  SET_FRAME_VISIBLE (f, 1);
+  SET_FRAME_VISIBLE (f, !IS_DAEMON);
 
   f->output_method = terminal->type;
   f->terminal = terminal;
@@ -1605,7 +1605,10 @@ other_frames (struct frame *f, bool invisible, bool force)
 		      && (force
 			  /* Allow deleting the terminal frame when at
 			     least one X frame exists.  */
-			  || (FRAME_WINDOW_P (f1) && !FRAME_WINDOW_P (f))))))
+                          || (FRAME_WINDOW_P (f1) && !FRAME_WINDOW_P (f))
+                          /* Allow deleting the last frame if a
+                             "daemon frame" exists.  */
+                          || !NILP (Fframe_parameter (frame1, Qdaemonp))))))
 	    return true;
 	}
     }
@@ -1685,6 +1688,8 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
       else
 	error ("Attempt to delete the only frame");
     }
+  else if (IS_DAEMON && !NILP (Fframe_parameter (frame, Qdaemonp)))
+      error ("Attempt to delete daemon's frame");
 
   XSETFRAME (frame, f);
 
-- 
2.11.1


  reply	other threads:[~2017-06-03 23:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-03 14:29 bug#27210: 25.2; Recovering loaddefs.el with desktop-mode hangs when linum is on Pierre Neidhardt
2017-06-03 14:56 ` Eli Zaretskii
2017-06-03 16:22   ` Pierre Neidhardt
2017-06-03 17:43     ` npostavs
2017-06-03 18:02       ` Eli Zaretskii
2017-06-03 18:38         ` Eli Zaretskii
2017-06-03 19:52           ` npostavs
2017-06-03 23:07             ` npostavs [this message]
2017-06-04 14:15               ` Eli Zaretskii
2017-06-04 15:08                 ` npostavs
2017-06-04 16:31                   ` Eli Zaretskii

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=874lvw1xho.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=27210@debbugs.gnu.org \
    --cc=ambrevar@gmail.com \
    --cc=eliz@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.