all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mac terminal.app: starting emacs, possibly as sudo
@ 2011-10-16 22:26 Marius Hofert
  2011-10-16 23:26 ` Perry Smith
  2011-10-16 23:43 ` Peter Dyballa
  0 siblings, 2 replies; 18+ messages in thread
From: Marius Hofert @ 2011-10-16 22:26 UTC (permalink / raw)
  To: Emacs help

Hi,

If I start "emacs" from the Mac terminal (Terminal.app), I get a rather old GNU Emacs 22.1.1 (/usr/bin/emacs) instead of the wonderful new GNU Emacs 23.3 I installed. 
1) How can I have the new emacs version opened when typing "emacs" in the terminal? 
2) Is it possible to start emacs in "sudo mode", so starting  emacs via "sudo emacs" in the terminal (and then being root when opening a shell from within emacs)?
I know I can have 1) by typing "open -a Emacs.app", but that does not allow 2). 

Cheers,

Marius


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-16 22:26 Mac terminal.app: starting emacs, possibly as sudo Marius Hofert
@ 2011-10-16 23:26 ` Perry Smith
  2011-10-17  7:37   ` Marius Hofert
  2011-10-16 23:43 ` Peter Dyballa
  1 sibling, 1 reply; 18+ messages in thread
From: Perry Smith @ 2011-10-16 23:26 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help


On Oct 16, 2011, at 5:26 PM, Marius Hofert wrote:

> Hi,
> 
> If I start "emacs" from the Mac terminal (Terminal.app), I get a rather old GNU Emacs 22.1.1 (/usr/bin/emacs) instead of the wonderful new GNU Emacs 23.3 I installed. 
> 1) How can I have the new emacs version opened when typing "emacs" in the terminal? 
> 2) Is it possible to start emacs in "sudo mode", so starting  emacs via "sudo emacs" in the terminal (and then being root when opening a shell from within emacs)?
> I know I can have 1) by typing "open -a Emacs.app", but that does not allow 2). 

This may take a little experimentation.  I have emacs 23.something compiled for Mac.  I have an application bundle in /Applications called Emacs.app.

If I run /Applications/Emacs.app/Contents/MacOS/bin/emacs, it starts up in the terminal.  If I run /Applications/Emacs.app/Contents/MacOS/Emacs it runs as a GUI (like open -a Emacs.app).

By running the bin/emacs, you can do sudo before hand and it will give you a root shell prompt (I just tested it.) Be aware that it will be using root's .emacs or .emacs.d files -- not yours.

The final thing you need is to either make an alias in your .bashrc file -- something like:

alias emacs=/Applications/Emacs.app/Contents/MacOS/bin/emacs

or you can change your PATH to point to /Applications/Emacs.app/Contents/MacOS/bin before /usr/bin

I'm not sure the alias will work with sudo.  Changing the path might be better.  aliases are weird critters.

HTH,
pedz




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-16 22:26 Mac terminal.app: starting emacs, possibly as sudo Marius Hofert
  2011-10-16 23:26 ` Perry Smith
@ 2011-10-16 23:43 ` Peter Dyballa
  2011-10-17  7:34   ` Marius Hofert
  1 sibling, 1 reply; 18+ messages in thread
From: Peter Dyballa @ 2011-10-16 23:43 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help


Am 17.10.2011 um 00:26 schrieb Marius Hofert:

> 1) How can I have the new emacs version opened when typing "emacs" in the terminal? 

Either reorder PATH or use the whole path to the executable! Or use a shell alias...

> 2) Is it possible to start emacs in "sudo mode", so starting  emacs via "sudo emacs" in the terminal (and then being root when opening a shell from within emacs)?

It won't work with the NS and "AppKit" variants (do you know of any "native" mac OS X GUI application that you can launch with sudo and then runs with elevated privileges?), it works with the X client and also without windowing system (in terminal).

--
Mit friedvollen Grüßen

  Pete

If all else fails read the instructions.
				- Donald Knuth




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-16 23:43 ` Peter Dyballa
@ 2011-10-17  7:34   ` Marius Hofert
  2011-10-17  8:07     ` Michael Albinus
  2011-10-17 10:34     ` Peter Dyballa
  0 siblings, 2 replies; 18+ messages in thread
