From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#75020: [PATCH] Fix make-separator-line for ttys not supporting underline Date: Sun, 22 Dec 2024 09:49:34 +0100 Message-ID: References: <8634ig6sb9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16208"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75020@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 22 09:51:15 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tPHgA-00042p-Np for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Dec 2024 09:51:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPHfz-00082Z-OJ; Sun, 22 Dec 2024 03:51:03 -0500 Original-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 1tPHfy-00082I-Lg for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 03:51:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPHfy-0001FV-Cz for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 03:51:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=tqtbzcZ4oos2VyEEWkhysdmh4cKD3e/9/XE1+pXwkAc=; b=lduefDaB+9LutPr0zIDLtiy8V67DC6igI7TZEp/bgaGKIinw+9wpwz9DphRxBhCJ7OemmkCralIsOy3/6GEymgOCfbVdGI0Tg4vYR0LzudfT8G/YJq7WIl5lHNeCjtumPwMk0LzBNyDcWrw07edO3P8ls8ZeglqRuF4jqdKF9J0WNIWzA09+b++0pjmATrNG7/2kh36WkElHQGMNCJ1fGl7o99q2WJ14zPtF4ptPTRmOZfEV+rxjj0mZAr+jspcF3+YC6xwuhayfwfOTNwuLf1ucLgAC2rAT25VRhbv91ZluUtxNrPqIUmLUHB2V76hDUXUQVjkPplMDWeyk+xdIbw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tPHfx-0007fT-To for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 03:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Dec 2024 08:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75020 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75020-submit@debbugs.gnu.org id=B75020.173485744529444 (code B ref 75020); Sun, 22 Dec 2024 08:51:01 +0000 Original-Received: (at 75020) by debbugs.gnu.org; 22 Dec 2024 08:50:45 +0000 Original-Received: from localhost ([127.0.0.1]:48976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPHfh-0007ep-9Y for submit@debbugs.gnu.org; Sun, 22 Dec 2024 03:50:45 -0500 Original-Received: from mail-ed1-f49.google.com ([209.85.208.49]:52330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPHfe-0007eZ-U6 for 75020@debbugs.gnu.org; Sun, 22 Dec 2024 03:50:43 -0500 Original-Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5d0d32cd31aso4618731a12.0 for <75020@debbugs.gnu.org>; Sun, 22 Dec 2024 00:50:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734857377; x=1735462177; 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=tqtbzcZ4oos2VyEEWkhysdmh4cKD3e/9/XE1+pXwkAc=; b=HWo5phQ38INoKLSzGd0GMpUPaHN3DPsPxxECh62zy4ood50kUHXIW+Zu8CNQcPv4Dp i78tP8izFHCkWqsjfT0LM9PXyaOcRtQygkEyucNj0exGHZe4jC4RVoJW98p+rpywl2Rp X2jxOlie8cREvqFgszA570mBhMHHTZD2zNzCgxSFYOmY3ScOP8sQfahe0uH71ZQH4F43 bWlqQR5KUY3RTgh/VgFE8GBO0BqqZbXwGSVpi0/B4a2fx+YZEtyhqUExYxNupUYW7iwk nxI2CEmxYgzVPsECrmLt588+kecsBrJQI22g9+d/WzOnM6Au1VhdAO1XWNeKKG0mrVoJ kmHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734857377; x=1735462177; 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=tqtbzcZ4oos2VyEEWkhysdmh4cKD3e/9/XE1+pXwkAc=; b=q2dCx5sDszvmrWFZ+SPjjm1TwI3wHlaSUTLDWdvPeWdDuEOv+5IU6QrZTOoWN8YuNz 0cXRM7HD+rBB0VljptbrjauFf27jbcF8gOZ08NTGAKX8jp0mVdvyWqhZctyfO9Nxe8gl LM7z3WD6P9Ln7lJV0EGyIV+3KfyRyOA6PIlfu1tGNr5YsDjK03rUhaSCoP/UgNiK8SM8 pxMens2uvRR0mnpKSThCHm77PmhO41S8MpLvLAG30Wr6Ha4i/6qZH3n5XUpMNs0sXCdR VSVbV4aax7argAvzMsTofWuM4wTh1YSpsmYXKaF5hJeujO2pkU0oXlGtiSjmS5YD7XQh TQUg== X-Gm-Message-State: AOJu0YyC0+ipQk/YskRt9trs29FTSobvhQ3uINopm+ghSWq6TVs+cAKC 7AEgTOI6Bq9QSLXsjEU+kAVv7ZDtmL57GAMGBUfR6SnCeHunHm3EBATj+A== X-Gm-Gg: ASbGncs6qLyud8iDVmRLH00XpAU154JIeepB6RbbTMxPGawNokpGQHgd6th8gYD1jay Qirv1UG9piEfqsoeDOUScrz/tLGqoY+0oAaglwILxlFbXVSsPg4TuFjsAd9Mnmdyxj0K/mQdFTt GAv9v2nX4uugEnDX1giWVT7a5w2qIb3iTTQJzT8v+Gpbp2BkQCiF6XMqoaS4AALmZsJxzIMdHbo 8CmZlZaVQc5VAdHqu/WUjL9qu1xcYUaIBGg57LX6dtbTAWBqN9YW+9hbL/LYOREdF44FXHX284v VaUjYbFqxItRO00c1/MVIzGHA6uq4HCIg3PNVeUyTtGGrU7xBLa5balDX/dPr/dGyA== X-Google-Smtp-Source: AGHT+IGwq3cMsG2RNdN6mrQiCBcWmynDlySesUF52w+xLnZCFfQf5YGkAIymM7uyVkk+BOEm3KNKFg== X-Received: by 2002:a05:6402:1d53:b0:5d0:bf5e:eb8 with SMTP id 4fb4d7f45d1cf-5d81de06611mr19560863a12.23.1734857376424; Sun, 22 Dec 2024 00:49:36 -0800 (PST) Original-Received: from pro2 (p200300e0b71f6700b0196211433a3436.dip0.t-ipconnect.de. [2003:e0:b71f:6700:b019:6211:433a:3436]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701c89asm3454014a12.79.2024.12.22.00.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 00:49:35 -0800 (PST) In-Reply-To: <8634ig6sb9.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 22 Dec 2024 10:22:02 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297585 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Date: Sun, 22 Dec 2024 08:43:14 +0100 >>=20 >> To reproduce, emacs -nw -Q on a terminal not supporting underlining (in >> my case Terminal.app on macOS). >>=20 >> - M-x display-line-number-mode RET >> - Eval (insert (amke-separator-line)) >>=20 >> =3D> the separator line is too long >>=20 >> Attached patch fixes that. > > Thanks. But I'm not sure this is for make-separator-line to decide. > For example, after applying the patch, using this recipe: > > M-: (insert (make-separator-line)) RET > M-x display-line-number-mode RET > > we will again get a too-long separator line. And with this recipe: > > M-x display-line-number-mode RET > M-: (insert (make-separator-line)) RET > M-x display-line-number-mode RET > > we will get a too-short separator line. > > So arguably, in these special cases, the caller should pass the > required length as the optional argument, because only the caller > knows the context in which the function is called and the purpose for > which the separator will be used. Which would mean the default of > using window-width is correct. > > Does this make sense? Yes, makes sense. I noticed this too now with C-h f context-menu-mode, for example. If the separator line size depends on the window which it currently does, one gets different results. And when the help buffer is shown in a different window, and in my case to the left or right, it's almost always too long and wraps to 2 or 3 lines. It looks pretty weird. But whatever, I'll close the bug in a minute. Thanks!