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

If startup option "nologrepeat" is set, don't log repeat information #119

Merged

Conversation

jamesnvc
Copy link
Contributor

Address #118

@@ -212,13 +212,12 @@ const tablePartContainsCellId = (tablePart, cellId) =>
const doesAttributedStringContainTableCellId = (parts, cellId) =>
parts
.filter(part => ['table', 'list'].includes(part.get('type')))
.some(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file contains only whitespace change from prettier and can be ignored during the review. Sorry for that.

@munen
Copy link
Collaborator

munen commented Nov 25, 2019

Hi @jamesnvc

As always, great work!

I did find a small issue: When there's another startup option set (for example #+STARTUP: showeverything nologrepeat), the regexp didn't catch it.

Here's my proposal to fix it: 435591e

However, it's your PR, so I'm not merging before you are OK with my proposal. Feel free to change anything, of course^^

In any case, thank you for proposing and implementing yet another great feature! 🙏 🙇‍♂️

* More info:
* https://www.gnu.org/software/emacs/manual/html_node/org/Repeated-tasks.html
*/
export function noLogRepeatEnabledP({ state, headerIndex }) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this be called logRepeatEnabledP instead, since it returns true if it should repeat and false if nologrepeat is set?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good question! I was actually thinking about this name for a moment when I had the same idea as you^^

I'm not super happy about the name, because it's quite long, but here's my thought process: The native Org feature is called nologrepeat. Hence it makes sense to call the feature flag in organice by the same name and not invert the native feature flags name. The feature flag is enabled when "nologrepeat" is 'enabled' or 'set'.

Atm it's kinda hard to read and if I would do it from scratch, I'd call the feature "logrepeatenabled", but Org mode has prior art here(;

On the other hand, having you trip up over the same naming issue that I was already thinking about is not a great argument for the name. So I'm open for a change if after reading this you have a strong fealing it woud be better the other way around!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What if we keep the name, but invert what it returns, so when nologrepeat is set it returns true? That way we keep the name, but it reads a bit more naturally; e.g. the check for logging the repeat information would be if (!noLogRepeatEnabledP(...)) { /* log repeat /* }

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, my, of course! It's a little late for me here, I apologize.

I should take a break, maybe(;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😄 Can't hurt! I can make that change & push it up

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sweet!

Also thanks for adding the test for detecting via properties. I was just starting to type that one in when I got the notification about your commit(;

I'll happily pull the changes in when you ping me.

@jamesnvc
Copy link
Contributor Author

Thanks for the feedback & tests @munen! I think things are looking good now.

@munen munen merged commit aa8cbfc into 200ok-ch:master Nov 25, 2019
@munen
Copy link
Collaborator

munen commented Nov 25, 2019

@jamesnvc They are looking great, indeed!

I updated the changelog and added a little bit of documentation: 965e4b8

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.

2 participants