all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Saving window config using desktop globals
Date: Mon, 14 Dec 2015 00:20:57 +0100	[thread overview]
Message-ID: <87d1uahr52.fsf@debian.uxu> (raw)
In-Reply-To: 87io42hsoi.fsf@debian.uxu

Emanuel Berg <embe8573@student.uu.se> writes:

> (defvar *default-window-configuration-register* ?0)
>
> (defun save-window-configuration (&optional register)
>    (interactive "P")
>    (window-configuration-to-register
>     (or register *default-window-configuration-register* )))
>
> (defun restore-window-configuration (&optional register)
>   (interactive "P")
>   (jump-to-register
>    (or register *default-window-configuration-register* )))

OK, that doesn't work for interactive use 'cept for
the default call... which is the one I just said one
should stick to, still, if the code is there, it
should work for all uses, for sure.

I suppose this solves that but now you have to pass
registers as lists from Elisp. Perhaps do the
interactive "p" and/or do type checks. I'll leave it
at that at least for tonight...

(defun save-window-configuration (&optional register)
  (interactive "P")
  (window-configuration-to-register
   (or (car register)
       *default-window-configuration-register* )))

(defun restore-window-configuration (&optional register)
  (interactive "P")
  (jump-to-register
   (or (car register)
       *default-window-configuration-register* )))

-- 
underground experts united
http://user.it.uu.se/~embe8573




  reply	other threads:[~2015-12-13 23:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13 19:30 Saving window config using desktop globals Tim Johnson
2015-12-13 20:35 ` Tim Johnson
2015-12-13 22:47 ` Emanuel Berg
2015-12-13 23:20   ` Emanuel Berg [this message]
2015-12-13 23:28     ` Emanuel Berg
2015-12-13 23:33       ` Tim Johnson
2015-12-13 23:41         ` Emanuel Berg
2015-12-13 23:48           ` Tim Johnson
2015-12-14  0:20             ` Emanuel Berg
2015-12-14  0:47               ` Tim Johnson
2015-12-14  0:57                 ` Emanuel Berg
2015-12-14  1:28                   ` Tim Johnson
2015-12-15  0:09                     ` [closed]Re: " Tim Johnson
2015-12-15  4:40                       ` Stefan Monnier
2015-12-16  2:27                       ` Emanuel Berg
2015-12-15  4:13                     ` Emanuel Berg
2015-12-13 23:27   ` Tim Johnson
2015-12-13 23:34     ` Emanuel Berg

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=87d1uahr52.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@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.