From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Changing Color Of Column # In Modeline Date: Wed, 23 Nov 2005 13:08:30 -0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1132781030 5841 80.91.229.2 (23 Nov 2005 21:23:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2005 21:23:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 23 22:23:47 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ef240-0002UR-6d for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Nov 2005 22:22:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ef23z-000138-DO for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Nov 2005 16:21:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ef1r8-0001nZ-6V for help-gnu-emacs@gnu.org; Wed, 23 Nov 2005 16:08:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ef1r5-0001lQ-GF for help-gnu-emacs@gnu.org; Wed, 23 Nov 2005 16:08:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ef1r1-0001kf-F1 for help-gnu-emacs@gnu.org; Wed, 23 Nov 2005 16:08:38 -0500 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Ef1r1-0001Ti-63 for help-gnu-emacs@gnu.org; Wed, 23 Nov 2005 16:08:35 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id jANL8WOX026308 for ; Wed, 23 Nov 2005 14:08:32 -0700 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jANL8VNj001382 for ; Wed, 23 Nov 2005 14:08:31 -0700 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jANL8V6o001375 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 23 Nov 2005 14:08:31 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31306 Archived-At: > How about putting this in your init file: > > (setf mode-line-position '(:eval (if (>= (current-column) 80) > '(:propertize "(%l,%c)" > face bold) > "(%l,%c)"))) Does that really work for you? mode-line-position is not documented in Emacs 21 -- are you running 22.0 (CVS)? It works fine in Emacs 22. Yes, `mode-line-position' is undefined in Emacs 21. I use this, BTW: (setq mode-line-position '(:eval (let ((help-echo "mouse-1: select (drag to resize), \ mouse-2: delete others, mouse-3: delete this")) `((-3 ,(propertize "%p" 'help-echo help-echo)) (size-indication-mode (8 ,(propertize " of %I" 'help-echo help-echo))) (line-number-mode ((column-number-mode (10 ,(propertize " (%l,%c)" 'face (and (> (current-column) 1on1-mode-line-column-limit) 'font-lock-function-name-face) 'help-echo help-echo)) (6 ,(propertize " L%l" 'help-echo help-echo)))) ((column-number-mode (5 ,(propertize " C%c" 'face (and (> (current-column) 1on1-mode-line-column-limit) 'font-lock-function-name-face) 'help-echo help-echo))))))))) The key thing here is :eval, which makes sure the column-number face gets updated - it is available in Emacs 21, as is `mode-line-format', which you can manipulate in a way similar to the above to change the `column-number-mode' face. In Emacs 20, you could use `put' to add the text properties (there is no `propertize'), but you cannot easily update the face, because there is no :eval.