alphapapa / org-sidebar

A helpful sidebar for Org mode
GNU General Public License v3.0
527 stars 16 forks source link

Extracting org-sidebar-tree feature to its own package #63

Closed localauthor closed 9 months ago

localauthor commented 10 months ago

Hello! This isn't an issue so much as a discussion starter.

I've used the sidebar-tree feature of org-sidebar for quite a while now and I've found myself modifying bits and pieces of it here and there over time. So, I've finally broken down and made a repo/package containing only that feature, called "org-tree". (Not convinced that's a good name.)

One justification for extracting the tree feature into a separate package, in my case, is to separate it from the fairly weighty org-ql and org-super-agenda dependencies. It seems to be quite distinct from the parts of org-sidebar that use those packages --- case in point, it seems to function just fine without them.

This version, additionally, addresses some of the requests that have been made here, most notably adding read-only-mode and follow-mode functionality. But then, it also loses the outline-mode interoperability. (Sad face.)

demo here: https://i.imgur.com/bOpFx6u.mp4

I wanted to ask you for your thoughts on this, before I publicize anything, since it's so heavily derived from your work. Any thoughts/notes? Would you like credit, copyright, etc., in any particular form? What do you think?

In any case, thanks for your sharing all your work and Emacs savvy!

alphapapa commented 10 months ago

Hello Grant,

Well, the bottom line is that the code in org-sidebar is released under the GPL, so you can do all the things the license allows, including modifying and redistributing the code under the same license. Ethically, if you copy code from other authors, you should credit them accordingly: at least, in the source code comments, and probably in the documentation as well.

Now I can't stop you from doing those things, and I wouldn't necessarily want to. But generally I'd prefer to improve the implementation in this package rather than splinter it--it's better for users and developers that way.

IIUC your concerns are twofold: 1) improvements to the tree-window functionality, and 2) the dependencies on org-super-agenda and org-ql.

Regarding 1: Of course, I'd be glad to have improvements to this package's code. As you can see, there are no outstanding pull requests, so it's not as if I'm declining to accept patches. As with anything else, unless the changes are trivial fixes, it's best to discuss them first, so as not to waste anyone's time in writing code that won't get merged. I don't know of any such outstanding discussions on this repo, but I might be wrong; as I always say, feel free to ping me on a discussion if I forget about it. I have a lot of packages, as well as work outside of FOSS, so my time for any one package is limited.

The most important improvement for the tree view that I know of is discussed in #36. As long as that remains unfixed, the tree view seems of limited usefulness to me. Even though I like the feature and wrote it myself, because of that, I hardly use it. I think it could probably be fixed with careful use of various hooks in one or both buffers, but I haven't spent the time to try yet. The author of the org-transclusion package might have insights that could help.

Regarding 2: It might sound prideful, but I think that org-super-agenda and org-ql are packages that every Org user ought to have installed, anyway; I think that most users who don't use them simply aren't aware of how useful they are, and if it were demonstrated to them, they'd probably start using them. At the same time, I respect the principle of independent functionality, and even among my own packages, I don't make them depend on each other unnecessarily.

And while I understand the desire to have the tree view available independently, I also don't think it's enough to justify being in a package of its own, especially while the issue mentioned in #36 remains.

