From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: desktop-files-not-to-save ignored for tramp files Date: Fri, 20 Feb 2009 18:27:43 +0100 Message-ID: <87y6w1t3w0.fsf@tux.homenetwork> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1235151325 1154 80.91.229.12 (20 Feb 2009 17:35:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Feb 2009 17:35:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 20 18:36:41 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LaZIY-0008UH-VW for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Feb 2009 18:36:27 +0100 Original-Received: from localhost ([127.0.0.1]:59965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaZHE-0002QS-5C for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Feb 2009 12:35:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaZGq-0002MM-51 for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 12:34:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaZGo-0002Kp-Tf for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 12:34:39 -0500 Original-Received: from [199.232.76.173] (port=49627 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaZGo-0002Kj-HY for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 12:34:38 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:57898 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LaZGo-0007VK-0N for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 12:34:38 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LaZGi-0002FC-06 for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 17:34:32 +0000 Original-Received: from 231.78.88-79.rev.gaoland.net ([79.88.78.231]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Feb 2009 17:34:31 +0000 Original-Received: from thierry.volpiatto by 231.78.88-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Feb 2009 17:34:31 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 231.78.88-79.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.90 (gnu/linux) Cancel-Lock: sha1:fdQ5E6c/Iwqmg9FTa4bRhVPpdUQ= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62232 Archived-At: 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 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