From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Xinyang Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 07:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61361@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167584219122578 (code B ref -1); Wed, 08 Feb 2023 07:44:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Feb 2023 07:43:11 +0000 Received: from localhost ([127.0.0.1]:54647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPf6k-0005s4-6L for submit@debbugs.gnu.org; Wed, 08 Feb 2023 02:43:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:40104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPc5d-0000GE-3v for submit@debbugs.gnu.org; Tue, 07 Feb 2023 23:29:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPc5c-0007ve-No for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 23:29:48 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11] helo=outgoing.mit.edu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPc5b-0000Vg-7A for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 23:29:48 -0500 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (authenticated bits=0) (User authenticated as chenxy@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 3184Thes012621 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 7 Feb 2023 23:29:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1675830585; bh=zZNjn3Wqj2Q2uvl+HIvE5l2n+SpjxqztIUA+kR6z6ik=; h=From:Date:Subject:To; b=PrSnDU727Q4evr2oI8nTXUyHFlmGylOlW3OqoKkcArsSJBeULTHrAayGFp7Qtz72z CYheW2xDmUIHRKpbP6OuslECMfHq5g8d/wFAxtEa8JEnvtoSDsmIqFGX3LOene3Ptp 0rsO8BtQWML3M8tcErPR0/cQKGvahR8JlSByV+SHCx1C5/EzFsomdDRxVjKlm0oLZ6 528WNx7uoZfQmXZY8P4wvZA8w3olZMMNYA2aL2q3PgA+5aPQbvurEjj801cWhsbzou ugqDzd4HbYHFnAR9sbIzSkbrEHMyy03MPnsrNRQjE5NZ8Bvh4rfreadn6QJ46e0IZh d/f2zCq4Vb+Lg== Received: by mail-ed1-f53.google.com with SMTP id q19so18880481edd.2 for ; Tue, 07 Feb 2023 20:29:44 -0800 (PST) X-Gm-Message-State: AO0yUKW69XyM0qWgdzn5kIqn2d98wOam6fcuhKIwilCd+ILPBenQZqwj nuBYaqNaShVOk03JJgCrfzsEp+5IIeouEkFYWqA= X-Google-Smtp-Source: AK7set/nWiLod7wq/sICWBuzMpXnrQMB7wpAoopOputBiRk+2QTFSaujA+7kpdkeEenaG/6cxSgSfgErODBeVTypeIg= X-Received: by 2002:a50:8741:0:b0:4aa:abae:199f with SMTP id 1-20020a508741000000b004aaabae199fmr1570127edv.47.1675830582740; Tue, 07 Feb 2023 20:29:42 -0800 (PST) MIME-Version: 1.0 From: Xinyang Chen Date: Tue, 7 Feb 2023 23:29:31 -0500 X-Gmail-Original-Message-ID: Message-ID: Content-Type: multipart/alternative; boundary="000000000000968cf405f428b68b" Received-SPF: pass client-ip=18.9.28.11; envelope-from=chenxy@mit.edu; helo=outgoing.mit.edu X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Mailman-Approved-At: Wed, 08 Feb 2023 02:43:09 -0500 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.4 (--) --000000000000968cf405f428b68b Content-Type: text/plain; charset="UTF-8" steps to reproduce: ;; test line (if (and (boundp 'overlay) (overlayp overlay)) (delete-overlay overlay)) (setq overlay (make-overlay 1 2)) (overlay-put overlay 'display "\nhello") ;; same result if you do this intead ;; (overlay-put overlay 'display (propertize "\nhello" 'cursor 0)) cursor does not display in the first line. --000000000000968cf405f428b68b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
steps to reproduce:
;; test line
(if (and (boundp &#= 39;overlay) (overlayp overlay)) (delete-overlay overlay))
(setq overlay = (make-overlay 1 2))
(overlay-put overlay 'display "\nhello"= ;)
;; same result if you do this intead
;; (overlay-put overlay '= display (propertize "\nhello" 'cursor 0))

cursor does = not display in the first line.
--000000000000968cf405f428b68b-- From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 13:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Xinyang Chen Cc: 61361@debbugs.gnu.org Received: via spool by 61361-submit@debbugs.gnu.org id=B61361.167586171611140 (code B ref 61361); Wed, 08 Feb 2023 13:09:01 +0000 Received: (at 61361) by debbugs.gnu.org; 8 Feb 2023 13:08:36 +0000 Received: from localhost ([127.0.0.1]:55034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPkBf-0002tb-Sp for submit@debbugs.gnu.org; Wed, 08 Feb 2023 08:08:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPkBd-0002tG-MW; Wed, 08 Feb 2023 08:08:34 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPkBX-0008Ca-Vm; Wed, 08 Feb 2023 08:08:28 -0500 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=vumEBUcuru2u+Z2Z9HEoOrwyEtzXWNJOCimwJbRokWo=; b=lISR4vYCSGLX iqYybGM3+yt+7zVIG4/yeGi+pZhld3j3due2FlqGef4rdZEsOz38pBMw7qDd6EghatZ4s4ieTZWXd eQSVJN2/IbhIUNxxZizzEloA9BVh/B6XC1IfFbgWAXEhZwbWHee40snPvf/DbjiS7syB0zqI5HsQj BmdEShqCh0OnFX4vKC6MLuYNIRL4BP4IW96a8u1mDyKBzL0jQoHD0KB/0QE7t5DSS5f97O+qo0mhf CAZ+SaW0rAoihXIaVEACsOndRYvvdHid7VJS2lyMHWKsChJfzGaDUh8W/4E1/8c2FcPzmJQ5Nc5q9 1UgdF4cW/+JygSPemnYcxQ==; Received: from [87.69.77.57] (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 1pPkBV-0005rg-95; Wed, 08 Feb 2023 08:08:26 -0500 Date: Wed, 08 Feb 2023 15:08:43 +0200 Message-Id: <83o7q4nw2s.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Xinyang Chen on Tue, 7 Feb 2023 23:29:31 -0500) References: X-Spam-Score: -2.3 (--) 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 (---) tags 61361 wontfix thanks > From: Xinyang Chen > Date: Tue, 7 Feb 2023 23:29:31 -0500 > > steps to reproduce: > ;; test line > (if (and (boundp 'overlay) (overlayp overlay)) (delete-overlay overlay)) > (setq overlay (make-overlay 1 2)) > (overlay-put overlay 'display "\nhello") > ;; same result if you do this intead > ;; (overlay-put overlay 'display (propertize "\nhello" 'cursor 0)) > > cursor does not display in the first line. Emacs cannot do what you are asking because the newline leaves no glyph on display. So the display engine cannot place the cursor on the newline as it does on other characters, which do have glyphs. This is a limitation of the 'cursor' property feature. Sorry. From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Eli Zaretskii , Xinyang Chen Cc: 61361@debbugs.gnu.org Received: via spool by 61361-submit@debbugs.gnu.org id=B61361.167586730029872 (code B ref 61361); Wed, 08 Feb 2023 14:42:02 +0000 Received: (at 61361) by debbugs.gnu.org; 8 Feb 2023 14:41:40 +0000 Received: from localhost ([127.0.0.1]:55159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPldk-0007lk-Ew for submit@debbugs.gnu.org; Wed, 08 Feb 2023 09:41:40 -0500 Received: from mail-wm1-f46.google.com ([209.85.128.46]:36545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPldg-0007lR-EX for 61361@debbugs.gnu.org; Wed, 08 Feb 2023 09:41:38 -0500 Received: by mail-wm1-f46.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so1632253wma.1 for <61361@debbugs.gnu.org>; Wed, 08 Feb 2023 06:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=+H87NkBJwuThtZM2swli+ukSldXLjgB4w1z1qCI1zH8=; b=lg59do2bJLAEie54QJbSWN2tT/oUoaDDLEIS/2rMEHZFY6t0ADJURg0zGfV13YgSyK 7cz0EE5fgWioEaG7b/mT7QGMwvn2zwm/iiaO9poZdS9wj3dMhguF3C9drai6OUU1mx8a MfU5Vs55pg5sDUwNtRV54cn2RfMoJxlRKym/YV9ORWRuhRJb7HV95FYNamQHR4UB/iNB sb/oUoxj7g8AjZqzkVS8PJGsjoQutpitSig+ZYpsIOKUFMgK2ISFm2DO9+ublbVaoM3c qwxlKebSqRbP3WOAs0EI/7BtPDOBFi7bEVE6INrcIeJBVR8K8EMZgzaZyDwRb78TbkGX /glg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+H87NkBJwuThtZM2swli+ukSldXLjgB4w1z1qCI1zH8=; b=PVoQdxuVNZ01TeylkR0vVbV82cbhdr9M2wEVbBEcKskbIaK+LQAJx8nhNWo4lsX0YE p1deZ5DQIBKfO5ulOvLP8yM9wjOHW3V1VzMK74K/rTzqxylyBZ23EGGjrLL7LxDbzjvj n5hmOl4xQTAFZSAFZAS5EzMtkkirMmjvTbdzZ1A0am5RdqYv0k9G3E8mJ6syfNjcoGdZ 0rvAWsKTTnOXyoo2OGO7MSw4SAm2nt48KZJkq5k2vjHeE4+s/To8tFSj88+JBLIXMfZw zeyY3tkeymuyEuZLEIMgXmKyPVya1KUY5NB5sBpSZmHOWwmnMYdUkTjdNJC9P2P3Etk7 pbAQ== X-Gm-Message-State: AO0yUKXYPPrbNfgsQU4uIoPe+OCJdOgCIYrCfbrbtx743JPUHWPzLUmL AquB4yxxALYwpFAyFYhBJFo= X-Google-Smtp-Source: AK7set8iQHVNF5qbOJ6xz7pGGORe8ihANw3YHuT27sAOW6hY8H5tpFG9INKB0CjfaHXyTdzgRK0GtQ== X-Received: by 2002:a05:600c:4494:b0:3dc:5a13:c7d1 with SMTP id e20-20020a05600c449400b003dc5a13c7d1mr8768621wmo.16.1675867290361; Wed, 08 Feb 2023 06:41:30 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id bi5-20020a05600c3d8500b003db012d49b7sm6033693wmb.2.2023.02.08.06.41.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Feb 2023 06:41:29 -0800 (PST) Message-ID: <20e98dc0-c939-7bd8-e922-aba4470a2567@yandex.ru> Date: Wed, 8 Feb 2023 16:41:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US References: <83o7q4nw2s.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83o7q4nw2s.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) 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.9 (-) Hi Eli, On 08/02/2023 15:08, Eli Zaretskii wrote: > tags 61361 wontfix > thanks > >> From: Xinyang Chen >> Date: Tue, 7 Feb 2023 23:29:31 -0500 >> >> steps to reproduce: >> ;; test line >> (if (and (boundp 'overlay) (overlayp overlay)) (delete-overlay overlay)) >> (setq overlay (make-overlay 1 2)) >> (overlay-put overlay 'display "\nhello") >> ;; same result if you do this intead >> ;; (overlay-put overlay 'display (propertize "\nhello" 'cursor 0)) >> >> cursor does not display in the first line. > Emacs cannot do what you are asking because the newline leaves no > glyph on display. So the display engine cannot place the cursor on > the newline as it does on other characters, which do have glyphs. > > This is a limitation of the 'cursor' property feature. Sorry. Could you explain that a little further? When I have a line with text and move point to the end of it, the cursor is rendered, right? Does that use some other method than "glyphs", making it unavailable to the handling of 'cursor' in a display spec? From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Xinyang Chen Cc: 61361@debbugs.gnu.org Received: via spool by 61361-submit@debbugs.gnu.org id=B61361.167586895310328 (code B ref 61361); Wed, 08 Feb 2023 15:10:02 +0000 Received: (at 61361) by debbugs.gnu.org; 8 Feb 2023 15:09:13 +0000 Received: from localhost ([127.0.0.1]:56303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPm4P-0002gW-4X for submit@debbugs.gnu.org; Wed, 08 Feb 2023 10:09:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPm4N-0002gK-3z for 61361@debbugs.gnu.org; Wed, 08 Feb 2023 10:09:11 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPm4G-0000MR-V8; Wed, 08 Feb 2023 10:09:05 -0500 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=2BZyMvxLOacNoUQRaVG4gz6oMCI0YePkqFSOzDRqZPQ=; b=dyCXWkOmZqGh CvoxGWxILaL0xSe0791QVpLQi2oM1U3WeuexT6Z6IEdwOmvLzhqwDnwwMSKQFWbiyU7N/IHQZ2lXX GDfG3S59uOnxC3sxUd4h6buG4ytV+rWxyyX67MLdUdUhytON+/J3Nw8jbyBfkYN0ZbBRgs5nfnFOM 3TusofrfQ/Sb8LCJlG2u0VHZcoVOh6daqs2H/kVQjX9orQc1zc8M+c5X6fxvOOIik0WnB6epxyZGE WmnU+6YNQjvHkly6eWd+e0z6FJrhEq5wwm+kgg6bAXq56xcEiYmo8rjt4qeXUkSxV5tyjwFhnT/4b CuekvKotbmPIf2rxj285HQ==; Received: from [87.69.77.57] (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 1pPm4G-0004GG-5o; Wed, 08 Feb 2023 10:09:04 -0500 Date: Wed, 08 Feb 2023 17:09:22 +0200 Message-Id: <83k00snqhp.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Xinyang Chen on Wed, 8 Feb 2023 09:25:07 -0500) References: <83o7q4nw2s.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Xinyang Chen > Date: Wed, 8 Feb 2023 09:25:07 -0500 > > I'm not seeing the point here though; what happens if you have a line with a single newline? What allows > placing a cursor there in that case? In that case, Emacs _knows_ that point is positioned at the newline, so it does an extra-special trick of placing the cursor after the last character of the line. But the 'cursor' property just supplies the index in the display string where your Lisp program wants to place the cursor. Emacs cannot place point inside a display string. So the display engine needs to find where that index is on display. And it cannot find that place because there's no glyph that corresponds to the newline. From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 15:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Dmitry Gutov Cc: chenxy@mit.edu, 61361@debbugs.gnu.org Received: via spool by 61361-submit@debbugs.gnu.org id=B61361.167586917510708 (code B ref 61361); Wed, 08 Feb 2023 15:13:02 +0000 Received: (at 61361) by debbugs.gnu.org; 8 Feb 2023 15:12:55 +0000 Received: from localhost ([127.0.0.1]:56318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPm7z-0002me-88 for submit@debbugs.gnu.org; Wed, 08 Feb 2023 10:12:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPm7x-0002mL-5z for 61361@debbugs.gnu.org; Wed, 08 Feb 2023 10:12:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPm7r-0004tL-A8; Wed, 08 Feb 2023 10:12:47 -0500 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=imaHWcyW1R4GqKBrHKezC+Q8t/qNW/XTyofdA/EERAI=; b=YyeLTJCp7qV+ SECJxUBPb//N+6JDTVz4DYeCseAifr2UKbi4f060GgvVq6gKY8ise/CHmHoHe6WHvTOZ0QKcBfore 4Yy9MH5qoOYLYRCQkBnb2kAqUTaYcJbPIp0MFjUb+pnRDGdeFGTMcGgJvKpedC9g1ERM+24vXES4Y p5pmwbYPsuYQ6HH9/Wwr8puyPt8oYQYQ+4P2wsDrjcjfjaPjp2n+/5HNe52R1hDNtB7uAViwEoADe SpEVPO0GKFyydK+i30j0tvftpe776D3wpm4zPIKRVG/1/L5ZwdHTU5yQGXLT09+5eGVvP06cy3eb9 vnn7sfSha5ZXT+k6RjAnpw==; Received: from [87.69.77.57] (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 1pPm75-0004bF-LR; Wed, 08 Feb 2023 10:12:35 -0500 Date: Wed, 08 Feb 2023 17:12:18 +0200 Message-Id: <83ilgcnqct.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20e98dc0-c939-7bd8-e922-aba4470a2567@yandex.ru> (message from Dmitry Gutov on Wed, 8 Feb 2023 16:41:28 +0200) References: <83o7q4nw2s.fsf@gnu.org> <20e98dc0-c939-7bd8-e922-aba4470a2567@yandex.ru> X-Spam-Score: -2.3 (--) 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 (---) > Date: Wed, 8 Feb 2023 16:41:28 +0200 > Cc: 61361@debbugs.gnu.org > From: Dmitry Gutov > > Hi Eli, > > On 08/02/2023 15:08, Eli Zaretskii wrote: > > tags 61361 wontfix > > thanks > > > >> From: Xinyang Chen > >> Date: Tue, 7 Feb 2023 23:29:31 -0500 > >> > >> steps to reproduce: > >> ;; test line > >> (if (and (boundp 'overlay) (overlayp overlay)) (delete-overlay overlay)) > >> (setq overlay (make-overlay 1 2)) > >> (overlay-put overlay 'display "\nhello") > >> ;; same result if you do this intead > >> ;; (overlay-put overlay 'display (propertize "\nhello" 'cursor 0)) > >> > >> cursor does not display in the first line. > > Emacs cannot do what you are asking because the newline leaves no > > glyph on display. So the display engine cannot place the cursor on > > the newline as it does on other characters, which do have glyphs. > > > > This is a limitation of the 'cursor' property feature. Sorry. > > Could you explain that a little further? > > When I have a line with text and move point to the end of it, the cursor > is rendered, right? Does that use some other method than "glyphs", > making it unavailable to the handling of 'cursor' in a display spec? Yes, it does use a different method, because in that case the cursor is displayed at point's position, not at some arbitrary index of a string. I just tried to explain the difference, in a previous message. If something is still unclear, please ask more specific questions. From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 15:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Eli Zaretskii , Xinyang Chen Cc: 61361@debbugs.gnu.org Received: via spool by 61361-submit@debbugs.gnu.org id=B61361.167586940911129 (code B ref 61361); Wed, 08 Feb 2023 15:17:01 +0000 Received: (at 61361) by debbugs.gnu.org; 8 Feb 2023 15:16:49 +0000 Received: from localhost ([127.0.0.1]:56328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPmBl-0002tR-A3 for submit@debbugs.gnu.org; Wed, 08 Feb 2023 10:16:49 -0500 Received: from mail-ej1-f53.google.com ([209.85.218.53]:40859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPmBj-0002tC-DY for 61361@debbugs.gnu.org; Wed, 08 Feb 2023 10:16:47 -0500 Received: by mail-ej1-f53.google.com with SMTP id rp23so906355ejb.7 for <61361@debbugs.gnu.org>; Wed, 08 Feb 2023 07:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=G9+hjc53sp/loGFaGW9gs7/8u15IuV1tzd6yCcGw6Mc=; b=SvgaQzwQikFOtph5zJUDH6czQc4KGfPkksKGMXpEopIm6qBJXs55RHWe8Hbd1SWldy G5Q8j36cUNlcxIlvfWcn6F7oAZ/NNNhxsuCyygMnmnMjbpyOZyKfJFsneLhMxjLGMsah hYb7aJ/U4ga75ZKwhHcsGOIrZhEyu+cURfkcpdDVqBH5lQg8q8+ilfIIIAR48OJtSYeD wVsSoLIzTOQIqjjDZAz5otM/9AmXRm6vV/XVyUBd6StcTChRFIDLdWNdIT2E9HUH/W4Q tPPkMDBLSivcHe8z3pBiHiHNpGQsmbC96N7dg8z6jbkX+DnJYKzs+igfpOG6SftaWKVx b4GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=G9+hjc53sp/loGFaGW9gs7/8u15IuV1tzd6yCcGw6Mc=; b=O2CGFaT9Sf7Fsnj3Bk+07E/Tq56X6R1PtTpQikAayoHgDBFiP4fEdxxccPUR8H4oJc LTY5PSXC1vmFbsNjI/neCXAwKx+ggUC3JLDOmEBiHkUkgRgI0t0t94EnMiHv0Mwkpji2 MQuKbJVVmJxFNbRoIXzqywAcfxBvI9B3J9vzoSjG5IdJEAIdDua20aLo16MLSFv3om5u YcVuMzYK5Xq1cUvLvzfuoR1gnDhYLbvDXN+1jxyKDcdpTsqBWhH+SToD0NQYSBOwM36H wtiZGjbrN/+QidlH/jcttNEYpUiNu+dZ9HqKkPjAiEu6iM14B8j+F1ibgKC2V0/gbyKQ RxzA== X-Gm-Message-State: AO0yUKWwVji/p5KwNU7a182lhz046zA3gApmMCqyp2MvjWxt6sysiPjp TlDRnH7zjUkiGm4G5rfvHd8= X-Google-Smtp-Source: AK7set9WrKaajRw3RCs7gFZXHSYDiLDQ1nGdbwLHsiOQqumC9D96prLtxj52cbflPRzMJDfrzXwKkA== X-Received: by 2002:a17:907:7f87:b0:8ae:707:e129 with SMTP id qk7-20020a1709077f8700b008ae0707e129mr3227790ejc.19.1675869401920; Wed, 08 Feb 2023 07:16:41 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id fp3-20020a1709069e0300b008aea5e0938esm692528ejc.183.2023.02.08.07.16.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Feb 2023 07:16:41 -0800 (PST) Message-ID: <05087da5-30d3-dbb5-1dd7-70acf050b37d@yandex.ru> Date: Wed, 8 Feb 2023 17:16:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US References: <83o7q4nw2s.fsf@gnu.org> <83k00snqhp.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83k00snqhp.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) 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.9 (-) On 08/02/2023 17:09, Eli Zaretskii wrote: >> From: Xinyang Chen >> Date: Wed, 8 Feb 2023 09:25:07 -0500 >> >> I'm not seeing the point here though; what happens if you have a line with a single newline? What allows >> placing a cursor there in that case? > In that case, Emacs_knows_ that point is positioned at the newline, > so it does an extra-special trick of placing the cursor after the last > character of the line. > > But the 'cursor' property just supplies the index in the display > string where your Lisp program wants to place the cursor. Emacs > cannot place point inside a display string. So the display engine > needs to find where that index is on display. And it cannot find that > place because there's no glyph that corresponds to the newline. So, no chance of the display engine detecting that the same display string with the 'cursor' property has a newline at that position? That's unfortunate: that means we'll need to create some wonky workaround for displaying a completion preview (in Company) when a completion starts with a newline. From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 15:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Dmitry Gutov Cc: chenxy@mit.edu, 61361@debbugs.gnu.org Received: via spool by 61361-submit@debbugs.gnu.org id=B61361.167587142515076 (code B ref 61361); Wed, 08 Feb 2023 15:51:01 +0000 Received: (at 61361) by debbugs.gnu.org; 8 Feb 2023 15:50:25 +0000 Received: from localhost ([127.0.0.1]:56409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPmiH-0003v5-9C for submit@debbugs.gnu.org; Wed, 08 Feb 2023 10:50:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPmiF-0003uo-4d for 61361@debbugs.gnu.org; Wed, 08 Feb 2023 10:50:24 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPmi8-0006rE-Sh; Wed, 08 Feb 2023 10:50:17 -0500 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=Iu9/4YyWXIUNuXPp1xAuecmR5AkZwkuDeWAkTQ1Zz4A=; b=rgFSF26ByO9a bNYGx5sec5mU7MNQBeZUChLSZhGEkm+scm4exTyqMo2P919gCPUhRCkCqTIFNqB5jbSB9utAUZJWO HN2cqzpWXnU75JqXhOgYlLE9ZJRamcAaclfcHstjmVDZbuw16tBh87CAs5/MXlphlYI5h4aUD5kSk 8nKhRxch9C3SEmvycowp4TYO/tx0fwagGlyK8vHrCKQKHtqmsOUDrL5bHSWakl4DH5o0Af+2lhmnC +HthWtndQFxyDwrwkF4DrFjIu9jhy7Vf+Dkcy0wdBlpJHwnWAMg+wVZYJVt3nseVpW0oK7GLpp0Mj RV4w1e8m4z+2E5jjn4LUvA==; Received: from [87.69.77.57] (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 1pPmi4-0006Pr-DS; Wed, 08 Feb 2023 10:50:16 -0500 Date: Wed, 08 Feb 2023 17:50:29 +0200 Message-Id: <83h6vwnol6.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <05087da5-30d3-dbb5-1dd7-70acf050b37d@yandex.ru> (message from Dmitry Gutov on Wed, 8 Feb 2023 17:16:40 +0200) References: <83o7q4nw2s.fsf@gnu.org> <83k00snqhp.fsf@gnu.org> <05087da5-30d3-dbb5-1dd7-70acf050b37d@yandex.ru> X-Spam-Score: -2.3 (--) 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 (---) > Date: Wed, 8 Feb 2023 17:16:40 +0200 > Cc: 61361@debbugs.gnu.org > From: Dmitry Gutov > > On 08/02/2023 17:09, Eli Zaretskii wrote: > >> From: Xinyang Chen > >> Date: Wed, 8 Feb 2023 09:25:07 -0500 > >> > > But the 'cursor' property just supplies the index in the display > > string where your Lisp program wants to place the cursor. Emacs > > cannot place point inside a display string. So the display engine > > needs to find where that index is on display. And it cannot find that > > place because there's no glyph that corresponds to the newline. > > So, no chance of the display engine detecting that the same display > string with the 'cursor' property has a newline at that position? "No chance" is too strong: this is software, after all. But it's not easy to do that. It involves several places with tricky code, that currently all work in unison, and make the same assumptions: . the decision where to place the cursor works on a screen-line basis: as we perform layout of each screen line, we decide whether the cursor should be in that line, and if so, on what glyph of that line . the decision whether a screen line is a candidate for showing the cursor when that screen line ends in a newline from a display or an overlay string, and/or when there's a gap in buffer positions shown on the screen due to buffer text hidden by some feature . the tricky (to say the least) code which finds the glyph where to put the cursor on a given screen line when buffer positions change non-monotonically with screen positions (due to bidirectional text) and/or have gaps due to overlay and display strings (it is here that the 'cursor' property is implemented) Historically, the 'cursor' property is a relatively late addition to the display engine, it was added in Emacs 22.1. It complicated the display code a little, but then along came bidirectional display and complicated that _a_lot_. So we are now at a place where the original design of the Emacs 21 display never meant to be. The entire design of overlay string display is problematic for adding significant features, because when an overlay string is rendered, we lose too much information about the original overlay (e.g., we don't even record where in the buffer the overlay was positioned, nor the overlay from which the string came). So any feature that needs to support properties of overlay strings must actually go back to buffer text and look up the overlays there to find the one we want! > That's unfortunate: that means we'll need to create some wonky > workaround for displaying a completion preview (in Company) when a > completion starts with a newline. Yes, I know. If someone wants to work on lifting this limitation, I can offer help, but I don't think I'll have time (nor motivation, to say the truth) to work on this myself. From unknown Sat Jun 21 05:15:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61361: cursor cannot be at the start of overlay that starts with a newline Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 22:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Eli Zaretskii Cc: chenxy@mit.edu, 61361@debbugs.gnu.org Received: via spool by 61361-submit@debbugs.gnu.org id=B61361.167589398921860 (code B ref 61361); Wed, 08 Feb 2023 22:07:01 +0000 Received: (at 61361) by debbugs.gnu.org; 8 Feb 2023 22:06:29 +0000 Received: from localhost ([127.0.0.1]:56826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPsaC-0005gW-RM for submit@debbugs.gnu.org; Wed, 08 Feb 2023 17:06:29 -0500 Received: from mail-ej1-f42.google.com ([209.85.218.42]:42694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPsaA-0005gF-HI for 61361@debbugs.gnu.org; Wed, 08 Feb 2023 17:06:27 -0500 Received: by mail-ej1-f42.google.com with SMTP id sa10so1006820ejc.9 for <61361@debbugs.gnu.org>; Wed, 08 Feb 2023 14:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=RbbsTuIWFULKsztJSlf5JZS1pmspEvoOnsNGZvh3Ru4=; b=C4et48kRB5ScVaHc0J8deAzrfW9Xkjro9YoJA6/TOfNk96cEY0zi0y2xJDDVJpDHs5 FMvgBdDoqkwpf1Rajz2zhcxPF1lFAxtWEmsIKt2r6/hG69ti4teSUSIQT4NjjyhMFbp6 qO+phlK035w6dH6fyxf10LlpbXgfKg374K12sf3Us9BYywcVoMlM1EO8vSwqaa+FldQV 61OeUe6YHLMSUfwSn/hwwsSsHvY6QsMlhtxuJQHjteDnB6OyaI4ZczYwBNHQIMVCzEU4 OBSrwabByarClFnd1LsjuoysLNWc4OBB817yGA6KMB63uLdOzRNgMijMFtYJoKW7CvSb Grog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RbbsTuIWFULKsztJSlf5JZS1pmspEvoOnsNGZvh3Ru4=; b=b+Pm2lti5OJBR+kUm7bQp4xGJRMTpAuRR1MAkqmkoSIRKbSTI5ay8JrgKMNxevk3VE Rg6ctMqBIVD4qlpw+W7Z3bH/vvbkr4L8pau9nGPMGst1WndL0/gN9wvE00UhMawZ+9st V0G3+HwEZUU2nxsstswHe7CZPe9eOMO1Rp1Zqv1hGrDYNqZrTCFCAqeju8wmXanRZw/7 kfZHweCzFSE46vCnAIWSJOqD+R8JIMGdqW4nPx2r8Mesu75KVXli3QZoSB033HWTa9fb /XWJagpXXUNGLsft8S1kOJPHBnXkWE+oh9m6+Rkkf9tKo1UKZpNcMYxMO7uD7PCUINoJ 666w== X-Gm-Message-State: AO0yUKVMYMc2RJYhvUZl3+1XG/Q7rbPWdnmxNZ+Vc+odsT/OlE4dINTx 5aQyMz79eU83yaSVJQ3YrKA= X-Google-Smtp-Source: AK7set9jFxiR9AM4dta+3gTenTytewTdZ8yM9YrQqwr/EgAoaeFPlcHCPgDTAU1UlQxG7WOwLSH2Mw== X-Received: by 2002:a17:906:5a5e:b0:8ae:11ca:81de with SMTP id my30-20020a1709065a5e00b008ae11ca81demr3292333ejc.34.1675893980254; Wed, 08 Feb 2023 14:06:20 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id gc1-20020a1709072b0100b008a58c3b8daesm4229ejc.164.2023.02.08.14.06.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Feb 2023 14:06:19 -0800 (PST) Message-ID: <58199b3a-c4e4-ccf9-a9a2-febdcdbcc1f0@yandex.ru> Date: Thu, 9 Feb 2023 00:06:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US References: <83o7q4nw2s.fsf@gnu.org> <83k00snqhp.fsf@gnu.org> <05087da5-30d3-dbb5-1dd7-70acf050b37d@yandex.ru> <83h6vwnol6.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83h6vwnol6.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) 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.9 (-) On 08/02/2023 17:50, Eli Zaretskii wrote: >> Date: Wed, 8 Feb 2023 17:16:40 +0200 >> Cc: 61361@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 08/02/2023 17:09, Eli Zaretskii wrote: >>>> From: Xinyang Chen >>>> Date: Wed, 8 Feb 2023 09:25:07 -0500 >>>> >>> But the 'cursor' property just supplies the index in the display >>> string where your Lisp program wants to place the cursor. Emacs >>> cannot place point inside a display string. So the display engine >>> needs to find where that index is on display. And it cannot find that >>> place because there's no glyph that corresponds to the newline. >> >> So, no chance of the display engine detecting that the same display >> string with the 'cursor' property has a newline at that position? > > "No chance" is too strong: this is software, after all. > > But it's not easy to do that. It involves several places with tricky > code, that currently all work in unison, and make the same > assumptions: > > . the decision where to place the cursor works on a screen-line > basis: as we perform layout of each screen line, we decide whether > the cursor should be in that line, and if so, on what glyph of > that line > . the decision whether a screen line is a candidate for showing the > cursor when that screen line ends in a newline from a display or > an overlay string, and/or when there's a gap in buffer positions > shown on the screen due to buffer text hidden by some feature > . the tricky (to say the least) code which finds the glyph where to > put the cursor on a given screen line when buffer positions change > non-monotonically with screen positions (due to bidirectional > text) and/or have gaps due to overlay and display strings (it is > here that the 'cursor' property is implemented) > > Historically, the 'cursor' property is a relatively late addition to > the display engine, it was added in Emacs 22.1. It complicated the > display code a little, but then along came bidirectional display and > complicated that _a_lot_. So we are now at a place where the original > design of the Emacs 21 display never meant to be. > > The entire design of overlay string display is problematic for adding > significant features, because when an overlay string is rendered, we > lose too much information about the original overlay (e.g., we don't > even record where in the buffer the overlay was positioned, nor the > overlay from which the string came). So any feature that needs to > support properties of overlay strings must actually go back to buffer > text and look up the overlays there to find the one we want! > >> That's unfortunate: that means we'll need to create some wonky >> workaround for displaying a completion preview (in Company) when a >> completion starts with a newline. > > Yes, I know. If someone wants to work on lifting this limitation, I > can offer help, but I don't think I'll have time (nor motivation, to > say the truth) to work on this myself. Thank you for the description. I might try that someday, but definitely not in the near term. Maybe someone beats me to it. Hopefully. From unknown Sat Jun 21 05:15:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Xinyang Chen Subject: bug#61361: closed (Re: bug#61361: cursor cannot be at the start of overlay that starts with a newline) Message-ID: References: X-Gnu-PR-Message: they-closed 61361 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: wontfix Reply-To: 61361@debbugs.gnu.org Date: Mon, 04 Sep 2023 21:09:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1693861742-755-1" This is a multi-part message in MIME format... ------------=_1693861742-755-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61361: cursor cannot be at the start of overlay that starts with a newline which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61361@debbugs.gnu.org. --=20 61361: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61361 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1693861742-755-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61361-done) by debbugs.gnu.org; 4 Sep 2023 21:08:19 +0000 Received: from localhost ([127.0.0.1]:52785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdGny-0000Ak-T5 for submit@debbugs.gnu.org; Mon, 04 Sep 2023 17:08:19 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:53606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdGnv-0000AU-9t for 61361-done@debbugs.gnu.org; Mon, 04 Sep 2023 17:08:17 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-50091b91a83so3048286e87.3 for <61361-done@debbugs.gnu.org>; Mon, 04 Sep 2023 14:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693861689; x=1694466489; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=uATKPgHDQer1OHncx7arC0MgGbKFngV30CNlbeR6Czs=; b=FyAlezXxj1On0BtM3niYGyeG6hfXPkUsd52CTtSBzglbAA/MXgNycf/6rPfO0EGrZR dKtCFPeTLzDl3n54WNUWwQhIKUYe17F7w2pqU5+h5JStwJVM65vlJTqaE/DeYp2BHGph dVxuwDBCX43Vv9ibq4RJ1Gm23F1G+pw/hKGEM5F0pTGRbZSqcwMjSSFQV5a2DzwnXrzJ G3IhSPK/uRR6kZl1vieFE5g/suAaBP62Zney9CN33A7ExNyVeuFVYjcpRRN3I3Zgfwzw uW/bQoBIq5Lh2tL+Q2PEKs/GPUob1zGfn2cBAHryVUMFamacI6qgCBDnYJ3bIwLhYhRD rNUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693861689; x=1694466489; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uATKPgHDQer1OHncx7arC0MgGbKFngV30CNlbeR6Czs=; b=TTOfDrh72oJ8XT7rItq6vgeF0AYCU01MXV9w/FFp+7UcTOmzN68D+UDzrsIEsZKhO9 gossg4d6oU3UIAkxuXHgsTdGofuI0IBUTR6TrpKIFcKyQTYi/k2XBdz1J8ShQY1ZO0Qt DmOL5HMs2TFYiev4mMJeIrI98R32K4ycmeechc/AyKHOSonyW2ya+nF9KbZgvR6iYhoM LVhYud1ONCEcLB5oLBmiNrAsizHLUnvJSEKSBxUmWJTsV+Gs4e7ve4lIazdpbzgf9iUu FeZKovRebkyR6ncHNe613tTLRSpyqdoasi5pZR0sP/lDh8mqOXw4TCas+Y0UEILoXl9L Tz3g== X-Gm-Message-State: AOJu0YzdTyFkqOo0Qhh1b3obOuv8Pu1fpBjwiIMF+XlOU6BNZY0Rm9gc 6H8cR6igk+XqRVC6ZCotwXWfX2ssf9R7AucILcI= X-Google-Smtp-Source: AGHT+IFlNjTVkygF4Rp2mERihRVrs5L2wPiNympQQf8y3gQpvohzw6BAu5G31BYcwsBGnusSChHWVrDLMvPvYvx4ZSo= X-Received: by 2002:a05:6512:104c:b0:4ff:80d4:e132 with SMTP id c12-20020a056512104c00b004ff80d4e132mr8945737lfb.29.1693861689092; Mon, 04 Sep 2023 14:08:09 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Sep 2023 14:08:08 -0700 From: Stefan Kangas In-Reply-To: <83o7q4nw2s.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Feb 2023 15:08:43 +0200") References: <83o7q4nw2s.fsf@gnu.org> MIME-Version: 1.0 Date: Mon, 4 Sep 2023 14:08:08 -0700 Message-ID: Subject: Re: bug#61361: cursor cannot be at the start of overlay that starts with a newline To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61361-done Cc: Xinyang Chen , 61361-done@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 (-) Eli Zaretskii writes: > tags 61361 wontfix > thanks > >> From: Xinyang Chen >> Date: Tue, 7 Feb 2023 23:29:31 -0500 >> >> steps to reproduce: >> ;; test line >> (if (and (boundp 'overlay) (overlayp overlay)) (delete-overlay overlay)) >> (setq overlay (make-overlay 1 2)) >> (overlay-put overlay 'display "\nhello") >> ;; same result if you do this intead >> ;; (overlay-put overlay 'display (propertize "\nhello" 'cursor 0)) >> >> cursor does not display in the first line. > > Emacs cannot do what you are asking because the newline leaves no > glyph on display. So the display engine cannot place the cursor on > the newline as it does on other characters, which do have glyphs. > > This is a limitation of the 'cursor' property feature. Sorry. Since this is a wontfix, I'm closing this bug report. ------------=_1693861742-755-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Feb 2023 07:43:11 +0000 Received: from localhost ([127.0.0.1]:54647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPf6k-0005s4-6L for submit@debbugs.gnu.org; Wed, 08 Feb 2023 02:43:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:40104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPc5d-0000GE-3v for submit@debbugs.gnu.org; Tue, 07 Feb 2023 23:29:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPc5c-0007ve-No for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 23:29:48 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11] helo=outgoing.mit.edu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPc5b-0000Vg-7A for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 23:29:48 -0500 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (authenticated bits=0) (User authenticated as chenxy@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 3184Thes012621 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 7 Feb 2023 23:29:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1675830585; bh=zZNjn3Wqj2Q2uvl+HIvE5l2n+SpjxqztIUA+kR6z6ik=; h=From:Date:Subject:To; b=PrSnDU727Q4evr2oI8nTXUyHFlmGylOlW3OqoKkcArsSJBeULTHrAayGFp7Qtz72z CYheW2xDmUIHRKpbP6OuslECMfHq5g8d/wFAxtEa8JEnvtoSDsmIqFGX3LOene3Ptp 0rsO8BtQWML3M8tcErPR0/cQKGvahR8JlSByV+SHCx1C5/EzFsomdDRxVjKlm0oLZ6 528WNx7uoZfQmXZY8P4wvZA8w3olZMMNYA2aL2q3PgA+5aPQbvurEjj801cWhsbzou ugqDzd4HbYHFnAR9sbIzSkbrEHMyy03MPnsrNRQjE5NZ8Bvh4rfreadn6QJ46e0IZh d/f2zCq4Vb+Lg== Received: by mail-ed1-f53.google.com with SMTP id q19so18880481edd.2 for ; Tue, 07 Feb 2023 20:29:44 -0800 (PST) X-Gm-Message-State: AO0yUKW69XyM0qWgdzn5kIqn2d98wOam6fcuhKIwilCd+ILPBenQZqwj nuBYaqNaShVOk03JJgCrfzsEp+5IIeouEkFYWqA= X-Google-Smtp-Source: AK7set/nWiLod7wq/sICWBuzMpXnrQMB7wpAoopOputBiRk+2QTFSaujA+7kpdkeEenaG/6cxSgSfgErODBeVTypeIg= X-Received: by 2002:a50:8741:0:b0:4aa:abae:199f with SMTP id 1-20020a508741000000b004aaabae199fmr1570127edv.47.1675830582740; Tue, 07 Feb 2023 20:29:42 -0800 (PST) MIME-Version: 1.0 From: Xinyang Chen Date: Tue, 7 Feb 2023 23:29:31 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: cursor cannot be at the start of overlay that starts with a newline To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000968cf405f428b68b" Received-SPF: pass client-ip=18.9.28.11; envelope-from=chenxy@mit.edu; helo=outgoing.mit.edu X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 08 Feb 2023 02:43:09 -0500 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.4 (--) --000000000000968cf405f428b68b Content-Type: text/plain; charset="UTF-8" steps to reproduce: ;; test line (if (and (boundp 'overlay) (overlayp overlay)) (delete-overlay overlay)) (setq overlay (make-overlay 1 2)) (overlay-put overlay 'display "\nhello") ;; same result if you do this intead ;; (overlay-put overlay 'display (propertize "\nhello" 'cursor 0)) cursor does not display in the first line. --000000000000968cf405f428b68b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
steps to reproduce:
;; test line
(if (and (boundp &#= 39;overlay) (overlayp overlay)) (delete-overlay overlay))
(setq overlay = (make-overlay 1 2))
(overlay-put overlay 'display "\nhello"= ;)
;; same result if you do this intead
;; (overlay-put overlay '= display (propertize "\nhello" 'cursor 0))

cursor does = not display in the first line.
--000000000000968cf405f428b68b-- ------------=_1693861742-755-1--