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

Inconsistent highlighting in org mode #9950

Closed
ssfrr opened this issue Dec 4, 2017 · 7 comments
Closed

Inconsistent highlighting in org mode #9950

ssfrr opened this issue Dec 4, 2017 · 7 comments
Labels
Fixed in develop stale marked as a stale issue/pr (usually by a bot)

Comments

@ssfrr
Copy link

ssfrr commented Dec 4, 2017

Description :octocat:

I'm seeing strange highlighting in my .org files. The same string (e.g. DONE or TODO is getting highlighted in different ways, based on rules I can't figure out. It also seems to be stateful in some way, because I can delete a line and then re-add it, and the highlighting will change.

You can see an example below of what it looks like:

different highlighting

Reproduction guide 🪲

(I'm so far not able to create a reliable MWE - perhaps with the info below you can provide some pointers towards one?)

Observed behaviour: 👀 💔

DONE text shows up in 2 different styles, one bright and one pale.

I ran SPC U SPC SPC what-cursor-position for both the brightly-colored and the paler version, and got the folloring output. The main difference seems to be that in the bright colored version the face is listed as org-done, whereas in the paler one it is (:inherit hl-todo :foreground "#afd8af").

Bright "DONE"
             position: 5088 of 8193 (62%), column: 5
            character: N (displayed as N) (codepoint 78, #o116, #x4e)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x4E
               script: latin
               syntax: w 	which means: word
             category: .:Base, L:Left-to-right (strong), U:Uppercase, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 4e" or "C-x 8 RET LATIN CAPITAL LETTER N"
          buffer code: #x4E
            file code: #x4E (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-ADBO-Source Code Pro-bold-normal-normal-*-18-*-*-*-m-0-iso10646-1 (#x0F)

Character code properties: customize what to show
  name: LATIN CAPITAL LETTER N
  general-category: Lu (Letter, Uppercase)
  decomposition: (78) ('N')

There are text properties here:
  face                 org-done
  fontified            t
  org-category         "todo"
Pale "DONE"
             position: 5183 of 8193 (63%), column: 5
            character: N (displayed as N) (codepoint 78, #o116, #x4e)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x4E
               script: latin
               syntax: w 	which means: word
             category: .:Base, L:Left-to-right (strong), U:Uppercase, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 4e" or "C-x 8 RET LATIN CAPITAL LETTER N"
          buffer code: #x4E
            file code: #x4E (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-ADBO-Source Code Pro-bold-normal-normal-*-18-*-*-*-m-0-iso10646-1 (#x0F)

Character code properties: customize what to show
  name: LATIN CAPITAL LETTER N
  general-category: Lu (Letter, Uppercase)
  decomposition: (78) ('N')

There are text properties here:
  face                 (:inherit hl-todo :foreground "#afd8af")
  fontified            t
  org-category         "todo"

Expected behaviour: ❤️ 😄
DONE text is highlighted the same in both cases.

System Info 💻

  • OS: gnu/linux
  • Emacs: 25.3.1
  • Spacemacs: 0.200.10
  • Spacemacs branch: master (rev. 4bb4cb4)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(helm emacs-lisp org)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES
@ghost
Copy link

ghost commented Dec 4, 2017

I also had this issue at least once the last days, just saying. Not being able to reproduce.

@Alexander-Miller
Copy link
Contributor

Looks like it's due to hl-todo being active in org-mode when it really shoudl't be. This hook needs to be changed to something that excludes org-mode.

@dudelson
Copy link

Thanks for identifying the cause of this issue, it was really driving me up the wall. In the short-term, I added this line to my configuration:

  (add-hook 'org-mode-hook (lambda () (hl-todo-mode -1) nil))

@Alexander-Miller
Copy link
Contributor

Nitpick: hooks should be named functions, so you can change or remove them again. That final nil isn't needed either.

@FryJay
Copy link

FryJay commented Nov 21, 2018

I've run into this issue as well when looking at org files. It ignores some of the colors I've set in org-todo-keyword-faces but they show up correctly in agendas. Adding the line @dudelson posted seems to have fixed it for me.

samspills pushed a commit to samspills/spacemacs that referenced this issue Dec 19, 2018
I was getting inconsistent highlighting in org-mode and found issue syl20bnr#9950. A
comment in the hl-todo package says that org-mode shouldn't be getting included
because org defines it's own todo states, but this isn't the case for
me (comment for reference:
https://github.com/tarsius/hl-todo/blob/master/hl-todo.el#L69-L71)

The added hook will disable hl-todo-mode on org-mode files.
samspills pushed a commit to samspills/spacemacs that referenced this issue Dec 19, 2018
I was getting inconsistent highlighting in org-mode and found issue syl20bnr#9950. A
comment in the hl-todo package says that org-mode shouldn't be getting included
because org defines it's own todo states, but this isn't the case for
me (comment for reference:
https://github.com/tarsius/hl-todo/blob/master/hl-todo.el#L69-L71)

The added hook will disable hl-todo-mode on org-mode files.
@duianto
Copy link
Collaborator

duianto commented May 10, 2019

The following PR is now on the develop branch:
Fix #9950: Hook added to disable hl-todo-mode in org files #11732

@github-actions
Copy link

github-actions bot commented May 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label May 9, 2020
@github-actions github-actions bot closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in develop stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

5 participants