GNU bug report logs - #76494
[PATCH] Highlight fill-column-indicator when current line is longer than `fill-column'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Elijah Gabe Pérez <eg642616@HIDDEN>; Keywords: patch; dated Sun, 23 Feb 2025 04:22:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 76494 <at> debbugs.gnu.org:


Received: (at 76494) by debbugs.gnu.org; 24 Feb 2025 12:31:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 24 07:31:53 2025
Received: from localhost ([127.0.0.1]:38802 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tmXcn-0003Iz-Ea
	for submit <at> debbugs.gnu.org; Mon, 24 Feb 2025 07:31:53 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:52268)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tmXck-0003Ig-66
 for 76494 <at> debbugs.gnu.org; Mon, 24 Feb 2025 07:31:51 -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 <eliz@HIDDEN>)
 id 1tmXce-0007fV-OM; Mon, 24 Feb 2025 07:31:44 -0500
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=8K5hkKzAT1k+G8hb4G/II2UXMmvv5cskXut2eLIa4sY=; b=PxwUIYsuX5NytW6s35EJ
 mR5hTQLltRzGH29q5L47lVbsmVfI4dyr4VQNW1t5Be6nyQaTuV2IQjrwNx8zzpRjHhJ/7LP0mNwuy
 l6VC4yEgTr9A/AiPgvxuLrjqD/hyO2yAf+oWi2wMIxB6nGNJYvUYoprhgb3pbmioiX4SiLKnfTnE/
 H5qucslW1BsfyyKjvtMYuX5g7tUQKzo+tYqqV0IM5J7EQcmX+6MLyiiVSmTFeINgiBjXhqlK7bxSD
 7w4Cvx9LHAPm3cIERnJ4zr01Q7ygUBoDNwxUJpttOtzSU3sd6mQX8ysPgd/UHwPWjJJcNR8cGpusF
 5pUU26bO91DoUg==;
Date: Mon, 24 Feb 2025 14:31:39 +0200
Message-Id: <86frk3zfpw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
In-Reply-To: <87jz9gdtyc.fsf@HIDDEN> (message from Elijah Gabe
 =?iso-8859-1?Q?P=E9rez?= on Sun, 23 Feb 2025 19:15:07 -0600)
Subject: Re: bug#76494: [PATCH] Highlight fill-column-indicator when current
 line is longer than `fill-column'
References: <87tt8lfg0h.fsf@HIDDEN> <86cyf9i3vj.fsf@HIDDEN>
 <875xl15e4w.fsf@HIDDEN> <864j0lhz1x.fsf@HIDDEN> <87jz9gdtyc.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76494
Cc: 76494 <at> debbugs.gnu.org
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: Elijah Gabe Pérez <eg642616@HIDDEN>
> Cc: 76494 <at> debbugs.gnu.org
> Date: Sun, 23 Feb 2025 19:15:07 -0600
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > The character is the same for all the screen lines, so if you change
> > it, that affects all the lines.
> 
> Not if you use setq-local which prevents this problem,
> such as this code:

There might be some misunderstanding: using setq-local makes the
character local to a buffer, whereas I thought you wanted to use a
special character only for the lines that exceed the fill-column?
When I use your code, then whenever I'm on a line that is too long,
_all_ the fill-column indicators in the window change into the U+2503
character shown in red, not just the indicator of that single line.

Did I misunderstand what you are trying to accomplish?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76494; Package emacs. Full text available.

Message received at 76494 <at> debbugs.gnu.org:


Received: (at 76494) by debbugs.gnu.org; 24 Feb 2025 01:15:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 23 20:15:21 2025
Received: from localhost ([127.0.0.1]:37542 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tmN45-00050N-7s
	for submit <at> debbugs.gnu.org; Sun, 23 Feb 2025 20:15:21 -0500
Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:57373)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1tmN3z-0004vn-PZ
 for 76494 <at> debbugs.gnu.org; Sun, 23 Feb 2025 20:15:19 -0500
