From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Williams Subject: Re: Breadcrumbs? Date: Tue, 25 Sep 2012 12:44:23 -0500 Message-ID: <21A5E1E970CD46459ECBE86D6CC4B28C676DDA32@spexch01.WindLogics.local> References: <21A5E1E970CD46459ECBE86D6CC4B28C676DD94D@spexch01.WindLogics.local> <1CA35E1C-E081-471B-9A56-9A83E1B3BECB@landerfamily.ca> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_21A5E1E970CD46459ECBE86D6CC4B28C676DDA32spexch01WindLog_" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGZBL-00033k-Nj for emacs-orgmode@gnu.org; Tue, 25 Sep 2012 13:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGZBK-00081H-DW for emacs-orgmode@gnu.org; Tue, 25 Sep 2012 13:44:27 -0400 Received: from shrimp.windlogics.com ([216.245.170.164]:6267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGZBK-00080s-6F for emacs-orgmode@gnu.org; Tue, 25 Sep 2012 13:44:26 -0400 In-Reply-To: <1CA35E1C-E081-471B-9A56-9A83E1B3BECB@landerfamily.ca> Content-Language: en-US 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: Anthony Lander Cc: "emacs-orgmode@gnu.org" --_000_21A5E1E970CD46459ECBE86D6CC4B28C676DDA32spexch01WindLog_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Very nice, thanks. I like to see the top-level heading too, so I removed t= he (rest ...) call near the beginning. -Ken From: Anthony Lander [mailto:anthony@landerfamily.ca] Sent: Monday, September 24, 2012 7:45 PM To: Ken Williams Cc: emacs-orgmode@gnu.org Subject: Re: [O] Breadcrumbs? Hi Ken, You can bind this to a speed command. It will show you the path to the curr= ent 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 ________________________________ CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the inte= nded recipient(s) and may contain confidential and privileged information. = Any unauthorized review, use, disclosure or distribution of any kind is str= ictly prohibited. If you are not the intended recipient, please contact the= sender via reply e-mail and destroy all copies of the original message. Th= ank you. --_000_21A5E1E970CD46459ECBE86D6CC4B28C676DDA32spexch01WindLog_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Very nice, thanks.  = I like to see the top-level heading too, so I removed the (rest ...) call n= ear the beginning.

 <= /p>

  -Ken

 <= /p>

From: Anthony = Lander [mailto:anthony@landerfamily.ca]
Sent: Monday, September 24, 2012 7:45 PM
To: Ken Williams
Cc: emacs-orgmode@gnu.org
Subject: Re: [O] Breadcrumbs?

 

Hi Ken,

 

You can bind this to a speed command. It will show y= ou the path to the current headline (less the first heading) in the echo ar= ea, and will also copy it to the kill ring. This is the functionality I nee= d, 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-bu= ffer)))

     (case-fold-search nil)

         (path (rest (org-g= et-outline-path))))

    (setq path (append path

              &nb= sp;        (save-excursion

              &nb= sp;          (org-back-to-heading t)

              &nb= sp;          (if (looking-at org-complex-heading-r= egexp)

              &nb= sp;              (list (match-string 4))= ))))

    (let ((formatted-path (org-format-outl= ine-path

              &nb= sp;            path

              &nb= sp;            (1- (frame-width)))))

      (kill-new formatted-path)<= /o:p>

      (message "%s" formatt= ed-path))))

 

Hope this helps,

 

 -Anthony

 



CONFIDENTIALITY NOTICE: Th= is e-mail message is for the sole use of the intended recipient(s) and may = contain confidential and privileged information. Any unauthorized review, u= se, disclosure or distribution of any kind is strictly prohibited. If you are not the intended recipient, please= contact the sender via reply e-mail and destroy all copies of the original= message. Thank you.
--_000_21A5E1E970CD46459ECBE86D6CC4B28C676DDA32spexch01WindLog_--