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

error "‘org-element-at-point’ cannot be used in non-org buffer #22

Open
gfgkmn opened this issue Sep 26, 2023 · 8 comments
Open

error "‘org-element-at-point’ cannot be used in non-org buffer #22

gfgkmn opened this issue Sep 26, 2023 · 8 comments

Comments

@gfgkmn
Copy link

gfgkmn commented Sep 26, 2023

I use Doom Emacs, and after upgrading to Emacs 29 and updating Doom, I encountered an issue when enabling shrface in eww. I kept receiving a minibuffer error message:

"Error running timer 'org-indent-initialize-agent': (error "'org-element-at-point' cannot be used in a non-org buffer #<buffer eww> (eww-mode)")"

I tried debugging it, but couldn't find a solution. It seems that org-element-at-point does not support non-org buffers.

Is there anybody who could help? I would be very thankful.

@2mc
Copy link

2mc commented Oct 25, 2023

Getting the very same ERROR.

@ziova
Copy link

ziova commented Jan 4, 2024

still having this issue, seems like disabling org indent mode seems to fix it but I do prefer keeping it on. any fixes?

@chenyanming
Copy link
Owner

Can not easily fix right now, you can use shr-indentation instead.

@ziova
Copy link

ziova commented May 3, 2024

hi is there any way to make sure that the indentation on each org-headline is the same, for example instead of:
image
have all the headines starting at the same time (instead of the normal org indentation where headlines get indented more if they are under another headline.

@ziova
Copy link

ziova commented May 3, 2024

or is there anyway to suppress the bullets whilst still maintaining navigational properties like imenu and headline folding?

@chenyanming
Copy link
Owner

chenyanming commented May 6, 2024

or is there anyway to suppress the bullets whilst still maintaining navigational properties like imenu and headline folding?

I have the following setting for nov:

  (setq nov-render-html-function #'my-nov-render-html)
  (defun my-nov-render-html ()
    (require 'eww)
    (let ((shrface-org nil)
          (shr-bullet (concat (char-to-string shrface-item-bullet) " "))
          (shr-table-vertical-line "|")
          (shr-width 65)              ; if serif, 80 is better, but serif has problem on width.
          (shr-indentation 3)
          (tab-width 8)
          (shr-external-rendering-functions
           (append '((img . nov-render-img)
                     (title . nov-render-title)
                     (pre . shrface-shr-tag-pre-highlight)
                     (code . shrface-tag-code)
                     (form . eww-tag-form)
                     (input . eww-tag-input)
                     (button . eww-form-submit)
                     (textarea . eww-tag-textarea)
                     (select . eww-tag-select)
                     (link . eww-tag-link)
                     (meta . eww-tag-meta))
                   shrface-supported-faces-alist))
          (shrface-toggle-bullets nil)
          (shrface-href-versatile t)
          (shr-use-fonts nil)           ; nil to use default font
          (shr-map nov-mode-map))

Bind shr-indentation to 3, it has similar reading experience.

All texts except headings will be indented with 3 white spaces like so,
image

@chenyanming
Copy link
Owner

chenyanming commented May 6, 2024

suppress the bullets

Bind shrface-toggle-bullets to t, shrface-headline-consult should still work.

@chenyanming
Copy link
Owner

I just found that the version org 9.6.1 which I am using right now, it could be able to use org-indent-mode for non-org buffer. Simply add

  (add-hook 'nov-mode-hook #'org-indent-mode)

It could enable org-indent-mode for nov.

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

No branches or pull requests

4 participants