Received: by mail-ot1-x344.google.com with SMTP id
 46e09a7af769-7272f1bec4aso1560190a34.2
 for <76494 <at> debbugs.gnu.org>; Sun, 23 Feb 2025 17:15:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740359710; x=1740964510; darn=debbugs.gnu.org;
 h=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=umx42yD96161xgatmL0xYY18zMYM5G+7X47W0BfJd1I=;
 b=gGST6xxQBT/UdVZRDJWyJN5raTkZ4vLQVWTnfXc3NM78TkiimvqZ1hO23IHlKzRgVj
 1NlC4bQVW9RPDoWKR5ESW8Wn8rph0DXMB1G5yoLw2/gECfRD1/xVx/3xb1x5p3DYSLkM
 wtIek4yhkvZHycj2HQC0Vsoq0pGqZm//lyuAiYeOoiQa7uQ1L3VCyIjREStPGDWvbcJ+
 HdHgWlwEz8mnNQWsvJ2wLotbCz2UpM8C/7i2k9+xVEJ6pY+fjBiIVOF95Pfdt94QRpYM
 Ai0bwkHhsSI3xWQ4yHs/heCWu18pUJd0jaOoXVbmQZmEt8XNpbyYcvPt5Vm/SiuT8heM
 mQQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740359710; x=1740964510;
 h=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=umx42yD96161xgatmL0xYY18zMYM5G+7X47W0BfJd1I=;
 b=Rdfv3ghMdIoSkzcBpp944KIjR90uKwksuEop9ijvE6YEDQnjpwxBiaNzTDkxNhwKgf
 z6dqYZfqpy5FAJxPU5WTaxppun2o3dcGx+pEw7O2NM2Wr/os/rSatd7Cw64TpwWc4c6K
 /KwZsNbJPB9IxBOkXLuz0kLCCluUV4bh9b9mzO/OCDmflPOtDB8ej8RIut2Faq3aSwae
 6GHZT4Kd6UG/ZrsHZE8BBcfsqVWf/QRQWl1ZwkvOuQkltqBadhlGnzDSC10eYX6n8qgz
 hOJ4DlJOAg3VVgrY7m/u/TD08hPTaaPR2aS5xpPwoUNzu4+FeBDVYocIV13DhoIuPOFx
 okfw==
X-Gm-Message-State: AOJu0YyZHZqmTo5rapO6zsVxCZdr2JGoz/BWwAgmrLlsNdGKnYSQDnv8
 6YipT5kepZWlLYT6gt8HtgesJXk6BpHX0rsaC7txVXXKNhzicFUiy/WJpX56
X-Gm-Gg: ASbGnctX4cP32aHfmrX2CZ1a5IUkhHU6UXrXhcYVyALVFeUXf/bP3IAqHtA38+y1oym
 mmAxChfn9IDUKUuY6E7sFI5uVfx9TmSwVJ1pGdU6gKGChkasg/qfnWfAYcvM1oqFwiuW5A9/86p
 jAMcN8I7MKuFGIa3jjB7wy2o0TmCjfkrZI+Tb7+dncbnf/jalzvxvo9e1MkL6aCZTbsYpcwLL+K
 7lZvmClUBxiAN9bhrIyNuUziWHGyA7y1cTlvrYSij942PtjWvPHk7PtUG0cWeoPgVu/sw==
X-Google-Smtp-Source: AGHT+IFG86vHBnq2A8x5PWTYwAMIne0igeY4KKSblV+q0F7nSFxN3LaOb0w7hj3QZXEwdSe/xcDWlA==
X-Received: by 2002:a05:6830:730d:b0:727:3692:1490 with SMTP id
 46e09a7af769-7274c1839f7mr8522553a34.2.1740359709711; 
 Sun, 23 Feb 2025 17:15:09 -0800 (PST)
