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: hl-line-mode and visual-line-mode Date: Thu, 22 Dec 2011 16:55:48 +0100 Message-ID: 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 1324576068 3898 80.91.229.12 (22 Dec 2011 17:47:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Dec 2011 17:47:48 +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:44 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-0001Vm-J7 for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Dec 2011 18:47:40 +0100 Original-Received: from localhost ([::1]:56760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdmjz-0005Yb-JO for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Dec 2011 12:47:39 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdl0I-000351-GU for help-gnu-emacs@gnu.org; Thu, 22 Dec 2011 10:56:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rdl0G-00062x-VS for help-gnu-emacs@gnu.org; Thu, 22 Dec 2011 10:56:22 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:61552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdl0G-00062r-OZ for help-gnu-emacs@gnu.org; Thu, 22 Dec 2011 10:56:20 -0500 Original-Received: by iacb35 with SMTP id b35so14145499iac.0 for ; Thu, 22 Dec 2011 07:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=fNGLIb2zEatjJfihu2roKbOkPzHpq3BoS5SMRm094j4=; b=SM5DGGA69N8Al9k7d/FOhXDUQh89iI//CuKnHA7PHet/yPNmC7QVolhhGEmNwStwYq 142/hCHz28oC44jm2WzNfl0DQSz2vG60pidf/PGwYfYROLHmNFJ1ooxS81F4oEMEEKwk 4XJeEv44Co1u5GCa92FiJgA3n3NcT27MJCfP0= Original-Received: by 10.43.47.135 with SMTP id us7mr11661683icb.31.1324569379296; Thu, 22 Dec 2011 07:56:19 -0800 (PST) Original-Received: by 10.42.4.149 with HTTP; Thu, 22 Dec 2011 07:55:48 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.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:83244 Archived-At: 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 fixed 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 (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. =C2=A0Only lines that end with a newline character are completely highlighted. How can I fix this? Thanks for any suggestions! Titus