LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How Can I edit files that emacs won't let me? (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-edit-files-that-emacs-wont-let-me-219930/)

MDBlueIce 08-19-2004 08:50 PM

How Can I edit files that emacs won't let me?
 
I was recently trying to edit my /etc/bash.bashrc file to permanently change my command prompt by altering the PS1 variable ( feel free to let me know if there is a better way to do this ). When i open the file with emacs, I can not alte it, because emacs says the buffer is read-only. So how do I alter the file, through bash maybe? All help is kool.

peace 08-19-2004 08:54 PM

It seems to be file permissions issue. See here:

andrew@dexter:~$ ls -l /etc/bash.bashrc
-rw-r--r-- 1 root root 508 May 8 12:43 /etc/bash.bashrc

It is read-only for everyone but the owner, root. 'su' into root and try to edit the file. Emacs will allow you to write to it then.

MDBlueIce 08-19-2004 09:37 PM

Weird...... I used the SU command to switch users to root like you advised. Then i tried to launch xemacs, i wasnt able to. I thought maybe it was just an issue with xemacs, so I tried emacs but I still got an error message. Then I tried xmms, but I couldnt run that either. Here are the error messages ( I have no idea what to make of them )...................

================================================================

drakeDoogle@linux:~> su root
Password:
linux:/home/lxuser # xemacs
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

X server not responding
: ":0.0"
linux:/home/lxuser # emacs
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

emacs: Cannot connect to X server :0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.

linux:/home/lxuser # xmms
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


** CRITICAL **: Unable to open display

==============================================================


Any idea what this means? Thanx again.


All times are GMT -5. The time now is 03:08 PM.