From: Titus von der Malsburg <malsburg@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: hl-line-mode and visual-line-mode
Date: Thu, 22 Dec 2011 17:07:57 +0100 [thread overview]
Message-ID: <CAM+LvrDdaV5tXMzdYhL+8mGLALb3q5YzMVwgxO7jDrEXkTYihw@mail.gmail.com> (raw)
In-Reply-To: <CAM+LvrBRGsutsD99kMkR2hooYGtRpb+=GcOn5m3g74RT7_gyCQ@mail.gmail.com>
Sorry for the mess in my previous mail. Gmail recently started to
reformat my emails after I send them and I don't know how I can switch
this off. Here's the code again:
(defun visual-line-line-range ()
(save-excursion
(cons (progn (vertical-motion 0) (point))
(progn (vertical-motion 1) (+ (point) 0)))))
(setq hl-line-range-function 'visual-line-line-range)
On Thu, Dec 22, 2011 at 4:55 PM, Titus von der Malsburg
<malsburg@gmail.com> wrote:
> In visual-line-mode, global-hl-line-mode marks the whole paragraph
> (the buffer line) instead of only the visual line. This can be fixed
> with this redefinition of hl-line-range-function:
> (defun visual-line-line-range () (save-excursion (cons
> (progn (vertical-motion 0) (point)) (progn (vertical-motion
> 1) (point)))))
>
> (setq hl-line-range-function 'visual-line-line-range)
>
> This works nicely except that it doesn't highlight the whole line but
> only the text contained in that line. The space between the last word
> and the margin is not marked. Only lines that end with a newline
> character are completely highlighted. How can I fix this?
>
> Thanks for any suggestions!
>
> Titus
--
Titus von der Malsburg
DFG Research Group 868: Mind and Brain Dynamics
Dept. of Linguistics, University of Potsdam
http://www.ling.uni-potsdam.de/~malsburg/
prev parent reply other threads:[~2011-12-22 16:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-22 15:55 hl-line-mode and visual-line-mode Titus von der Malsburg
2011-12-22 16:07 ` Titus von der Malsburg [this message]
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=CAM+LvrDdaV5tXMzdYhL+8mGLALb3q5YzMVwgxO7jDrEXkTYihw@mail.gmail.com \
--to=malsburg@gmail.com \
--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.
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).