X-Loop: help-debbugs@HIDDEN Subject: bug#77452: 31.0.50; Wide characters in left margin on ttys Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 02 Apr 2025 09:53:01 +0000 Resent-Message-ID: <handler.77452.B.174358758130810 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 77452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 77452 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.174358758130810 (code B ref -1); Wed, 02 Apr 2025 09:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Apr 2025 09:53:01 +0000 Received: from localhost ([127.0.0.1]:54992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tzumK-00080p-Rr for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 05:53:01 -0400 Received: from lists.gnu.org ([2001:470:142::17]:51388) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tzumI-0007zj-46 for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 05:52:58 -0400 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 <gerd.moellmann@HIDDEN>) id 1tzumC-0006T1-F5 for bug-gnu-emacs@HIDDEN; Wed, 02 Apr 2025 05:52:52 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <gerd.moellmann@HIDDEN>) id 1tzumA-0003Oc-OE for bug-gnu-emacs@HIDDEN; Wed, 02 Apr 2025 05:52:52 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43948021a45so66080235e9.1 for <bug-gnu-emacs@HIDDEN>; Wed, 02 Apr 2025 02:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743587568; x=1744192368; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=6ELEZuHm2NviJJsTFmfexMrfumTH9m0QD6PTOPnTA28=; b=RM4qRjzwGfEjCtwxAashQhRHOnxmJaDIu7flDNVyQI72O2ktqQcXfWFNMDPsWMbDm7 SQtzVSw/PPeuyUOZQet9Daxn5Ci+PNiWsp9M4SBO7BbGR4NGmrRMiH4e3WxdMOK/hjra /Daj06hWQ1WLD/lLPQ7sfWz/d0loUTevv2WlE/lSo7C1Y9Y+bbTwm8hiGUKB30XZrJ9z DwxskZT4PG7mffkQx2PELqairne91IjBON6Vo7/3DgiNH8YeTK0708+xsPG3kZeB07TV sWolSNe3g8qoWTw0E3QsYRHYnMJyl87EnHMxeeBhN+wj7GoktwtF0KNLSobTQsrUBg9J mhxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743587568; x=1744192368; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6ELEZuHm2NviJJsTFmfexMrfumTH9m0QD6PTOPnTA28=; b=oDE66JNeA1Sy+ltUTmTD1x367OTzncJg4E7TNFGigyjM9/mm4HoDUcUzkqrG1UVgtB Y4tJ7AdG0H1N1W3ZTsyuOP3SJWZbaSY4bbmK6xohcuAlD+/P5B1VJc2hhkfVuW9VzNEY MWQRQ0AhFlxCRGPl+QEJV6VUQIIZ+BsMsgp41osMgGsqSCDUYGlwkEo22PboubHDz6Lq DwQl61Tzx9cQOKGXSR3n7JaKm/ZHR/TvtdOirhHu0ikhxZNT4W+129jCsmKxvfhfBdab 6x4EMBfxrWyz6xUk3x2+Cx0xzdaigTsJov/XGK9nvCrTvoIdBcVPohtM+FKEq9n++u5H TARw== X-Gm-Message-State: AOJu0Yy9769gmEhMsVp0l2k9FX0bvwzr+qj5Up0vwwuy7+CW4u5sUYK0 9MSUTQlh9wQDe/cuIpfE2x34UOwQVzh+loOqlgvXtBJB6jW978qHuoA3Yc4K X-Gm-Gg: ASbGncto3rwcwJsQMicCktwiQcqquC5SpDMtkt+XR4WvI1phzntkqDa+EMeMOwwE6Ha fl/Ugc9V9Np7zGUIYJiGnIj5uN/ydIf9k0BVzSKRKPCsCY6w9BsmSnyW4sLpl7eJ/821pw036ia 8INNGil4bYzLN3+W1IEyTOIRP/im/QWxh3tydI4Um3f7SwCVKrRQx/YBR1fZ+sLG0widMp9ATDQ 0I/kv18amUExCfJB2JiuNg6hqyvQltigVx7yYgt+YGtB534pNeXBHzCnphMoqiCZbaOoKiFijaq TpCSILArI79gQ0BMQMg2hwByiH2vaeeWoy1SiQOoN9R9iGIB8ow66dKgsXrDFRpWeJlSTl2Cdyf dlsv9zKt0r3tJe7kp01rEn7Ge/rHsofgnyrSh92WWNCpDJDOHa0QmsKNYI7IPLp56 X-Google-Smtp-Source: AGHT+IHSaA5QKK41cEb0oVNLWP4J3iONb9vR8Mww2mFz++mlzsPXAFLlz8zPGTySb10dOLt0SOV6tA== X-Received: by 2002:a05:600c:1e0d:b0:43d:2313:7b54 with SMTP id 5b1f17b1804b1-43db61d78c9mr150183345e9.3.1743587568253; Wed, 02 Apr 2025 02:52:48 -0700 (PDT) Received: from pro2 (p200300e0b70a9c0041297a09c80267cb.dip0.t-ipconnect.de. [2003:e0:b70a:9c00:4129:7a09:c802:67cb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43eb61b843bsm15634855e9.40.2025.04.02.02.52.47 for <bug-gnu-emacs@HIDDEN> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Apr 2025 02:52:47 -0700 (PDT) From: Gerd =?UTF-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Date: Wed, 02 Apr 2025 11:52:46 +0200 Message-ID: <m2ecyax53l.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=gerd.moellmann@HIDDEN; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) in emacs -Q -nw, eval=20 (defun foo () (interactive) (with-current-buffer (get-buffer-create "*foo*") (setq left-margin-width 2) (erase-buffer) (insert "abc") (insert (propertize "def" 'display '((margin left-margin) "1=F0=9F=92= =A1"))))) and M-x foo. This creates a buffer "*foo*" displaying a string in a left margin area of width 2. The string consists of 2 characters but has a displ= ay width of 3 since the light bulb character has a display width of 2. (char-width ?=F0=9F=92=A1) =3D> 2 So, writing the left margin string to the terminal advances the output cursor by 3 not 2. This confuses the display engine, as one can witness by editing in the *foo* buffer, adding new lines etc. In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.3.0, NS appkit-2575.40 Version 15.3.2 (Build 24D81)) of 2025-04-02 built on pro2 Repository revision: 71b3298c0e813ba1432e75370c460eea5caf72d5 Repository branch: master System Description: macOS 15.3.2
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Gerd =?UTF-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Subject: bug#77452: Acknowledgement (31.0.50; Wide characters in left margin on ttys) Message-ID: <handler.77452.B.174358758130810.ack <at> debbugs.gnu.org> References: <m2ecyax53l.fsf@HIDDEN> X-Gnu-PR-Message: ack 77452 X-Gnu-PR-Package: emacs Reply-To: 77452 <at> debbugs.gnu.org Date: Wed, 02 Apr 2025 09:53:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 77452 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 77452: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D77452 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#77452: 31.0.50; Wide characters in left margin on ttys Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 02 Apr 2025 12:39:02 +0000 Resent-Message-ID: <handler.77452.B77452.174359753519683 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 77452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gerd =?UTF-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Cc: 77452 <at> debbugs.gnu.org Received: via spool by 77452-submit <at> debbugs.gnu.org id=B77452.174359753519683 (code B ref 77452); Wed, 02 Apr 2025 12:39:02 +0000 Received: (at 77452) by debbugs.gnu.org; 2 Apr 2025 12:38:55 +0000 Received: from localhost ([127.0.0.1]:55966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tzxMs-00057M-E3 for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 08:38:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39654) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tzxMp-00056K-SB for 77452 <at> debbugs.gnu.org; Wed, 02 Apr 2025 08:38:52 -0400 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 <eliz@HIDDEN>) id 1tzxMk-0004RR-Dn; Wed, 02 Apr 2025 08:38:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Klc36QIby17cEpwocFo1AlxRj2UEG4cS+sxedhTtF3g=; b=bSEPRz6olekEsslE1CBf AFCQfKmgqrQ+Wvb3RiILD+e/t8RohQnDMAbbr+66HyhLXVk5iRVlcunGCTPbXKHO8YjvmCjcvwwVP 8aGxEMKMQXc6PFDOK/OZXTyEeFqURg7tgOUqxvjxI3VlpCPd9uxCJSHxe5Tki1ACG4u0pFObJkKfy 9hZ8s4qylFZDJJQ0kGnpQbfrTYVCYhm4c0p51hewX0KaHbeOEtX4J1LybROZkMoVKQ7lnRvoTcEUJ n3Kq/uZfKyGRbBe2b8RnfPaBvgsGaP7DJWf2eqUuTsstg9pGw31AGP3eTBAsCxia2wiKXUHv42TP9 8DHvqHEabypr8A==; Date: Wed, 02 Apr 2025 15:38:02 +0300 Message-Id: <86o6xe20yd.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <m2ecyax53l.fsf@HIDDEN> (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Wed, 02 Apr 2025 11:52:46 +0200) References: <m2ecyax53l.fsf@HIDDEN> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Gerd Möllmann <gerd.moellmann@HIDDEN> > Date: Wed, 02 Apr 2025 11:52:46 +0200 > > in emacs -Q -nw, eval > > (defun foo () > (interactive) > (with-current-buffer (get-buffer-create "*foo*") > (setq left-margin-width 2) > (erase-buffer) > (insert "abc") > (insert (propertize "def" 'display '((margin left-margin) "1💡"))))) > > and M-x foo. > > This creates a buffer "*foo*" displaying a string in a left > margin area of width 2. The string consists of 2 characters but has a display > width of 3 since the light bulb character has a display width of 2. > > (char-width ?💡) > => 2 > > So, writing the left margin string to the terminal advances the output > cursor by 3 not 2. This confuses the display engine, as one can witness > by editing in the *foo* buffer, adding new lines etc. The problem is not the char-width of 💡 nor with advancement of the cursor, the problem is that the string "1💡" doesn't fit in the 2-column wide margin, and Emacs should have displayed only "1", since we cannot clip glyphs on TTY frames. Are you going to work on fixing this long-time problem? Or should I?
X-Loop: help-debbugs@HIDDEN Subject: bug#77452: 31.0.50; Wide characters in left margin on ttys Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 02 Apr 2025 13:06:02 +0000 Resent-Message-ID: <handler.77452.B77452.174359910732695 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 77452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 77452 <at> debbugs.gnu.org Received: via spool by 77452-submit <at> debbugs.gnu.org id=B77452.174359910732695 (code B ref 77452); Wed, 02 Apr 2025 13:06:02 +0000 Received: (at 77452) by debbugs.gnu.org; 2 Apr 2025 13:05:07 +0000 Received: from localhost ([127.0.0.1]:56098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tzxmF-0008VE-1N for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 09:05:07 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:44248) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tzxmC-0008U0-Dy for 77452 <at> debbugs.gnu.org; Wed, 02 Apr 2025 09:05:04 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-39c1efc4577so1452267f8f.0 for <77452 <at> debbugs.gnu.org>; Wed, 02 Apr 2025 06:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743599098; x=1744203898; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8sz5v8VFy6UtKRT1GqTrBz6WLvLdzet+ILv2jiqhNNk=; b=Zgxl9FbgujLDABO9C63TXjTNKYS+gsbJiKvXd4YZE/CN63BuYYlbbRNAwkICbTmwFG Lt5NlAENj4lG8WpVBrgQKN2L8ikMtr89gkSjESUuzRM0K/1zNzccCZ9DF0dAd8nB2at/ pKEFpUXt+L0Ym5IU5Qlwtl5D/lfU6Ap3CFzbYFTxP20ovZ/0/OIYLe7hTsU5x82zFe9j IRGtkgJkSCFoyjn6U5Dm/2yQ21z7Owa4dOL2I7AGYpPbfX7O7FPZU1JUbonNlmLiHXjM 6zbJDnEHgO8sGl8n2AxxTlMm6N7nOg+asDiLVuTdhIi37lioQgKnyehEb6U7LDswtPIj iiww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743599098; x=1744203898; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8sz5v8VFy6UtKRT1GqTrBz6WLvLdzet+ILv2jiqhNNk=; b=qgX7csjnw8JBe1J8tAET/5gq0sD+NWI14Cxlp0DRgqJ1C4cxJj0ny17yY+HVROFUUW k6N7tdiWzLGsdzteNifKm2+/1bG5HAYmXtCilxca672pqOme6lGBmi4TQIU/lRRYRn1q 36TYnnIlWiRhcRlMwswnCPQRAziQbELGMv3DYMuTpKhM01EF2ekvlvWT87oVVCChHLYo 3wplwpTY8r5Y4CLJWVDJADVGYO6MjimJRpgz9aoNNMSvlUpHnRU/cePYwfm2SWVH+8O9 83NDd24jHSMhKZQzC/WkXqHf0OxDcp66SdOT3AbyfumqtLzABiyJA20lRms3KR79tM0w oMOw== X-Gm-Message-State: AOJu0YzOfjJEXpxbkg9wDs+MDPFC2gNAAUUG7PkRHV5yjVZpnB4sTVgD orlHM2wsTbK0o2Dnc4sOuRh7TU+mJMbB5kRr7tpBnTUGE1BCXL5AAf5elS+e X-Gm-Gg: ASbGncuOe9wAskYMgJ7VFhaR6stXiJg/0vV3RegWXZ/WQxMVtjiIPALhnzmQdj8fn4o 3rzbzpHwrW8OauU0unaOa5okLTjaHBuVDcSVTry8+UqQiEqUUbHu2TjggG8t0CnrjzSTZSS2TNZ 16yPlrxymV887/FZ07RAFpYsgzi0KzF/xLG8z91Sci/5nZa4jfP5WplNsyq2udL52rnFRND6gQ1 xwrOraruPeTzZlM+5FhSKD/JVjmJ5cdtspaW2AdSnlcmkkGD9h23RVkoHrdlfcDj9icf9ziuZN7 NufY/sSeDKK8m26N3pmTSKCP43nqz8NVge93/kjPqYyIIWFVFb7dMsBWfAWqd6V1QVbiWVeQjNU ejf2WQIeLh/It1Sr9QtskZu0xwnVqRRDA+YKmK/8Wi0+0WElyYuxCtg== X-Google-Smtp-Source: AGHT+IGr8r0FDbpPlI521kwyTLC2ksvSB/0MCCl9TFwrxQ6Pgm2BHwtR/J+1eXgIPfHDR/S2yJHRmA== X-Received: by 2002:a5d:47c4:0:b0:391:4231:40a with SMTP id ffacd0b85a97d-39c2364ffdemr5918855f8f.33.1743599097211; Wed, 02 Apr 2025 06:04:57 -0700 (PDT) Received: from pro2 (p200300e0b70a9c0041297a09c80267cb.dip0.t-ipconnect.de. [2003:e0:b70a:9c00:4129:7a09:c802:67cb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c0b7a4318sm16628744f8f.87.2025.04.02.06.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Apr 2025 06:04:56 -0700 (PDT) From: Gerd =?UTF-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> In-Reply-To: <86o6xe20yd.fsf@HIDDEN> References: <m2ecyax53l.fsf@HIDDEN> <86o6xe20yd.fsf@HIDDEN> Date: Wed, 02 Apr 2025 15:04:55 +0200 Message-ID: <m2a58yww7c.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> From: Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> >> Date: Wed, 02 Apr 2025 11:52:46 +0200 >>=20 >> in emacs -Q -nw, eval=20 >>=20 >> (defun foo () >> (interactive) >> (with-current-buffer (get-buffer-create "*foo*") >> (setq left-margin-width 2) >> (erase-buffer) >> (insert "abc") >> (insert (propertize "def" 'display '((margin left-margin) "1=F0=9F= =92=A1"))))) >>=20 >> and M-x foo. >>=20 >> This creates a buffer "*foo*" displaying a string in a left >> margin area of width 2. The string consists of 2 characters but has a di= splay >> width of 3 since the light bulb character has a display width of 2. >>=20 >> (char-width ?=F0=9F=92=A1) >> =3D> 2 >>=20 >> So, writing the left margin string to the terminal advances the output >> cursor by 3 not 2. This confuses the display engine, as one can witness >> by editing in the *foo* buffer, adding new lines etc. > > The problem is not the char-width of =F0=9F=92=A1 nor with advancement of= the > cursor, the problem is that the string "1=F0=9F=92=A1" doesn't fit in the > 2-column wide margin, and Emacs should have displayed only "1", since > we cannot clip glyphs on TTY frames. Exactly, that pretty much what I meant :-). The wide character may not be output to the terminal, otherwise display and matrices get out of sync. > Are you going to work on fixing this long-time problem? Or should I? I tried to read and understand display_line etc. this morning, but I'm afra= id there is too much going on there for me to find the cause of this in reasonable time.
X-Loop: help-debbugs@HIDDEN Subject: bug#77452: 31.0.50; Wide characters in left margin on ttys Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 02 Apr 2025 14:49:01 +0000 Resent-Message-ID: <handler.77452.B77452.174360528314846 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 77452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gerd =?UTF-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Cc: 77452 <at> debbugs.gnu.org Received: via spool by 77452-submit <at> debbugs.gnu.org id=B77452.174360528314846 (code B ref 77452); Wed, 02 Apr 2025 14:49:01 +0000 Received: (at 77452) by debbugs.gnu.org; 2 Apr 2025 14:48:03 +0000 Received: from localhost ([127.0.0.1]:58813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tzzNq-0003r9-J8 for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 10:48:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44070) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tzzNn-0003my-Eb for 77452 <at> debbugs.gnu.org; Wed, 02 Apr 2025 10:48:00 -0400 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 <eliz@HIDDEN>) id 1tzzNi-0006G9-1g; Wed, 02 Apr 2025 10:47:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GSaQxkc2zqdi3TvYJODB5r0E35xe8PyNfofSj+uTygA=; b=O3tBBXeBUMTR4R7nDWLQ KDxOzZDYPnMCM+RzKs2SHHaikv9N0HXhPjAkltuPbwDx/FY/vOFc/noo+E+5ZLKAgtcAehUYqJLgY FEEpFIXo5ylZPzbCXFKHK4xwc2xWUmKrkwC3mtwAoj1OEinsVw+L6qaM51V1TjTraB+ucv/ERL/Rz qmJIwRdKSTD3hhhTitnTtk8cY/OaNQnVUI6lc8C5D/6EW+abUN9482TWMTHUnKLPzED5kV6s9pqa1 7SRXj9cdb47/mmzHzTG/J7hXzx4OR37h0fKNWqWgspHCNu2rmMnJt6l5uR8H/s7ciexQ45YlezFXE KT6E2AIL40NMVQ==; Date: Wed, 02 Apr 2025 17:47:47 +0300 Message-Id: <86iknm1uy4.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <m2a58yww7c.fsf@HIDDEN> (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Wed, 02 Apr 2025 15:04:55 +0200) References: <m2ecyax53l.fsf@HIDDEN> <86o6xe20yd.fsf@HIDDEN> <m2a58yww7c.fsf@HIDDEN> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Gerd Möllmann <gerd.moellmann@HIDDEN> > Cc: 77452 <at> debbugs.gnu.org > Date: Wed, 02 Apr 2025 15:04:55 +0200 > > Eli Zaretskii <eliz@HIDDEN> writes: > > > The problem is not the char-width of 💡 nor with advancement of the > > cursor, the problem is that the string "1💡" doesn't fit in the > > 2-column wide margin, and Emacs should have displayed only "1", since > > we cannot clip glyphs on TTY frames. > > Exactly, that pretty much what I meant :-). The wide character may not > be output to the terminal, otherwise display and matrices get out of > sync. > > > Are you going to work on fixing this long-time problem? Or should I? > > I tried to read and understand display_line etc. this morning, but I'm afraid > there is too much going on there for me to find the cause of this in > reasonable time. Does the below look right to you? diff --git a/src/xdisp.c b/src/xdisp.c index 2c676c0..1c54e7c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25685,7 +25685,7 @@ #define RECORD_MAX_MIN_POS(IT) \ /* Now, get the metrics of what we want to display. This also generates glyphs in `row' (which is IT->glyph_row). */ - n_glyphs_before = row->used[TEXT_AREA]; + n_glyphs_before = row->used[it->area]; x = it->current_x; /* Remember the line height so far in case the next element doesn't @@ -25732,6 +25732,7 @@ #define RECORD_MAX_MIN_POS(IT) \ the next one. */ if (it->area != TEXT_AREA) { + enum glyph_row_area area = it->area; row->ascent = max (row->ascent, it->max_ascent); row->height = max (row->height, it->max_ascent + it->max_descent); row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); @@ -25740,6 +25741,14 @@ #define RECORD_MAX_MIN_POS(IT) \ row->extra_line_spacing = max (row->extra_line_spacing, it->max_extra_line_spacing); set_iterator_to_next (it, true); + /* If we exhausted the glyphs of the marginal area... */ + if (it->area != area + /* ...and the last character was multi-column... */ + && it->nglyphs > 1 + /* ...and not all of its glyphs fit in the marginal area... */ + && row->used[area] < n_glyphs_before + it->nglyphs) + /* ...then reset back to the previous character. */ + row->used[area] = n_glyphs_before; /* If we didn't handle the line/wrap prefix above, and the call to set_iterator_to_next just switched to TEXT_AREA, process the prefix now. */
X-Loop: help-debbugs@HIDDEN Subject: bug#77452: 31.0.50; Wide characters in left margin on ttys Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 02 Apr 2025 14:53:05 +0000 Resent-Message-ID: <handler.77452.B77452.174360556316233 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 77452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: gerd.moellmann@HIDDEN Cc: 77452 <at> debbugs.gnu.org Received: via spool by 77452-submit <at> debbugs.gnu.org id=B77452.174360556316233 (code B ref 77452); Wed, 02 Apr 2025 14:53:05 +0000 Received: (at 77452) by debbugs.gnu.org; 2 Apr 2025 14:52:43 +0000 Received: from localhost ([127.0.0.1]:58856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tzzSM-0004Dk-Uc for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 10:52:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58544) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tzzSJ-0004DA-RZ for 77452 <at> debbugs.gnu.org; Wed, 02 Apr 2025 10:52:40 -0400 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 <eliz@HIDDEN>) id 1tzzSE-0007EY-DO; Wed, 02 Apr 2025 10:52:34 -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=V2tVz88SGjvMVB5Q98rOUoYZdznwia+wjm7RhR2oMJI=; b=jOuVgFuwnoTB dCFl8tQGApW0Vnk4X7fLsTgh2uB/QSeW81XkQV7vBsYKekkLotqC5jRWWVun8hMxfAWJKu2fvFccQ 6eGqcie/MLbNkp0rmpVIhTZ2AEHVLhMH9loZmxGkmpq86wzZeMx3mCYu/gVmmTU94dFaEpKed2r7h MI8EAsZO+LGPvXnQG4dcwk9Ykn+L7FP6tpIbni/f9pJXvXI/a1BM/xyDjidXew8HD9YHL71KFDzIJ KCai7M/EByjxw2nwkDQV9mvq4DyEjayYIF3xxho7pv7k2C+lUMsunDi1yNaJyahl5Vq71d/7hUJeH cP501B6h56FptHjnYatr4g==; Date: Wed, 02 Apr 2025 17:52:27 +0300 Message-Id: <86h6361uqc.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <86iknm1uy4.fsf@HIDDEN> (message from Eli Zaretskii on Wed, 02 Apr 2025 17:47:47 +0300) References: <m2ecyax53l.fsf@HIDDEN> <86o6xe20yd.fsf@HIDDEN> <m2a58yww7c.fsf@HIDDEN> <86iknm1uy4.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: 77452 <at> debbugs.gnu.org > Date: Wed, 02 Apr 2025 17:47:47 +0300 > From: Eli Zaretskii <eliz@HIDDEN> > > > I tried to read and understand display_line etc. this morning, but I'm afraid > > there is too much going on there for me to find the cause of this in > > reasonable time. > > Does the below look right to you? Sorry, please try the slightly more safe change below: diff --git a/src/xdisp.c b/src/xdisp.c index 2c676c0..33d7314 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25685,7 +25685,7 @@ #define RECORD_MAX_MIN_POS(IT) \ /* Now, get the metrics of what we want to display. This also generates glyphs in `row' (which is IT->glyph_row). */ - n_glyphs_before = row->used[TEXT_AREA]; + n_glyphs_before = row->used[it->area]; x = it->current_x; /* Remember the line height so far in case the next element doesn't @@ -25732,6 +25732,7 @@ #define RECORD_MAX_MIN_POS(IT) \ the next one. */ if (it->area != TEXT_AREA) { + enum glyph_row_area area = it->area; row->ascent = max (row->ascent, it->max_ascent); row->height = max (row->height, it->max_ascent + it->max_descent); row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); @@ -25740,6 +25741,15 @@ #define RECORD_MAX_MIN_POS(IT) \ row->extra_line_spacing = max (row->extra_line_spacing, it->max_extra_line_spacing); set_iterator_to_next (it, true); + if (!FRAME_WINDOW_P (it->f) + /* If we exhausted the glyphs of the marginal area... */ + it->area != area + /* ...and the last character was multi-column... */ + && it->nglyphs > 1 + /* ...and not all of its glyphs fit in the marginalk area... */ + && row->used[area] < n_glyphs_before + it->nglyphs) + /* ...then reset back to the previous character. */ + row->used[area] = n_glyphs_before; /* If we didn't handle the line/wrap prefix above, and the call to set_iterator_to_next just switched to TEXT_AREA, process the prefix now. */
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.