[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does anyone really use emacs in terminal?
From: |
Thorsten Jolitz |
Subject: |
Re: Does anyone really use emacs in terminal? |
Date: |
Thu, 09 May 2013 10:21:18 +0200 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
"Pascal J. Bourguignon" <pjb@informatimago.com> writes:
> No, the only real risk with emacs, is that it's so agreable to use, that
> you may forgot you're logged as root. For this, I have:
>
> (when (= (user-uid) 0)
> (set-background-color "black")
> (set-foreground-color "red"))
>
> in my .emacs files…
I have this in my (minimal) init file for Emacs root sessions, which is
quite nice since it keeps the e.g. black background and wheat foreground
colors and only adds a red header line at the top of the buffer. I
copied it from somewhere, probably Fabrice Niessen's .emacs, but I'm not
sure about it.
,--------------------------------------------------------------------
| ;; ** Warning about being 'root'
|
| (message "emacs-ESU-script root warning ...")
|
| (defface find-file-root-header-face
| '((t (:foreground "white" :background "red3")))
| "*Face use to display header-lines for files opened as root.")
|
| (defun find-file-root-header-warning ()
| "*Display a warning in header line of the current buffer.
| This function is suitable to add to `find-file-root-hook'."
| (let* ((warning "WARNING: EDITING FILE WITH ROOT PRIVILEGES!")
| (space (+ 6 (- (frame-width) (length warning))))
| (bracket (make-string (/ space 2) ?-))
| (warning (concat bracket warning bracket)))
| (setq header-line-format
| (propertize warning 'face 'find-file-root-header-face))))
|
| (add-hook 'find-file-hook 'find-file-root-header-warning)
| (add-hook 'dired-mode-hook 'find-file-root-header-warning)
`--------------------------------------------------------------------
--
cheers,
Thorsten
- Re: Does anyone really use emacs in terminal?, (continued)
- Re: Does anyone really use emacs in terminal?, Chad Brown, 2013/05/05
- Re: Does anyone really use emacs in terminal?, Cecil Westerhof, 2013/05/07
- Re: Does anyone really use emacs in terminal?, Hugh Lawson, 2013/05/07
- Re: Does anyone really use emacs in terminal?, Nicolas Richard, 2013/05/08
- Re: Does anyone really use emacs in terminal?, Bob Proulx, 2013/05/08
- Re: Does anyone really use emacs in terminal?, Nicolas Richard, 2013/05/08
- Re: Does anyone really use emacs in terminal?, Steven Degutis, 2013/05/08
- Re: Does anyone really use emacs in terminal?, Steinar Bang, 2013/05/22
- Re: Does anyone really use emacs in terminal?, Peter Dyballa, 2013/05/09
- Message not available
- Re: Does anyone really use emacs in terminal?, Pascal J. Bourguignon, 2013/05/08
- Re: Does anyone really use emacs in terminal?,
Thorsten Jolitz <=
- Re: Does anyone really use emacs in terminal?, Peter Dyballa, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Jai Dayal, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Peter Dyballa, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Jai Dayal, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Peter Dyballa, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Peter Dyballa, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Jai Dayal, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Peter Dyballa, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Jai Dayal, 2013/05/09
- Re: Does anyone really use emacs in terminal?, Óscar Fuentes, 2013/05/09