From: Marius Hofert @ 2011-10-17  7:34 UTC (permalink / raw)
  To: Peter Dyballa, Perry Smith; +Cc: Emacs help

Dear Perry, Dear Peter,

thanks a lot for helping.

I tried sudo /Applications/Emacs.app/Contents/MacOS/bin/emacs and I am indeed root in the shell :-) 
There are some things that are strange, though: Option/Alt is not Meta anymore, so when I wanted to start a shell with M-x ... I obtained a "=" symbol (or rather, an "approximate" symbol). I realized that ESC is now Meta. 
=> Are there any other significant changes I should be aware of?
=> Is it possible to get the same/similar behavior as in the GUI, maybe through simply redefining root's .emacs and .emacs.d as my own? (bad practice?)

Well, maybe I should rethink the whole process: When do I want to open emacs as root? From time to time, I open a file and modify it. When I try to save it, I get the read-only warning. This means I would like to be su to modify this file. It's probably best to just open it with C-x C-f /sudo::path-to-file... But by closing and reopening all my modifications to the file are lost. How can one avoid this?


Cheers,

Marius



On 2011-10-17, at 01:43 , Peter Dyballa wrote:

> 
> Am 17.10.2011 um 00:26 schrieb Marius Hofert:
> 
>> 1) How can I have the new emacs version opened when typing "emacs" in the terminal? 
> 
> Either reorder PATH or use the whole path to the executable! Or use a shell alias...
> 
>> 2) Is it possible to start emacs in "sudo mode", so starting  emacs via "sudo emacs" in the terminal (and then being root when opening a shell from within emacs)?
> 
> It won't work with the NS and "AppKit" variants (do you know of any "native" mac OS X GUI application that you can launch with sudo and then runs with elevated privileges?), it works with the X client and also without windowing system (in terminal).
> 
> --
> Mit friedvollen Grüßen
> 
>  Pete
> 
> If all else fails read the instructions.
> 				- Donald Knuth
> 





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-16 23:26 ` Perry Smith
@ 2011-10-17  7:37   ` Marius Hofert
  2011-10-17 10:36     ` Peter Dyballa
  0 siblings, 1 reply; 18+ messages in thread
From: Marius Hofert @ 2011-10-17  7:37 UTC (permalink / raw)
  To: Perry Smith, Peter Dyballa; +Cc: Emacs help

Oh, and something else: Instead of adding /Applications/Emacs.app/Contents/MacOS/bin/emacs to PATH (before /usr/bin), can't one just remove /usr/bin/emacs and create a link to /Applications/Emacs.app/Contents/MacOS/bin/emacs?
There are also emacs-undumped and emacsclient in /usr/bin, not sure what they are for, though.

On 2011-10-17, at 01:26 , Perry Smith wrote:

> 
> On Oct 16, 2011, at 5:26 PM, Marius Hofert wrote:
> 
>> Hi,
>> 
>> If I start "emacs" from the Mac terminal (Terminal.app), I get a rather old GNU Emacs 22.1.1 (/usr/bin/emacs) instead of the wonderful new GNU Emacs 23.3 I installed. 
>> 1) How can I have the new emacs version opened when typing "emacs" in the terminal? 
>> 2) Is it possible to start emacs in "sudo mode", so starting  emacs via "sudo emacs" in the terminal (and then being root when opening a shell from within emacs)?
>> I know I can have 1) by typing "open -a Emacs.app", but that does not allow 2). 
> 
> This may take a little experimentation.  I have emacs 23.something compiled for Mac.  I have an application bundle in /Applications called Emacs.app.
> 
> If I run /Applications/Emacs.app/Contents/MacOS/bin/emacs, it starts up in the terminal.  If I run /Applications/Emacs.app/Contents/MacOS/Emacs it runs as a GUI (like open -a Emacs.app).
> 
> By running the bin/emacs, you can do sudo before hand and it will give you a root shell prompt (I just tested it.) Be aware that it will be using root's .emacs or .emacs.d files -- not yours.
> 
> The final thing you need is to either make an alias in your .bashrc file -- something like:
> 
> alias emacs=/Applications/Emacs.app/Contents/MacOS/bin/emacs
> 
> or you can change your PATH to point to /Applications/Emacs.app/Contents/MacOS/bin before /usr/bin
> 
> I'm not sure the alias will work with sudo.  Changing the path might be better.  aliases are weird critters.
> 
> HTH,
> pedz
> 





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  7:34   ` Marius Hofert
@ 2011-10-17  8:07     ` Michael Albinus
  2011-10-17  8:29       ` Marius Hofert
  2011-10-17 13:34       ` Perry Smith
  2011-10-17 10:34     ` Peter Dyballa
  1 sibling, 2 replies; 18+ messages in thread
