From: "Benson Chu" <bensonchu457@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] Added alias for removed font-lock function
Date: Sat, 31 Dec 2022 22:53:01 -0600 [thread overview]
Message-ID: <22714367-c1e6-4562-9af5-63ac6ff0aecb@app.fastmail.com> (raw)
In-Reply-To: <jwvedsrmr62.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
Something like this?
Thanks!
Benson
On Thu, Dec 22, 2022, at 8:49 AM, Stefan Monnier wrote:
>> +(define-obsolete-function-alias 'font-lock-fontify-syntactically-region #'font-lock-default-fontify-syntactically "29.1")
>
>
> Indeed, tho, could you try and fit this within 80 columns?
> Also, I think the better replacement for the old
> `font-lock-fontify-syntactically-region` could be
> (funcall font-lock-fontify-syntactically-function BEG END), which by
> default will end up calling `font-lock-default-fontify-syntactically`.
>
>
> Stefan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Added-back-renamed-function-font-lock-fontify-syntac.patch --]
[-- Type: text/x-patch; name="0001-Added-back-renamed-function-font-lock-fontify-syntac.patch", Size: 2242 bytes --]
From ab0c195fa295409bd53367270bbcb9591071407a Mon Sep 17 00:00:00 2001
From: Benson Chu <bensonchu457@gmail.com>
Date: Sat, 31 Dec 2022 19:45:43 -0600
Subject: [PATCH] Added back renamed function
font-lock-fontify-syntactically-region
A more accurate replacement for font-lock-fontify-syntactically-region
would be a function that funcalls the
font-lock-fontify-syntactically-function variable. That way, callers
of the function can inherit new behavior, if the value of that variable
changes.
* lisp/font-lock.el: remove obsolete alias, added defun for
---
lisp/font-lock.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 831e603239..bb4fce64cc 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1183,7 +1183,7 @@ font-lock-default-fontify-region
(setq font-lock-syntactically-fontified end))
(font-lock-fontify-syntactic-keywords-region start end)))
(unless font-lock-keywords-only
- (funcall font-lock-fontify-syntactically-function beg end loudly))
+ (font-lock-fontify-syntactically-region beg end loudly))
(font-lock-fontify-keywords-region beg end loudly)
`(jit-lock-bounds ,beg . ,end))))
@@ -1531,6 +1531,11 @@ font-lock-comment-start-skip
(defvar font-lock-comment-end-skip nil
"If non-nil, Font Lock mode uses this instead of `comment-end-skip'.")
+(defun font-lock-fontify-syntactically-region (beg end &optional loudly)
+ "Syntactically fontify the text between BEG and END.
+This works by calling `font-lock-fontify-syntactically-function'."
+ (funcall font-lock-fontify-syntactically-function beg end loudly))
+
(defun font-lock-default-fontify-syntactically (start end &optional loudly)
"Put proper face on each string and comment between START and END.
START should be at the beginning of a line."
@@ -2363,7 +2368,6 @@ cpp-font-lock-keywords
(define-obsolete-function-alias 'font-lock-after-fontify-buffer #'ignore "29.1")
(define-obsolete-function-alias 'font-lock-after-unfontify-buffer #'ignore "29.1")
-(define-obsolete-function-alias 'font-lock-fontify-syntactically-region #'font-lock-default-fontify-syntactically "29.1")
\f
(provide 'font-lock)
--
2.39.0
next prev parent reply other threads:[~2023-01-01 4:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 0:11 [PATCH] Added alias for removed font-lock function Benson Chu
2022-12-22 9:01 ` Eli Zaretskii
2022-12-22 14:49 ` Stefan Monnier
2023-01-01 4:53 ` Benson Chu [this message]
2023-01-01 4:57 ` Benson Chu
2023-01-07 8:52 ` Eli Zaretskii
2023-01-07 15:38 ` Stefan Monnier
2023-01-08 11:45 ` Eli Zaretskii
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=22714367-c1e6-4562-9af5-63ac6ff0aecb@app.fastmail.com \
--to=bensonchu457@gmail.com \
--cc=emacs-devel@gnu.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.