emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tip for EXWM users] An alternative method for isolate trees


From: Juan Manuel Macías
Subject: [tip for EXWM users] An alternative method for isolate trees
Date: Mon, 01 Mar 2021 13:55:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Since EXWM uses Emacs frames as virtual desktops, I have written this
alternative method of `org-tree-to-indirect-buffer', which I share here.
With this method I can have several isolated trees, with their own name,
and access them quickly (with helm-buffer-list, for example):

#+begin_src emacs-lisp
  (defun my-goto-buffer-regexp (regexp)
    (dolist (buffer (buffer-list))
      (let ((name (buffer-name buffer)))
        (when (and name (not (string-equal name ""))
                   (string-match regexp name))
          (switch-to-buffer buffer)))))

  (defun my-org-tree-to-indirect-buffer ()
    (interactive)
    (let ((buf (buffer-name))
          (ind-buf (replace-regexp-in-string "\\[.+\\]" "" (nth 4 
(org-heading-components))))
          (org-indirect-buffer-display 'new-frame))
      (org-tree-to-indirect-buffer)
      (my-goto-buffer-regexp ind-buf)
      (rename-buffer (concat buf "::" ind-buf))))
#+end_src

Best regards,

Juan Manuel 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]