[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hl-line-mode and visual-line-mode

From: Titus von der Malsburg
Subject: Re: hl-line-mode and visual-line-mode
Date: Thu, 22 Dec 2011 17:07:57 +0100

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 ()
    (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
<address@hidden> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]