From: Jim Blandy <jimb@red-bean.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: PATCH: Don't mark entire man sections bold
Date: Mon, 19 Oct 2020 19:56:17 -0700 [thread overview]
Message-ID: <CAHgb+0mQzJ8XLk03nCe+w7u_oCAGYQKY3y0MoO9eaU0H3HaW9Q@mail.gmail.com> (raw)
In-Reply-To: <87362cm0r7.fsf@gnus.org>
[-- Attachment #1.1: Type: text/plain, Size: 633 bytes --]
D'oh. Sorry.
On Sun, Oct 18, 2020 at 12:50 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Jim Blandy <jimb@red-bean.com> writes:
>
> > Maybe `Man-fontify-manpage` should be passed more arguments. But it
> > seemed easier just to make ansi-color-apply-on-region more robust, and
> > have it remember the proper starting position whenever there's some
> > highlighting to be resumed.
>
> Sounds like a good idea.
>
> The patch was malformed, though (probably mangled by Gmail), so could
> you resend it as an attachment?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
>
[-- Attachment #1.2: Type: text/html, Size: 1117 bytes --]
[-- Attachment #2: 0001-Man-highlighting-Don-t-occasionally-bold-entire-sect.patch --]
[-- Type: text/x-patch, Size: 1685 bytes --]
From 2b65205572277260d4a317f82bd7d1dd7493287f Mon Sep 17 00:00:00 2001
From: Jim Blandy <jimb@red-bean.com>
Date: Fri, 16 Oct 2020 22:35:16 -0700
Subject: [PATCH] Man highlighting: Don't occasionally bold entire sections.
* lisp/ansi-color.el (ansi-color-apply-on-region): Always save a
restart position in ansi-color-context-region if the region ends with
highlighting active.
---
lisp/ansi-color.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index 141ad2353e..c3b2d98c14 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -414,11 +414,17 @@ ansi-color-apply-on-region
;; if the rest of the region should have a face, put it there
(funcall ansi-color-apply-face-function
start-marker end-marker (ansi-color--find-face codes))
- (setq ansi-color-context-region (if codes (list codes)))))
+ ;; Save a restart position when there are codes active. It's
+ ;; convenient for man.el's process filter to pass `begin'
+ ;; positions that overlap regions previously colored; these
+ ;; `codes' should not be applied to that overlap, so we need
+ ;; to know where they should really start.
+ (setq ansi-color-context-region (if codes (list codes end-marker)))))
;; Clean up our temporary markers.
(unless (eq start-marker (cadr ansi-color-context-region))
(set-marker start-marker nil))
- (set-marker end-marker nil)))
+ (unless (eq end-marker (cadr ansi-color-context-region))
+ (set-marker end-marker nil))))
(defun ansi-color-apply-overlay-face (beg end face)
"Make an overlay from BEG to END, and apply face FACE.
--
2.26.2
next prev parent reply other threads:[~2020-10-20 2:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-17 6:26 PATCH: Don't mark entire man sections bold Jim Blandy
2020-10-18 7:50 ` Lars Ingebrigtsen
2020-10-20 2:56 ` Jim Blandy [this message]
2020-10-20 11:09 ` Lars Ingebrigtsen
2020-10-20 16:17 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHgb+0mQzJ8XLk03nCe+w7u_oCAGYQKY3y0MoO9eaU0H3HaW9Q@mail.gmail.com \
--to=jimb@red-bean.com \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.