unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: Changing Color Of Column # In Modeline
Date: Wed, 23 Nov 2005 13:08:30 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICOEDFCPAA.drew.adams@oracle.com> (raw)
In-Reply-To: <dm2jl8$rs8$1@sea.gmane.org>

     > 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.

  reply	other threads:[~2005-11-23 21:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22  1:07 Changing Color Of Column # In Modeline gamename
2005-11-22  6:26 ` M Jared Finder
2005-11-22 17:24 ` rgb
2005-11-22 21:02   ` gamename
2005-11-23  1:21     ` M Jared Finder
2005-11-23 20:32       ` Kevin Rodgers
2005-11-23 21:08         ` Drew Adams [this message]
     [not found]         ` <mailman.16497.1132780124.20277.help-gnu-emacs@gnu.org>
2005-11-24  0:20           ` gamename
2005-11-24  6:21             ` Drew Adams
     [not found]             ` <mailman.16559.1132813301.20277.help-gnu-emacs@gnu.org>
2005-11-25 23:03               ` gamename
2005-11-26  0:01                 ` Drew Adams
2005-11-26 18:33               ` gamename
2005-11-26 18:53                 ` Drew Adams
     [not found]                 ` <mailman.16824.1133031197.20277.help-gnu-emacs@gnu.org>
2005-11-27  0:25                   ` gamename
2005-11-22 23:09   ` Ilya Zakharevich
2005-11-25 17:55     ` rgb
2005-11-25 18:54       ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICOEDFCPAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).