Received: from fedora ([2806:10ae:e:8def::1]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7273a14070esm2185547a34.49.2025.02.23.17.15.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 23 Feb 2025 17:15:09 -0800 (PST)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76494: [PATCH] Highlight fill-column-indicator when current
 line is longer than `fill-column'
In-Reply-To: <864j0lhz1x.fsf@HIDDEN>
References: <87tt8lfg0h.fsf@HIDDEN> <86cyf9i3vj.fsf@HIDDEN>
 <875xl15e4w.fsf@HIDDEN> <864j0lhz1x.fsf@HIDDEN>
Date: Sun, 23 Feb 2025 19:15:07 -0600
Message-ID: <87jz9gdtyc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 76494
Cc: 76494 <at> debbugs.gnu.org
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.7 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

> The character is the same for all the screen lines, so if you change
> it, that affects all the lines.

Not if you use setq-local which prevents this problem,
such as this code:

(add-hook 'display-fill-column-indicator-mode-hook
   (lambda ()
       (add-hook
        'post-command-hook
        (lambda ()
          (if (> (save-excursion (end-of-line) (current-column))
                 fill-column)
              (progn
                (setq-local
                 display-fill-column-indicator-character 9475)
                (face-remap-set-base 'fill-column-indicator
                                     (list :inherit 'error :stipple nil
                                           :box nil :strike-through nil
                                           :overline nil :underline nil)))
            (setq-local
             display-fill-column-indicator-character 9474)
            (face-remap-reset-base 'fill-column-indicator)))
        nil t)))

I couldn't find a way to implement it without it looking terrifying,
so I think I'll just settle with the highlight.

-- 
                                                   - E.G via GNU Emacs.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76494; Package emacs. Full text available.

Message received at 76494 <at> debbugs.gnu.org:


Received: (at 76494) by debbugs.gnu.org; 23 Feb 2025 07:59:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 23 02:59:23 2025
Received: from localhost ([127.0.0.1]:59198 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tm6tX-00015l-2a
	for submit <at> debbugs.gnu.org; Sun, 23 Feb 2025 02:59:23 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:32870)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tm6tR-00015S-IM
 for 76494 <at> debbugs.gnu.org; Sun, 23 Feb 2025 02:59:20 -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 <eliz@HIDDEN>)
 id 1tm6tM-0007l9-0R; Sun, 23 Feb 2025 02:59:12 -0500
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=O3v3xirxiUXzqGcpeBZxWKmkDjy/lsNsrLgc1ORLcKU=; b=D5LCDE2cxdEcjDyjWD80
 504Im84pPrJEu2Y0g1G0wZA4kHFx6T/fiiMSPTaw1RSzdi2W0jTRTV9rZVBDVy+/JnWZEqYPzlJY8
 NlUtMX3sZjqUxP2rg4chRabEBTM60ZfRYqSA4WQI27wsoPpKZahuTCeWPtPlOxDxhu7skFQmrLLSg
 Y0JaJK9Xxjn+TubM3K3BbUdEaSsV5nf5ShD7qmgPL+hT1KPAQTE0uUW95eVnvpTC2ZGKvMdkQ2td8
 /I+wTJ/7o3L1fnPx7sKu67nh6lJ0uOtg/eRMHpZEduahHJCPsSP+SxwYgZ1kjJd9f2+gUez3pex4Z
 554kXo9+u0RcbQ==;
Date: Sun, 23 Feb 2025 09:59:06 +0200
Message-Id: <864j0lhz1x.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <875xl15e4w.fsf@HIDDEN> (message from Elijah Gabe
 =?utf-8?Q?P=C3=A9rez?= on Sun, 23 Feb 2025 01:11:43 -0600)
Subject: Re: bug#76494: [PATCH] Highlight fill-column-indicator when current
 line is longer than `fill-column'
References: <87tt8lfg0h.fsf@HIDDEN> <86cyf9i3vj.fsf@HIDDEN>
 <875xl15e4w.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76494
Cc: 76494 <at> debbugs.gnu.org
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: Elijah Gabe Pérez <eg642616@HIDDEN>
> Cc: 76494 <at> debbugs.gnu.org
> Date: Sun, 23 Feb 2025 01:11:43 -0600
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> I also wanted to do the same for indicator character but I couldn't find
> >> a way to implement it.
> >
> > What do you mean by "indicator character"?
> 
> i meant `display-fill-column-indicator-character', I wanted to
> allow changing its character to a custom one.
> 
> example: use this `┃' character (or one chosen by the user)
> instead default `│' when changing the fill-column-indicator face.

The character is the same for all the screen lines, so if you change
it, that affects all the lines.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76494; Package emacs. Full text available.

Message received at 76494 <at> debbugs.gnu.org:


Received: (at 76494) by debbugs.gnu.org; 23 Feb 2025 07:12:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 23 02:12:06 2025
Received: from localhost ([127.0.0.1]:59117 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tm69l-0007GQ-TW
	for submit <at> debbugs.gnu.org; Sun, 23 Feb 2025 02:12:06 -0500
Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:44132)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1tm69j-0007Fh-1j
 for 76494 <at> debbugs.gnu.org; Sun, 23 Feb 2025 02:12:03 -0500
Received: by mail-ot1-x344.google.com with SMTP id
 46e09a7af769-72726a65cbaso2024918a34.0
 for <76494 <at> debbugs.gnu.org>; Sat, 22 Feb 2025 23:12:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740294706; x=1740899506; darn=debbugs.gnu.org;
 h=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=2/4R6ZmWO3ad+I8/elWJOdFnSy1qyuqhpQIm0ul1gbo=;
 b=OGlAFRmbBjzfUWWwNG/v+giRAFcfxZ5Bm9V+n//g2xyhyvW5DUT6k7l35SmmWmCcdE
 HDOhQnuw00sOGHE4+KesOKCydOiVTpktCDI2DH8gaghxykLfZegvA0lLv0ZNR8I/p0uf
 cTFtXNTmJFW7E2/jOp6Dq6ot1m6CG77u/KPiPgXBOxEO1Y/bc8paW5xLcSbEJeTs/Thf
 5LDlNhaPvepitxo7UK5pan7R1HWOuEG2f8EDU9EWJii3A+7BOOQ+xa+TeIpGxRL/miZS
 dHfjPcE9xv9RbNX+f9FXszQEa9SRpBq6qRMaEEat3NDNuKypr8YVjXQUX5ehaDs/TGZt
 nhvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740294706; x=1740899506;
 h=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=2/4R6ZmWO3ad+I8/elWJOdFnSy1qyuqhpQIm0ul1gbo=;
 b=O06aPVbsCJud7Th3a/68nFlDEkY7t4k+KaxuTRtdd9Z8MTTurcEMDWb4MGABrOU2As
 zhh98f0aRzopR5ud/fZUgPxl4QMVcnPeGJg6mpmfiN3gLWg1dWogNBdE5sxtaXhctG6K
 9Ls9X/CrfNfMAT6iWwPaqTa33sviR8Lnf7WjDg249dnUtf0tL0uoihhW03o4FFJf/vLp
 1Xo8nuNiI7Idfda8UnfxzvFHpUZ0QcO/4Mx6OAJERZVMUVeuiMexTvolPo8k8bJ2ywPn
 xOEfuSR2kFc+iTfiJEdWQch8Aa/GXoRegO9s2iiZ4u3Aen0dBad1Iw/it/0/pyWxVCmS
 u/Zg==
X-Gm-Message-State: AOJu0YxaHqY8CeXaKa/67sTWpp5PzrKB5qBLQeCs2G1ukneaaB71yYzM
 z6Dg8IbwTdmi/kPhhDD0+07Ucl0i2+XrK8SkmTvQrg4opDMCdLoh+8sTRyCm
X-Gm-Gg: ASbGncuiyshn1A2tRp030sqTpfDFXl5MnyAisKFgI7SCU860keY3tmnESRDCtZOlMtb
 YUO7Z7RvOlcNqE8mchEIczaqZFbtHVPpjp9ajHmxTMnCp4vNOOKaXJUBOPKiv3QE1mi+qO1RyMN
 ippQFqYK8qP2TzlCSdmiQSVxiqyxjn3a97UaoDP4Jdptu2JCaC9CNi33+bLom0Uk+FoQXvUCyk3
 YU5ANQcs3G4B2xPS6lTl2099kmjnho1sS3KWoX+u7/HXgVeeVJ3vGP+9vGMDcxuPIC3Xg==
X-Google-Smtp-Source: AGHT+IEeGn092twFxcLiHjcaOXEcPmFM6mM5LFhKZ1fOePBOdJV0p/Uzeicn2WYZQFDwzL869AEy0A==
X-Received: by 2002:a05:6830:6f8d:b0:727:3664:ca23 with SMTP id
 46e09a7af769-7274c0b5000mr7175093a34.0.1740294705522; 
 Sat, 22 Feb 2025 23:11:45 -0800 (PST)
Received: from fedora ([2806:10ae:e:8def::1]) by smtp.gmail.com with ESMTPSA id
 586e51a60fabf-2b954820085sm7594451fac.6.2025.02.22.23.11.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 22 Feb 2025 23:11:44 -0800 (PST)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76494: [PATCH] Highlight fill-column-indicator when current
 line is longer than `fill-column'
In-Reply-To: <86cyf9i3vj.fsf@HIDDEN>
References: <87tt8lfg0h.fsf@HIDDEN> <86cyf9i3vj.fsf@HIDDEN>
Date: Sun, 23 Feb 2025 01:11:43 -0600
Message-ID: <875xl15e4w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 76494
Cc: 76494 <at> debbugs.gnu.org
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.7 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

> I see your change adds a post-command-hook, but when and how is that
> hook removed?

The hook is removed when display-fill-column-indicator-mode is turn-off,
i forgot to remove the hook in the submitted patch, I've fixed it.

>> I also wanted to do the same for indicator character but I couldn't find
>> a way to implement it.
>
> What do you mean by "indicator character"?

i meant `display-fill-column-indicator-character', I wanted to
allow changing its character to a custom one.

example: use this `=E2=94=83' character (or one chosen by the user)
instead default `=E2=94=82' when changing the fill-column-indicator face.

>> +(defcustom display-fill-column-indicator-warning nil
>> +  "Highlight fill-column-indicator when cursor is above `fill-column'.
>> +Non-nil means highlight fill-column-indicator when cursor is
>> +above `fill-column'."
>> +  :type 'boolean)
>
> This lacks a :version tag.
>
> Also, what do you mean by "cursor is above `fill-column'"?  The
> "above" part confuses me.

I updated the patch to clarify this part.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Highlight-fill-column-indicator-when-current-line-is.patch

From bfba03d2fc242bf6ca1d6f2b3a964b27d72a8eda Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Sat, 22 Feb 2025 12:19:07 -0600
Subject: [PATCH] Highlight fill-column-indicator when current line is longer

* lisp/display-fill-column-indicator.el
(display-fill-column-indicator-warning): New use-option.
(display-fill-column-indicator-warning-face): New face.
(display-fill-column-indicator-mode):
Add `display-fill-column-indicator-warning'.
---
 lisp/display-fill-column-indicator.el | 30 ++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el
index c55a03533bd..e2395bb1f01 100644
--- a/lisp/display-fill-column-indicator.el
+++ b/lisp/display-fill-column-indicator.el
@@ -42,6 +42,30 @@ display-fill-column-indicator
   :group 'display
   :link '(info-link "(emacs)Displaying Boundaries"))
 
+(defcustom display-fill-column-indicator-warning nil
+  "Highlight fill-column-indicator when current column is too long.
+Non-nil means highlight fill-column-indicator when current column exceeds
+`display-fill-column-indicator-column'."
+  :type 'boolean
+  :version "31.1")
+
+(defface display-fill-column-indicator-warning-face
+  '((t :inherit error :stipple nil))
+  "Face used to highlight `display-fill-column-indicator' when column is too long."
+  :version "31.1")
+
+(defun fill-indicator--set-warning ()
+  "Set the warning face for the fill column indicator."
+  (if-let* ((column (if (integerp display-fill-column-indicator-column)
+                        display-fill-column-indicator-column
+                      fill-column))
+            ((> (save-excursion (end-of-line) (current-column))
+                column)))
+      (progn
+        (face-remap-set-base
+         'fill-column-indicator
+         'display-fill-column-indicator-warning-face))
+    (face-remap-reset-base 'fill-column-indicator)))
 
 ;;;###autoload
 (define-minor-mode display-fill-column-indicator-mode
@@ -68,7 +92,11 @@ display-fill-column-indicator-mode
                              (eq (aref (query-font (car (internal-char-font nil ?\u2502))) 0)
                                  (face-font 'default))))
                     ?\u2502
-                  ?|))))
+                  ?|)))
+        (if display-fill-column-indicator-warning
+            (add-hook 'post-command-hook #'fill-indicator--set-warning nil t)))
+    (if display-fill-column-indicator-warning
+        (remove-hook 'post-command-hook #'fill-indicator--set-warning t))
     (setq display-fill-column-indicator nil)))
 
 (defun display-fill-column-indicator--turn-on ()
-- 
2.48.1


--=-=-=
Content-Type: text/plain



-- 
                                                   - E.G via GNU Emacs.

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76494; Package emacs. Full text available.

Message received at 76494 <at> debbugs.gnu.org:


Received: (at 76494) by debbugs.gnu.org; 23 Feb 2025 06:15:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 23 01:15:08 2025
Received: from localhost ([127.0.0.1]:58953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tm5Gd-000143-Ta
	for submit <at> debbugs.gnu.org; Sun, 23 Feb 2025 01:15:08 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:52630)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tm5Gb-0000z2-5O
 for 76494 <at> debbugs.gnu.org; Sun, 23 Feb 2025 01:15:06 -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 <eliz@HIDDEN>)
 id 1tm5GV-0005mn-TO; Sun, 23 Feb 2025 01:14:59 -0500
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=weSOt42U1jSrLjkBueDv89hygD9WAtqvbM8GKVk3RB8=; b=sLnu1MZwcyYqDfEWm3F/
 Wza/ZKJ3eaR7XBCVLVrwhLhH1mAgJy3iK0DTtH8a0nn+E6olt3N+D7p6urRTMKHrU821FANhWdHgH
 m4DE4G0ndQAnDng+f4Aspb3AFdlkhDk3Mnjgxqmgn8mhuNTAi3+uxjVEK2htAz/ZQ724tE6YhAfuN
 q40AndLM0M7X+fgDjMjhUU9sRnQ+r/8EW8D749TvtUObSr078akhcbq5FrqXj5o2KyvhSMkORLhIs
 vhAOc6TqVb+OXpYN4HuOQEqhHmzDDzkYFbh1WlJ8gPIN6fDXDX0eBHUKsX2JPs/zdcVcStWXY4NoM
 2zD+gdqxFXTM6w==;