From: Michael Albinus @ 2011-10-17  8:07 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help

Marius Hofert <marius.hofert@math.ethz.ch> writes:

> Dear Perry, Dear Peter,

Hi,

> Well, maybe I should rethink the whole process: When do I want to open
> emacs as root? From time to time, I open a file and modify it. When I
> try to save it, I get the read-only warning. This means I would like
> to be su to modify this file. It's probably best to just open it with
> C-x C-f /sudo::path-to-file... But by closing and reopening all my
> modifications to the file are lost. How can one avoid this?

If you edit file /a/b/c and you cannot save it because it is owned by
root, you could save it by "C-x C-w /sudo::/a/b/c".

> Cheers,
>
> Marius

Best regards, Michael.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  8:07     ` Michael Albinus
@ 2011-10-17  8:29       ` Marius Hofert
  2011-10-17  8:32         ` Michael Albinus
  2011-10-17 13:34       ` Perry Smith
  1 sibling, 1 reply; 18+ messages in thread
From: Marius Hofert @ 2011-10-17  8:29 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs help

Dear Michael,

1) thanks a lot, that will definitely be useful in the future!

2) Concerning my last question: Is there any harm in "replacing" /usr/bin/emacs by /Applications/Emacs.app/Contents/MacOS/Emacs? This way one can easily use "sudo emacs" or "emacs -Q"... and start the GUI emacs with these features.

Cheers,

Marius


On 2011-10-17, at 10:07 , Michael Albinus wrote:

> Marius Hofert <marius.hofert@math.ethz.ch> writes:
> 
>> Dear Perry, Dear Peter,
> 
> Hi,
> 
>> Well, maybe I should rethink the whole process: When do I want to open
>> emacs as root? From time to time, I open a file and modify it. When I
>> try to save it, I get the read-only warning. This means I would like
>> to be su to modify this file. It's probably best to just open it with
>> C-x C-f /sudo::path-to-file... But by closing and reopening all my
>> modifications to the file are lost. How can one avoid this?
> 
> If you edit file /a/b/c and you cannot save it because it is owned by
> root, you could save it by "C-x C-w /sudo::/a/b/c".
> 
>> Cheers,
>> 
>> Marius
> 
> Best regards, Michael.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  8:29       ` Marius Hofert
@ 2011-10-17  8:32         ` Michael Albinus
  2011-10-17  9:13           ` Marius Hofert
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Albinus @ 2011-10-17  8:32 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help

Marius Hofert <marius.hofert@math.ethz.ch> writes:

> Dear Michael,

Hi Marius,

> 2) Concerning my last question: Is there any harm in "replacing"
> /usr/bin/emacs by /Applications/Emacs.app/Contents/MacOS/Emacs? This
> way one can easily use "sudo emacs" or "emacs -Q"... and start the GUI
> emacs with these features.

No idea, I do not use Mac.

> Cheers,
>
> Marius

Best regards, Michael.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  8:32         ` Michael Albinus
@ 2011-10-17  9:13           ` Marius Hofert
  2011-10-17 10:38             ` Peter Dyballa
  0 siblings, 1 reply; 18+ messages in thread
From: Marius Hofert @ 2011-10-17  9:13 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs help

okay, I tried:

cd /usr/bin
sudo mv ./emacs ./emacs.old # move pre-installed emacs
sudo ln -s /Applications/Emacs.app/Contents/MacOS/emacs emacs

