From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Nordl=F6w?= Newsgroups: gmane.emacs.help Subject: Auto-Prompt for Password and Raise Privilegies when needed Date: Mon, 3 May 2010 09:50:22 -0700 (PDT) Organization: http://groups.google.com Message-ID: <146fc610-6a5e-4607-b61d-248c926f1d67@b7g2000yqk.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273016791 10541 80.91.229.12 (4 May 2010 23:46:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 23:46:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 05 01:46:30 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1O9Ror-00017N-CH for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 01:46:29 +0200 Original-Received: from localhost ([127.0.0.1]:40010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9Roq-0001jw-Ti for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 19:46:28 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!b7g2000yqk.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1272905423 15933 127.0.0.1 (3 May 2010 16:50:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 3 May 2010 16:50:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b7g2000yqk.googlegroups.com; posting-host=150.227.15.253; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-Via: 1.1 ip1-w.foi.se:8080 (IronPort-WSA/6.3.3-015) X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.7 (KHTML, like Gecko) Chrome/5.0.391.0 Safari/533.7,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177890 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:73301 Archived-At: The Finder in Mac OS X is very much ahead of everything else when it comes to cleverness in auto-raising the user when needed to reach or execute resources that require other privilegies than the current. I tried to teach new Emacs user to remember the tramp-prefix /sudo:: or /su:: but unfortunately many users (ever engineers) are to lazy to remember these things and in stressed situations they tend to revert to really cumbersome and error-prone alternatives using copy, edit elsewhere and copy-back which unfortunately may change permissions and modes on the file. Instead I really believe Emacs should use the Mac OS x way of thinking when opening and modifying files (using find-file and alikes) that are owned by other users. When we try to edit a file that is owned by another user but writable by the current user Emacs (through TRAMP) should ask for the password of the user owning the file and then reopen the file by adding TRAMP- sudo/su-prefix to the url. I strongly believe this should be default behavior in Emacs. The implement this we need a hook that is called every time the user tries to change the content of the file. How do define that function? I grepped for the string Buffer is read-only in the emacs cvs sources. This is printed each time we try to modify a buffer that is read-only. This is an internal string. Do we have to modify the builtins in this case? Or is there another way of solving this problem? Thanks in advance for any comments, Per Nordl=F6w