Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add font-lock for el-patch-def* forms #38

Closed
wants to merge 2 commits into from

Conversation

Fuco1
Copy link
Contributor

@Fuco1 Fuco1 commented Apr 13, 2019

Fixes #35

Copy link
Member

@raxod502 raxod502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to do this on a per-macro basis inside el-patch-deftype, so that syntax highlighting works for all functions, including user-defined ones?

I think this would be best implemented by introducing a new optional key for el-patch-deftype-alist (say :font-lock) which is a function that takes e.g. the name of the macro and then sets up the font-lock appropriately. Then we can have pre-defined functions for the two cases you have here (just like we have el-patch-classify-variable and el-patch-classify-function), and encourage their use.

@Fuco1
Copy link
Contributor Author

Fuco1 commented Apr 14, 2019

Yea that makes sense. I'm leaving for a vacation now for 10 days so I'll cook something afterwards.

@raxod502
Copy link
Member

Sounds good. Enjoy your trip!

@Fuco1
Copy link
Contributor Author

Fuco1 commented Jul 2, 2019

Hey @raxod502 I've done some changes, is this in line with what you invisioned?

I'll add a documentation entry after the review.

Copy link
Member

@raxod502 raxod502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the most part, this looks great. Thanks for incorporating my feedback.

@@ -651,48 +675,55 @@ DEFINITION is a list starting with `defun' or similar."
(el-patch-deftype defconst
:classify el-patch-classify-variable
:locate el-patch-locate-variable
:font-lock #'el-patch-fontify-as-variable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, I'd like these to be unquoted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I personally prefer as little magic as possible especially with macros, so I pass quoted or unquoted based on how it is used later. But consistency almost always trumps purity :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think you are right about preferring quoted, and if I were designing this macro again then I would do it your way. It's not a good enough reason to break backwards compatibility, though :P

@raxod502
Copy link
Member

raxod502 commented Oct 1, 2019

This thread is being closed automatically by Tidier because it is labeled with "waiting on response" and has not seen any activity for 90 days. But don't worry—if you have any information that might advance the discussion, leave a comment and the thread may be reopened :)

@Fuco1
Copy link
Contributor Author

Fuco1 commented Jan 7, 2021

Hey, I completely forgot about this not being merged, as I use it in my config since forever.

I've updated the :font-lock to be passed unquoted and rebased to the latest HEAD. When you have a moment check it out! :)

@Fuco1
Copy link
Contributor Author

Fuco1 commented Jan 7, 2021

(seems like github doesn't re-check my repo if this is closed, maybe reopening will make it refresh... as of now it still shows the old patch)

@raxod502
Copy link
Member

Unfortunately, it seems like it's not possible to re-open the pull request, because I have since deleted the develop branch of el-patch. Would you mind opening a new pull request with the same change?

raxod502 added a commit that referenced this pull request Jan 3, 2022
Closes   #35.
Based on #49
     and #38.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add font-lock for the el-patch-defun & friends
2 participants