unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>
Cc: klaus.berndl@capgemini-sdm.com, sperber@deinprogramm.de,
	lennart.borgman@gmail.com, emacs-devel@gnu.org
Subject: RE: read syntax for window configs
Date: Sat, 6 Mar 2010 11:32:26 -0800	[thread overview]
Message-ID: <8FE0E48DBF9E4A618C50413475DD174F@us.oracle.com> (raw)
In-Reply-To: <87bpf1a4l5.fsf@mail.jurta.org>

> > Read syntax for window (and frame) configs would be very welcome.
> >
> > Currently, we have things like desktop.el that save some 
> > session state, but they don't save window/frame configs.
> 
> There is a task in etc/TODO:
> 
>   ** Make desktop.el save the "frame configuration" of Emacs (in some
>     useful sense).

Better to separate that feature out. Have a separate feature (library) to save
window/frame configs. And then let desktop.el optionally make use of that
separate feature.

IOW, saving/restoring buffers, variables, etc. (what desktop does today) is
different from saving/restoring window/frame configs. There is no reason to
couple them by putting them in the same library - no reason to require code that
needs only one of the features to load a big library that does both.

> > FWIW, one of my libraries bookmarks desktops, so you can 
> > more easily switch among different contexts (desktop files).
> 
> This looks like another task in etc/TODO:
> 
>   ** Give desktop.el a feature to switch between different named
>     desktops.

Desktop has an unfortunate limitation (IMO) that is also, it seems, somewhat
gratuitous: It expects (and therefore pretty much requires) only one desktop
file per directory. All of the desktop.el functions are written that way - they
drive off of a directory name. 

That means that trying to use the desktop.el code to do something more flexible,
switching among arbitrary desktop files located anywhere, is ugly. My code has
to jump through some otherwise unnecessary hoops to do this. I had to duplicate
and modify some of the desktop.el code, just to get around this function
interface.

Anyway, the TODO item you cite is fine, but a welcome preliminary TODO item
would be to change the desktop.el functions to accept (at least optionally) a
desktop file location (file name), and not just rely on a directory.

See also thread "desktop.el - only one desktop file per directory?",
http://lists.gnu.org/archive/html/emacs-devel/2010-01/msg01112.html

---

FWIW, my bookmark code is a trivial extension to bookmark.el, which defines a
`desktop' bookmark type. I just define:

1. A command to set a desktop bookmark (reads a file name and writes a desktop
file).

2. A function to make a desktop bookmark record ( records the desktop file and a
desktop bookmark handler).

3. A desktop bookmark handler (gets the desktop file name from the bookmark and
changes to that saved desktop).

The code is here:
http://www.emacswiki.org/emacs/bookmark%2b.el

Because I allow multiple desktop files per dir, the code for #1 and #3 is more
involved that it should need to be. With more reasonable desktop.el functions,
which accepted a desktop file name, it would be short and simple.

Note: My code doesn't worry about multiple users and sessions wrt locks - it is
rudimentary (hence fragile) wrt locking. While I allow multiple desktop files
per dir, I haven't bothered to try to handle multiple lock files per dir etc.

Really, it is an individual desktop file (not a directory) that should have an
associated lock. Truly breaking with the current directory-level granularity
would require handling locks on a per-file basis, I imagine (but I'm no expert
on how the locking works).

If the TODO item I proposed were implemented, then the necessary file-level
locking would hopefully be taken care of also.







  reply	other threads:[~2010-03-06 19:32 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 18:53 Fwd: CEDET sync Lluís
2010-03-01 18:59 ` Chong Yidong
2010-03-01 19:36   ` Lennart Borgman
2010-03-01 21:27   ` Stefan Monnier
2010-03-01 22:07     ` Fabian Ezequiel Gallina
2010-03-01 22:42     ` Eric M. Ludlam
2010-03-02  7:58       ` AW: " Berndl, Klaus
2010-03-02  8:51         ` Stephen J. Turnbull
2010-03-02  9:35           ` David Kastrup
2010-03-02  9:43             ` Lennart Borgman
2010-03-02 10:36               ` AW: " Berndl, Klaus
2010-03-02 10:43                 ` Lennart Borgman
2010-03-02 11:08                   ` AW: " Berndl, Klaus
2010-03-02 21:03                     ` Juri Linkov
2010-03-03  3:20                       ` Stephen J. Turnbull
2010-03-05 13:45                         ` Michael Sperber
2010-03-05 17:07                           ` read syntax for window configs (was: CEDET sync) Drew Adams
2010-03-05 17:48                             ` Lennart Borgman
2010-03-06 17:44                               ` read syntax for window configs Juri Linkov
2010-03-06 17:48                             ` Juri Linkov
2010-03-06 19:32                               ` Drew Adams [this message]
2010-03-18 16:07                             ` Michael Sperber
2010-03-18 16:41                               ` Drew Adams
2010-03-19 10:48                               ` martin rudalics
2010-03-19 11:09                                 ` Michael Sperber
2010-03-19 13:07                                   ` martin rudalics
2010-03-19 15:31                                     ` Michael Sperber
2010-03-02 11:13                   ` AW: Fwd: CEDET sync Richard Riley
2010-03-02 11:42                     ` David Kastrup
2010-03-02 15:23             ` Stephen J. Turnbull
2010-03-02 16:06               ` David Kastrup
2010-03-02 17:20                 ` Stephen J. Turnbull
2010-03-02 17:58                   ` David Kastrup
2010-03-03  3:51                     ` Stephen J. Turnbull
2010-03-02 18:40                   ` OT: threats to Free Software (was: AW: Fwd: CEDET sync) Stefan Monnier
2010-03-02 19:33                     ` Lennart Borgman
2010-03-02 22:07                     ` David Reitter
2010-03-03 22:48                       ` Richard Stallman
2010-03-03  4:00                     ` Stephen J. Turnbull
2010-03-03 22:48                       ` Richard Stallman
2010-03-03 10:37                     ` Richard Stallman
2010-03-03 10:37                   ` AW: Fwd: CEDET sync Richard Stallman
2010-03-03 18:37                     ` Stephen J. Turnbull
2010-03-03 19:00                       ` Chong Yidong
2010-03-05 20:05                       ` Richard Stallman
2010-03-06  4:29                         ` Stephen J. Turnbull
2010-03-06  7:45                           ` David Kastrup
2010-03-03  7:07               ` joakim
2010-03-02 15:25         ` Stefan Monnier
2010-03-02 15:59           ` AW: " Berndl, Klaus
2010-03-02 16:08             ` Chong Yidong
2010-03-02 16:44               ` Stephen J. Turnbull
2010-03-02 20:28                 ` Chong Yidong
2010-03-03  4:06                   ` Stephen J. Turnbull
2010-03-03  4:47                     ` Miles Bader
2010-03-03  7:21                       ` Stephen J. Turnbull
2010-03-03 15:45                         ` Chong Yidong
2010-03-03  7:41                     ` David Kastrup
2010-03-03  8:51                       ` Stephen J. Turnbull
2010-03-03  9:10                       ` tomas
2010-03-03 10:02                         ` David Kastrup
2010-03-03 16:51                           ` Stephen J. Turnbull
2010-03-02 18:45             ` Stefan Monnier
2010-03-03 10:38           ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8FE0E48DBF9E4A618C50413475DD174F@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=klaus.berndl@capgemini-sdm.com \
    --cc=lennart.borgman@gmail.com \
    --cc=sperber@deinprogramm.de \
    /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 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).