Starting "emacs" from a new terminal then opened emacs, but ended up in a mess:
localhost:~ mhofert$ emacs
Warning: arch-dependent data dir (/Users/david/src/emacs-dev/ftp-versions/emacs-23.3/nextstep/Emacs.app/Contents/MacOS/libexec/emacs/23.3/x86_64-apple-darwin/) does not exist.
Warning: arch-independent data dir (/Users/david/src/emacs-dev/ftp-versions/emacs-23.3/nextstep/Emacs.app/Contents/Resources/share/emacs/23.3/etc/) does not exist.
Error: charsets directory (/Users/david/src/emacs-dev/ftp-versions/emacs-23.3/nextstep/Emacs.app/Contents/Resources/share/emacs/23.3/etc/charsets) does not exist.
Emacs will not function correctly without the character map files.
Please check your installation!
Warning: Could not find simple.el nor simple.elc

Any ideas?
/Applications/Emacs.app/Contents/MacOS/emacs works fine, though.

Cheers,

Marius

On 2011-10-17, at 10:32 , Michael Albinus wrote:

> Marius Hofert <marius.hofert@math.ethz.ch> writes:
> 
>> Dear Michael,
> 
> Hi Marius,
> 
>> 2) Concerning my last question: Is there any harm in "replacing"
>> /usr/bin/emacs by /Applications/Emacs.app/Contents/MacOS/Emacs? This
>> way one can easily use "sudo emacs" or "emacs -Q"... and start the GUI
>> emacs with these features.
> 
> No idea, I do not use Mac.
> 
>> Cheers,
>> 
>> Marius
> 
> Best regards, Michael.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  7:34   ` Marius Hofert
  2011-10-17  8:07     ` Michael Albinus
@ 2011-10-17 10:34     ` Peter Dyballa
  1 sibling, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2011-10-17 10:34 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help


Am 17.10.2011 um 09:34 schrieb Marius Hofert:

> => Are there any other significant changes I should be aware of?

C-h i m Emacs RET and then navigate to the documentation of your GNU Emacs variant. Google is another option.

> => Is it possible to get the same/similar behavior as in the GUI, maybe through simply redefining root's .emacs and .emacs.d as my own? (bad practice?)

Root can launch its Emacs with the -u or --user option.

> But by closing and reopening all my modifications to the file are lost. How can one avoid this?

Then don't close it! With a few GB of swap you can keep a few (million) files open.

--
Mit friedvollen Grüßen

  Pete

The problem with the French is that they don't have a word for « entrepreneur ».
				– Georges W. Bush




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  7:37   ` Marius Hofert
@ 2011-10-17 10:36     ` Peter Dyballa
  2011-10-17 13:33       ` Perry Smith
  2011-10-17 20:52       ` Marius Hofert
  0 siblings, 2 replies; 18+ messages in thread
From: Peter Dyballa @ 2011-10-17 10:36 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help


Am 17.10.2011 um 09:37 schrieb Marius Hofert:

> Oh, and something else: Instead of adding /Applications/Emacs.app/Contents/MacOS/bin/emacs to PATH (before /usr/bin), can't one just remove /usr/bin/emacs and create a link to /Applications/Emacs.app/Contents/MacOS/bin/emacs?
> There are also emacs-undumped and emacsclient in /usr/bin, not sure what they are for, though.

I wouldn't try to destroy the system. (But you're not me!)

--
Greetings

  Pete                                           0
                                           %-/\_//
                                            (*)(*)




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  9:13           ` Marius Hofert
@ 2011-10-17 10:38             ` Peter Dyballa
  0 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2011-10-17 10:38 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help, Michael Albinus


Am 17.10.2011 um 11:13 schrieb Marius Hofert:

> Any ideas?

Try to understand the error messages! Record your understanding by writing a small notice or memo!

--
Greetings

  Pete

Windows, c'est un peu comme le beaujolais nouveau: à chaque nouvelle cuvée on sait que ce sera dégueulasse, mais on en prend quand même, par masochisme.




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17 10:36     ` Peter Dyballa
@ 2011-10-17 13:33       ` Perry Smith
  2011-10-17 15:18         ` Peter Dyballa
  2011-10-17 20:52       ` Marius Hofert
  1 sibling, 1 reply; 18+ messages in thread
From: Perry Smith @ 2011-10-17 13:33 UTC (permalink / raw)
  To: Marius Hofert; +Cc: Emacs help

Marius,

On Oct 17, 2011, at 5:36 AM, Peter Dyballa wrote:

> 
> Am 17.10.2011 um 09:37 schrieb Marius Hofert:
> 
>> Oh, and something else: Instead of adding /Applications/Emacs.app/Contents/MacOS/bin/emacs to PATH (before /usr/bin), can't one just remove /usr/bin/emacs and create a link to /Applications/Emacs.app/Contents/MacOS/bin/emacs?
>> There are also emacs-undumped and emacsclient in /usr/bin, not sure what they are for, though.
> 
> I wouldn't try to destroy the system. (But you're not me!)

I would agree with Peter.  I try to not modify "Apple" stuff but find ways to work around it.  I have no idea of some weird script somewhere uses Apple's stock emacs.  The other obstacle is at some point, Apple will update the system, install a new emacs, and you will lose your changes.

As far as the keyboard: you are now going through two layers.  When you type a key, the Terminal is interpreting that keystroke.  I am sure that is slightly customizable but how much, I don't know.  Then Terminal sends it to emacs as a sequence of keys.  I believe you have most the modifiers at that point.  Here is an example: with the GUI emacs, when you hold the control key down and hit an "a", emacs knows that entire sequence of key strokes.  But when emacs is running inside Terminal, Terminal knows and sees the whole key sequence but sends just a Control-A to emacs.  There will be a few dramatic impacts and probably a few subtle ones too.

So, in particular, how the "chord" keys work, option, command, control, and shift (and also left and right shift, left and right command, etc) is controlled more by Terminal than it is by emacs.  I hope all that makes sense.

Good luck,
pedz




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17  8:07     ` Michael Albinus
  2011-10-17  8:29       ` Marius Hofert
@ 2011-10-17 13:34       ` Perry Smith
  2011-10-17 15:28         ` Peter Dyballa
  1 sibling, 1 reply; 18+ messages in thread
From: Perry Smith @ 2011-10-17 13:34 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs help

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]


On Oct 17, 2011, at 3:07 AM, Michael Albinus wrote:

> Marius Hofert <marius.hofert@math.ethz.ch> writes:
> 
> If you edit file /a/b/c and you cannot save it because it is owned by
> root, you could save it by "C-x C-w /sudo::/a/b/c".

Now there's a clever man... I would have saved it off, opened it with sudo,
and pasted the changes in.  I'd never thought to just save the changes
via sudo.



[-- Attachment #2: Type: text/html, Size: 810 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
       [not found] <mailman.387.1318803983.15868.help-gnu-emacs@gnu.org>
@ 2011-10-17 14:04 ` Stefan Monnier
  0 siblings, 0 replies; 18+ messages in thread
