From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: seberino@spawar.navy.mil Newsgroups: gmane.emacs.help Subject: Re: How add one to column # on modeline (%c) so starts from _1_? Date: Tue, 8 Oct 2002 12:33:41 -0700 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <20021008123341.A25649@spawar.navy.mil> References: <195F58F118C9D311B622009027DC812FFDD81B@mail1.technology.serco.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034105741 10189 127.0.0.1 (8 Oct 2002 19:35:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2002 19:35:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17z088-0002aY-00 for ; Tue, 08 Oct 2002 21:34:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17z07O-0000IN-00; Tue, 08 Oct 2002 15:34:10 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17z074-0008P9-00 for help-gnu-emacs@gnu.org; Tue, 08 Oct 2002 15:33:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17z06y-00085R-00 for help-gnu-emacs@gnu.org; Tue, 08 Oct 2002 15:33:47 -0400 Original-Received: from seberino.spawar.navy.mil ([128.49.22.159]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17z06x-0007zk-00 for help-gnu-emacs@gnu.org; Tue, 08 Oct 2002 15:33:43 -0400 Original-Received: from seberino by seberino.spawar.navy.mil with local (Exim 4.10) id 17z06v-0006gU-00; Tue, 08 Oct 2002 12:33:41 -0700 Original-To: Victor Kirk Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <195F58F118C9D311B622009027DC812FFDD81B@mail1.technology.serco.com>; from vkirk@technology.serco.com on Tue, Oct 08, 2002 at 10:39:57AM +0100 Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2393 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2393 Thanks for the help!!!!! I implemented your suggestion in my mode line def.... (setq default-mode-line-format (list "" 'mode-line-buffer-identification " " (system-name) " " '(:eval (format "%s" (+ (string-to-int "%c") 1))) "Line %l Col %c")) Indeed the eval part delivers a "1". The problem is that the "1" is not updated as columnn number changes.... it just stays "1" for all time.... What did you mean by "column-number-mode"??? Perhaps that would solve problem of updating the eval line continuously???? Chris On Tue, Oct 08, 2002 at 10:39:57AM +0100, Victor Kirk wrote: > > > > '(:eval "%c + 1") > > > The above will print "0 + 1" on the modeline when in the first column. > > This is because it thre result is a string which contains those characters. > What you need to do is > > o convert %c to an int - (string-to-int "%c") > o add one to this value - (+ (string-to-int "%c") 1) > o Return the result as a string (format "%s" (+ (string-to-int "%c") 1)) > > > How can I tell Emacs to evaluate the *addition* in quotes rather > > than just interpret it as a /string/???? > > Thus try > > (:eval (format "%s" (+ (string-to-int "%c") 1))) > > And don't forget to use column-number-mode! > > Vic > -- > > > > This message, including attachments, is intended only for the use by the > person(s) to whom it is addressed. It may contain information which is > privileged and confidential. Copying or use by anybody else is not > authorised. If you are not the intended recipient, please contact the sender > as soon as possible. The views expressed in this communication may not > necessarily be the views held by Serco Integrated Transport. > > > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://mail.gnu.org/mailman/listinfo/help-gnu-emacs -- _______________________________________ Dr. Christian Seberino SPAWAR Systems Center San Diego Code 2363 49590 Lassing Rd. Rm. A339 San Diego, CA 92152-6147 U.S.A. Phone: (619) 553-7940 Fax: (619) 553-1269 Email: seberino@spawar.navy.mil _______________________________________