help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving window config using desktop globals


From: Emanuel Berg
Subject: Re: Saving window config using desktop globals
Date: Mon, 14 Dec 2015 00:41:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Tim Johnson <tim@akwebsoft.com> writes:

> :) I love your code and your enthusiasm for sharing
> it, but as you might see from my other reply,
> I really boogered my question and I should have said
> simply:
>
> "How do I save a register in a desktop file?" and if
> I can't "What are options for saving a window
> layout?" So Sorry.

"Desktop file" = ordinary file?

1. Write data:

(defun write-string-to-file (str file)
  "Write STR to FILE.
FILE is created if it doesn't exist, otherwise it is overwritten."
  (interactive "sstring: \nFfile: ")
  (with-temp-file file (insert str "\n") ))

2. Restore data:

(defun file-to-string (file)
  "Put the contents of FILE into a string and return it."
  (interactive "Ffile: ")
  (with-temp-buffer
    (insert-file-contents file)
    (buffer-string) ))

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]