From: Stefan Monnier @ 2011-10-17 14:04 UTC (permalink / raw)
  To: help-gnu-emacs

> 2) Is it possible to start emacs in "sudo mode", so starting  emacs via
> "sudo emacs" in the terminal (and then being root when opening a shell from
> within emacs)?

I recommend you don't run large applications such as Emacs as root.
You can edit root-owned files from Emacs using Tramp's (aka
"/sudo::<filename>"), which is usually more convenient.
[ Tho I must admit I probably use Zile more often than Emacs to edit
  root-owned files. ]


        Stefan


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17 13:33       ` Perry Smith
@ 2011-10-17 15:18         ` Peter Dyballa
  0 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2011-10-17 15:18 UTC (permalink / raw)
  To: Perry Smith; +Cc: Emacs help


Am 17.10.2011 um 15:33 schrieb Perry Smith:

> The other obstacle is at some point, Apple will update the system, install a new emacs, and you will lose your changes.

And this newly installed /usr/bin/emacs might follow down the sym-link…

> I am sure that is slightly customizable but how much, I don't know.

There are two areas: one in the preferences of the Apple Terminal, the other by choosing a value for the environment variable TERM – although the latter is rather meant for the software running in that terminal to tell it how to make sense of the ANSI and non-ANSI Esc sequences produced in that terminal.

> Here is an example: with the GUI emacs, when you hold the control key down and hit an "a", emacs knows that entire sequence of key strokes.

Not exactly. The GUI application will know that some modifier key(s) is/are pressed when a key event happens.

> But when emacs is running inside Terminal, Terminal knows and sees the whole key sequence but sends just a Control-A to emacs.

