From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Lander Subject: Re: Breadcrumbs? Date: Mon, 24 Sep 2012 20:44:52 -0400 Message-ID: <1CA35E1C-E081-471B-9A56-9A83E1B3BECB@landerfamily.ca> References: <21A5E1E970CD46459ECBE86D6CC4B28C676DD94D@spexch01.WindLogics.local> Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: multipart/alternative; boundary="Apple-Mail=_3970D262-5D9F-444F-967E-44CA5FCC9AE2" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGJGk-0000Mo-Qh for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 20:44:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGJGj-0006i2-6L for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 20:44:58 -0400 Received: from mail-ie0-f169.google.com ([209.85.223.169]:55808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGJGi-0006hw-UP for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 20:44:57 -0400 Received: by ied10 with SMTP id 10so13890454ied.0 for ; Mon, 24 Sep 2012 17:44:55 -0700 (PDT) In-Reply-To: <21A5E1E970CD46459ECBE86D6CC4B28C676DD94D@spexch01.WindLogics.local> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ken Williams Cc: "emacs-orgmode@gnu.org" --Apple-Mail=_3970D262-5D9F-444F-967E-44CA5FCC9AE2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Ken, On 12-Sep-24, at 5:36 PM, Ken Williams wrote: > Has anyone ever tried implementing a =93breadcrumbs=94-type feature in = org-mode? By that I mean something that would quickly tell you the = headings up the whole path to the root, to quickly orient yourself when = you=92re deep within a document. I was originally thinking of something = always-present shown at the top of the frame, but maybe it would be = better as something shown on demand in the minibuffer, possibly making = it taller while shown. You can bind this to a speed command. It will show you the path to the = current headline (less the first heading) in the echo area, and will = also copy it to the kill ring. This is the functionality I need, but it = would be easy to modify to do what you want. (defun org-copy-outline-path-less-root-to-kill-ring (&optional a b) "Copy the current outline path, less the first node, to the kill ring, and echo to the echo area." (interactive "P") (let* ((bfn (buffer-file-name (buffer-base-buffer))) (case-fold-search nil) (path (rest (org-get-outline-path)))) (setq path (append path (save-excursion (org-back-to-heading t) (if (looking-at org-complex-heading-regexp) (list (match-string 4)))))) (let ((formatted-path (org-format-outline-path path (1- (frame-width))))) (kill-new formatted-path) (message "%s" formatted-path)))) Hope this helps, -Anthony --Apple-Mail=_3970D262-5D9F-444F-967E-44CA5FCC9AE2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Hi = Ken,

On 12-Sep-24, at 5:36 PM, Ken Williams = wrote:

Has anyone ever tried = implementing a =93breadcrumbs=94-type feature in org-mode?  By that = I mean something that would quickly tell you the headings up the whole = path to the root, to quickly orient yourself when you=92re deep within a = document.  I was originally thinking of something always-present = shown at the top of the frame, but maybe it would be better as something = shown on demand in the minibuffer, possibly making it taller while = shown.

You can = bind this to a speed command. It will show you the path to the current = headline (less the first heading) in the echo area, and will also copy = it to the kill ring. This is the functionality I need, but it would be = easy to modify to do what you want.

(defun = org-copy-outline-path-less-root-to-kill-ring (&optional a = b)
  "Copy the current outline path, less the first node, = to the
kill ring, and echo to the echo area."
  = (interactive "P")
  (let* ((bfn (buffer-file-name = (buffer-base-buffer)))
     (case-fold-search = nil)
         (path (rest = (org-get-outline-path))))
    (setq path (append = path
                =        (save-excursion
    =                     =  (org-back-to-heading t)
        =                  (if = (looking-at org-complex-heading-regexp)
      =                     =    (list (match-string 4))))))
    (let = ((formatted-path (org-format-outline-path
      =                     =  path
              =              (1- = (frame-width)))))
      (kill-new = formatted-path)
      (message "%s" = formatted-path))))

Hope this = helps,

 -Anthony

<= /div>
= --Apple-Mail=_3970D262-5D9F-444F-967E-44CA5FCC9AE2--