Date: Sun, 23 Feb 2025 08:14:56 +0200
Message-Id: <86cyf9i3vj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
In-Reply-To: <87tt8lfg0h.fsf@HIDDEN> (message from Elijah Gabe
 =?iso-8859-1?Q?P=E9rez?= on Sat, 22 Feb 2025 22:21:02 -0600)
Subject: Re: bug#76494: [PATCH] Highlight fill-column-indicator when current
 line is longer than `fill-column'
References: <87tt8lfg0h.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76494
Cc: 76494 <at> debbugs.gnu.org
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: Elijah Gabe Pérez <eg642616@HIDDEN>
> Date: Sat, 22 Feb 2025 22:21:02 -0600
> 
> This patch allow warn to user if current line exceeds
> display-fill-column-indicator-column.

Thanks.

> When current line exceeds display-fill-column-indicator-column ...
>                                            |
> (print "......................................")
>                                            |
> ... fill-column indicator face will change ^
> temporarily to a noticeable face to warn the user that the current
> column is getting too long.

I see your change adds a post-command-hook, but when and how is that
hook removed?

> I also wanted to do the same for indicator character but I couldn't find
> a way to implement it.

What do you mean by "indicator character"?

> +(defcustom display-fill-column-indicator-warning nil
> +  "Highlight fill-column-indicator when cursor is above `fill-column'.
> +Non-nil means highlight fill-column-indicator when cursor is
> +above `fill-column'."
> +  :type 'boolean)

This lacks a :version tag.

Also, what do you mean by "cursor is above `fill-column'"?  The
"above" part confuses me.

