[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [mentoring-done] a darkroom/writeroom mode for Emacs
From: |
martin rudalics |
Subject: |
Re: [mentoring-done] a darkroom/writeroom mode for Emacs |
Date: |
Mon, 15 Dec 2014 16:28:06 +0100 |
> Yes I got it: I can collect pixelwise statistics about the line
> lengths and then use window width. (with one problem I can circumvent:
> window-width does not count *existing* margins).
You can always get the margins of a window via (window-margins).
Multiply the result with (frame-char-width) and you get the pixels
(beware of a nil return value).
> But to do comparisons with column based variables like `fill-column',
`fill-column' might be a problem, indeed. Do you really need it?
> I
> still need the character (assumed fixed) pixel width, which I need to
> extract like this.
>
> (window-text-pixel-size (selected-window)
> (point-min) (1+ (point-min)))
This will fail miserably with variable character widths.
> This fails for empty buffers, but that case is negligible anyway.
>
> The code is much cleaner now, so thanks.
>
> Anyway, its a bit confusing that `window-width' can't take the font size
> in consideration, while `window-text-pixel-size' can.
It can't. Nobody can, so far ... Eli might fix this eventually.
> Though it probably
> makes sense since a window can display chars of many widths. But then
> using it without PIXELWISE should be deprecated.
For a human being it's easier to think in terms of columns rather than
in pixels.
> It might *become* its intent, if you wish to explain what you had in
> mind.
I only thought that if you add/remove characters to/from the longest
line you might also consider recentering the entire text on the fly.
martin
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, (continued)
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, João Távora, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, Dmitry Gutov, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, João Távora, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, Dmitry Gutov, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, João Távora, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, Stefan Monnier, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, martin rudalics, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, João Távora, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, martin rudalics, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, João Távora, 2014/12/15
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs,
martin rudalics <=
- Re: [mentoring-done] a darkroom/writeroom mode for Emacs, João Távora, 2014/12/15
- RE: [mentoring] a darkroom/writeroom mode for Emacs, Drew Adams, 2014/12/12
- Re: [mentoring] a darkroom/writeroom mode for Emacs, Stefan Monnier, 2014/12/12
- Re: [mentoring] a darkroom/writeroom mode for Emacs, Phillip Lord, 2014/12/09
- [mentor-request] Ecco - a literate programming documentation generator, João Távora, 2014/12/08
- Results of the "mentoring" experiment Re: Metaproblem, part 3, João Távora, 2014/12/21
- Re: Results of the "mentoring" experiment Re: Metaproblem, part 3, Rasmus, 2014/12/21
- Re: Results of the "mentoring" experiment, Stephen Leake, 2014/12/22
- Re: Results of the "mentoring" experiment, João Távora, 2014/12/22
- Re: Results of the "mentoring" experiment, João Távora, 2014/12/22