shrface icon indicating copy to clipboard operation
shrface copied to clipboard

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

Open gfgkmn opened this issue 2 years ago • 11 comments

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.

gfgkmn avatar Sep 26 '23 09:09 gfgkmn

Getting the very same ERROR.

2mc avatar Oct 25 '23 08:10 2mc

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

niv-l avatar Jan 04 '24 19:01 niv-l

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

chenyanming avatar Apr 01 '24 09:04 chenyanming

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.

niv-l avatar May 03 '24 19:05 niv-l

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

niv-l avatar May 03 '24 19:05 niv-l

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 avatar May 06 '24 07:05 chenyanming

suppress the bullets

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

chenyanming avatar May 06 '24 07:05 chenyanming