From: storm@cua.dk (Kim F. Storm)
Cc: Masatake YAMATO <jet@gyve.org>, emacs-devel@gnu.org
Subject: Re: ruler support in hexl mode
Date: 12 Mar 2004 00:56:29 +0100 [thread overview]
Message-ID: <m3vflb2b0y.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <jwvekrzffre.fsf-monnier+emacs@asado.iro.umontreal.ca>
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > You can drop all of that ruler-mode- stuff if you use the advanced
> > pixel-alignment form of :align-to (see xdisp.c around line 17990):
>
> Hey neat. When was this added?
>
> > (let ((s " 87654321 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789abcdef")
> > (pos 0))
> > ;; Turn spaces in the header into stretch specs so they work
> > ;; regardless of the header-line face.
> > (while (string-match "[ \t]+" s pos)
> > (setq pos (match-end 0))
> > (put-text-property (match-beginning 0) pos 'display
> > ;; Assume fixed-size chars
> > `(space :align-to (+ (scroll-bar . left)
> > left-fringe left-margin
> > ,(1- pos)))
> > s))
>
> Note that if there's no margin (i.e. 99% of the time) this will not align
> things properly on a text terminal. This is the reason why I do
> a `make-string' for the leading space: the size of the string is used
> for alignment in text-terminals while the `display' prop is used otherwise.
Clever! I didn't consider that.
>
> Of course, the text-terminal display engine should ideally be improved to
> understand :align-to and such things, but I won't be the one to implement it.
I can give it a try.
>
> Also, how about adding a `text-start' special case which would stand for
> (+ (scroll-bar . left) left-fringe left-margin) so that we don't have to
> remember all the possible display elements and so that when we decide to
> add yet another display element we won't have to update the code.
That's a good idea. I'll do that.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
next prev parent reply other threads:[~2004-03-11 23:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-05 5:29 ruler support in hexl mode Masatake YAMATO
2004-03-08 20:05 ` Stefan Monnier
2004-03-09 12:11 ` Masatake YAMATO
2004-03-11 6:59 ` Masatake YAMATO
2004-03-11 16:27 ` Kim F. Storm
2004-03-11 17:43 ` Stefan Monnier
2004-03-11 23:56 ` Kim F. Storm [this message]
2004-03-12 6:05 ` Masatake YAMATO
2004-03-12 21:24 ` Stefan Monnier
2004-03-13 18:13 ` Masatake YAMATO
2004-03-15 7:37 ` Masatake YAMATO
2004-03-15 4:55 ` Richard Stallman
2004-03-15 11:00 ` Kim F. Storm
2004-03-16 19:02 ` Richard Stallman
2004-03-17 0:08 ` Kim F. Storm
2004-03-17 0:42 ` Stefan Monnier
2004-03-17 2:23 ` Kim F. Storm
2004-03-19 5:01 ` Richard Stallman
2004-03-19 10:06 ` Kim F. Storm
2004-03-19 13:33 ` Kim F. Storm
2004-03-08 21:00 ` Miles Bader
2004-03-11 14:41 ` Juanma Barranquero
2004-03-17 3:59 ` Miles Bader
2004-03-18 0:53 ` Juanma Barranquero
2004-03-20 4:48 ` Richard Stallman
2004-03-22 11:52 ` Juanma Barranquero
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=m3vflb2b0y.fsf@kfs-l.imdomain.dk \
--to=storm@cua.dk \
--cc=emacs-devel@gnu.org \
--cc=jet@gyve.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.