From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Does anyone really use emacs in terminal? Date: Thu, 09 May 2013 10:21:18 +0200 Message-ID: <87li7o1s3l.fsf@gmail.com> References: <0b72021c-139f-4269-8e81-5b5ef97fb83d@googlegroups.com> <8761yu64e4.fsf@Servus.decebal.nl> <87r4higq45.fsf@gmail.com> <87ip2tyftv.fsf@yahoo.fr> <20130508155351.GA5399@hysteria.proulx.com> <87obclrrb9.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1368087710 2341 80.91.229.3 (9 May 2013 08:21:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 May 2013 08:21:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 09 10:21:49 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UaM6k-0005jX-7N for geh-help-gnu-emacs@m.gmane.org; Thu, 09 May 2013 10:21:46 +0200 Original-Received: from localhost ([::1]:41421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaM6j-00049Q-IM for geh-help-gnu-emacs@m.gmane.org; Thu, 09 May 2013 04:21:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaM6W-00049I-BX for help-gnu-emacs@gnu.org; Thu, 09 May 2013 04:21:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaM6U-0007wX-Be for help-gnu-emacs@gnu.org; Thu, 09 May 2013 04:21:32 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaM6U-0007wG-54 for help-gnu-emacs@gnu.org; Thu, 09 May 2013 04:21:30 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UaM6T-0005S8-6L for help-gnu-emacs@gnu.org; Thu, 09 May 2013 10:21:29 +0200 Original-Received: from g231234252.adsl.alicedsl.de ([92.231.234.252]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 May 2013 10:21:29 +0200 Original-Received: from tjolitz by g231234252.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 May 2013 10:21:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231234252.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:81sR/Mri8l+nIAlS1CnrUl4Zw5s= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90564 Archived-At: "Pascal J. Bourguignon" 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