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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

org-roam-mode buffer broken due to (global-)page-break-lines-mode (Spacemacs continuously switches major-mode) #14969

Open
dalanicolai opened this issue Aug 3, 2021 · 10 comments
Labels
- Bug tracker - Help wanted Org stale marked as a stale issue/pr (usually by a bot)

Comments

@dalanicolai
Copy link
Contributor

dalanicolai commented Aug 3, 2021

Description :octocat:

org-roam-mode buffer is broken due to (global-)page-break-lines-mode

Reproduction guide 馃

  • Start Emacs

  • Install org-roam via the org-mode layer instructions

  • Additionally carry out the setting up instructions of the org-mode manual.

  • Create a node using M-x org-roam-node-find followed by C-c C-c

  • Within that note create another note but now using M-x org-roam-node-insert (and submit with C-c C-c)

  • follow the link to the newly created note

  • in the 'new note' buffer do M-x org-roam-buffer-toggle

There should be a backlink, otherwise there is a bug (which probably has not yet
been reported). If there is no backlink then customize the
org-roam-mode-section-functions. There settings are correct, but possibly have
to get 'reapplied`. Please note down as a bug.

Finally if there is a backlink then notice that you can not follow it by placing
the cursor on it and pressing enter. If you switch off
global-page-break-lines-mode before creating the org-mode buffer (delete and
toggle again), then the link does work (as already reported
here.

Now the org-roam-mode is derived from special-mode (via
magit-section-mode-hook) and, as none of these modes is included in
page-break-lines-modes, should be excluded from global-page-break-lines-mode.
However Spacemacs, somehow designates the org-roam-mode buffer as (over here)
either an emacs-lisp-mode buffer or an org-mode buffer.

Now it took me a long time to find the culprit, and still help is appreciated.
So to see what is causing the problem evaluate the following lines:

(defun derived-mode-p (&rest modes)
  "Non-nil if the current major mode is derived from one of MODES.
Uses the `derived-mode-parent' property of the symbol to trace backwards."
  (apply #'provided-mode-derived-p (print major-mode) modes))

now just observe what happens. Spacemacs is switching modes continuously.

The derived-mode-p function is used in page-break-lines-mode-maybe.

So maybe for now we can indeed first switch-off global-page-break-lines-mode
for users of org-roam-mode (as suggested
here).

Observed behaviour: 馃憖 馃挃
backlinks don't work

Expected behaviour: 鉂わ笍 馃槃
backlinks work

System Info 馃捇

  • OS: gnu/linux
  • Emacs: 28.0.50
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 40ae5e2)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: ivy
  • Layers:
(erc restclient test-layer robot-framework
     (org-wiki :variables org-wiki-location "~/Sync/org/wiki")
     command-log
     (latex :variables latex-backend 'company-auctex)
     auto-completion gnus emacs-lisp common-lisp
     (scheme :variables scheme-implementations
             '(guile racket mit))
     (clojure :variables clojure-enable-linters 'clj-kondo)
     racket
     (haskell :variables haskell-completion-backend 'dante)
     git helm
     (ivy :variables ivy-enable-icons t)
     lsp dap markdown multiple-cursors
     (spacemacs-evil :variables spacemacs-evil-collection-allowed-list 'nil)
     helpful c-c++ rust julia python
     (jupyter :variables org-babel-jupyter-resource-directory "~/org/jupyter")
     ipython-notebook yaml javascript
     (org :variables org-directory "~/Sync/org" org-default-notes-file "~/Sync/org/notes.org" org-agenda-files
          '("~/Sync/org/google-calendar" "~/Sync/org/contacts.org" "/home/dalanicolai/Sync/org/journal" "/mnt/4EEDC07F44412A81/git/Masterthesis/TODOs.org" "~/spacemacs/diary.org")
          org-enable-notifications t org-start-notification-daemon-on-startup t org-enable-org-journal-support t org-journal-enable-agenda-integration t org-journal-dir "~/Sync/org/journal/" org-journal-file-format "%Y%m%d.org" org-journal-file-type 'weekly org-enable-roam-support t org-enable-templated-html-support t org-enable-github-support t org-enable-reveal-js-support t org-enable-org-contacts-support t org-contacts-files
          '("~/Sync/org/contacts.org")
          org-capture-templates
          '(("c" "Contacts" entry
             (file "~/Sync/org/contacts.org")
             "* %(org-contacts-template-name)\n          :PROPERTIES:\n          :EMAIL: %(org-contacts-template-email)\n          :PHONE:\n          :ALIAS:\n          :NICKNAME:\n          :IGNORE:\n          :ICON:\n          :NOTE:\n          :ADDRESS:\n          :BIRTHDAY:\n          :END:")))
     (bibtex :variables bibtex-dialect 'biblatex bibtex-enable-ebib-support t bibtex-files
             '("/mnt/4EEDC07F44412A81/jabref/main/main.bib")
             ebib-default-directory "/mnt/4EEDC07F44412A81/jabref/main/files" ebib-preload-bib-files bibtex-files ebib-file-search-dirs
             '("/mnt/4EEDC07F44412A81/jabref/main/files")
             ebib-import-directory "/mnt/4EEDC07F44412A81/jabref/main/files" org-ref-default-bibliography
             '("/mnt/4EEDC07F44412A81/jabref/main/main.bib")
             bibtex-completion-bibliography
             '("/mnt/4EEDC07F44412A81/jabref/main/main.bib")
             org-ref-get-pdf-filename-function 'org-ref-get-zotero-filename ebib-window-vertical-split 'above)
     (shell :variables shell-default-height 30 shell-default-position 'bottom)
     spell-checking syntax-checking version-control treemacs pdf djvu toc
     (calibre :variables calibredb-root-dir "/mnt/4EEDC07F44412A81/Calibrebibliotheek" calibredb-add-delete-original-file "yes" calibredb-download-dir "~/Downloads" calibredb-fetch-covers "yes" calibredb-show-entry-switch 'switch-to-buffer-other-window calibredb-show-results t calibredb-title-width 84 calibredb-author-width 25 calibredb-tag-width 14 calibredb-comment-width 32)
     epub fasd html github
     (sql :variables sql-capitalize-keywords t sql-lsp-sqls-workspace-config-path 'workspace)
     csv eaf eww info maxima)
  • System configuration features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Backtrace 馃惥


@dalanicolai
Copy link
Contributor Author

dalanicolai commented Aug 3, 2021

While I wanted to report the backlink issue, I also noticed that this 'Spacemacs bug' was already reported: org-roam/org-roam#1732

So also it seems that backlinks do not get created before "(re)applying" the org-roam-mode-section-functions or restarting Spacemacs. This seems to have been reported already also: org-roam/org-roam#1708

@dalanicolai
Copy link
Contributor Author

I am not sure what the bug-tracker label means; but I guess it means this is an upstream bug? Because I think this really is a Spacemacs bug.

@lebensterben
Copy link
Collaborator

bug tracker means this is a confirmed bug. if there's a future bug fix or workaround, this will be the tracking issue.

@duianto
Copy link
Collaborator

duianto commented Aug 4, 2021

I guess it means this is an upstream bug?

There is a separate Upstream label.

@dalanicolai
Copy link
Contributor Author

Thanks! Handy to know...

@mattford63
Copy link

mattford63 commented Aug 7, 2021

After disabling page-break-lines globally, locally, everywhere this issues still occurs.

However if after displaying the org-roam backlink buffer you manually do a org-roam-buffer-refresh it will work (but only if page-break-lines is disabled)

bhipple added a commit to bhipple/spacemacs that referenced this issue Aug 22, 2021
This matches the org-agenda key, and is doubly important since we need to
refresh regularly to workaround the page-break-lines bug, as described here
syl20bnr#14969 (comment)
smile13241324 pushed a commit that referenced this issue Aug 22, 2021
This matches the org-agenda key, and is doubly important since we need to
refresh regularly to workaround the page-break-lines bug, as described here
#14969 (comment)
@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Aug 7, 2022
Repository owner deleted a comment from github-actions bot Aug 7, 2022
@lebensterben lebensterben added Help wanted and removed stale marked as a stale issue/pr (usually by a bot) labels Aug 7, 2022
@Sergey-Makarov
Copy link

Here is a simple solution that works for me so far and does not require disabling any of the modes (including page-break-line-mode and display-line-number-mode): org-roam/org-roam#1732 (comment)

@lebensterben
Copy link
Collaborator

@dalanicolai

please verify whether it fixes your issue

@nickanderson
Copy link
Contributor

The elisp linked by @Sergey-Makarov (org-roam/org-roam#1732 (comment)) fixes this issue for me as well.

Copy link

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 Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Bug tracker - Help wanted Org stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

6 participants