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

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

Re: Help me unlock a file while in emacs on the Mac


From: Andrew Choi
Subject: Re: Help me unlock a file while in emacs on the Mac
Date: Wed, 07 May 2003 18:17:53 GMT
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

"Susan G. Conger" <congers@yoeric.com> writes:

> I need help.  I am trying to figure out the best way to unlock the file 
> I am currently editing in emacs on the Mac.  I need to have some type of 
> lisp command I believe that calls the shell and execute a command.  I 
> just don't know how to do this and it seems like it should be straight 
> forward.

I assume you want to unlock files with lock flags set in the Finder.
For read-only files, just use toggle-read-only.

Define the following two functions.

  (defun mac-unlock-file (fn)
    (interactive "fUnlock file: ")
    (call-process "/usr/bin/chflags" nil t nil "nouchg" (expand-file-name fn)))

  (defun mac-unlock-current-file ()
    (interactive)
    (mac-unlock-file (buffer-file-name)))

Then you can bind mac-unlock-current-file to a key (please see the
manual for how to do this) or just call it by typing M-x
mac-unlock-current-file.


reply via email to

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