From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: How can I put display-time to the right of the mode line? Date: Wed, 11 Dec 2013 16:58:33 +0100 Organization: Aioe.org NNTP Server Message-ID: <87zjo7idkt.fsf@nl106-137-194.student.uu.se> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1386777662 5459 80.91.229.3 (11 Dec 2013 16:01:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2013 16:01:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 11 17:01:07 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 1VqmDj-0003P8-CX for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 17:01:07 +0100 Original-Received: from localhost ([::1]:58100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqmDj-00069w-2A for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 11:01:07 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!zen.net.uk!dedekind.zen.co.uk!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 73 Original-NNTP-Posting-Host: VVbyYd/iFZoeWNmD9i++cQ.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:JZ9rjZdz4oPjNmV4Y8v+uTYID+I= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:202672 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:94941 Archived-At: Alan Schmitt writes: > Is there a way to have some information in the mode > line, in my case the time showed by display-time, to be > at all the way to the right of the mode line? Yes, I found the mode line is configurable with the below Elisp [last]. If you want context (and some more defuns to do various things to the mode line), check out the entire config file [1]. For a particular mode, you'll need something like this, in combination with the rest. ;;;; shell / SHELL (defun set-shell-mode-line () "Mode line: Set the mode line for `shell' use." (set-variable '*mode-line-caption* "zsh" t) (set-variable '*show-mode-line-caption* t t) (set-variable '*show-mode-line-modified* nil t) (set-variable '*show-default-directory* nil t) (set-variable '*show-mode-line-buffer-identification* nil t) (set-variable '*show-mode-line-modes* nil t) (set-variable 'column-number-mode nil t) (set-variable 'line-number-mode nil t) ) (add-hook 'shell-mode-hook 'set-shell-mode-line) If you can figure out how all that works, you are a bright guy. What is dynamic and what is not, is all intermixed at different layers. But if you do the work of setting it up (mode by mode, if you want it) I can guarantee it works, as I used it several years by now. However, that doesn't say, there isn't a better way to do it. [1] http://user.it.uu.se/~embe8573/conf/.emacs-mode-line ;;; what to show (defvar *show-mode-line-caption*) (setq *show-mode-line-caption* nil) (defvar *mode-line-caption*) (defvar *show-mode-line-modified*) (setq *show-mode-line-modified* t) (defvar *show-mode-line-buffer-identification*) (setq *show-mode-line-buffer-identification* t) (defvar *show-mode-line-modes*) (setq *show-mode-line-modes* nil) (setq column-number-mode nil) (setq line-number-mode nil) (defvar *show-default-directory*) (setq *show-default-directory* t) (defun set-mode-line () "Mode line: Show the mode line elements if the respective global booleans are set." (setq-default mode-line-format `(" " (*show-mode-line-modified* mode-line-modified) (*show-mode-line-modified* " ") (*show-mode-line-caption* *mode-line-caption*) (*show-mode-line-caption* " ") (*show-default-directory* default-directory) (*show-mode-line-buffer-identification* mode-line-buffer-identification) (*show-mode-line-buffer-identification* " ") (line-number-mode "[%l] ") (column-number-mode "{%c} ") (*show-mode-line-modes* mode-line-modes) ))) (set-mode-line) -- Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu underground experts united: http://user.it.uu.se/~embe8573