all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: seberino@spawar.navy.mil
Cc: help-gnu-emacs@gnu.org
Subject: Re: How add one to column # on modeline (%c) so starts from _1_?
Date: Tue, 8 Oct 2002 12:33:41 -0700	[thread overview]
Message-ID: <20021008123341.A25649@spawar.navy.mil> (raw)
In-Reply-To: <195F58F118C9D311B622009027DC812FFDD81B@mail1.technology.serco.com>; from vkirk@technology.serco.com on Tue, Oct 08, 2002 at 10:39:57AM +0100

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
_______________________________________

  reply	other threads:[~2002-10-08 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08  9:39 How add one to column # on modeline (%c) so starts from _1_? Victor Kirk
2002-10-08 19:33 ` seberino [this message]
2002-10-09 14:34   ` ken
  -- strict thread matches above, loose matches on Subject: below --
2002-09-26  5:35 seberino
2002-09-26  5:52 ` Eli Zaretskii
2002-10-07 17:49   ` seberino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021008123341.A25649@spawar.navy.mil \
    --to=seberino@spawar.navy.mil \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.