minad / org-modern

:unicorn: Modern Org Style
GNU General Public License v3.0
1.54k stars 48 forks source link

Invisible horizontal rule #59

Closed FieryCod closed 2 years ago

FieryCod commented 2 years ago

I'm on the latest revision of the emacs and for some reason, the horizontal rule is not visible. Here is how I did configure the package.

I can confirm that I don't see a horizontal rule even when using the minimal config listed in the README.md.

Config

(use-package! org-modern
  :custom
  (org-modern-horizontal-rule t)
  (org-modern-keyword ">")
  (org-modern-table-vertical 1.0)
  (org-modern-star ["I" "II" "III" "IV" "V" "VI" "VII" "VIII"])
  (org-modern-todo-faces
   '(("DOING" :background "orange"))))

(defadvice! org-modern--update-label-face-override ()
  :override #'org-modern--update-label-face
  (set-face-attribute 'org-modern-symbol nil :family "Iosevka")
  (set-face-attribute org-modern-variable-pitch nil :family "Iosevka Aile")
  (set-face-attribute 'org-modern-horizontal-rule nil :inherit 'italic :box 1)
  (set-face-attribute 'org-modern-tag nil :inherit 'italic :box 1)
  (set-face-attribute
   'org-modern-label nil
   :inherit org-modern-variable-pitch
   :box (list :color (face-attribute 'default :background nil t)
              :line-width -3)))

(add-hook! org-mode org-modern-mode)

Demonstration

https://user-images.githubusercontent.com/14275210/172046004-70881a2d-eb55-4454-b12a-e242da7c9e2b.mp4

Additional info

generated    Jun 05, 2022 12:07:43
system       Pop!_OS 22.04 LTS Linux 5.17.5-76051705-generic x86_64 x
emacs        29.0.50 master e74652386 ~/.emacs.d/ -> ~/.emacs.d/
doom         3.0.0-dev grafted, HEAD -> master, origin/master, origin/HEAD bea3cc1 2022-06-04 15:02:06 +0200 ~/.doom.d/ -> ~/.doom.d/
shell        /bin/zsh
features     CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
traits       gui server-running envvar-file custom-file
custom       connection-local-profile-alist connection-local-criteria-alist package-selected-packages
modules      :completion (ivy +icons +prescient) company :ui deft doom doom-quit (emoji +unicode) hl-todo ophints (popup +defaults) vc-gutter workspaces ligatures :editor (evil +everywhere) fold multiple-cursors snippets :emacs (dired +icons) electric ibuffer undo vc :term vterm :checkers syntax :tools direnv editorconfig (eval +overlay) gist (lookup +dictionary +docsets) lsp (magit +forge) make rgb upload :os tty :lang (clojure +lsp) data emacs-lisp json (javascript +lsp) markdown nix (latex +latexmk +cdlatex +fold) (org +dragndrop +gnuplot +pomodoro +roam2) (sh +zsh) (web +css +html) (yaml +lsp) :config (default +bindings +smartparens)
packages     (hl-line :disable t) (websocket) (mermaid-mode) (posframe) (org-roam-ui :recipe (:host github :repo org-roam/org-roam-ui :files (*.el out))) (org-modern :recipe (:host github :repo minad/org-modern)) (org-ref) (ob-mermaid) (yaml-mode) (polish-holidays :recipe (:host github :repo mikolajb/emacs-polish-holidays))
minad commented 2 years ago

I cannot reproduce your issue. My steps:

  1. emacs -Q (Emacs 27 and Emacs 28)
  2. Open example.org
  3. Run package-initialize and enable org-modern-mode

Can you please try Emacs 28 to check if this is a regression of Emacs 29? Do you use pgtk? (I don't support Emacs 29 just yet, since it has too many issues for me to follow.)

minad commented 2 years ago

Note that the "minimal config" listed in the README.org is not actually a minimal configuration. The configuration is there such that users can reproduce the looks from the screenshot.

A minimal configuration is this:

(global-org-modern-mode)
FieryCod commented 2 years ago

I've checked:

With minimal Doom config

Plain emacs

I've tried with minimal clean installation of doom emacs and with one additional package org-modern and the issue persists. I think it's somehow connected with doom emacs, but I don't know what is exactly broken there.

minad commented 2 years ago

Okay, please ask on the doom tracker. @tecosaur recently started to use this, so we may also see this package in doom at some point.

tecosaur commented 2 years ago

This was actually something I was going to open an issue about (eventually). Pinning down the cause may not be easy here, but in case it lets you make a guess minad, I'm able to reproduce this (in Doom) using the default theme and inspecting the hrule this is what I see:

             position: 2 of 7 (14%), column: 0
            character: - (displayed as -) (codepoint 45, #o55, #x2d)
              charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x2D
               script: latin
               syntax: _    which means: symbol
             category: .:Base, >:Not at bol, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 2d" or "C-x 8 RET HYPHEN-MINUS"
          buffer code: #x2D
            file code: #x2D (encoded by coding system utf-8-unix)
              display: by this font (glyph code):
    ftcrhb:-JB-JetBrains Mono-normal-normal-normal-*-24-*-*-*-m-0-iso10646-1 (#x281)

Character code properties: customize what to show
  name: HYPHEN-MINUS
  general-category: Pd (Punctuation, Dash)
  decomposition: (45) ('-')

There are text properties here:
  display              (space :width text)
  face                 org-meta-line
  fontified            t
  line-prefix          ""
  wrap-prefix          ""
  ws-butler-chg        chg

I must add though, separate to this issue, while the strikethrough line works visually it doesn't leave me very satisfied. I'm much happier with https://github.com/purcell/page-break-lines as it is both (1) thicker and (2) doesn't extend the entire width of the buffer (I also don't see any issues with it). Is there any scope for an hrule more like that in org-modern?

minad commented 2 years ago

@tecosaur I am more happy with the thin line. In contrast I don't like the ASCII box drawing of page-break-lines. You can disable hrules if you don't like it. If there is a simple generalization, which doesn't take much code, we can also extend org-modern.

tecosaur commented 2 years ago

Makes sense, I don't think it would take much to generalise though (I'm guessing 5-10 lines) so I'll spin up a quick PR for perusal.

tecosaur commented 2 years ago

Done, see #62.

psyleft commented 2 years ago

I know that I'm late to this discussion, but I've discovered the reason doom users are unable to see the horizontal rule. The earlier comments here were on the right track, doom by default adds a hook that immediately runs the function doom-themes-org-config when it loads the doom-themes package. This applies some general fixes/improvements to org mode (per the package's own description). You can disable this behavior by adding the following to your init.el file:

(use-package-hook! doom-themes
  :pre-config
  (remove-hook 'doom-load-theme-hook #'doom-themes-org-config))

This might be a useful thing to add to the README if a lot of people are using doom and could potentially run into this issue.

TheJJ commented 8 months ago

I've proposed a fix doomemacs/themes#819 in the doom-themes to not use org-meta-line as face, instead introduce a new one. Also this pull request allows disabling fontification throught the doom-themes hook.

minad commented 8 months ago

Oh wow, I wasn't aware that the Doom themes modify font locking themselves. This is unusual for themes. It would be ideal if there were customization option to disable this feature completely. Alternatively such a fontification feature could be moved fully to an external package, or maybe org-modern could be extended accordingly if anything from the Doom fontification is missing in org-modern.

https://github.com/doomemacs/themes/blob/ce4cd3beee1bd5492e43a698e3d73d6123f5aa72/extensions/doom-themes-ext-org.el#L88

TheJJ commented 8 months ago

what do you suggest to do? maybe @hlissner has an idea how to resolve this properly?