unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* desktop.el - only one desktop file per directory?
@ 2010-01-23  0:16 Drew Adams
  2010-01-23  1:37 ` Drew Adams
  2010-01-23  2:38 ` Davis Herring
  0 siblings, 2 replies; 5+ messages in thread
From: Drew Adams @ 2010-01-23  0:16 UTC (permalink / raw)
  To: 'Emacs-Devel devel'

For anyone familiar with Desktop or its code -

(I tried contacting the author, but the email address for him in desktop.el is
apparently no longer valid.)

I haven't used desktop.el. I was thinking of using it from some Lisp code.
Looking over the code, it seems that it only allows for a single desktop file
per directory.

Is that right? If so, is it an important restriction (to maintain)?

With code I can of course create multiple desktop files in a dir. But
`desktop-read' seems to expect only one.

I guess I can plow through the `desktop-read' code and figure out which bits of
it I really need (beyond just calling `load' for the file). But I thought I'd
ask here first. Suggestions about which bits of the `desktop-read' code are
essential?

Is there a good reason that the basic functions don't just accept a (full) file
name (and potentially allow for multiple files per dir)?

Would the mere existence of more than one desktop file in some dir wreak havoc
with the normal use of Desktop (provided it is not pointed to such a dir and
thus left guessing)? Lock or owner problems, perhaps?





^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: desktop.el - only one desktop file per directory?
  2010-01-23  0:16 desktop.el - only one desktop file per directory? Drew Adams
@ 2010-01-23  1:37 ` Drew Adams
  2010-01-23  2:41   ` Davis Herring
  2010-01-23  2:38 ` Davis Herring
  1 sibling, 1 reply; 5+ messages in thread
From: Drew Adams @ 2010-01-23  1:37 UTC (permalink / raw)
  To: 'Emacs-Devel devel'

I did come up with something that seems to work OK.

But if someone has answers to any of the questions I posed, I'd still be
interested.

In particular, I'd like to know more about the potential problems of ignoring
(i.e. just releasing) locks and loading the same or another desktop file. I'm
not turning on `desktop-save-mode' at all; I'm just saving (without locking) and
loading desktop files willy-nilly. ;-)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: desktop.el - only one desktop file per directory?
  2010-01-23  0:16 desktop.el - only one desktop file per directory? Drew Adams
  2010-01-23  1:37 ` Drew Adams
@ 2010-01-23  2:38 ` Davis Herring
  1 sibling, 0 replies; 5+ messages in thread
From: Davis Herring @ 2010-01-23  2:38 UTC (permalink / raw)
  To: Drew Adams; +Cc: 'Emacs-Devel devel'

> For anyone familiar with Desktop or its code -

As a preliminary/cursory reply -

> (I tried contacting the author, but the email address for him in
> desktop.el is apparently no longer valid.)

I'm the maintainer for it now, I think.  I wrote the locking code, anyway.

> Is that right? If so, is it an important restriction (to maintain)?

You could let-bind `desktop-base-file-name', of course.  The reason it's
that way is basically the variable `desktop-path', so that Emacs can find
one of several desktop files (depending on the current directory) with
minimal user intervention.

> I guess I can plow through the `desktop-read' code and figure out
> which bits of it I really need (beyond just calling `load' for the
> file). But I thought I'd ask here first. Suggestions about which bits
> of the `desktop-read' code are essential?

If you ever have `desktop-restore-eager' non-t, the desktop file may just
set up requests to create buffers, and you'll still have to actually make
them.  You can just call `desktop-lazy-complete' to force it immediately.

> Is there a good reason that the basic functions don't just accept a (full)
> file name (and potentially allow for multiple files per dir)?

(See above.)

> Would the mere existence of more than one desktop file in some dir
> wreak havoc with the normal use of Desktop (provided it is not pointed
> to such a dir and thus left guessing)? Lock or owner problems,
> perhaps?

If it doesn't have the correct name, Desktop will obviously never know
it's there any more than it would any other random Elisp file.  Since
Desktop thinks there's just one per directory, it might cause an erroneous
lock collision if you were using a "real" desktop file and a faux desktop
file in the same directory, but you could just let-bind
`desktop-base-lock-name' (too) to avoid that.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: desktop.el - only one desktop file per directory?
  2010-01-23  1:37 ` Drew Adams
@ 2010-01-23  2:41   ` Davis Herring
  2010-01-23  5:12     ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Davis Herring @ 2010-01-23  2:41 UTC (permalink / raw)
  To: Drew Adams; +Cc: 'Emacs-Devel devel'

> In particular, I'd like to know more about the potential problems of
> ignoring (i.e. just releasing) locks and loading the same or another
> desktop file.  I'm not turning on `desktop-save-mode' at all; I'm just
> saving (without locking) and loading desktop files willy-nilly. ;-)

The only problem that comes immediately to mind is that `desktop-read'
moves the buffers it creates (eagerly, which is often all of them) to the
front of the buffer list, which might be undesired.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: desktop.el - only one desktop file per directory?
  2010-01-23  2:41   ` Davis Herring
@ 2010-01-23  5:12     ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2010-01-23  5:12 UTC (permalink / raw)
  To: herring; +Cc: 'Emacs-Devel devel'

Thanks to Davis for his replies about this.

If I have any more questions (none for the moment), I now know whom to follow up
with.

Thx - Drew





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-23  5:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-23  0:16 desktop.el - only one desktop file per directory? Drew Adams
2010-01-23  1:37 ` Drew Adams
2010-01-23  2:41   ` Davis Herring
2010-01-23  5:12     ` Drew Adams
2010-01-23  2:38 ` Davis Herring

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).