Which is one byte of the hex value 0x1 or octal \001 or decimal 1 (while the figure 1 has an ASCII value of 49 [o61, x31]).

--
Greetings

  Pete

Let's face it; we don't want a free market economy either.
		– James Farley, president, Coca-Cola Export Corp., 1959




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17 13:34       ` Perry Smith
@ 2011-10-17 15:28         ` Peter Dyballa
  0 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2011-10-17 15:28 UTC (permalink / raw)
  To: Perry Smith; +Cc: Emacs help, Michael Albinus


Am 17.10.2011 um 15:34 schrieb Perry Smith:

> 
> On Oct 17, 2011, at 3:07 AM, Michael Albinus wrote:
> 
>> Marius Hofert <marius.hofert@math.ethz.ch> writes:
>> 
>> If you edit file /a/b/c and you cannot save it because it is owned by
>> root, you could save it by "C-x C-w /sudo::/a/b/c".
> 
> Now there's a clever man... I would have saved it off, opened it with sudo,
> and pasted the changes in.  I'd never thought to just save the changes
> via sudo.

You're opening and changing and saving that one file with "elevated privileges", just as some native Mac OS X application would when it asks you for the password. (Don't know what happens with the backup copy /a/b/c~ which GNU Emacs produces. And how the process in reality proceeds; it's easy to rename the file as the backup copy and open it afterwards in a buffer that has been renamed, so that you'll be saving saving it as a new file – which makes handling of date stamps very easy.)

--
Greetings

  Pete

"Klingons do not believe in indentation - except perhaps in the skulls of their project managers."




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Mac terminal.app: starting emacs, possibly as sudo
  2011-10-17 10:36     ` Peter Dyballa
  2011-10-17 13:33       ` Perry Smith
@ 2011-10-17 20:52       ` Marius Hofert
  1 sibling, 0 replies; 18+ messages in thread
From: Marius Hofert @ 2011-10-17 20:52 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: Emacs help

Dear Perry, Dear Peter,

thanks for your detailed explanations. 
I finally used put in "export PATH=/Applications/Emacs.app/Contents/MacOS/:$PATH" in ~/.profile, so now I can call "emacs" from within the terminal (e.g., via sudo) and get the desired result.

Cheers,

Marius

PS: In the meantime, I also found a similar question/problem here:
http://superuser.com/questions/199570/warnings-errors-with-emacs-cocoa-23-2-on-osx-terminal

On 2011-10-17, at 12:36 , Peter Dyballa wrote:

> 
> Am 17.10.2011 um 09:37 schrieb Marius Hofert:
> 
>> Oh, and something else: Instead of adding /Applications/Emacs.app/Contents/MacOS/bin/emacs to PATH (before /usr/bin), can't one just remove /usr/bin/emacs and create a link to /Applications/Emacs.app/Contents/MacOS/bin/emacs?
>> There are also emacs-undumped and emacsclient in /usr/bin, not sure what they are for, though.
> 
> I wouldn't try to destroy the system. (But you're not me!)
> 
> --
> Greetings
> 
>  Pete                                           0
>                                           %-/\_//
>                                            (*)(*)
> 





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-10-17 20:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-16 22:26 Mac terminal.app: starting emacs, possibly as sudo Marius Hofert
2011-10-16 23:26 ` Perry Smith
2011-10-17  7:37   ` Marius Hofert
2011-10-17 10:36     ` Peter Dyballa
2011-10-17 13:33       ` Perry Smith
2011-10-17 15:18         ` Peter Dyballa
2011-10-17 20:52       ` Marius Hofert
2011-10-16 23:43 ` Peter Dyballa
2011-10-17  7:34   ` Marius Hofert
2011-10-17  8:07     ` Michael Albinus
2011-10-17  8:29       ` Marius Hofert
2011-10-17  8:32         ` Michael Albinus
2011-10-17  9:13           ` Marius Hofert
2011-10-17 10:38             ` Peter Dyballa
2011-10-17 13:34       ` Perry Smith
2011-10-17 15:28         ` Peter Dyballa
2011-10-17 10:34     ` Peter Dyballa
     [not found] <mailman.387.1318803983.15868.help-gnu-emacs@gnu.org>
2011-10-17 14:04 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.