all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* hl-line-mode and visual-line-mode
@ 2011-12-22 15:55 Titus von der Malsburg
  2011-12-22 16:07 ` Titus von der Malsburg
  0 siblings, 1 reply; 2+ messages in thread
From: Titus von der Malsburg @ 2011-12-22 15:55 UTC (permalink / raw
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: hl-line-mode and visual-line-mode
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Titus von der Malsburg @ 2011-12-22 16:07 UTC (permalink / raw
  To: help-gnu-emacs

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/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-22 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.