bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41810: [PATCH][ELPA] adaptive-wrap: Fontify wrap-prefix


From: Kévin Le Gouguec
Subject: bug#41810: [PATCH][ELPA] adaptive-wrap: Fontify wrap-prefix
Date: Mon, 22 Jun 2020 00:01:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:
>
>> +(defun adaptive-wrap--prefix-face (fcp beg end)
>> +  (or (get-text-property 0 'face fcp)
>> +      <snip>
>> +      (when (= (char-before end) ?\n)
>> +        (let ((eol-face (get-text-property (1- end) 'face)))
>
> Is it guaranteed that (< (point-min) end (1+ (point-max)))?
> Otherwise = and get-text-property will barf.

I think I managed to convince myself that there's no risk; if I'm
reading adaptive-wrap-prefix-function (and jit-lock.el) correctly, end
is always strictly greater than beg (which is at least (point-min)), and
never goes past (point-max).

>> +          (when (and eol-face (adaptive-wrap--face-extends eol-face))
>> +            eol-face)))))
>
> Nit: Can't the when+and be replaced with a single and?

Sure.

>> +                      ?\ ))))
>
> Please change this to ?\s regardless of whether the second patch is
> installed.

Can do.

> Apart from the redundant when, I think it's fine.  If you really want
> to shave off some forms you can write e.g.

Thanks, I'll go with (cond …).

Updated patches:

Attachment: patch1.patch
Description: Text Data

Attachment: patch2.patch
Description: Text Data

Thank you for the review!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]