From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Session management patch, please comment. Date: Mon, 18 Feb 2002 23:37:06 -0700 (MST) Message-ID: <200202190637.g1J6b6E15641@santafe.santafe.edu> References: <200202171911.UAA02993@gaffa.gaia.swipnet.se> Reply-To: rms@gnu.org NNTP-Posting-Host: quimby2.netfonds.no X-Trace: quimby2.netfonds.no 1014101621 1556 195.204.10.66 (19 Feb 2002 06:53:41 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 19 Feb 2002 06:53:41 GMT Cc: emacs-devel@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16d49l-0000P0-00 for ; Tue, 19 Feb 2002 07:53:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16d3wO-0000P2-00; Tue, 19 Feb 2002 01:39:52 -0500 Original-Received: from pele.santafe.edu ([192.12.12.119]) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16d3tj-0008Vx-00; Tue, 19 Feb 2002 01:37:07 -0500 Original-Received: from santafe.santafe.edu (santafe [192.12.12.2]) by pele.santafe.edu (8.11.6+Sun/8.9.3) with ESMTP id g1J6b9u27722; Mon, 18 Feb 2002 23:37:09 -0700 (MST) Original-Received: (from rms@localhost) by santafe.santafe.edu (8.10.2+Sun/8.9.3) id g1J6b6E15641; Mon, 18 Feb 2002 23:37:06 -0700 (MST) X-Authentication-Warning: santafe.santafe.edu: rms set sender to rms@santafe using -f Original-To: Jan.Djarv@mbox200.swipnet.se In-reply-to: <200202171911.UAA02993@gaffa.gaia.swipnet.se> (Jan.Djarv@mbox200.swipnet.se) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1306 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1306 It is an amazingly large amount of code, but I suppose there is no easier way. What a pity. Did you copy any substantial part of it from the X distribution, or anywhere else? Or did you write all of it afresh? + DEFUN ("x-sm-interact-done", Fx_sm_interact_done, Sx_sm_interact_done, 1, 1, 0, + doc: /* End interaction as a response to save_yourself. + If the argument CANCEL is non-nil, Emacs will tell the session manager + to cancel the shutdown */) This isn't clear enough--it doesn't tell me when to use this function or how. Perhaps it would be clear to a person who knows this relates to the session manager *and* knows all about the session manager, but that is not good enough; this doc string ought to make sense to an ordinary Emacs Lisp programmer who knows nothing about the session manager. + doc: /* The previous session id Emacs got from session manager. + This is nil if Emacs was not started by the session manager. + The value of this variable and `x-sm-id' may be the same, depending on how + the session manager works. + See also `x-sm-id'.*/); This doc string should explain what the previous session id is good for. What does it mean? Documentation for data should explain its overall meaning, not just what it looks like and what values are found when. + DEFVAR_LISP ("x-sm-cancel-shutdown", &Vx_sm_cancel_shutdown, + doc: /* If non-nil, Emacs will cancel the session manager shutdown. + Setting this variable enables hooks in `save-yourself-hook' to cancel + a shutdown. This should only be done at an explicit user request to do + so.*/); When should the Lisp programmer set or use this? When is it tested? I don't see anything in the code that ever tests this variable, so I am at a loss to understand its purpose. + (defvar save-yourself-hook nil + "Hooks run when a save-yourself event occurs. + The hook gets one argument, the current session id. This is a string and + can for example, be used to create a unique file name.") Since this is not a normal hook, it should have a different name. Perhaps save-yourself-functions. But I think save-session-functions is a clearer name; it gives the user more information and is more natural. + (defvar restart-yourself-hook nil + "Hooks run when Emacs is started by a session manager.. + The hook gets two arguments, PREV-SESSID and SESSID. Likewise this. Perhaps restart-session-functions. In general, replacing "yourself" with "session" in all the function and variable names would be an improvement. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel