From: Dmitry Gutov <dmitry@gutov.dev>
To: Juri Linkov <juri@linkov.net>
Cc: 71604-done@debbugs.gnu.org
Subject: bug#71604: diff--get-revision-properties calls set-auto-mode twice
Date: Mon, 17 Jun 2024 23:01:34 +0300 [thread overview]
Message-ID: <e13c882d-61d6-453f-a7e7-4b77872be2a6@gutov.dev> (raw)
In-Reply-To: <865xu7zg6o.fsf@mail.linkov.net>
On 17/06/2024 19:33, Juri Linkov wrote:
>> vc-find-revision-no-save calls set-auto-mode, and then we repeat that call
>> in diff-syntax-fontify-props.
>>
>> Which is a problem with CC Mode because it parses the buffer inside the
>> major mode function, and ends up doing that twice, at least the first time
>> the buffer is initialized before being saved to revision cache. Not exactly
>> double the work, but more work nevertheless.
>>
>> This is a split off from https://debbugs.gnu.org/61667#587. I thought
>> I recalled an existing report of vc-diff being slow, but apparently not.
>>
>> @@ -2883,9 +2883,6 @@ diff--get-revision-properties
>> (buffer (cdr entry)))
>> (if (buffer-live-p buffer)
>> (progn
>> - ;; Don't re-initialize the buffer (which would throw
>> - ;; away the previous fontification work).
>> - (setq file nil)
>> (setq diff--cached-revision-buffers
>> (cons entry
>> (delq entry diff--cached-revision-buffers))))
>> @@ -2905,7 +2902,8 @@ diff--get-revision-properties
>> (diff--cache-schedule-clean)
>> (and buffer
>> (with-current-buffer buffer
>> - (diff-syntax-fontify-props file text line-nb)))))
>> + ;; major mode is set in vc-find-revision-no-save already.
>> + (diff-syntax-fontify-props nil text line-nb)))))
>
> Thanks, looks correct.
Pushed to master, thanks.
prev parent reply other threads:[~2024-06-17 20:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 2:25 bug#71604: diff--get-revision-properties calls set-auto-mode twice Dmitry Gutov
2024-06-17 16:33 ` Juri Linkov
2024-06-17 20:01 ` Dmitry Gutov [this message]
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=e13c882d-61d6-453f-a7e7-4b77872be2a6@gutov.dev \
--to=dmitry@gutov.dev \
--cc=71604-done@debbugs.gnu.org \
--cc=juri@linkov.net \
/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.