Code Monkey home page Code Monkey logo

Comments (2)

alphapapa avatar alphapapa commented on August 18, 2024 1

Hi Karl,

Thanks very much. My email address is in the Author: header of all my Emacs packages, but I'm not great at keeping up with email, so GitHub issues are usually easier for me to keep track of anyway.

The lack of necessity to organize task-based buffers is also expressed by the fact that I do not even use projectile or a similar package.

I understand, thanks. Maybe someday it will be useful for you, but not everyone needs to manage buffers this way.

One of the most precious tools for me is your org-tree-to-indirect-buffer.

To be clear, org-tree-to-indirect-buffer is built-in to Org. Maybe you mean this customized version I have shared somewhere before:

(defun ap/org-tree-to-indirect-buffer (&optional arg)
  "Create indirect buffer and narrow it to current subtree.
The buffer is named after the subtree heading, with the filename
appended.  If a buffer by that name already exists, it is
selected instead of creating a new buffer."
  (interactive "P")
  (let* ((new-buffer-p)
         (pos (point))
         (buffer-name (let* ((heading (org-get-heading t t))
                             (level (org-outline-level))
                             (face (intern (concat "outline-" (number-to-string level))))
                             (heading-string (propertize (org-link-display-format heading)
                                                         'face face)))
                        (concat heading-string "::" (buffer-name))))
         (new-buffer (or (get-buffer buffer-name)
                         (prog1 (condition-case nil
                                    (make-indirect-buffer (current-buffer) buffer-name 'clone)
                                  (error (make-indirect-buffer (current-buffer) buffer-name)))
                           (setq new-buffer-p t)))))
    (switch-to-buffer new-buffer)
    (when new-buffer-p
      ;; I don't understand why setting the point again is necessary, but it is.
      (goto-char pos)
      (rename-buffer buffer-name)
      (org-narrow-to-subtree))))

(advice-add 'org-tree-to-indirect-buffer :override 'ap/org-tree-to-indirect-buffer)

(btw, I found a small drawback: it's not possible to org-tree-to-indirect-buffer within an indirect buffer.)

I seem to recall noticing the same problem, but I tested it now and it seems to work. Maybe I fixed it in the past and forgot, and maybe you're using the version without the fix? :) Anyway, the version posted above is what I'm using in my config now. Please let me know if that problem persists for you and I'll try to fix it.

In case you prefer email, I'll send this to you by email as well.

BTW, It was a pleasure to "meet" you in John's meetup today! Maybe next time I'll be able to get my microphone working and chat that way as well.

Thanks,
Adam

from bufler.el.

novoid avatar novoid commented on August 18, 2024 1

To be clear, org-tree-to-indirect-buffer is built-in to Org. Maybe you mean this customized version I have shared somewhere before.

Oh yes. This was a wrong phrasing. Thanks for correction.

Of course, I'm using your customized version.

(btw, I found a small drawback: it's not possible to org-tree-to-indirect-buffer within an indirect buffer.)

I seem to recall noticing the same problem, but I tested it now and it seems to work. Maybe I fixed it in the past and forgot, and maybe you're using the version without the fix? :)

You're right again: I copied your code and never updated. However, your version above reflects my version. So I might have found a bug which is depending on the Org mode data. Today's test worked fine. When I find myself in a situation where this fails (I noticed it only once and refrained from trying it again), I make sure to submit a decent bug report where you can see the issue yourself.

BTW, It was a pleasure to "meet" you in John's meetup today! Maybe next time I'll be able to get my microphone working and chat that way as well.

The pleasure was all mine. Can not wait for the next meeting with your working microphone ;-)

from bufler.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.