From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Victor Kirk Newsgroups: gmane.emacs.help Subject: RE: How add one to column # on modeline (%c) so starts from _1_? Date: Tue, 8 Oct 2002 10:39:57 +0100 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <195F58F118C9D311B622009027DC812FFDD81B@mail1.technology.serco.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: main.gmane.org 1034070053 22657 127.0.0.1 (8 Oct 2002 09:40:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2002 09:40:53 +0000 (UTC) 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 17yqrE-0005tJ-00 for ; Tue, 08 Oct 2002 11:40:52 +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 17yqnn-0007wD-00; Tue, 08 Oct 2002 05:37:19 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17yqnG-0007rE-00 for help-gnu-emacs@gnu.org; Tue, 08 Oct 2002 05:36:46 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17yqnE-0007qw-00 for help-gnu-emacs@gnu.org; Tue, 08 Oct 2002 05:36:45 -0400 Original-Received: from porky.serco.com ([195.50.81.243]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17yqnE-0007qk-00 for help-gnu-emacs@gnu.org; Tue, 08 Oct 2002 05:36:44 -0400 Original-Received: from [10.22.1.247] (helo=mail1.technology.serco.com) by porky.serco.com with esmtp (Exim 4.10) id 17yqnD-0003yN-01 for help-gnu-emacs@gnu.org; Tue, 08 Oct 2002 09:36:43 +0000 Original-Received: by mail1.technology.serco.com with Internet Mail Service (5.5.2650.21) id ; Tue, 8 Oct 2002 10:39:59 +0100 Original-To: help-gnu-emacs@gnu.org X-Mailer: Internet Mail Service (5.5.2650.21) X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *17yqnD-0003yN-01*Y4Qb0ozLySs* 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:2370 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2370 > '(: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.