From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Hl-line and visual-line Date: Thu, 20 May 2010 16:30:59 -0400 Message-ID: <45790724-63FC-4B80-A70D-8CD49A92FEE3@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-8--272483293" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1274387489 25515 80.91.229.12 (20 May 2010 20:31:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 May 2010 20:31:29 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 20 22:31:26 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OFCOn-00015f-JC for ged-emacs-devel@m.gmane.org; Thu, 20 May 2010 22:31:21 +0200 Original-Received: from localhost ([127.0.0.1]:53973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFCOm-0003H6-QX for ged-emacs-devel@m.gmane.org; Thu, 20 May 2010 16:31:20 -0400 Original-Received: from [140.186.70.92] (port=32847 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFCOc-0003G7-0j for emacs-devel@gnu.org; Thu, 20 May 2010 16:31:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFCOa-00089a-6a for emacs-devel@gnu.org; Thu, 20 May 2010 16:31:09 -0400 Original-Received: from mail-gw0-f41.google.com ([74.125.83.41]:52840) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFCOa-00089S-2X for emacs-devel@gnu.org; Thu, 20 May 2010 16:31:08 -0400 Original-Received: by gwb20 with SMTP id 20so173331gwb.0 for ; Thu, 20 May 2010 13:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-pgp-agent:x-mailer; bh=4SE387lpLpAGCPRquJZifcTDZCFx7teYNzBgCxq7QV4=; b=f/8Me3AX7Oiw46rDlTW4yWEuC6LhvybKsgUdGrpIsjrj05qA2vVWubE+pQEbNyJoW7 TxaJu0kDVSNKon30q97h7wJ2kDF/rzoetaFrTRrV/MGeR24epScpKWq6x3r/M4XLDetl PgrY9JzkonE0ftAta4aX8b2LUjPAzpmLMYrSk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-pgp-agent:x-mailer; b=jJ96hrSGY2MQZJWeCDKBQz/TG17jVOdbiS7SyhiJ7BTBFCnL5yM2LiDvRlEOre+b5Z 8TyN7B5QZtG3lcYWNjN4ym0zKK5d1g3mrRfUr6TqsazUQxurklnIWnBo8wHgTARbj9xg mJKjOXSN3GzUMdiUGALyay+NXhFCP5mT9zwWs= Original-Received: by 10.229.248.211 with SMTP id mh19mr179375qcb.104.1274387466876; Thu, 20 May 2010 13:31:06 -0700 (PDT) Original-Received: from elin.psy.cmu.edu (ELIN.PSY.CMU.EDU [128.2.248.190]) by mx.google.com with ESMTPS id x34sm108683qce.9.2010.05.20.13.31.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 May 2010 13:31:06 -0700 (PDT) X-Pgp-Agent: GPGMail 1.2.3 X-Mailer: Apple Mail (2.1078) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124970 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-8--272483293 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hl-line highlights the buffer line rather than the visual line even in = `visual-line-mode': I don't think that makes sense. So I think this little change would be good upstream as well. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ebb21c4..4b6d07d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-20 David Reitter + + * simple.el (visual-line-line-range): Define. + (visual-line-mode): Use for hl-line-range-function. + 2010-05-07 Chong Yidong =20 * Version 23.2 released. diff --git a/lisp/simple.el b/lisp/simple.el index 28ed4ef..b7f2646 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4697,6 +4697,11 @@ other purposes." (copy-tree fringe-indicator-alist))))))) (set-default symbol value))) =20 +(defun visual-line-line-range () + (save-excursion + (cons (progn (vertical-motion 0) (point)) + (progn (vertical-motion 1) (point))))) + (defvar visual-line--saved-state nil) =20 (define-minor-mode visual-line-mode @@ -4712,7 +4717,8 @@ This also turns on `word-wrap' in the buffer." ;; visual-line-mode is turned off. (dolist (var '(line-move-visual truncate-lines truncate-partial-width-windows - word-wrap fringe-indicator-alist)) + word-wrap fringe-indicator-alist + hl-line-range-function)) (if (local-variable-p var) (push (cons var (symbol-value var)) visual-line--saved-state))) @@ -4722,12 +4728,14 @@ This also turns on `word-wrap' in the buffer." word-wrap t fringe-indicator-alist (cons (cons 'continuation visual-line-fringe-indicators) - fringe-indicator-alist))) + fringe-indicator-alist)) + (set (make-local-variable 'hl-line-range-function) = #'visual-line-line-range)) (kill-local-variable 'line-move-visual) (kill-local-variable 'word-wrap) (kill-local-variable 'truncate-lines) (kill-local-variable 'truncate-partial-width-windows) (kill-local-variable 'fringe-indicator-alist) + (kill-local-variable 'hl-line-range-function) (dolist (saved visual-line--saved-state) (set (make-local-variable (car saved)) (cdr saved))) (kill-local-variable 'visual-line--saved-state))) --Apple-Mail-8--272483293 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.12 (Darwin) iEYEARECAAYFAkv1nAgACgkQYotoJUVQB4IAdgCfZ3lFq896m/EVvXpgZcUcsJaE yXUAnibw2tRCWb83suM5QadL8CTgsO/n =qfWD -----END PGP SIGNATURE----- --Apple-Mail-8--272483293--