[Top][All Lists]

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

Re: desktop-files-not-to-save ignored for tramp files

From: Thierry Volpiatto
Subject: Re: desktop-files-not-to-save ignored for tramp files
Date: Fri, 20 Feb 2009 18:27:43 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.90 (gnu/linux)

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 <address@hidden> 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

reply via email to

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