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 several customization variables #21

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

notetiene
Copy link

@notetiene notetiene commented Sep 14, 2017

This adds several customization variables and restore a better way to hide leading stars.

Kaligule and others added 16 commits February 10, 2017 22:10
This is already thought of in orgmode (see hide-leading-stars), we
shouldn't reimplement it in org-bullets. Also it sort of didn't work
in terminals.
* org-bullets.el (org-bullets-bullet-map): Fix documentation style.
(org-bullets-level-char): Add docstring.
* org-bullets.el (org-bullets-face-name): Change customization type
  for nil or a face.  This allows auto-completing a face.
* org-bullets.el (org-bullets-mode): Replace the use of the
  interactive-only function `font-lock-fontify-buffer` to
  `font-lock-flush`.
Remove importing the `cl` feature since it’s not used anywhere
* org-bullets.el (org-bullets-mode): Use `add-text-properties` instead
  of `put-text-property`.  Add higlight mouse-face and help-echo
  message.
* org-bullets.el (org-bullets-compose-leading-stars): Add
  customization variable to set the composition behavior (replace
  characters).
(org-bullets--char-series): Add function to calculate the current
character from a series and the current level.
(org-bullets-mode): Add the series variable.  Add pattern matching
case for setting the series variable according to
`org-bullets-compose-leading-stars`.
* org-bullets.el (org-bullets--bullet-events): Rename
  `org-bullets-bullet-map` to `org-bullets--bullet-events` in order to
  include other event text-properties.
(org-bullets-mode): Use `org-bullets--bullet-events` instead of
hard-coding text properties.
* org-bullets.el (org-bullets-mouse-events): Add this customization
  variable to disable mouse events easily.
(org-bullets-mode): Refactor to only activate mouse events when
`org-bullets-mouse-events` is set.
* org-bullets.el (org-bullets-face-name): Add quote to symbol.
If set to a name of a face, that face will be used. When nil, do
not change the face used."
:group 'org-bullets
:type '(choice (const :tag "Off" nil)
Copy link

Choose a reason for hiding this comment

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

Is the added complexity of providing two different behaviors here worth it? Why would a user choose one option instead of the other?

Copy link
Author

@notetiene notetiene Sep 14, 2017

Choose a reason for hiding this comment

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

This is the same behavior. Nothing changed except I specified a better customization type. This allows auto-completion of faces.

Could you please explain what you mean? I probably don't understand what you said.

Copy link
Author

@notetiene notetiene Sep 14, 2017

Choose a reason for hiding this comment

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

The fact that faces are symbols doesn't mean this variable allows all symbols. Nil is also a (constant) symbol.

In order to provide completion for both nil and symbol faces, I need to make a composite type.

However, this does not make the variable typed or restrict in any way setting the variable to any other types. :type keywords in defcustom are only useful when using the customize interface.

Copy link

Choose a reason for hiding this comment

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

Ah, I didn't realize this was a previously available option. You may disregard my commentary :)

Copy link
Author

Choose a reason for hiding this comment

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

Anyway thanks for reviewing that at least 😂

integral-dw added a commit to integral-dw/org-bullets that referenced this pull request Mar 17, 2020
Added require for Org to stop compiler nag
Changed hiding code to respect org-hide
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