From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andrew Choi Newsgroups: gmane.emacs.help Subject: Re: Help me unlock a file while in emacs on the Mac Date: Wed, 07 May 2003 18:17:53 GMT Organization: Shaw Residential Internet Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052331706 3572 80.91.224.249 (7 May 2003 18:21:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 7 May 2003 18:21:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 07 20:21:45 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19DTWx-0000rV-00 for ; Wed, 07 May 2003 20:20:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19DTX3-00051Y-02 for gnu-help-gnu-emacs@m.gmane.org; Wed, 07 May 2003 14:20:45 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!news3.calgary.shaw.ca.POSTED!not-for-mail X-Trace-PostClient-IP: 68.144.207.94 Original-Newsgroups: gnu.emacs.help Original-Lines: 24 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-NNTP-Posting-Host: 24.71.223.147 Original-X-Complaints-To: abuse@shaw.ca Original-X-Trace: news3.calgary.shaw.ca 1052331473 24.71.223.147 (Wed, 07 May 2003 12:17:53 MDT) Original-NNTP-Posting-Date: Wed, 07 May 2003 12:17:53 MDT Original-Xref: shelby.stanford.edu gnu.emacs.help:112904 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9399 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9399 "Susan G. Conger" 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.