I was referring to saved-default-directory, not default directory.

Troy

From: Uwe Brauer [mailto:o...@mat.ucm.es]
Sent: Thursday, June 25, 2015 10:52 AM
To: Daniels, Troy (US)
Cc: matlab-emacs-discuss@lists.sourceforge.net
Subject: Re: [Matlab-emacs-discuss] partial solution

On 06/25/2015 04:47 PM, Daniels, Troy (US) wrote:

The only change that I would make is:



(defun my-matlab-switch-and-save-default-directory ()

    (interactive)

    (let ((saved-default-directory default-directory))

  (switch-to-buffer "*MATLAB*")

                (setq default-directory saved-default-directory)))



By using let, you don't permanently change the value of the variable (if it 
already existed for some other code) and you don't add a new variable if it 
didn't.

right, however default-directory, is overwritten everytime you open a new 
buffer.
so this setting is anyhow temporal.

Uwe






Troy



-----Original Message-----

From: Uwe Brauer [mailto:o...@mat.ucm.es]

Sent: Thursday, June 25, 2015 5:35 AM

To: matlab-emacs

Subject: [Matlab-emacs-discuss] partial solution



*** WARNING ***

This message originates from outside our organization, either from an external 
partner or the internet. Consider carefully whether you should click on any 
links, open any attachments or reply. For additional information about 
Spearphishing, click here 
<http://intranet.ent.baesystems.com/howwework/security/spotlights/Pages/SpearphishingTips.aspx><http://intranet.ent.baesystems.com/howwework/security/spotlights/Pages/SpearphishingTips.aspx>.
 If you feel the email is suspicious, please follow this process. 
<http://intranet.ent.baesystems.com/howwework/security/spotlights/Documents/Dealing%20With%20Suspicious%20Emails.pdf><http://intranet.ent.baesystems.com/howwework/security/spotlights/Documents/Dealing%20With%20Suspicious%20Emails.pdf>



Hello



To answer my own question, the following hack does what I want:



(defun my-matlab-switch-and-save-default-directory ()

    (interactive)

    (setq saved-default-directory default-directory)

        (switch-to-buffer "*MATLAB*")

    (setq default-directory saved-default-directory))



Maybe somebody with real lips skills could improve the code.



regards



Uwe Brauer





------------------------------------------------------------------------------

Monitor 25 network devices or servers for free with OpManager!

OpManager is web-based network management software that monitors network 
devices and physical & virtual servers, alerts via email & sms for fault. 
Monitor 25 devices for free with no restriction. Download now 
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o

_______________________________________________

Matlab-emacs-discuss mailing list

Matlab-emacs-discuss@lists.sourceforge.net<mailto:Matlab-emacs-discuss@lists.sourceforge.net>

https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss



------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to