From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Titus von der Malsburg Newsgroups: gmane.emacs.help Subject: Re: hl-line-mode and visual-line-mode Date: Thu, 22 Dec 2011 17:07:57 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1324576066 3889 80.91.229.12 (22 Dec 2011 17:47:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Dec 2011 17:47:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 22 18:47:40 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rdmk0-0001Vl-J7 for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Dec 2011 18:47:40 +0100 Original-Received: from localhost ([::1]:56761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdmk0-0005Yf-2b for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Dec 2011 12:47:40 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:44472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdlC8-00064w-5G for help-gnu-emacs@gnu.org; Thu, 22 Dec 2011 11:08:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdlC2-0008SW-2S for help-gnu-emacs@gnu.org; Thu, 22 Dec 2011 11:08:36 -0500 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:61305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdlC1-0008SN-Ue for help-gnu-emacs@gnu.org; Thu, 22 Dec 2011 11:08:30 -0500 Original-Received: by ghrr18 with SMTP id r18so6120965ghr.0 for ; Thu, 22 Dec 2011 08:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=TVRo9a3zWp6t+4R3CyyK1fBhn8/5POw20Pdh+mZkI8Q=; b=X+TPywE6EIaRvOrUb6olmplklRET3A0i9gPiyTjRyaZcnnSbTGlvhpZ2zaKYsEiv4S xIHB62kPyEAK5JFCBnLferH5jPb0iuCYVlGgVooRKZM/wiWuJr42Pv3Ecy20BrRPyTGx ePqa3UChThDSDKepWobHW50AxcOt5vqd+cOkw= Original-Received: by 10.50.15.161 with SMTP id y1mr11052260igc.4.1324570109189; Thu, 22 Dec 2011 08:08:29 -0800 (PST) Original-Received: by 10.42.4.149 with HTTP; Thu, 22 Dec 2011 08:07:57 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.169 X-Mailman-Approved-At: Thu, 22 Dec 2011 12:47:33 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83243 Archived-At: 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 wrote: > In visual-line-mode, global-hl-line-mode marks the whole paragraph > (the buffer line) instead of only the visual line. =C2=A0This can be fixe= d > with this redefinition of hl-line-range-function: > =C2=A0 (defun visual-line-line-range ()=C2=A0 =C2=A0 (save-excursion=C2= =A0 =C2=A0 =C2=A0 (cons > (progn (vertical-motion 0) (point)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(progn (vertical-motion > 1) (point))))) > > =C2=A0=C2=A0 (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. =C2=A0The space between the last wo= rd > and the margin is not marked. =C2=A0Only lines that end with a newline > character are completely highlighted. =C2=A0How can I fix this? > > Thanks for any suggestions! > > =C2=A0Titus --=20 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/