From unknown Fri Jun 20 07:20:16 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36361 <36361@debbugs.gnu.org> To: bug#36361 <36361@debbugs.gnu.org> Subject: Status: 'hl-line-range-function' as list of choice Reply-To: bug#36361 <36361@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:20:16 +0000 retitle 36361 'hl-line-range-function' as list of choice reassign 36361 emacs submitter 36361 Sebastian Urban severity 36361 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 12:30:28 2019 Received: (at submit) by debbugs.gnu.org; 24 Jun 2019 16:30:28 +0000 Received: from localhost ([127.0.0.1]:57791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfRrP-0007Bx-RQ for submit@debbugs.gnu.org; Mon, 24 Jun 2019 12:30:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:46372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfRrO-0007Ai-PN for submit@debbugs.gnu.org; Mon, 24 Jun 2019 12:30:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60921) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfRrN-0008AW-Rp for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 12:30:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfRrM-0001gc-VO for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 12:30:25 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:50953) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfRrM-0001f1-JN for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 12:30:24 -0400 Received: by mail-wm1-x32d.google.com with SMTP id c66so14510wmf.0 for ; Mon, 24 Jun 2019 09:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=hjnjsSd8zaoAryN+Jqx6PZ0Flq/V51oimGqcmtnlTQE=; b=PJTALFKVE59Kd4n0/9JS4bUMFu+55t47dr/AcYgzmdOrhBDFvgp3QfEargACL2IA+g hm/Qp88o1TUPcbtXxssUwNfbKYN6LoN4/ZvsKUVMY18M8eirhbOO0RFERz+GvvEtcPtH HJeRa22ix4aLrDgDRyfRcdsSsDGPTlrZaMQW+JYMp8GY05DyUfSyzcZ+eUqvVQkCdPOq 9froPvXY3YdgGKvEPIJNw3+ON+22l6JsJHIX52GWG6z5vypAVe0roRD625phFai1UuCX ZbMoqYcQMd2OgF4tdTLSYSfqwVu74UupjbudrtVJEY/xw+W4ZB9uNtqVAPL2V/y8y+wx 4kiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=hjnjsSd8zaoAryN+Jqx6PZ0Flq/V51oimGqcmtnlTQE=; b=QqksTrvpMBdsI0Ehi6ADO/SxKRZpCoC6mfdtg1EiU2N09yo017OC1FWhNNDRG2ix6r G6RABWEesNMdyzs587kgMaQZGZtCz1OsVeKe4tXOTsOLyPVRRBDh5ZfOb/UR75zlvxlw efeqIeyhB2+AUymlMagFjc5m2ZiF1t5T0j9TQegP8esDnJ9qtH8e3w12roBNb07TWlAl Vo2MyEM5Oz6yF7LBZMFQasLtYw4O/BCfHLIR4Odc/KvtL2D2DOzYspxbH0KhLLskJFR4 uGdjQIsY8Q8XRgpb9jMQpseawZ7CqZeleyKo0kQPH6Juse2syIDlT+/TZ7MtWbkqJO77 hUzQ== X-Gm-Message-State: APjAAAUjRwepbrdO4JMKB5kZ3PZaDQn2lGhzI6xOrrfcCDlJXXA7KuO6 IbPvBUNFCEkXkYwKW2gymrXTL2mC X-Google-Smtp-Source: APXvYqyjduJ+tjUzHaIOw/pdeOc8nkF7RDe8gsVnrm5mJ+OZaQC5QwUhbQgVa2mJKjEkYMK0KJ43GQ== X-Received: by 2002:a1c:e28b:: with SMTP id z133mr15403664wmg.136.1561393822966; Mon, 24 Jun 2019 09:30:22 -0700 (PDT) Received: from ?IPv6:2a00:f41:1870:f1b8:ed6d:9890:85f5:2b6d? ([2a00:f41:1870:f1b8:ed6d:9890:85f5:2b6d]) by smtp.gmail.com with ESMTPSA id 32sm23279357wra.35.2019.06.24.09.30.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 09:30:22 -0700 (PDT) To: Bug GNU Emacs From: Sebastian Urban Subject: 'hl-line-range-function' as list of choice Message-ID: <57613049-fca3-ba0e-82b1-3ff2e1995da8@gmail.com> Date: Mon, 24 Jun 2019 18:30:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Because 'hl-line-mode' highlight logical line instead of screen line when 'visual-line-mode' is active, and for example 'C-a' and 'C-e' change behaviour, some people want 'hl-line-mode' to change the behaviour as well. They usually use 'hl-line-range-function' to define how it should highlight, but... cannot it be made simpler? Like by making 'hl-line-range-function' a list of choice: - nil for default behaviour, - "Screen line" to change to screen line, - "Function" for user to write what he wants. I'm writing this from perspective of "Customize" menu. S. U. In GNU Emacs 26.2 (build 1, i686-w64-mingw32) of 2019-04-13 built on CIRROCUMULUS Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749 Windowing system distributor 'Microsoft Corp.', version 6.1.7601 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 08 19:51:47 2019 Received: (at 36361) by debbugs.gnu.org; 8 Jul 2019 23:51:47 +0000 Received: from localhost ([127.0.0.1]:59989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkdQB-0008RA-Es for submit@debbugs.gnu.org; Mon, 08 Jul 2019 19:51:47 -0400 Received: from quimby.gnus.org ([80.91.231.51]:35940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkdQA-0008R1-5p for 36361@debbugs.gnu.org; Mon, 08 Jul 2019 19:51:46 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkdQ4-0006aY-Kc; Tue, 09 Jul 2019 01:51:42 +0200 From: Lars Ingebrigtsen To: Sebastian Urban Subject: Re: bug#36361: 'hl-line-range-function' as list of choice References: <57613049-fca3-ba0e-82b1-3ff2e1995da8@gmail.com> Date: Tue, 09 Jul 2019 01:51:40 +0200 In-Reply-To: <57613049-fca3-ba0e-82b1-3ff2e1995da8@gmail.com> (Sebastian Urban's message of "Mon, 24 Jun 2019 18:30:18 +0200") Message-ID: <871rz0gk4z.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Sebastian Urban writes: > Because 'hl-line-mode' highlight logical line instead of screen line > when 'visual-line-mode' is active, and for example 'C-a' and 'C-e' > change behaviour, some people want 'hl-line-mode' to chang [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36361 Cc: 36361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Sebastian Urban writes: > Because 'hl-line-mode' highlight logical line instead of screen line > when 'visual-line-mode' is active, and for example 'C-a' and 'C-e' > change behaviour, some people want 'hl-line-mode' to change the > behaviour as well. They usually use 'hl-line-range-function' to > define how it should highlight, but... cannot it be made simpler? > Like by making 'hl-line-range-function' a list of choice: > - nil for default behaviour, > - "Screen line" to change to screen line, > - "Function" for user to write what he wants. I think that makes sense, and I think `visual-line-mode' should adjust `hl-line-range-function' automatically to do the visual line highlight. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 26 14:49:19 2021 Received: (at 36361) by debbugs.gnu.org; 26 Oct 2021 18:49:19 +0000 Received: from localhost ([127.0.0.1]:47555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfRVf-0000J6-6r for submit@debbugs.gnu.org; Tue, 26 Oct 2021 14:49:19 -0400 Received: from mail-qv1-f49.google.com ([209.85.219.49]:46011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfRVN-0000ID-KR for 36361@debbugs.gnu.org; Tue, 26 Oct 2021 14:49:17 -0400 Received: by mail-qv1-f49.google.com with SMTP id a4so87407qva.12 for <36361@debbugs.gnu.org>; Tue, 26 Oct 2021 11:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=QsqoBvmC8AI6Auw6N4VwvcIi3Ls3tSvx0s9QbAurcAk=; b=ipxpNqJVG0nHHASwZQCMdGM6nAJrhTCoM0/pHdDLoUSQOvHlk2O4uyNUIh5XpFGxNM nm7kOUdntlxmrJRaznvjCkbuRmSzL2XTWUa3d/Z5+jJQlWbGDSDOGNWCmK+lfIT+2CeP Tku2fhC4+zpX6Bwm9THZ5sn3IzUpisTabdlU+Xz48xy0OOIC9UBCmSlHnHz8Yu54Tqb4 6j15MZtA5fgooxJinlxYjgcZswzMQ3yqkU3jN8231X2ZGKGJ950adxVRfSWgFy69Wji9 Ar6fhb2NbVfngtlQFz/PRe0lkcYuS7bngasH7Pdsozy+Yzn5dQ0q2X9PFVQxnu100aLz mKqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=QsqoBvmC8AI6Auw6N4VwvcIi3Ls3tSvx0s9QbAurcAk=; b=yP+OMympaSFi3GW7z5pKBvfeCRNR6mdfs+4CMRIcS5lwl6ksNzaxTJ27WaneB16lFu hBynJNRw8+mcJntNEwyJs97gh+fEr1t2wwh+6rMOVDHCxZ7HGbSSQhE5RArzmdLCWlc9 1+9a7czQpFRU1h2dm8ZtZj8ejnfM8nzQGn8HCNsl1oDjuZgGfP2uASe1O0wEfIOXSWQc eeeZn+0WTz04c9BQDjg0r+13M6m2SVflRB7DseMKiCNir3QFoQhU8C6umSBX7b/mItBb BKWVdJ5nXTOZzJguqJ+SNjG7rznII3YOKFuMQ6aTVfGLKYP6IgW8jWGKtyKJjFfXFm0M Nowg== X-Gm-Message-State: AOAM532JuKoE2jfaVdMseUGvpQ2GSbbYi7gGChSFRWhn1kXEscj9R7cj x9OcUdpkV/pB3O41Sp/NCjsdoDH9gNQ= X-Google-Smtp-Source: ABdhPJwGJnBWmLJzPRM0aqn2IPUQhheX+TILerZ11moeO82m3K0/OOGZjPa2O3rvmGAl8hdV6L4H4g== X-Received: by 2002:a05:6214:1c42:: with SMTP id if2mr13687411qvb.39.1635274134500; Tue, 26 Oct 2021 11:48:54 -0700 (PDT) Received: from smtpclient.apple (pool-108-26-204-101.bstnma.fios.verizon.net. [108.26.204.101]) by smtp.gmail.com with ESMTPSA id c9sm10705591qtp.75.2021.10.26.11.48.53 for <36361@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Oct 2021 11:48:54 -0700 (PDT) From: Howard Melman Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: bug#36361: 'hl-line-range-function' as list of choice Message-Id: <1EAD3D6A-620E-4863-A0CB-4A7977FE0842@gmail.com> Date: Tue, 26 Oct 2021 14:48:53 -0400 To: 36361@debbugs.gnu.org X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: FWIW, I've been using the following in Emacs 27.2: #+begin_src elisp (defun visual-line-range-function () "Return a cons cell of positions of begining and end of the current line in `visual-line-mode`. Meant to be used as the value of `hl-line-range-f [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hmelman[at]gmail.com) 0.0 T_SPF_HELO_TEMPERROR SPF: test of HELO record failed (temperror) 0.0 T_SPF_TEMPERROR SPF: test of record failed (temperror) 3.7 FAKE_REPLY_B No description available. X-Debbugs-Envelope-To: 36361 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: FWIW, I've been using the following in Emacs 27.2: #+begin_src elisp (defun visual-line-range-function () "Return a cons cell of positions of begining and end of the current line in `visual-line-mode`. Meant to be used as the value of `hl-line-range-f [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hmelman[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.49 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.49 listed in wl.mailspike.net] -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 3.7 FAKE_REPLY_B No description available. FWIW, I've been using the following in Emacs 27.2: #+begin_src elisp (defun visual-line-range-function () "Return a cons cell of positions of begining and end of the current line in `visual-line-mode`. Meant to be used as the value of `hl-line-range-function`." (save-excursion (cons (progn (beginning-of-visual-line) (point)) (progn (beginning-of-visual-line 2) (point))))) (defun set-visual-line-range-function () (setq-local hl-line-range-function (if visual-line-mode 'visual-line-range-function nil))) (add-hook 'visual-line-mode-hook 'set-visual-line-range-function) #+end_src but it seems to conflict with the temporary-goal-column in line-move-visual. If I have a buffer: - foo - bar - zot With point just before foo and do C-n twice, the first one moves point to just before bar, but the second moves point to the beginning of the 3rd line. Suggestions for an improved version are welcome. Howard From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 26 15:11:40 2021 Received: (at 36361) by debbugs.gnu.org; 26 Oct 2021 19:11:40 +0000 Received: from localhost ([127.0.0.1]:47568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfRrH-0000uw-RC for submit@debbugs.gnu.org; Tue, 26 Oct 2021 15:11:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfRrF-0000uf-NF for 36361@debbugs.gnu.org; Tue, 26 Oct 2021 15:11:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfRrA-0001vB-Cm; Tue, 26 Oct 2021 15:11:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=My57kzGsP05iAy9x5hPsZVFDglsyffWtEflwWWjlBSA=; b=paf2hnhvcyy5 QSvtdgVYy0RMlKmX87GrNucctztYSZYBkK4DoK5lK0bnMxyBxvF4zZKMogosNmc5apDtR+t/uMc/k eaihUUtls7s1h+ZycwN6z+hxbh+moPzOQFkGpQ8XrOhIVoefGGUE42xmuHfo+7lmkYEWC/sfkUhxK xataa56lDsjD8+Qb5F3RH5jBm7kDJTv4AfSma/MxOMr4pAzyQiTCRCndu9hnTobU8nbvDfmQ7xvx2 4Ah/+SFCxETWovQgYXh7nm/T1RzWcrAsAiwkGXpn3bHdaPtZ31K7g1HWymnczU/OdjxeRbCWrJcnd qxUKY4CgIcMylN2wrr+PlA==; Received: from [87.69.77.57] (port=4819 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfRr9-0001qj-Rl; Tue, 26 Oct 2021 15:11:32 -0400 Date: Tue, 26 Oct 2021 22:11:28 +0300 Message-Id: <831r47y527.fsf@gnu.org> From: Eli Zaretskii To: Howard Melman In-Reply-To: <1EAD3D6A-620E-4863-A0CB-4A7977FE0842@gmail.com> (message from Howard Melman on Tue, 26 Oct 2021 14:48:53 -0400) Subject: Re: bug#36361: 'hl-line-range-function' as list of choice References: <57613049-fca3-ba0e-82b1-3ff2e1995da8@gmail.com> <1EAD3D6A-620E-4863-A0CB-4A7977FE0842@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36361 Cc: 36361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Howard Melman > Date: Tue, 26 Oct 2021 14:48:53 -0400 > > FWIW, I've been using the following in Emacs 27.2: > > #+begin_src elisp > (defun visual-line-range-function () > "Return a cons cell of positions of begining and end > of the current line in `visual-line-mode`. Meant to be used > as the value of `hl-line-range-function`." > (save-excursion > (cons (progn (beginning-of-visual-line) (point)) > (progn (beginning-of-visual-line 2) (point))))) > > (defun set-visual-line-range-function () > (setq-local hl-line-range-function > (if visual-line-mode 'visual-line-range-function nil))) > > (add-hook 'visual-line-mode-hook 'set-visual-line-range-function) > #+end_src > > but it seems to conflict with the temporary-goal-column in > line-move-visual. If I have a buffer: > > - foo > - bar > - zot > > With point just before foo and do C-n twice, the first one moves point > to just before bar, but the second moves point to the beginning of the > 3rd line. > > Suggestions for an improved version are welcome. Try this: (defun visual-line-range-function () "Return a cons cell of positions of begining and end of the current line in `visual-line-mode`. Meant to be used as the value of `hl-line-range-function`." (save-excursion (cons (progn (vertical-motion 0) (point)) (progn (vertical-motion 1) (point))))) From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 26 15:18:01 2021 Received: (at 36361) by debbugs.gnu.org; 26 Oct 2021 19:18:02 +0000 Received: from localhost ([127.0.0.1]:47572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfRxR-00015V-IY for submit@debbugs.gnu.org; Tue, 26 Oct 2021 15:18:01 -0400 Received: from mail-qt1-f177.google.com ([209.85.160.177]:43943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfRxP-000158-Cl for 36361@debbugs.gnu.org; Tue, 26 Oct 2021 15:17:59 -0400 Received: by mail-qt1-f177.google.com with SMTP id r17so221039qtx.10 for <36361@debbugs.gnu.org>; Tue, 26 Oct 2021 12:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=c2V8CQy/72uOb1LLQkNWaKu0Qqj5A23GNnuXP3OxiGM=; b=jcaFY4E3VnhdMCMHsAD39A1fnOtemJjnDzo1rOi093ip2ond0Pr6I/lWM6jNS+bHtP 6+igw0B5VvFPaDEr8G2IDvTQJ6Invi2F3KzutdOrTW8hewrbQcw+WEx5iocJ8a1FbDW6 QcULHRceiDFFyuT9StuY74vcefcRf3UyDUFiiapmnaSg1OZL4bBr/vYHbO8WZfvpqdRb FmPZGW40lFHhI/vTo32e90qp+V/TKtMohJc8t1zuf24W0T+z1AlQQpKu9WqQxH7eDwsw bdE6XjI1kxWKCGZRs/+Jg68PnenPLVH7DZpfvl+x7CSsSg9rjyDrQNTO6fSGHyl7MuIJ 4pGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=c2V8CQy/72uOb1LLQkNWaKu0Qqj5A23GNnuXP3OxiGM=; b=NOLdOtakBkHT4xxsk090hFTqhg6l1vaKVQ7uXYWsdw5BsbT3gy+h7r5BStdSgPVzXp 5ejK+O4tdCOBt3d7/ndMfYCUUJvf8BCjSpJ/3KYyvlk9GfbU8C6RHQ03FA/9v3nsSTt9 P61G++YMBP4B3eeYIuautCFsk4LK8xAUps+7kZbV406C/07NxOquMc8XLxw1CovWccmO HpUxo9TB244f/4BoSX0RVtFiYQsHGQM7/xtMKM4DPJWRy5mkJMj6se3+BAA2Uh1X/bO8 h83wLAUNQC6dYAqVR5gmQ6tlmdhqYuHUs+wwJ8r9HikfLEzXd3MaPSPAEwDkQ7gkJoTU HDDg== X-Gm-Message-State: AOAM530Fq6qE3Gu4rsfekARMPuOAhqbNyU0sdSi6jVX4TUeu0WpbYtth wx4NKm960R2XfHdQFUOdIumjUtrCqds= X-Google-Smtp-Source: ABdhPJy2KaZU4ID8zo9JCi/Ksv2pEVYq2nKS9O+5oSCbV6tVscz2Wdw/PzS9bQmQ6RsF+DAUblCQmA== X-Received: by 2002:ac8:5f88:: with SMTP id j8mr26610208qta.275.1635275873798; Tue, 26 Oct 2021 12:17:53 -0700 (PDT) Received: from smtpclient.apple (pool-108-26-204-101.bstnma.fios.verizon.net. [108.26.204.101]) by smtp.gmail.com with ESMTPSA id z13sm11180703qtq.30.2021.10.26.12.17.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Oct 2021 12:17:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: bug#36361: 'hl-line-range-function' as list of choice From: Howard Melman In-Reply-To: <831r47y527.fsf@gnu.org> Date: Tue, 26 Oct 2021 15:17:52 -0400 Content-Transfer-Encoding: 7bit Message-Id: <499A8206-22BA-4FAA-A358-858D9C2053E9@gmail.com> References: <57613049-fca3-ba0e-82b1-3ff2e1995da8@gmail.com> <1EAD3D6A-620E-4863-A0CB-4A7977FE0842@gmail.com> <831r47y527.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 36361 Cc: 36361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Oct 26, 2021, at 3:11 PM, Eli Zaretskii wrote: > > Try this: > > (defun visual-line-range-function () > "Return a cons cell of positions of begining and end > of the current line in `visual-line-mode`. Meant to be used > as the value of `hl-line-range-function`." > (save-excursion > (cons (progn (vertical-motion 0) (point)) > (progn (vertical-motion 1) (point))))) That does seem to work well. Thanks. I hope visual-line-mode and hl-line-mode can be made to work well together out of the box. Howard