Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

0
votes
2answers
56 views

Emacs, .historian and root user

I use the following alias: alias e='emacsclient -a '\'''\'' -t alias sudo='sudo ' That way I can execute both, commands and aliases, with sudo, including e, which launchs the emacs server if it is ...
2
votes
2answers
99 views

Can I acquire root privilege to edit a system file without restarting emacs with `sudo`? [duplicate]

Sometimes, when I am running an emacs process (either started withemacs -nw or emacsclient -nw with an emacs server daemon), I would like to edit a system file. Can I acquire root privilege without ...
0
votes
1answer
260 views

How to execute sudo command in org-babel in relative path under current working directory

I want to execute sudo command in org-babel like this: #+begin_src shell :dir "/sudo::" :cache no make sudo make install #+end_src It works fine. It use TRAMP /sudo: method. But I need to execute ...
1
vote
2answers
280 views

How to make Org-Babel support tangel to su/sudo file with tramp-sudo?

I hope to let org-babel can tangle to root permission file with tramp-sudo support like the following format: #+BEGIN_SRC clojure :dir /sudo:: :tangle "/etc/kk.clj" ... #+END_SRC But it does not ...
0
votes
0answers
40 views

Error when trying to save a file as root using Tramp and sudo

I am following the directions laid out in this answer to edit my sshd_config file. However when I try to save I get: byte-code: Wrong type argument: listp, 126 Does anybody know why this would be ...
3
votes
1answer
422 views

How to run sudo commands using shell-command?

When I run any sudo command using shell-command—for example, (shell-command "sudo ls")—I get the following error: sudo: no tty present and no askpass program specified How can I get around this? I'm ...
2
votes
2answers
653 views

How to edit and save an extremely stubborn read-only file

I am trying to edit the file /etc/postfix/main.cf but this applies to any file. Currently its permission bits are set to -rw-r--r-- I want to open, edit and save this file when operating as a ...
2
votes
2answers
392 views

How do I open a non-readable file from inside emacs when I opened emacs as a regular user?

The question pretty much says it all. I opened emacs as a regular user and am trying to edit something in the /etc/ folder (I know this is dangerous etc. etc.) How can I do this?
0
votes
2answers
68 views

change default tramp path for finding files

I found the following code here, (defun sudo-find-file (file-name) "Like find file, but opens the file as root." (interactive "FSudo Find File: ") (let ((tramp-file-name (concat "/sudo::" (...
4
votes
1answer
371 views

“sudo emacs” Doesn't Work

I am trying to use sudo emacs with no luck so far. When I run with --debug-init I get the following. Debugger entered--Lisp error: (file-error "Cannot open load file" "no such file or directory "web-...
1
vote
2answers
704 views

How to sudo save file in TRAMP mode?

I just started using tramp mode, and it looks amazing. However, there's one issue that's making it non-usable for me. I have several boxes which I log into with one user, say, user. He's in sudoers ...
8
votes
1answer
709 views

How to disable auto-save in emacs only for files opened as root

I want to use emacs auto-save feature with tramp, but only for file that I don't open using sudo. My current configuration, based on the tramp documentation, looks like this: ;;;;;;;; BAKUCP ;;;;;;;; ...
4
votes
1answer
107 views

Install programs which require superuser permissions

I would like to, as part of Emacs Lisp package set-up process to run some programs which typically require superuser access, for instance, I would like to make sure that certain system packages are ...
2
votes
1answer
292 views

How to prevent tramp from blocking when entering password?

For my speech recognition mode I have emacs listen asynchronously using make-network-process for messages sent by my python client. If I say anything that should translate to emacs taking an action ...
2
votes
1answer
245 views

Prevent Tramp from asking for a password for passwordless sudo

Opening /sudo::/etc/hosts with tramp prompts for a password even though I have passwordless sudo. I use ido. $ sudo grep NOPASSWD /etc/sudoers %wheel ALL=(ALL) NOPASSWD: ALL Is there any way to fix ...
6
votes
0answers
428 views

Cannot edit a file as root if ~/.authinfo.gpg file exists

I got ~/.authinfo.gpg to store my multiple email accounts for gnus, but if ~/.authinfo.gpg exists, the tramp won't work. It will always say: Decrypting /home/chz/.authinfo.gpg...done Emacs won't ...