* [PATCH] Added alias for removed font-lock function @ 2022-12-22 0:11 Benson Chu 2022-12-22 9:01 ` Eli Zaretskii 2022-12-22 14:49 ` Stefan Monnier 0 siblings, 2 replies; 8+ messages in thread From: Benson Chu @ 2022-12-22 0:11 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 323 bytes --] Hello, I build Emacs off of master regularly, and recently found that while using the font-lock-studio package, one function in lisp/font-lock.el was renamed. I've added a define-obsolete-function-alias for the renamed function, and have attached a patch to this email. Is this the right way to submit a patch? Thanks! [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Added-alias-for-removed-font-lock-function.patch --] [-- Type: text/x-patch; name="0001-Added-alias-for-removed-font-lock-function.patch", Size: 1025 bytes --] From 280e7fb7f233ee50efeb4995361a5e67a8006c9c Mon Sep 17 00:00:00 2001 From: Benson Chu <bensonchu457@gmail.com> Date: Wed, 21 Dec 2022 17:41:32 -0600 Subject: [PATCH] Added alias for removed font-lock function To: emacs-devel@gnu.org As part of 18947103fabf8070738b3bd9c5a8d02f90988a3d, `font-lock-fontify-syntactically-region' was renamed to `font-lock-default-fontify-sytactically'. * lisp/font-lock.el: added obselete alias for renamed function --- lisp/font-lock.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index bf9a179d6ae..2dfbe3ad232 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2361,6 +2361,7 @@ 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 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Added alias for removed font-lock function 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 1 sibling, 0 replies; 8+ messages in thread From: Eli Zaretskii @ 2022-12-22 9:01 UTC (permalink / raw) To: Benson Chu; +Cc: emacs-devel > Date: Wed, 21 Dec 2022 18:11:50 -0600 > From: "Benson Chu" <bensonchu457@gmail.com> > > I build Emacs off of master regularly, and recently found that while > using the font-lock-studio package, one function in lisp/font-lock.el > was renamed. > > I've added a define-obsolete-function-alias for the renamed function, > and have attached a patch to this email. Is this the right way to > submit a patch? A better way of submitting patches is with "M-x report-emacs-bug", then the patch gets recorded by our issue tracker and has a reference number. I installed this patch on the emacs-29 branch. Thanks. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Added alias for removed font-lock function 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 1 sibling, 1 reply; 8+ messages in thread From: Stefan Monnier @ 2022-12-22 14:49 UTC (permalink / raw) To: Benson Chu; +Cc: emacs-devel > +(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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Added alias for removed font-lock function 2022-12-22 14:49 ` Stefan Monnier @ 2023-01-01 4:53 ` Benson Chu 2023-01-01 4:57 ` Benson Chu 0 siblings, 1 reply; 8+ messages in thread From: Benson Chu @ 2023-01-01 4:53 UTC (permalink / raw) To: emacs-devel [-- 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 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Added alias for removed font-lock function 2023-01-01 4:53 ` Benson Chu @ 2023-01-01 4:57 ` Benson Chu 2023-01-07 8:52 ` Eli Zaretskii 0 siblings, 1 reply; 8+ messages in thread From: Benson Chu @ 2023-01-01 4:57 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 743 bytes --] Er, I mean this. Thanks! Benson On Sat, Dec 31, 2022, at 10:53 PM, Benson Chu wrote: > 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 > Attachments: > * 0001-Added-back-renamed-function-font-lock-fontify-syntac.patch [-- 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: 2306 bytes --] From 6b21f1ed56b0b196fba3a626f50464b91139db47 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 831e603239..eb68bbc5c6 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,12 @@ 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. +If LOUDLY is non-nil, print status messages while fontifying. +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 +2369,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 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Added alias for removed font-lock function 2023-01-01 4:57 ` Benson Chu @ 2023-01-07 8:52 ` Eli Zaretskii 2023-01-07 15:38 ` Stefan Monnier 0 siblings, 1 reply; 8+ messages in thread From: Eli Zaretskii @ 2023-01-07 8:52 UTC (permalink / raw) To: Benson Chu, Stefan Monnier, Lars Ingebrigtsen; +Cc: emacs-devel > Date: Sat, 31 Dec 2022 22:57:34 -0600 > From: "Benson Chu" <bensonchu457@gmail.com> > > Er, I mean this. > > Thanks! > Benson > > On Sat, Dec 31, 2022, at 10:53 PM, Benson Chu wrote: > > 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 > > Attachments: > > * 0001-Added-back-renamed-function-font-lock-fontify-syntac.patch > > From 6b21f1ed56b0b196fba3a626f50464b91139db47 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 Stefan, Lars, any further comments? If not, I will install this soon on the emacs-29 branch. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Added alias for removed font-lock function 2023-01-07 8:52 ` Eli Zaretskii @ 2023-01-07 15:38 ` Stefan Monnier 2023-01-08 11:45 ` Eli Zaretskii 0 siblings, 1 reply; 8+ messages in thread From: Stefan Monnier @ 2023-01-07 15:38 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Benson Chu, Lars Ingebrigtsen, emacs-devel >> From 6b21f1ed56b0b196fba3a626f50464b91139db47 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 > > Stefan, Lars, any further comments? If not, I will install this soon > on the emacs-29 branch. LGTM, Stefan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Added alias for removed font-lock function 2023-01-07 15:38 ` Stefan Monnier @ 2023-01-08 11:45 ` Eli Zaretskii 0 siblings, 0 replies; 8+ messages in thread From: Eli Zaretskii @ 2023-01-08 11:45 UTC (permalink / raw) To: Stefan Monnier; +Cc: bensonchu457, larsi, emacs-devel > From: Stefan Monnier <monnier@iro.umontreal.ca> > Cc: "Benson Chu" <bensonchu457@gmail.com>, Lars Ingebrigtsen > <larsi@gnus.org>, emacs-devel@gnu.org > Date: Sat, 07 Jan 2023 10:38:53 -0500 > > >> From 6b21f1ed56b0b196fba3a626f50464b91139db47 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 > > > > Stefan, Lars, any further comments? If not, I will install this soon > > on the emacs-29 branch. > > LGTM, Thanks, installed on the emacs-29 branch. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-01-08 11:45 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 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
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).