!rUhEinythPhVTdddsb:matrix.org

org-mode

777 Members
org-mode: digital and analog116 Servers

Load older messages


SenderMessageTime
5 Jan 2019
@mediapathic:matrix.orgmediapathicor, is there a better way to do that than killing the indirect buffer?01:20:29
@mediapathic:matrix.orgmediapathic(and that is the third time today I've typed "bugger" for "buffer" and maybe I should eat more)01:21:14
@mediapathic:matrix.orgmediapathic What's the correct terminology for the buffer that's created when I C-c ' on a src block? I love that thing too. 01:42:30
@adam:thebeckmeyers.xyz&Adam
In reply to @mediapathic:matrix.org
I love the new org-toggle-narrow-to-subtree
wait. Is that new? I feel like I've had that a long time.
02:10:48
@alphapapa:matrix.orgalphapapa
In reply to mediapathic
I should maybe set up some hotkeys for indirect buffer, but that's a bit more complicated, as I would want it as a toggle, which would imply (I think?) detecting if we're in an indirect buffer and killing it.
I just use C-S-b to open a subtree in an indirect buffer. I have a small advice function that renames the indirect buffer with the name of the subtree.
02:12:38
@alphapapa:matrix.orgalphapapa

FYI: just published https://github.com/alphapapa/unpackaged.el#agenda-for-subtree-or-region

02:12:57
@alphapapa:matrix.orgalphapapa

mediapathic: You might find this useful:

02:14:37
@alphapapa:matrix.orgalphapapa
(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)
           (buffer-name (let ((heading (nth 4 (org-heading-components))))
                          ;; FIXME: I think there's an Org function that does this, but I can't find it.
                          (concat (if (string-match org-bracket-link-regexp heading)
                                      ;; Heading is an org link; use link name
                                      ;; TODO: but what if only part of the heading is?
                                      (match-string 3 heading)
                                    ;; Not a link; use whole heading
                                    heading)
                                  "::" (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
        (rename-buffer buffer-name)
        (org-narrow-to-subtree))))

  (advice-add 'org-tree-to-indirect-buffer :override 'ap/org-tree-to-indirect-buffer)
02:14:45
@mediapathic:matrix.orgmediapathic
In reply to @adam:thebeckmeyers.xyz
wait. Is that new? I feel like I've had that a long time.
Bernt Hansen has some stuff that emulates it, which I stole back in my "copy and paste blindly" days. You maybe did the same thing?
03:21:49
@mediapathic:matrix.orgmediapathic
In reply to @alphapapa:matrix.org

mediapathic: You might find this useful:

oooh thanks.
03:22:01
@adam:thebeckmeyers.xyz&Adammaybe its spacemacs-specific. Too lazy to check right now.03:22:11
@mediapathic:matrix.orgmediapathicoh, yeah, that could be03:22:34
@anantpaatra:matrix.orgAnant PaatraIt seems the behavior is similar to narrowing to subtree and narrow widen, and indirect to subtree is also SPC (or M-m in my case) s b03:22:56
@anantpaatra:matrix.orgAnant Paatrain spacemacs that is03:22:59
@anantpaatra:matrix.orgAnant Paatranarrowing to subtree is SPC s n03:23:36
@anantpaatra:matrix.orgAnant Paatraand SPC n w03:23:55
@anantpaatra:matrix.orgAnant Paatraso its definitely very fast, but not exactly toggling03:24:07
@adam:thebeckmeyers.xyz&Adamah ya. That03:24:59
@mediapathic:matrix.orgmediapathicI should look at the spacemacs code and see how they get rid of the indirect buffer05:01:39
@adam:thebeckmeyers.xyz&AdamI've never used indirect buffers with org in spacemacs, so I can't say that that's a feature that exists.05:03:27
@adam:thebeckmeyers.xyz&AdamAnybody know how to have org automatically insert a given license header into all source-code files generated when tangling a document?05:03:58
@alphapapa:matrix.orgalphapapa
In reply to &Adam
Anybody know how to have org automatically insert a given license header into all source-code files generated when tangling a document?
Sure, take a look at unpackaged.el
05:04:20
@alphapapa:matrix.orgalphapapa

I have a header that gets tangled into the file

05:04:31
@adam:thebeckmeyers.xyz&Adamwill do. Thanks.05:04:35
@adam:thebeckmeyers.xyz&Adamnot helpful for my usecase.05:06:13
@alphapapa:matrix.orgalphapapa
In reply to &Adam
: &Adam> not helpful for my usecase.
:(
05:06:23
@adam:thebeckmeyers.xyz&Adamin that package, you're just generating a single tangled .el file.05:06:34
@adam:thebeckmeyers.xyz&Adam I'm manually specifying in the :tangle header where each src block should go. :/ 05:07:00
@adam:thebeckmeyers.xyz&AdamI guess I could just include a noweb reference at the top of each one, but that feels real hacky...05:07:21
@adam:thebeckmeyers.xyz&Adamprobably what I'll do for right now anyway to not spend too much time yak-shaving.05:07:49

There are no newer messages yet.


Back to Room ListRoom Version: 1