Finally, I'm careful with org-super-agenda and org-ql to make them well-behaved "citizens", i.e. merely having them installed shouldn't cause any problems for any user (and if such a problem were found, I'd fix it quickly).

So I think my position is: I'd rather the tree-sidebar code not be published separately. I think it wouldn't be good for users or developers, especially in its current state. If there are improvements to be made (and there are), I'd like them to be made here, and I'd be grateful if such improvements were contributed by interested users and developers.

Ultimately, what would be best for everyone is if the tree-sidebar functionality were improved and refined and upstreamed into Org itself. Since it's a feature that doesn't depend on org-ql or org-super-agenda, this package could serve as an "incubator" for its functionality (keeping the FSF copyright assignment in mind during development of it). Then ideally it could be upstreamed; I think it would be obviously useful enough that there wouldn't be much objection to doing so.

What do you think? Thanks.

localauthor commented 10 months ago

Cool cool. All good points. I’ll check out #36 and work on translating my changes into a few PRs, to see what you think.

Also, yes, I think upstreaming would be a great thing to aim for, ultimately.

alphapapa commented 10 months ago

Great, thanks.

localauthor commented 10 months ago

A few changes that I want to get your views on before I get too far along in coding:

ps. no rush on anything here; no worries if it takes some time for you to consider any of this. thanks in the meantime!

alphapapa commented 10 months ago

A few changes that I want to get your views on before I get too far along in coding:

Sure.

  • Setting the tree-buffer to read-only-mode. This would open up the use of single letter keybindings for navigation, a la org-speed-keys. Possibly a sidebar-tree minor mode would even be warranted?

ISTM that the use of read-only-mode is orthogonal to what bindings are used. Let's think about how we want the buffer to work first, and then about how to achieve it. That is, we don't want users typing into that buffer, I think (preventing newly entered text from appearing in it is one of the problems we want to solve, after all), but we probably want them to be able to rearrange the outline tree.

  • Using org-sidebar-tree-jump-source as the default for o-s-t-jump-fn. Anecdotally, I was a bit confounded by all the indirect buffers created by the default jump-function 'jump-indirect', and wonder if that's not a bit littery for a default, if that makes sense.

Well, I did make that an option for a reason. :) That's a very minor issue, so let's deal with that after the important stuff is done. (I chose this default because I think it's a powerful, useful feature that few users are aware of, and if it weren't the default, the vast majority of users would never even know it was possible. As it is now, if they don't like it, they can change the option.)

  • Making mouse keybindings optional. It is difficult to select the window with the mouse without jumping to a heading.

Similarly minor, I think. We need to get the basic functionality working and solve the bugs, then we can deal with bindings. (Anyway, the mouse bindings could be put into a minor mode of their own.)

  • Using mode-line for info instead of header-line. (Aesthetic preference.)

Also minor, and not related to the serious problems we need to solve. (We can make an option for this when the time comes.)

Having said all that, if these "minor" issues are more important to your needs than, e.g. fixing #36, feel free to propose changes to effect them first, or only; you've no obligation to work on #36 or anything else, of course. Thanks.

localauthor commented 9 months ago

I started puzzling through a fix for #36 and ended up in knots. So I started thinking that perhaps using clone-indirect-buffer as a starting point presents more problems than benefits.

It seems that using org-sidebar-ql as a starting point instead gets you close to similar functionality basically for free:

(defun org-sidebar-ql-tree ()
  (interactive)
  (let ((org-sidebar-side org-sidebar-tree-side)
        (file buffer-file-name))
    (org-sidebar-ql file nil)))

Granted, the headings are not org headings, like they are in an indirect-buffer. But that doesn't seem to be the primary (or even a necessary) feature of the sidebar-tree.

I thought maybe you tried this and moved away from it for some reason I haven't thought of. WDYT?

alphapapa commented 9 months ago

My purpose for the sidebar tree buffer is for it to actually be an Org buffer showing the tree. The user should be able to see headings, priorities, and tags; see the relationship between headings; and rearrange headings. If we were to just list the headings in a flat list, it wouldn't be a tree anymore.

Probably the way to solve the problem would be to add additional font-lock rules that would make anything other than headings invisible and intangible in that buffer. That way it would automatically be updated as the underlying contents change.

Thaodan commented 9 months ago

I tried your package, it works ok but one big bug is there when using frames that it always opens the new buffers in the frame last used and not in the frame that contained the previously opened buffer.

To org-sidebar: I noticed that org-sidebar-tree just freezes Emacs for me when I call org-sidebar-tree-toggle.

(quit)
  (if (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (progn (if (eq spec (car (car org-fold-core--specs))) (progn (put-text-property from to 'invisible spec)))))
  (if (eq org-fold-core-style 'overlays) (let ((o (make-overlay from to nil (org-fold-core-get-folding-spec-property spec :front-sticky) (org-fold-core-get-folding-spec-property spec :rear-sticky)))) (if org-fold-core--isearch-active (progn (setq org-fold-core--isearch-overlays (cons o org-fold-core--isearch-overlays)))) (overlay-put o 'evaporate t) (overlay-put o (org-fold-core--property-symbol-get-create spec) spec) (overlay-put o 'invisible spec) (overlay-put o 'priority (length (member spec (org-fold-core-folding-spec-list)))) (overlay-put o 'isearch-open-invisible #'org-fold-core--isearch-show) (overlay-put o 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary)) (put-text-property from to (org-fold-core--property-symbol-get-create spec) spec) (put-text-property from to 'isearch-open-invisible #'org-fold-core--isearch-show) (put-text-property from to 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary) (if (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (progn (if (eq spec (car (car org-fold-core--specs))) (progn (put-text-property from to 'invisible spec))))))
  (if (not spec) (error "Calling `org-fold-core-region' with missing SPEC") (if (eq org-fold-core-style 'overlays) (let ((o (make-overlay from to nil (org-fold-core-get-folding-spec-property spec :front-sticky) (org-fold-core-get-folding-spec-property spec :rear-sticky)))) (if org-fold-core--isearch-active (progn (setq org-fold-core--isearch-overlays (cons o org-fold-core--isearch-overlays)))) (overlay-put o 'evaporate t) (overlay-put o (org-fold-core--property-symbol-get-create spec) spec) (overlay-put o 'invisible spec) (overlay-put o 'priority (length (member spec (org-fold-core-folding-spec-list)))) (overlay-put o 'isearch-open-invisible #'org-fold-core--isearch-show) (overlay-put o 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary)) (put-text-property from to (org-fold-core--property-symbol-get-create spec) spec) (put-text-property from to 'isearch-open-invisible #'org-fold-core--isearch-show) (put-text-property from to 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary) (if (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (progn (if (eq spec (car (car org-fold-core--specs))) (progn (put-text-property from to 'invisible spec)))))))
  (if flag (if (not spec) (error "Calling `org-fold-core-region' with missing SPEC") (if (eq org-fold-core-style 'overlays) (let ((o (make-overlay from to nil (org-fold-core-get-folding-spec-property spec :front-sticky) (org-fold-core-get-folding-spec-property spec :rear-sticky)))) (if org-fold-core--isearch-active (progn (setq org-fold-core--isearch-overlays (cons o org-fold-core--isearch-overlays)))) (overlay-put o 'evaporate t) (overlay-put o (org-fold-core--property-symbol-get-create spec) spec) (overlay-put o 'invisible spec) (overlay-put o 'priority (length (member spec (org-fold-core-folding-spec-list)))) (overlay-put o 'isearch-open-invisible #'org-fold-core--isearch-show) (overlay-put o 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary)) (put-text-property from to (org-fold-core--property-symbol-get-create spec) spec) (put-text-property from to 'isearch-open-invisible #'org-fold-core--isearch-show) (put-text-property from to 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary) (if (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (progn (if (eq spec (car ...)) (progn (put-text-property from to ... spec))))))) (if (not spec) (mapc #'(lambda (spec) (org-fold-core-region from to nil spec)) (org-fold-core-folding-spec-list)) (if (and (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (eq org-fold-core-style 'text-properties)) (progn (if (eq spec (car (car org-fold-core--specs))) (progn (let (...) (while ... ...)))))) (if (eq org-fold-core-style 'text-properties) (progn (remove-text-properties from to (list (org-fold-core--property-symbol-get-create spec) nil))))))
  (save-restriction (widen) (if (eq org-fold-core-style 'overlays) (progn (if org-fold-core--keep-overlays (mapc #'(lambda (ov) (if ... ...)) (overlays-in from to)) (remove-overlays from to 'org-invisible spec) (remove-overlays from to 'invisible spec)))) (if flag (if (not spec) (error "Calling `org-fold-core-region' with missing SPEC") (if (eq org-fold-core-style 'overlays) (let ((o (make-overlay from to nil ... ...))) (if org-fold-core--isearch-active (progn (setq org-fold-core--isearch-overlays ...))) (overlay-put o 'evaporate t) (overlay-put o (org-fold-core--property-symbol-get-create spec) spec) (overlay-put o 'invisible spec) (overlay-put o 'priority (length (member spec ...))) (overlay-put o 'isearch-open-invisible #'org-fold-core--isearch-show) (overlay-put o 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary)) (put-text-property from to (org-fold-core--property-symbol-get-create spec) spec) (put-text-property from to 'isearch-open-invisible #'org-fold-core--isearch-show) (put-text-property from to 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary) (if (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (progn (if (eq spec ...) (progn ...)))))) (if (not spec) (mapc #'(lambda (spec) (org-fold-core-region from to nil spec)) (org-fold-core-folding-spec-list)) (if (and (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (eq org-fold-core-style 'text-properties)) (progn (if (eq spec (car ...)) (progn (let ... ...))))) (if (eq org-fold-core-style 'text-properties) (progn (remove-text-properties from to (list (org-fold-core--property-symbol-get-create spec) nil)))))))
  (save-excursion (save-restriction (widen) (if (eq org-fold-core-style 'overlays) (progn (if org-fold-core--keep-overlays (mapc #'(lambda ... ...) (overlays-in from to)) (remove-overlays from to 'org-invisible spec) (remove-overlays from to 'invisible spec)))) (if flag (if (not spec) (error "Calling `org-fold-core-region' with missing SPEC") (if (eq org-fold-core-style 'overlays) (let ((o ...)) (if org-fold-core--isearch-active (progn ...)) (overlay-put o 'evaporate t) (overlay-put o (org-fold-core--property-symbol-get-create spec) spec) (overlay-put o 'invisible spec) (overlay-put o 'priority (length ...)) (overlay-put o 'isearch-open-invisible #'org-fold-core--isearch-show) (overlay-put o 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary)) (put-text-property from to (org-fold-core--property-symbol-get-create spec) spec) (put-text-property from to 'isearch-open-invisible #'org-fold-core--isearch-show) (put-text-property from to 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary) (if (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (progn (if ... ...))))) (if (not spec) (mapc #'(lambda (spec) (org-fold-core-region from to nil spec)) (org-fold-core-folding-spec-list)) (if (and (memql 'grab-invisible org-fold-core--optimise-for-huge-buffers) (eq org-fold-core-style 'text-properties)) (progn (if (eq spec ...) (progn ...)))) (if (eq org-fold-core-style 'text-properties) (progn (remove-text-properties from to (list ... nil))))))))
  (progn (save-excursion (save-restriction (widen) (if (eq org-fold-core-style 'overlays) (progn (if org-fold-core--keep-overlays (mapc #'... (overlays-in from to)) (remove-overlays from to 'org-invisible spec) (remove-overlays from to 'invisible spec)))) (if flag (if (not spec) (error "Calling `org-fold-core-region' with missing SPEC") (if (eq org-fold-core-style 'overlays) (let (...) (if org-fold-core--isearch-active ...) (overlay-put o ... t) (overlay-put o ... spec) (overlay-put o ... spec) (overlay-put o ... ...) (overlay-put o ... ...) (overlay-put o ... ...)) (put-text-property from to (org-fold-core--property-symbol-get-create spec) spec) (put-text-property from to 'isearch-open-invisible #'org-fold-core--isearch-show) (put-text-property from to 'isearch-open-invisible-temporary #'org-fold-core--isearch-show-temporary) (if (memql ... org-fold-core--optimise-for-huge-buffers) (progn ...)))) (if (not spec) (mapc #'(lambda ... ...) (org-fold-core-folding-spec-list)) (if (and (memql ... org-fold-core--optimise-for-huge-buffers) (eq org-fold-core-style ...)) (progn (if ... ...))) (if (eq org-fold-core-style 'text-properties) (progn (remove-text-properties from to ...))))))))
  (unwind-protect (progn (save-excursion (save-restriction (widen) (if (eq org-fold-core-style 'overlays) (progn (if org-fold-core--keep-overlays (mapc ... ...) (remove-overlays from to ... spec) (remove-overlays from to ... spec)))) (if flag (if (not spec) (error "Calling `org-fold-core-region' with missing SPEC") (if (eq org-fold-core-style ...) (let ... ... ... ... ... ... ... ...) (put-text-property from to ... spec) (put-text-property from to ... ...) (put-text-property from to ... ...) (if ... ...))) (if (not spec) (mapc #'... (org-fold-core-folding-spec-list)) (if (and ... ...) (progn ...)) (if (eq org-fold-core-style ...) (progn ...))))))) (if (or (not modified) (eq modified 'autosaved)) (progn (restore-buffer-modified-p modified))))
  (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (save-excursion (save-restriction (widen) (if (eq org-fold-core-style 'overlays) (progn (if org-fold-core--keep-overlays ... ... ...))) (if flag (if (not spec) (error "Calling `org-fold-core-region' with missing SPEC") (if ... ... ... ... ... ...)) (if (not spec) (mapc ... ...) (if ... ...) (if ... ...)))))) (if (or (not modified) (eq modified 'autosaved)) (progn (restore-buffer-modified-p modified)))))
  (let ((spec (org-fold-core-get-folding-spec-from-alias spec-or-alias))) (if spec (progn (org-fold-core--check-spec spec))) (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (save-excursion (save-restriction (widen) (if (eq org-fold-core-style ...) (progn ...)) (if flag (if ... ... ...) (if ... ... ... ...))))) (if (or (not modified) (eq modified 'autosaved)) (progn (restore-buffer-modified-p modified))))))
  org-fold-region(189632 214061 t headline)
  (if (derived-mode-p 'org-mode) (org-fold-region (max from (point-min)) (min to (point-max)) flag 'headline) (apply oldfun from to flag extra))
  outline-flag-region@fix-for-org-fold(#<subr outline-flag-region> 189632 214061 t)
  apply(outline-flag-region@fix-for-org-fold #<subr outline-flag-region> (189632 214061 t))
  outline-flag-region(189632 214061 t)
  outline-hide-region-body(188 240383)
  outline-hide-body()
  (progn (outline-hide-body) (outline-next-visible-heading 1))
  (while (progn (outline-hide-body) (outline-next-visible-heading 1)))
  (progn (while (progn (outline-hide-body) (outline-next-visible-heading 1))) nil)
  (save-excursion (goto-char (point-min)) (if (org-before-first-heading-p) (progn (outline-next-visible-heading 1))) (progn (while (progn (outline-hide-body) (outline-next-visible-heading 1))) nil))
  (save-current-buffer (set-buffer tree-buffer) (use-local-map org-sidebar-tree-map) (progn (setq mode-line-format nil) (setq header-line-format (concat "Tree: " (buffer-name buffer)))) (toggle-truncate-lines 1) (save-excursion (goto-char min) (if (org-before-first-heading-p) (progn (outline-next-heading) (setq min (point))) (outline-show-branches))) (narrow-to-region min max) (save-excursion (goto-char (point-min)) (if (org-before-first-heading-p) (progn (outline-next-visible-heading 1))) (progn (while (progn (outline-hide-body) (outline-next-visible-heading 1))) nil)) (if (org-before-first-heading-p) nil (outline-back-to-heading)))
  (let* ((buffer-name (concat "<tree>" (buffer-name buffer))) (--dash-source-850-- (save-current-buffer (set-buffer buffer) (list (point-min) (point-max)))) (min (car-safe (prog1 --dash-source-850-- (setq --dash-source-850-- (cdr --dash-source-850--))))) (max (car --dash-source-850--)) (existing-buffer (get-buffer buffer-name)) (tree-buffer nil)) (if existing-buffer (progn (if (buffer-base-buffer existing-buffer) (kill-buffer existing-buffer) (warn "Existing tree buffer that is not indirect: %s" existing-buffer)))) (setq tree-buffer (clone-indirect-buffer buffer-name nil 'norecord)) (save-current-buffer (set-buffer tree-buffer) (use-local-map org-sidebar-tree-map) (progn (setq mode-line-format nil) (setq header-line-format (concat "Tree: " (buffer-name buffer)))) (toggle-truncate-lines 1) (save-excursion (goto-char min) (if (org-before-first-heading-p) (progn (outline-next-heading) (setq min (point))) (outline-show-branches))) (narrow-to-region min max) (save-excursion (goto-char (point-min)) (if (org-before-first-heading-p) (progn (outline-next-visible-heading 1))) (progn (while (progn (outline-hide-body) (outline-next-visible-heading 1))) nil)) (if (org-before-first-heading-p) nil (outline-back-to-heading))) tree-buffer)
  (let* ((buffer (car (cdr (or (plist-member --cl-rest-- ':buffer) (list nil (current-buffer))))))) (let* ((buffer-name (concat "<tree>" (buffer-name buffer))) (--dash-source-850-- (save-current-buffer (set-buffer buffer) (list (point-min) (point-max)))) (min (car-safe (prog1 --dash-source-850-- (setq --dash-source-850-- (cdr --dash-source-850--))))) (max (car --dash-source-850--)) (existing-buffer (get-buffer buffer-name)) (tree-buffer nil)) (if existing-buffer (progn (if (buffer-base-buffer existing-buffer) (kill-buffer existing-buffer) (warn "Existing tree buffer that is not indirect: %s" existing-buffer)))) (setq tree-buffer (clone-indirect-buffer buffer-name nil 'norecord)) (save-current-buffer (set-buffer tree-buffer) (use-local-map org-sidebar-tree-map) (progn (setq mode-line-format nil) (setq header-line-format (concat "Tree: " (buffer-name buffer)))) (toggle-truncate-lines 1) (save-excursion (goto-char min) (if (org-before-first-heading-p) (progn (outline-next-heading) (setq min (point))) (outline-show-branches))) (narrow-to-region min max) (save-excursion (goto-char (point-min)) (if (org-before-first-heading-p) (progn (outline-next-visible-heading 1))) (progn (while (progn (outline-hide-body) (outline-next-visible-heading 1))) nil)) (if (org-before-first-heading-p) nil (outline-back-to-heading))) tree-buffer))
  org-sidebar-tree-view-buffer()
  (list (org-sidebar-tree-view-buffer))
  (org-sidebar--display-buffers (list (org-sidebar-tree-view-buffer)) :window-parameters (list (cons 'org-sidebar-tree-window t)))
  (let ((org-sidebar-side org-sidebar-tree-side)) (org-sidebar--display-buffers (list (org-sidebar-tree-view-buffer)) :window-parameters (list (cons 'org-sidebar-tree-window t))))
  org-sidebar-tree()
  (if (and tree-window (save-current-buffer (set-buffer (window-buffer tree-window)) (and (<= parent-point-min (point-min)) (= parent-point-max (point-max)) (or (eq parent-buffer (buffer-base-buffer)) (eq parent-buffer (current-buffer)))))) (delete-window tree-window) (org-sidebar-tree))
  (let* ((parent-point-min (point-min)) (parent-point-max (point-max)) (parent-buffer (or (buffer-base-buffer) (current-buffer))) (tree-window (let (needle) (let ((list (window-at-side-list nil org-sidebar-tree-side)) (i 0) elt) (while (if list (progn ... ...)) (let (... ...) (ignore it it-index)) (progn (setq i ...) (setq list ...)))) needle))) (if (and tree-window (save-current-buffer (set-buffer (window-buffer tree-window)) (and (<= parent-point-min (point-min)) (= parent-point-max (point-max)) (or (eq parent-buffer (buffer-base-buffer)) (eq parent-buffer (current-buffer)))))) (delete-window tree-window) (org-sidebar-tree)))
  org-sidebar-tree-toggle()
  funcall-interactively(org-sidebar-tree-toggle)
  call-interactively(org-sidebar-tree-toggle record nil)
  command-execute(org-sidebar-tree-toggle record)
  (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name))
  (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history 'extended-command-history command-name))) (signal (car err) (cdr err))))
  (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)) (command-name (symbol-name command))) (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history 'extended-command-history command-name))) (signal (car err) (cdr err)))))
  (progn (progn (setq this-command command) (setq real-this-command command)) (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)) (command-name (symbol-name command))) (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history 'extended-command-history command-name))) (signal (car err) (cdr err))))))
  (if command (progn (progn (setq this-command command) (setq real-this-command command)) (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)) (command-name (symbol-name command))) (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history ... command-name))) (signal (car err) (cdr err)))))))
  helm-M-x-execute-command(org-sidebar-tree-toggle)
  funcall(helm-M-x-execute-command org-sidebar-tree-toggle)
  (progn (funcall action selection))
  (if (and selection action) (progn (funcall action selection)))
  (let ((source (or helm-saved-current-source (helm-get-current-source))) non-essential) (setq selection (helm-coerce-selection (or selection helm-saved-selection (helm-get-selection nil nil source) (and (assq 'accept-empty source) "")) source)) (if preserve-saved-action nil (setq helm-saved-action nil)) (if (and selection action) (progn (funcall action selection))))
  helm-execute-selection-action-1()
  (prog1 (helm-execute-selection-action-1) (helm-log-run-hook "helm-execute-selection-action" 'helm-after-action-hook))
  (unwind-protect (prog1 (helm-execute-selection-action-1) (helm-log-run-hook "helm-execute-selection-action" 'helm-after-action-hook)) (setq helm--executing-helm-action nil))
  helm-execute-selection-action()
  (if helm--quit nil (helm-execute-selection-action))
  (prog1 (if helm--quit nil (helm-execute-selection-action)) (helm-log "helm-internal" (concat "[End session] " (make-string 41 45))))
  (let (helm--source-name helm-current-source helm-in-persistent-action helm--quit (helm-buffer (or buffer helm-buffer))) (helm-initialize resume input default sources) (and ori--minibuffer-follows-selected-frame (setq minibuffer-follows-selected-frame (if (or helm--nested (minibufferp helm-current-buffer)) nil t))) (if helm-execute-action-at-once-if-one nil (helm-display-buffer helm-buffer resume) (select-window (helm-window)) (if (and resume helm-visible-mark-overlays) (progn (set-window-margins (selected-window) (+ (string-width helm-visible-mark-prefix) helm-left-margin-width))))) (if helm-allow-mouse nil (helm--remap-mouse-mode 1)) (add-hook 'post-command-hook 'helm--maybe-update-keymap) (add-hook 'helm-after-update-hook 'helm--maybe-update-keymap) (add-hook 'post-command-hook 'helm--update-header-line) (helm-log "helm-internal" "show prompt") (unwind-protect (helm-read-from-minibuffer prompt input preselect resume keymap default history) (helm-cleanup)) (prog1 (if helm--quit nil (helm-execute-selection-action)) (helm-log "helm-internal" (concat "[End session] " (make-string 41 45)))))
  (condition-case _v (let (helm--source-name helm-current-source helm-in-persistent-action helm--quit (helm-buffer (or buffer helm-buffer))) (helm-initialize resume input default sources) (and ori--minibuffer-follows-selected-frame (setq minibuffer-follows-selected-frame (if (or helm--nested (minibufferp helm-current-buffer)) nil t))) (if helm-execute-action-at-once-if-one nil (helm-display-buffer helm-buffer resume) (select-window (helm-window)) (if (and resume helm-visible-mark-overlays) (progn (set-window-margins (selected-window) (+ (string-width helm-visible-mark-prefix) helm-left-margin-width))))) (if helm-allow-mouse nil (helm--remap-mouse-mode 1)) (add-hook 'post-command-hook 'helm--maybe-update-keymap) (add-hook 'helm-after-update-hook 'helm--maybe-update-keymap) (add-hook 'post-command-hook 'helm--update-header-line) (helm-log "helm-internal" "show prompt") (unwind-protect (helm-read-from-minibuffer prompt input preselect resume keymap default history) (helm-cleanup)) (prog1 (if helm--quit nil (helm-execute-selection-action)) (helm-log "helm-internal" (concat "[End session] " (make-string 41 45))))) ((debug quit) (helm-restore-position-on-quit) (helm-log-run-hook "helm-internal" 'helm-quit-hook) (helm-log "helm-internal" (concat "[End session (quit)] " (make-string 34 45))) nil))
  (unwind-protect (condition-case _v (let (helm--source-name helm-current-source helm-in-persistent-action helm--quit (helm-buffer (or buffer helm-buffer))) (helm-initialize resume input default sources) (and ori--minibuffer-follows-selected-frame (setq minibuffer-follows-selected-frame (if (or helm--nested (minibufferp helm-current-buffer)) nil t))) (if helm-execute-action-at-once-if-one nil (helm-display-buffer helm-buffer resume) (select-window (helm-window)) (if (and resume helm-visible-mark-overlays) (progn (set-window-margins (selected-window) (+ ... helm-left-margin-width))))) (if helm-allow-mouse nil (helm--remap-mouse-mode 1)) (add-hook 'post-command-hook 'helm--maybe-update-keymap) (add-hook 'helm-after-update-hook 'helm--maybe-update-keymap) (add-hook 'post-command-hook 'helm--update-header-line) (helm-log "helm-internal" "show prompt") (unwind-protect (helm-read-from-minibuffer prompt input preselect resume keymap default history) (helm-cleanup)) (prog1 (if helm--quit nil (helm-execute-selection-action)) (helm-log "helm-internal" (concat "[End session] " (make-string 41 45))))) ((debug quit) (helm-restore-position-on-quit) (helm-log-run-hook "helm-internal" 'helm-quit-hook) (helm-log "helm-internal" (concat "[End session (quit)] " (make-string 34 45))) nil)) (if (fboundp 'advice-remove) (progn (advice-remove 'tramp-read-passwd #'helm--suspend-read-passwd) (advice-remove 'ange-ftp-get-passwd #'helm--suspend-read-passwd) (advice-remove 'epa-passphrase-callback-function #'helm--suspend-read-passwd) (advice-remove 'linum-on #'helm--advice-linum-on))) (helm-log "helm-internal" "helm-alive-p = %S" (setq helm-alive-p nil)) (helm--remap-mouse-mode -1) (setq helm-alive-p nil) (and ori--minibuffer-follows-selected-frame (set-default-toplevel-value 'minibuffer-follows-selected-frame ori--minibuffer-follows-selected-frame)) (setq helm--force-updating-p nil) (setq helm--buffer-in-new-frame-p nil) (setq helm-pattern "") (progn (setq helm--ignore-errors nil) (setq helm-debug nil)))
  (let ((non-essential t) mouse-autoselect-window focus-follows-mouse mode-line-in-non-selected-windows minibuffer-completion-confirm (ori--minibuffer-follows-selected-frame (and (boundp 'minibuffer-follows-selected-frame) (default-toplevel-value 'minibuffer-follows-selected-frame))) (input-method-verbose-flag helm-input-method-verbose-flag) (helm-maybe-use-default-as-input (and (null input) (or helm-maybe-use-default-as-input (let* ((--cl-var-- ...) (s nil) (--cl-flag-- t) --cl-var--) (while (and ... ...) (setq --cl-var-- ...)) --cl-var--))))) (unwind-protect (condition-case _v (let (helm--source-name helm-current-source helm-in-persistent-action helm--quit (helm-buffer (or buffer helm-buffer))) (helm-initialize resume input default sources) (and ori--minibuffer-follows-selected-frame (setq minibuffer-follows-selected-frame (if (or helm--nested ...) nil t))) (if helm-execute-action-at-once-if-one nil (helm-display-buffer helm-buffer resume) (select-window (helm-window)) (if (and resume helm-visible-mark-overlays) (progn (set-window-margins ... ...)))) (if helm-allow-mouse nil (helm--remap-mouse-mode 1)) (add-hook 'post-command-hook 'helm--maybe-update-keymap) (add-hook 'helm-after-update-hook 'helm--maybe-update-keymap) (add-hook 'post-command-hook 'helm--update-header-line) (helm-log "helm-internal" "show prompt") (unwind-protect (helm-read-from-minibuffer prompt input preselect resume keymap default history) (helm-cleanup)) (prog1 (if helm--quit nil (helm-execute-selection-action)) (helm-log "helm-internal" (concat "[End session] " (make-string 41 45))))) ((debug quit) (helm-restore-position-on-quit) (helm-log-run-hook "helm-internal" 'helm-quit-hook) (helm-log "helm-internal" (concat "[End session (quit)] " (make-string 34 45))) nil)) (if (fboundp 'advice-remove) (progn (advice-remove 'tramp-read-passwd #'helm--suspend-read-passwd) (advice-remove 'ange-ftp-get-passwd #'helm--suspend-read-passwd) (advice-remove 'epa-passphrase-callback-function #'helm--suspend-read-passwd) (advice-remove 'linum-on #'helm--advice-linum-on))) (helm-log "helm-internal" "helm-alive-p = %S" (setq helm-alive-p nil)) (helm--remap-mouse-mode -1) (setq helm-alive-p nil) (and ori--minibuffer-follows-selected-frame (set-default-toplevel-value 'minibuffer-follows-selected-frame ori--minibuffer-follows-selected-frame)) (setq helm--force-updating-p nil) (setq helm--buffer-in-new-frame-p nil) (setq helm-pattern "") (progn (setq helm--ignore-errors nil) (setq helm-debug nil))))
  helm-internal((((name . "Emacs Commands history") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  apply(helm-internal ((((name . "Emacs Commands history") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (26 . helm-select-action) (18 . undefined) (19 . undefined) (24 keymap ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (26 . helm-select-action) (18 . undefined) (19 . undefined) (24 keymap ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history))
  (if (keywordp (car plist)) (progn (setq helm--local-variables (append helm--local-variables (helm-parse-keys plist))) (apply fn (mapcar #'(lambda (key) (plist-get plist key)) helm-argument-keys))) (apply fn plist))
  (if (and helm-alive-p (eq fn #'helm)) (if (helm--alive-p) (error "Error: Trying to run helm within a running helm session") (save-current-buffer (set-buffer (helm-buffer-get)) (prog1 (message "Aborting an helm session running in background") (helm-keyboard-quit)))) (if (keywordp (car plist)) (progn (setq helm--local-variables (append helm--local-variables (helm-parse-keys plist))) (apply fn (mapcar #'(lambda (key) (plist-get plist key)) helm-argument-keys))) (apply fn plist)))
  (let ((fn (cond ((or (and helm-alive-p (plist-get plist :allow-nest)) (and helm-alive-p (memq ... plist))) #'helm--nest) ((keywordp (car plist)) #'helm) (t #'helm-internal)))) (if (and helm-alive-p (eq fn #'helm)) (if (helm--alive-p) (error "Error: Trying to run helm within a running helm session") (save-current-buffer (set-buffer (helm-buffer-get)) (prog1 (message "Aborting an helm session running in background") (helm-keyboard-quit)))) (if (keywordp (car plist)) (progn (setq helm--local-variables (append helm--local-variables (helm-parse-keys plist))) (apply fn (mapcar #'(lambda ... ...) helm-argument-keys))) (apply fn plist))))
  helm((((name . "Emacs Commands history") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  apply(helm ((((name . "Emacs Commands history") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (26 . helm-select-action) (18 . undefined) (19 . undefined) (24 keymap ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (26 . helm-select-action) (18 . undefined) (19 . undefined) (24 keymap ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history))
  (progn (setq helm--local-variables (append helm--local-variables (helm-parse-keys plist))) (apply fn (mapcar #'(lambda (key) (plist-get plist key)) helm-argument-keys)))
  (if (keywordp (car plist)) (progn (setq helm--local-variables (append helm--local-variables (helm-parse-keys plist))) (apply fn (mapcar #'(lambda (key) (plist-get plist key)) helm-argument-keys))) (apply fn plist))
  (if (and helm-alive-p (eq fn #'helm)) (if (helm--alive-p) (error "Error: Trying to run helm within a running helm session") (save-current-buffer (set-buffer (helm-buffer-get)) (prog1 (message "Aborting an helm session running in background") (helm-keyboard-quit)))) (if (keywordp (car plist)) (progn (setq helm--local-variables (append helm--local-variables (helm-parse-keys plist))) (apply fn (mapcar #'(lambda (key) (plist-get plist key)) helm-argument-keys))) (apply fn plist)))
  (let ((fn (cond ((or (and helm-alive-p (plist-get plist :allow-nest)) (and helm-alive-p (memq ... plist))) #'helm--nest) ((keywordp (car plist)) #'helm) (t #'helm-internal)))) (if (and helm-alive-p (eq fn #'helm)) (if (helm--alive-p) (error "Error: Trying to run helm within a running helm session") (save-current-buffer (set-buffer (helm-buffer-get)) (prog1 (message "Aborting an helm session running in background") (helm-keyboard-quit)))) (if (keywordp (car plist)) (progn (setq helm--local-variables (append helm--local-variables (helm-parse-keys plist))) (apply fn (mapcar #'(lambda ... ...) helm-argument-keys))) (apply fn plist))))
  helm(:sources (((name . "Emacs Commands history") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init (closure ... nil ...)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (f12 closure ... nil ... ...) (f11 closure ... nil ... ...) (f10 closure ... nil ... ...) (f9 closure ... nil ... ...) (f8 closure ... nil ... ...) (f7 closure ... nil ... ...) (f6 closure ... nil ... ...) (f5 closure ... nil ... ...) (f4 closure ... nil ... ...) (f3 closure ... nil ... ...) (f2 closure ... nil ... ...) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 closure ... nil ... ...) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) :prompt "M-x " :buffer "*helm M-x*" :history helm-M-x-input-history :truncate-lines t)
  (progn (setq current-prefix-arg nil) (helm :sources sources :prompt prompt :buffer "*helm M-x*" :history 'helm-M-x-input-history :truncate-lines t))
  (unwind-protect (progn (setq current-prefix-arg nil) (helm :sources sources :prompt prompt :buffer "*helm M-x*" :history 'helm-M-x-input-history :truncate-lines t)) (helm-M-x--unwind-forms))
  (let* ((pred (or predicate #'commandp)) (helm-fuzzy-sort-fn #'(lambda (candidates _source) (helm-fuzzy-matching-default-sort-fn-1 candidates t))) (sources (list (helm-make-source "Emacs Commands history" 'helm-M-x-class :data #'(lambda nil (helm-comp-read-get-candidates ... pred nil nil "")) :fuzzy-match helm-M-x-fuzzy-match) (helm-make-source "Emacs Commands" 'helm-M-x-class :data #'(lambda nil (helm-comp-read-get-candidates collection pred nil nil "")) :fuzzy-match helm-M-x-fuzzy-match))) (prompt (concat (cond ((eq helm-M-x-prefix-argument '-) "- ") ((and (consp helm-M-x-prefix-argument) (eq ... 4)) "C-u ") ((and (consp helm-M-x-prefix-argument) (integerp ...)) (format "%d " (car helm-M-x-prefix-argument))) ((integerp helm-M-x-prefix-argument) (format "%d " helm-M-x-prefix-argument))) "M-x "))) (setq helm-M-x--timer (run-at-time 1 0.1 #'helm-M-x--notify-prefix-arg)) (add-hook 'helm-move-selection-after-hook #'helm-M-x--move-selection-after-hook) (add-hook 'helm-before-action-hook #'helm-M-x--before-action-hook) (if (and sources helm-M-x-reverse-history) (progn (setq sources (nreverse sources)))) (unwind-protect (progn (setq current-prefix-arg nil) (helm :sources sources :prompt prompt :buffer "*helm M-x*" :history 'helm-M-x-input-history :truncate-lines t)) (helm-M-x--unwind-forms)))
  helm-M-x-read-extended-command([org-capture-goto-last-stored elfeed-summary--action lsp-ui-imenu-window-fix-width lsp:omnisharp-run-tests-in-class-request-column ccls-call-hierarchy-node ANG LaTeX-default-options ivy-explorer mc/prompt-for-inclusion-in-whitelist \.hasIssuesEnabled TeX-print-command magit-revision-filter-files-on-follow start-char yas-x-prompt helm-ls-git-stage-marked-and-amend-commit LaTeX-after-insert-env-hook /home/bidar/.local/private/etc/emacs/lib/lsp-mode/ LaTeX-math-rightharpoondown ∅\ \\varnothing elfeed-db-update-hook mc/for-each-fake-cursor lsp-perlnavigator lsp-config :EndLineNumber er/looking-back-max pdf-outline-mouse-display-link America/Asuncion MGIEX LaTeX-math-Theta magit-patch-save-arguments A289A untracking text? emms-info-native--valid-id3v2-frame-id-p logview--maybe-complain-about-movement vai-Latn lsp:set-rename-params-uri? ↭\ \\leftrightsquigarrow lsp-ui-find-workspace-symbol lsp--virtual-buffer America/Thule discard-new nongnu_elpa_recipes org-sidebar-refresh keyid lsp-inlay-hint-face peg-autoloads transient:magit-log:--dense unread-num zot ...])
  (if (or defining-kbd-macro executing-kbd-macro) (helm-M-x--vanilla-M-x) (helm-M-x-read-extended-command obarray))
  helm-M-x(nil)
  funcall-interactively(helm-M-x nil)
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)

I'm using Org-Mode 9.7 and Emacs 30.

alphapapa commented 9 months ago

@Thaodan

I'm using Org-Mode 9.7 and Emacs 30.

I can't offer support for unreleased versions of Org and Emacs. If you can debug the problem and offer a patch to preemptively fix a problem--and you're certain that it needs to be fixed in this package instead of upstream--I would welcome that. Otherwise, you're using those bleeding-edge versions of software at your peril and should expect weird breakage.

As well, this issue is for discussing refactoring the package. If you want to work on that issue, please file it appropriately.

Thaodan commented 9 months ago

First I'm aware that I'm kinda highjacking the issue.

I'm using Org-Mode 9.7 and Emacs 30.

I can't offer support for unreleased versions of Org and Emacs. If you can debug the problem and offer a patch to preemptively fix a problem--and you're certain that it needs to be fixed in this package instead of upstream--I would welcome that. Otherwise, you're using those bleeding-edge versions of software at your peril and should expect weird breakage.

I think the issue is related to using frames or pop-up-frames (C-h v pop-up-frames RET) in general.

alphapapa commented 9 months ago

First I'm aware that I'm kinda highjacking the issue.

Ok, but please don't. I have tens of packages and hundreds of issues to keep track of. Mixing them together just makes my work harder.

I'm using Org-Mode 9.7 and Emacs 30. I can't offer support for unreleased versions of Org and Emacs. If you can debug the problem and offer a patch to preemptively fix a problem--and you're certain that it needs to be fixed in this package instead of upstream--I would welcome that. Otherwise, you're using those bleeding-edge versions of software at your peril and should expect weird breakage. I think the issue is related to using frames or pop-up-frames (C-h v pop-up-frames RET) in general.

Ok, if you can reproduce it, please file a new issue about it.

localauthor commented 9 months ago

Given the intractability of issue #36 (for me anyway), I've done a pretty much complete re-write of the feature that circumvents clone-indirect-buffer by using tabulated-list mode instead (inspired by embark-live).

So far, it's working really nicely -- with follow-mode, ability to rearrange headings, change TODO/priorities, etc.

Given the change in the underlying mechanism, I'm coming back to the idea of letting it stand as a package on its own (as either "org-tree", or maybe "org-side-tree"?) and taking on the future maintenance there. WDYT?

alphapapa commented 9 months ago

...I did not mean to click the close button, but the UI jumped around as the page loaded and my click landed on the button instead of the textarea...

Anyway, @localauthor I looked at your org-tree source code, and I can see that you've put a lot of work into it, and it looks well-written. For smaller Org buffers, I can imagine it would perform well enough. But due to its collecting a list of every heading in the buffer, it won't be able to scale well. Also, tabulated-list-mode doesn't seem like the most appropriate solution to displaying a tree, although I can imagine that it could work well enough to some extent.

Anyway, while I do admire your work in org-tree, I don't think it's a generally suitable solution to this problem. I still think that something can probably be done with font-lock or various after-change functions, something like that. I may be wrong, of course.

The bottom line here is that that implementation of org-tree isn't what I want to offer in org-sidebar. But if that library suits your needs (and some other users'), that's great. :)

localauthor commented 9 months ago

Ugh, scaling. 🤦‍♂️ I’m sure you’re right about that. The work continues :) Thanks for checking it out!

I’m going to close this, since the real action is in #36.

alphapapa commented 9 months ago

I look forward to following your progress. Thanks.