all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: lekktu@gmail.com, emacs-devel@gnu.org
Subject: Re: A few questions about desktop.el
Date: Wed, 03 May 2006 15:48:57 +0300	[thread overview]
Message-ID: <877j55gb6p.fsf@jurta.org> (raw)
In-Reply-To: <E1FZV9K-0000NI-LC@fencepost.gnu.org> (Richard Stallman's message of "Fri, 28 Apr 2006 11:44:54 -0400")

>     Two things are done: first, a desktop file is modified when it is read
>     (without incident) to include a "in use" tag; further Emacses will
>     complain about this if they see it, and will leave the desktop file
>     unloaded unless the user accepts the collision risk.
>
> I think it is somewhat dangerous to modify the file when reading it.
> My experience tells me that that can lead to various problems in weird
> cases, and it is much better if operations that only look at data
> are written so that they do not change anything.
>
> Can you use a different file name for the "in use" marker?

Wouldn't it be better to use Emacs standard file locking mechanism,
i.e. after reading a desktop file to mark the desktop file's buffer
as modified?  This ensures that trying to save the desktop in another
Emacs session will raise a question about stealing/leaving the lock.

Another simpler solution (without touching the desktop file's buffer) is
to remember the desktop file's timestamp after reading it, and before
saving it compare it with the old timestamp, and ask the question about
whether to override it or not.

-- 
Juri Linkov
http://www.jurta.org/emacs/

  parent reply	other threads:[~2006-05-03 12:48 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-22  2:42 A few questions about desktop.el Juanma Barranquero
2005-07-22 10:53 ` Juanma Barranquero
2005-07-22 22:52   ` Richard M. Stallman
2005-07-26  8:56     ` Juanma Barranquero
2005-07-27 14:03       ` Richard M. Stallman
2005-07-27 14:28         ` Juanma Barranquero
2005-07-28  3:20           ` Richard M. Stallman
2005-07-28  7:34             ` David Kastrup
2005-07-28 12:51               ` Juanma Barranquero
2005-07-29  0:11               ` Richard M. Stallman
2005-07-28  3:20           ` Richard M. Stallman
2005-07-29  0:37             ` Juanma Barranquero
2005-07-28  4:24           ` Masatake YAMATO
2006-04-27 23:05           ` Stuart D. Herring
2006-04-28 14:56             ` Juanma Barranquero
2006-04-29  4:57               ` Stuart D. Herring
2006-04-30  1:16                 ` Juanma Barranquero
2006-05-02 15:06                   ` Stuart D. Herring
2006-05-02 15:14                     ` Juanma Barranquero
2006-05-02 15:42                       ` Stuart D. Herring
2006-05-02 17:57                         ` Stuart D. Herring
2006-04-28 15:44             ` Richard Stallman
2006-04-29  5:02               ` Stuart D. Herring
2006-04-30  3:03                 ` Richard Stallman
2006-05-03 12:48               ` Juri Linkov [this message]
2006-05-03 14:37                 ` Lars Hansen
2006-05-03 20:43                   ` Richard Stallman
2006-05-04 16:27                   ` Stuart D. Herring
2006-05-05  6:44                     ` Lars Hansen
2007-06-05  9:24                     ` Juanma Barranquero
2007-06-08 21:17                       ` Davis Herring
2007-06-08 21:29                         ` Juanma Barranquero
2007-06-08 22:05                           ` Davis Herring
2007-06-08 22:14                         ` Juri Linkov
2007-06-09  0:51                           ` Davis Herring
2007-06-09 21:31                             ` Juri Linkov
2007-06-10 23:28                               ` Juanma Barranquero
2007-06-11 20:54                                 ` Juri Linkov
2007-06-12 11:21                                   ` Juanma Barranquero
2006-05-04 16:17                 ` Stuart D. Herring
2005-08-08 15:02   ` Lars Hansen
2005-07-22 13:50 ` Juanma Barranquero
2005-07-22 14:36   ` Juanma Barranquero
2005-07-26  8:27     ` Juanma Barranquero
2005-08-08 15:04     ` Lars Hansen
2005-07-22 19:11 ` Lars Hansen
2005-07-22 21:24   ` Juanma Barranquero
2005-07-22 22:50 ` Richard M. Stallman
2005-07-26  9:11   ` Juanma Barranquero
2005-07-27 14:04     ` Richard M. Stallman
2005-07-27 14:16       ` Juanma Barranquero
2005-07-28  3:20         ` Richard M. Stallman
2005-07-29  0:44           ` Juanma Barranquero
2005-08-10  9:50         ` Lars Hansen
2005-08-10 11:24           ` Juanma Barranquero
2006-02-09 16:30             ` Juanma Barranquero
2006-02-09 20:00               ` Lars Hansen
2006-02-09 21:11               ` Lars Hansen
2006-02-09 23:46                 ` Juanma Barranquero
2005-08-10 22:05           ` Luc Teirlinck
2005-08-10 23:45             ` Luc Teirlinck
2005-08-11  1:12               ` Luc Teirlinck
2005-08-11  1:36                 ` Luc Teirlinck
2005-08-11  3:01                 ` Luc Teirlinck
2005-08-11  6:12                   ` Lars Hansen
2005-08-08 14:51 ` Lars Hansen
2005-08-08 18:35   ` Juanma Barranquero
2005-08-09  7:12     ` Lars Hansen
2005-08-09  7:36       ` Lars Hansen
2005-08-09  8:49       ` Juanma Barranquero
2005-08-09  9:31         ` David Kastrup
2005-08-09  9:59           ` Juanma Barranquero

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=877j55gb6p.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /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.