> +(defface display-fill-column-indicator-warning-face
> +  '((t :inherit error :stipple nil))
> +  "Face used to highlight fill-column-indicator when the line is too long.")

This should also have a :version tag.  And fill-column-indicator
should be quoted, so that help command produce a cross-reference from
it.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76494; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Feb 2025 04:21:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 22 23:21:25 2025
Received: from localhost ([127.0.0.1]:58701 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tm3Ua-0006A7-QD
	for submit <at> debbugs.gnu.org; Sat, 22 Feb 2025 23:21:25 -0500
Received: from lists.gnu.org ([2001:470:142::17]:39052)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1tm3UX-00069k-Hy
 for submit <at> debbugs.gnu.org; Sat, 22 Feb 2025 23:21:22 -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 <eg642616@HIDDEN>)
 id 1tm3UQ-0001AP-Gl
 for bug-gnu-emacs@HIDDEN; Sat, 22 Feb 2025 23:21:14 -0500
Received: from mail-oo1-xc43.google.com ([2607:f8b0:4864:20::c43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1tm3UO-0001tO-Qa
 for bug-gnu-emacs@HIDDEN; Sat, 22 Feb 2025 23:21:14 -0500
Received: by mail-oo1-xc43.google.com with SMTP id
 006d021491bc7-5fc13355a5bso1571184eaf.3
 for <bug-gnu-emacs@HIDDEN>; Sat, 22 Feb 2025 20:21:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740284470; x=1740889270; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=L/WaXQjPNEmQgWyZjTVYRahSVWvXFzlVv4KOQvJGWU0=;
 b=che7wwIsNzT3g0et4YBqZ/7432Mnw8Gz9SRyPdc385nL6sZKFqHSPtmfHlHwIMSYre
 oOENkNi5mAqGEO+I1o0qk5RFPCCclo2zRficSDdobGQZR+Q3rEdaL0O92L19qlPYka5J
 Aa3n8VeN+OopBLpeXh2j+OIGNFYNTj89wDVToRSx/9pFQOj7Yf9OQYYslX7DFR3SS5n1
 477jMTxvemg9dbZLoOwCHzoBgcc6expatqKCX6al30EciapBU2trM6T90DAa3o8aXJp2
 vqsi5s9EiYCm0D6bTVOWa0L5StSHsgzkOT6vveTODYoImenJY68lb9AP5LXLs3NQx11X
 DLYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740284470; x=1740889270;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=L/WaXQjPNEmQgWyZjTVYRahSVWvXFzlVv4KOQvJGWU0=;
 b=iax6ATSQChrIef/7jvzgTd1YLiyNDRxJHCsG96ogCAmxRR8kFVQRX2/b6dMihzdk9B
 9qp3Y01Wq8Uip1dxtVD7mBrvGClzyE76p7kaQ4jrmQqHOa6BE/LrJbqUJORX/+5JB2qA
 aaFte16SLM6nwBRUhpZBtblBi+XGkY/+0X6A33jd0xICLApeQPh7xSh4SlZl1FXsqgS7
 PjL3ycel0n6ORoouav4nwtMWHIs2lTyV8VnWYLN4kKjI1xXL05fUuQUbPtj3HJaa6VmW
 kxK1O/1DuuDb/3H6utYolRZGuEV0lVZj3bzq8TXXLgUN7CECwvRUtw1rztqCRnA/svSC
 7Ukg==
X-Gm-Message-State: AOJu0Yx1Ol9QqykWt2AYWSBA2uCyR5F5FjSEGnpTvP2TIeLLDt6KUO3E
 91x/FcA45LXwtQraLTFklQMchy1HhqsxeLltH90whYsuqcSuDbekrP104eOY
X-Gm-Gg: ASbGncsb5QqgMdrWeBpZgCGt4sDqjoYL0/pGCMGnFRa7SBygzSj3SLMYm1/Irdlzcms
 UspyQLGQlMefpSjZroBPfk91/46U282ptIUvYJmJHoRZdSbB/DNMQIUUKbgN9e/IMeaLr50W7md
 PLEJrTURBG+/pOeyrvzCWGIaDvYYfMiFXfz//h4KJHQLYDWNAnkSTrnQzNyGKHULZj0SUuHPTcK
 2RT0SsCshvQESqlrKTRctUgTqzIRjTH1KDsDd7rzYz/qsDyz3DDjgLCCEks+9ZyLAALLA==
X-Google-Smtp-Source: AGHT+IG1+qIleq8dAgEHEaGYtf44UjYJcZ3Mr7eLP76TYZ6Y5qO3x6bpR+JAxOA5ZfZzqgmIPBGhSQ==
X-Received: by 2002:a05:6808:250e:b0:3f4:1a4d:81a5 with SMTP id
 5614622812f47-3f4247f2b90mr7062963b6e.39.1740284470649; 
 Sat, 22 Feb 2025 20:21:10 -0800 (PST)
Received: from fedora ([2806:10ae:e:8def::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-3f411bc1179sm1852475b6e.9.2025.02.22.20.21.09
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 22 Feb 2025 20:21:10 -0800 (PST)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Highlight fill-column-indicator when current line is longer
 than `fill-column'
X-Debbugs-Cc: 
Date: Sat, 22 Feb 2025 22:21:02 -0600
Message-ID: <87tt8lfg0h.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::c43;
 envelope-from=eg642616@HIDDEN; helo=mail-oo1-xc43.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Tags: patch This patch allow warn to user if current line
 exceeds display-fill-column-indicator-column. When current line exceeds
 display-fill-column-indicator-column
 ... | (print "") | ... fill-column indicator face will change ^ temporarily
 to a noticeable face to [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
X-Debbugs-Envelope-To: submit
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.2 (/)

--=-=-=
Content-Type: text/plain

Tags: patch

This patch allow warn to user if current line exceeds
display-fill-column-indicator-column.

When current line exceeds display-fill-column-indicator-column ...
                                           |
(print "......................................")
                                           |
... fill-column indicator face will change ^
temporarily to a noticeable face to warn the user that the current
column is getting too long.

I also wanted to do the same for indicator character but I couldn't find
a way to implement it.

(I hope this feature has been understood)


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Highlight-fill-column-indicator-when-current-line-is.patch

From 4f608bb7dbb23b812284fada179a38485e660a9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Sat, 22 Feb 2025 12:19:07 -0600
Subject: [PATCH] Highlight fill-column-indicator when current line is longer
 than ...

... `fill-column'

* lisp/display-fill-column-indicator.el
(display-fill-column-indicator-warning): New use-option.
(display-fill-column-indicator-warning-face): New face.
(display-fill-column-indicator-mode):
Add `display-fill-column-indicator-warning'.
---
 lisp/display-fill-column-indicator.el | 29 ++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el
index c55a03533bd..ca4b51fab2a 100644
--- a/lisp/display-fill-column-indicator.el
+++ b/lisp/display-fill-column-indicator.el
@@ -42,6 +42,15 @@ display-fill-column-indicator
   :group 'display
   :link '(info-link "(emacs)Displaying Boundaries"))
 
+(defcustom display-fill-column-indicator-warning nil
+  "Highlight fill-column-indicator when cursor is above `fill-column'.
+Non-nil means highlight fill-column-indicator when cursor is
+above `fill-column'."
+  :type 'boolean)
+
+(defface display-fill-column-indicator-warning-face
+  '((t :inherit error :stipple nil))
+  "Face used to highlight fill-column-indicator when the line is too long.")
 
 ;;;###autoload
 (define-minor-mode display-fill-column-indicator-mode
@@ -68,7 +77,25 @@ display-fill-column-indicator-mode
                              (eq (aref (query-font (car (internal-char-font nil ?\u2502))) 0)
                                  (face-font 'default))))
                     ?\u2502
-                  ?|))))
+                  ?|)))
+
+        (if display-fill-column-indicator-warning
+            (add-hook
+             'post-command-hook
+             (lambda ()
+               (if-let* ((column (if (numberp display-fill-column-indicator-column)
+                                     display-fill-column-indicator-column
+                                   fill-column))
+                         ((> (save-excursion (end-of-line) (current-column))
+                             column)))
+                   (progn
+                     (face-remap-set-base
+                      'fill-column-indicator
+                      'display-fill-column-indicator-warning-face))
+                 (face-remap-reset-base 'fill-column-indicator)))
+             nil t)
+          )
+        )
     (setq display-fill-column-indicator nil)))
 
 (defun display-fill-column-indicator--turn-on ()
-- 
2.48.1


--=-=-=
Content-Type: text/plain


-- 
                                                   - E.G via GNU Emacs.

--=-=-=--




Acknowledgement sent to Elijah Gabe Pérez <eg642616@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76494; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 24 Feb 2025 22:00:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.