bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36583: 26.1; emacs 26 tries loading original user's .emacs after su


From: Noam Postavsky
Subject: bug#36583: 26.1; emacs 26 tries loading original user's .emacs after su to root
Date: Mon, 15 Jul 2019 09:04:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> How 'bout let the /root/.emacs file do something like:
>
>     (load (concat "~" (user-login-name) "/.emacs"))
>     
> ?
> For convenience, we could provide an ad-hoc function that would do that
> "right" (i.e. looking for .emacs, .emacs.d/init.el, and things like
> that).  We could even put it in /root/.emacs.d/early-init.el.

Wouldn't it be simpler to do this in the shell, e.g.,

    cat >>/root/.bashrc <<'EOF'
    alias emacs='emacs -u "$LOGNAME"'
    EOF

although I would personally suggest

    cat >>/root/.bashrc <<'EOF'
    alias emacs='echo Do not run emacs as root'
    EOF





reply via email to

[Prev in Thread] Current Thread [Next in Thread]