Skip to content

GeanyLua: Add the 'comment' field to 'geany.fileinfo'; rename fields 'opener' and 'closer' to 'comment_open' and 'comment_close'. #1397

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Skif-off
Copy link
Contributor

@Skif-off Skif-off commented Dec 30, 2024

From discussion 4174.

It's really strange: we have information about multi-line comments, but no single-line comments. Let's fix this :)

@xiota
Copy link
Contributor

xiota commented Apr 11, 2025

Would "comment" instead of "single" be better?

@Skif-off
Copy link
Contributor Author

Yes, sounds better. Fixed.

@b4n
Copy link
Member

b4n commented Apr 11, 2025

opener and closer sound real weird, but that's already there. But why not simply use the same name as Geany for this new one? So one day those other two weird names could also use a better one without having comment already there rendering things less clear. JMO.

@xiota
Copy link
Contributor

xiota commented Apr 11, 2025

If the plan is to eventually use the same names as Geany, should add all three now, comment_single, comment_open, comment_close... and note opener/closer as deprecated.

@Skif-off
Copy link
Contributor Author

comment_open and comment_close sound clearer, but they are longer (this is a bit unusual for fields).

If the plan is to eventually use the same names as Geany, should add all three now

Changes will be mentioned in the list of changes on the releases page, but I do not know how many users look at the list of changes and will be able to adjust their scripts. On the other hand, new Geany versions are rarely released, and reviewing the list of changes cannot become a tedious chore :)
On the other hand, maintaining compatibility is traditionally considered a friendlier solution.
So, it seems to me that there is no urgent need to rename opener and closer.

About the length of the name: I thought of using comm instead of comment.

@Skif-off Skif-off changed the title GeanyLua: Add the 'single' field to 'geany.fileinfo' GeanyLua: Add the 'comment' field to 'geany.fileinfo' Apr 12, 2025
@xiota
Copy link
Contributor

xiota commented Apr 12, 2025

It's not about "urgent", but whether renaming the fields will or can be done at all. Would be good for someone with commit privileges to just make a decision.

The existing names are not self-explanatory and don't match the names used by Geany. Anyone using them would already have to check (and recheck) documentation for usage.

The main reasons to leave them alone are they're shorter and might be used in existing scripts. However, plugins and scripts often require user intervention with new releases, so the change wouldn't really be unexpected. Error messages would prompt users to check documentation for updates.

@Skif-off
Copy link
Contributor Author

@xiota, what do you think about comm instead of comment?

@xiota
Copy link
Contributor

xiota commented Apr 13, 2025

comm would be worse than comment. Not self-explanatory, doesn't match Geany name, and less descriptive.

Upon further reflection, I now think field names should be switched entirely to the Geany name, immediately dropping the old names.

  • Matching Geany names allows them to be found in either Geany or GeanyLua source or documentation.
  • Potentially revising a few existing scripts is a minor inconvenience.
  • Immediately dropping the old name allows both old and new name to be present within a single commit. If the old name were deprecated and dropped later, finding the new name in a several years old commit could be more challenging.

@Skif-off
Copy link
Contributor Author

  • There are several examples of abbreviated names.
  • We can enter "desk", "ext" or "comm" faster than "description", "extension", "comment_open" or "comment_close".
  • I do not know about the source code, but users will have to open the help in any case.

But you're the maintainer, so the final decision should be yours.

I changed it and if everything is okay, then I will merge the commits and correct the commit message.

@xiota
Copy link
Contributor

xiota commented Apr 13, 2025

There are these too...

SetTableStr("type",   FileTypeStr(name));
SetTableStr("desc",   FileTypeStr(title));
SetTableStr("comment", FileTypeStr(comment_single));

Too much to change... maybe should minimize changes and revert back. I'm going to think some more about it some more...

…'opener' and 'closer' to 'comment_open' and 'comment_close'.
@Skif-off Skif-off changed the title GeanyLua: Add the 'comment' field to 'geany.fileinfo' GeanyLua: Add the 'comment' field to 'geany.fileinfo'; rename fields 'opener' and 'closer' to 'comment_open' and 'comment_close'. Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants