From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: desktop-files-not-to-save ignored for tramp files
Date: Fri, 20 Feb 2009 18:27:43 +0100 [thread overview]
Message-ID: <87y6w1t3w0.fsf@tux.homenetwork> (raw)
In-Reply-To: a06f430f0902200709g57a6689fv4821f756e7ae1bf2@mail.gmail.com
Hi, i send the code i use for that here, i sent it also
to the tramp mailing list yesterday i think.
`desktop-files-not-to-save' never work for me
so i use this code:
,----
| (defun tv-list-tramp-buffer-file-name ()
| (let* ((desktop-info-list (mapcar #'desktop-buffer-info (buffer-list)))
| (tramp-buf-list (loop for i in desktop-info-list
| if (and (listp i)
| (stringp (car (nth 8 i)))
| (string-match "^/su:.*\\|^/sudo:.*\\|^/ssh:.*" (car (nth 8 i))))
| collect (nth 2 i))))
| tramp-buf-list))
|
| (add-hook 'desktop-save-hook #'(lambda ()
| (let ((del-buf-list
| (tv-list-tramp-buffer-file-name)))
| (dolist (i del-buf-list)
| (kill-buffer i)))))
`----
Nurullah Akkaya <nurullah.akkaya@blooby.com> writes:
> I edit various files using tramp, i am on a slow connection thus want to
> avoid saving remote files while exiting.
> the default value for desktop-files-not-to-save is "^/[^/:]*:" when i check
> the regex using list buffers it does match tramp files
> but they are still saved when i exit emacs. is there another way to make
> desktop-mode skip tramp files?
>
> i have the following in my .emacs for loading desktop.
>
> ;;destop mode
> (load "desktop")
> (desktop-load-default)
> ;(desktop-read)
> ;; automatically save the desktop on exit.
> (setq desktop-enable t)
> ;;save where we left cursor in file on kill
> (require 'saveplace)
> (setq-default save-place t)
>
> thanks...
--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France
next prev parent reply other threads:[~2009-02-20 17:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 15:09 desktop-files-not-to-save ignored for tramp files Nurullah Akkaya
2009-02-20 16:05 ` Juanma Barranquero
2009-02-20 16:18 ` Nurullah Akkaya
2009-02-20 17:02 ` Peter Dyballa
2009-02-20 17:27 ` Thierry Volpiatto [this message]
2009-02-21 10:57 ` Michael Albinus
2009-02-21 11:10 ` Thierry Volpiatto
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=87y6w1t3w0.fsf@tux.homenetwork \
--to=thierry.volpiatto@gmail.com \
--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.