[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Finding simpler better sudo for Emacs
From: |
Michael Albinus |
Subject: |
Re: Finding simpler better sudo for Emacs |
Date: |
Tue, 30 Mar 2021 12:34:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Jean Louis <bugs@gnu.support> writes:
Hi Jean,
> (defun sudo (&rest arguments)
> "Executes list ARGUMENTS with system command `sudo'."
> (let ((default-directory
> (concat "/sudo::" (file-local-name default-directory))))
> (shell-command-to-string (string-join arguments " "))))
>
> (sudo "ls") → " 0install-ea1f1e-download
> 847cf980479cf1dd15482464efa8620ca98c1c93c5a3ac1e2a1dd24918b9cd46.html
> adb.1001.log" ;; are files from my tmp
>
> but then if I change to dired buffer ~/tmp and do: M-: -- (sudo "ls")
> I get following error:
>
> "sh: cd: /root/tmp/: No such file or directory
OK, so let's do
(defun sudo (&rest arguments)
"Executes list ARGUMENTS with system command `sudo'."
(let ((default-directory
(concat "/sudo::" (file-local-name (expand-file-name
default-directory)))))
(shell-command-to-string (string-join arguments " "))))
Best regards, Michael.
- Control of fan-speed on Lenovo Thinkpads, Jean Louis, 2021/03/29
- Re: Control of fan-speed on Lenovo Thinkpads, Michael Albinus, 2021/03/30
- Re: Control of fan-speed on Lenovo Thinkpads, Jean Louis, 2021/03/30
- Re: Control of fan-speed on Lenovo Thinkpads, Jean Louis, 2021/03/30
- Re: Control of fan-speed on Lenovo Thinkpads, Michael Albinus, 2021/03/30
- Finding simpler better sudo for Emacs, Jean Louis, 2021/03/30
- Re: Finding simpler better sudo for Emacs,
Michael Albinus <=
- Re: Finding simpler better sudo for Emacs, Jean Louis, 2021/03/30
- Re: Finding simpler better sudo for Emacs, Michael Albinus, 2021/03/30
- Re: Finding simpler better sudo for Emacs, Jean Louis, 2021/03/30
- Re: Finding simpler better sudo for Emacs, Michael Albinus, 2021/03/30
- Re: Finding simpler better sudo for Emacs, Jean Louis, 2021/03/30
Re: Control of fan-speed on Lenovo Thinkpads, Stefan Monnier, 2021/03/30