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 08:43:14 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31310"; mail-complaints-to="usenet@ciao.gmane.io" To: 75020@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 22 08:44:17 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 1tPGdM-0007z5-Te for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Dec 2024 08:44:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPGdC-0007eQ-33; Sun, 22 Dec 2024 02:44:06 -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 1tPGd8-0007dz-Nv for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 02:44:03 -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 1tPGd8-0002Gq-CX for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 02:44: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:From:To:Subject; bh=YYmKyvLZr80c73TigldWviaZUMbRmynCw5s8n+4Yci0=; b=VKTNvTYlmCwbrHzVgqNB1gEquQT/O0g5DedfU7vbyTQZhxzQ+Dw7nF5Cr4qwC+T1mo7mnyMqaP3gqHj3qvmM4xtw2duOYsI4RHRGvgngkPRkwR0jCu1IxeAzERmmZy/ml4B6tIcWw+r7S9H9eduKDZHe1h+I3vgus580mhGtaJ3TRYF2AYwTSoCbj1QTeX6iQoWeNDksVJwYR6D3nVYvFgKhVjzwelM9GGexiuj3t7etPaw0JD5XpWvwcT6tUYAA7VW9sgJDH+DYsrLO2ncDbRgHmN5k09tuApqMA1id9lvd0jSCgIgFvkWLbxELdsuacQb97rvM/yGW0Gm36YZ7CA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tPGd8-0004Sw-0y for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 02:44:02 -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 07:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75020 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173485340517108 (code B ref -1); Sun, 22 Dec 2024 07:44:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Dec 2024 07:43:25 +0000 Original-Received: from localhost ([127.0.0.1]:48884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPGcW-0004Rs-GH for submit@debbugs.gnu.org; Sun, 22 Dec 2024 02:43:24 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:35816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPGcU-0004Rk-Ek for submit@debbugs.gnu.org; Sun, 22 Dec 2024 02:43:23 -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 1tPGcU-0007cA-6F for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 02:43:22 -0500 Original-Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPGcS-0002Cp-HC for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 02:43:21 -0500 Original-Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-aa6aad76beeso492928666b.2 for ; Sat, 21 Dec 2024 23:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734853398; x=1735458198; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=YYmKyvLZr80c73TigldWviaZUMbRmynCw5s8n+4Yci0=; b=ZpMKdlMmhyMLRU8uP6fORuvfzKwXNBw5aYMKxa+I4sUdA4P3stiM8pNr+rTWEcg1hD 2WuJNbObsLXUJNpkZXdHodypqv/NoNT6uHNCoDknXcELhO3oBPrtnej8vX9oI7s3NvKD fFImMge1f+2m0YREPYHSByj5UA6xUIlfR82AzLbN8LkvI9oF5fC+IiDoMx9gRL7+Vlyp 5bYxwLuF+JjO89E5R3Qq03pNwlRmwR6maXiQbTXpMlYFmnU9WknaM1svHxSn2s7AXwiM ryr5h4X/rNaI2GIwnJ6BOCWn7VrSQ7iot5ruv1gvfzQlMcKBvfmyO9y6ilm71M0DFM2k WucA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734853398; x=1735458198; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YYmKyvLZr80c73TigldWviaZUMbRmynCw5s8n+4Yci0=; b=B8OUoyIyrIgDuaq0HQLLWKiU/wWELXLg5gG0fux35Xfkcj923KqWW6vGGEkLh0j3hF MN4kBLYlwaqEM+PONqc4mXApBxzeaqOvX6UCxHn7/vBLfF69Ij+KKUQq8DD8rawcXXsv Qa5qgVCqM850Qo10EuHtB3E8XXHjHLL0cOJlxCiD3lomrjLcYoIJAVcbhhaN04Gn4W8I ixgT6kLdMctn7LTi6epiLJdASshDINglzw3WqwpC6z/94pRUyY/OLX2DPSuQdxWWoswb yvCGAIOgg+0mBrq1W565+O1TwgT5OA4nSzck7l5s9Xp+nfvdaZrbsHssASkYfmtxUWbp YA+A== X-Gm-Message-State: AOJu0YzlAkGjUezUVLNZuUxOA1dbEb7ZPw64jvW/x/eqNbEF1RBVi4bH GtpegStJtLUX6c3BffHwUGSAShJNvrA9wS62kK1tfHsHMAMSasEQVdJLyw== X-Gm-Gg: ASbGnctNTXX18nldnwqgMwk1hyZP7tlxj+heIL5pqU5xivpYqbnWUrcxuPSHh/R8O2l 2GhvkB0GOVgfE65VJRX+VPRxqvgCkqYmShkx6x7hh2AErY3VFi1s45H4SMBhr3f5CasRNu2mKcp 7VzPjX86gVsdt19MFyYFpB110cEaugqYYqPzAnafWu/HuoG/72IITJzDlujCeUBGvYrCc+xZEgp D/NE87BdlMGaV3DFwRun+NJbs3tOgUMWguyFuHIHYFBgfgw2hqnBLaPcrkhAZb+qb8xo9z/X5VH xlehmFtgWn97yZJuatpQqboelTEEDEQxlmI2im1QsG8j6JcjiICRqmafuyvqvG8RaA== X-Google-Smtp-Source: AGHT+IHHaqZtnKTxsjaRwXLzbWxxuECc3OphR7iDYtKi5ZirAq8mz7fM00vL5JbBdaFcNs4prr2aKQ== X-Received: by 2002:a17:907:3f9b:b0:aa6:5ec2:966c with SMTP id a640c23a62f3a-aac270385acmr807042066b.7.1734853397460; Sat, 21 Dec 2024 23:43:17 -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 a640c23a62f3a-aac0e8301bdsm360655066b.31.2024.12.21.23.43.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 23:43:16 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x630.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-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:297579 Archived-At: --=-=-= Content-Type: text/plain Tags: patch To reproduce, emacs -nw -Q on a terminal not supporting underlining (in my case Terminal.app on macOS). - M-x display-line-number-mode RET - Eval (insert (amke-separator-line)) => the separator line is too long Attached patch fixes that. In GNU Emacs 31.0.50 (build 4, aarch64-apple-darwin24.2.0) of 2024-12-21 built on pro2 Repository revision: cbafbb2dd57993397c0d624461e3611831414e91 Repository branch: cl-packages System Description: macOS 15.2 Configured using: 'configure --without-ns --cache-file /var/folders/1d/k_6t25f94sl83szqbf8gpkrh0000gn/T//config.cache.cl-packages --with-native-compilation --with-mps=yes CC=clang 'CFLAGS=-Wgnu-imaginary-constant -Wunused-result -g -fno-omit-frame-pointer -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -Wno-ignored-attributes -Wno-flag-enum -Wno-missing-method-return-type -Wno-variadic-macros -Wno-strict-prototypes -Wno-availability -Wno-nullability-completeness' --prefix=/Users/gerd/.local' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-make-separator-line-for-ttys-not-supporting-unde.patch >From d481da70010eab163d12f770ed11f8fef171406a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Sun, 22 Dec 2024 08:35:40 +0100 Subject: [PATCH] Fix make-separator-line for ttys not supporting underline * lisp/simple.el (make-separator-line): Use window-max-chars-per-line instead of window-width. --- lisp/simple.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index cb3b12d4402..bd8466a5b1a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -745,8 +745,9 @@ make-separator-line (concat (propertize (make-string length ?\s) 'face 'separator-line) "\n") (propertize "\n" 'face '(:inherit separator-line :extend t))) - ;; In terminals (that don't support underline), use a line of dashes. - (concat (propertize (make-string (or length (1- (window-width))) ?-) + ;; In terminals that don't support underline, use a line of dashes. + (concat (propertize (make-string (or length + (1- (window-max-chars-per-line))) ?-) 'face 'separator-line) "\n"))) -- 2.47.1 --=-=-=--