Skip to content

Fixed emacs font-lock issues in site-lisp/kpp.el#151

Merged
yantosca merged 8 commits into
devfrom
feature/fix-kpp-el
May 8, 2026
Merged

Fixed emacs font-lock issues in site-lisp/kpp.el#151
yantosca merged 8 commits into
devfrom
feature/fix-kpp-el

Conversation

@yantosca
Copy link
Copy Markdown
Contributor

In this PR we have used AI to "lint" the site-lisp/kpp.el file. Some of the emacs lisp commands in kpp.el were changed/updated in newer emacs versions and so this was causing rendering issues.

@RolfSander: Please test with your version of emacs and let me know if this works OK.

site-lisp/kpp.el
- Linted this file with Claude AI and resolved several issues that
  were preventing proper font-lock rendering on newer versions
  of emacs.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca added this to the 3.4.1 milestone Apr 30, 2026
@yantosca yantosca requested a review from RolfSander April 30, 2026 15:37
@yantosca yantosca self-assigned this Apr 30, 2026
@yantosca yantosca added the bugfix Fixes a bug or a technical issue label Apr 30, 2026
@RolfSander
Copy link
Copy Markdown
Contributor

Thanks, @yantosca, I will check the new .el file. Please give
me some time...

@RolfSander
Copy link
Copy Markdown
Contributor

I noticed that kpp.el still contains #WRITE_ATM,
#WRITE_MAT, #WRITE_OPT and #WRITE_SPC. Can they be deleted?

@RolfSander
Copy link
Copy Markdown
Contributor

I found several other obsolete KPP commands and section names which
apparently were re-introduced by the AI: #DEFRAD, #INITIALIZE,
#LUMP, #RUN, #SETRAD, #SPARSEDATA, #TRANSPORTALL,
#TRANSPORT, #USES, #USE, #XGRID, #YGRID, #ZGRID.

@RolfSander
Copy link
Copy Markdown
Contributor

Since the suffixes .def and .spc are also used for other (non-KPP)
files, the new code does not activate the KPP mode for these files
anymore. Do we want this change? I see two options:

  1. We re-activate the KPP mode for all *.def and *.spc files. This
    should be fine if people who use our kpp.el know what they are
    doing.

  2. Instead of activating the KPP mode automatically, we add the
    following header to all our *.def and *.spc files:

    // -*- kpp -*-

    With this option, non-KPP *.def and *.spc files won't be
    affected. However, we would have to remember in the future to always
    add this header to our new files. In addition, it means that we have
    an emacs-specific header in the files which is irrelevant when using
    a different editor.

I'm not sure what's better but I tend towards option 1.

@yantosca
Copy link
Copy Markdown
Contributor Author

yantosca commented May 4, 2026

Thanks @RolfSander. Let's go with option 1.

@RolfSander
Copy link
Copy Markdown
Contributor

OK, I'll re-activate spc and def.

@RolfSander
Copy link
Copy Markdown
Contributor

Do you want me to delete the obsolete KPP commands and section names?

@RolfSander
Copy link
Copy Markdown
Contributor

As there were no objections, I have removed the obsolete KPP sections
and commands again.

Copy link
Copy Markdown
Contributor

@RolfSander RolfSander left a comment

Choose a reason for hiding this comment

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

It works fine for me now.

@yantosca yantosca merged commit d3c408c into dev May 8, 2026
10 checks passed
@yantosca yantosca deleted the feature/fix-kpp-el branch May 8, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug or a technical issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants