From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: Insert org-id Link at Point via Outline Path Completion Date: Sat, 1 Aug 2015 16:20:38 +0300 Message-ID: References: <20150801090706.GA3296@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ffba12d6b50fd051c3fcd40 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLWiP-0002gC-RP for emacs-orgmode@gnu.org; Sat, 01 Aug 2015 09:20:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLWiO-0000Tt-2c for emacs-orgmode@gnu.org; Sat, 01 Aug 2015 09:20:41 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:35925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLWiN-0000TI-N0 for emacs-orgmode@gnu.org; Sat, 01 Aug 2015 09:20:40 -0400 Received: by pachj5 with SMTP id hj5so56719435pac.3 for ; Sat, 01 Aug 2015 06:20:38 -0700 (PDT) In-Reply-To: <20150801090706.GA3296@gmail.com> 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: Xebar Saram , Dominic Surano , org mode --e89a8ffba12d6b50fd051c3fcd40 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thx so much Bernhard this looks really promising. i never had luck with either company or auto-complete t o get it to work reliably (it often stops working even though its still in the mod bar). anyway i tried it and added this to my config (after cloning from git): (add-to-list 'load-path "/home/zeltak/.emacs.g/company-org-headings") (add-hook 'org-mode-hook (lambda () (set (make-local-variable 'company-backends) '((company-org-headings))))) i dont see it completes on org heading, is there any keys i need to press or anything else in need to config? does this work only when you try to insert a link? best and thx so much, this look awesome P.S have you considered Helm for this as well? best Z On Sat, Aug 1, 2015 at 12:07 PM, Bernhard Pr=C3=B6ll wrote: > Hi Saram, > > I've been in the same boat and decided to write a company-backend for > this purpose. So if you're already using company-mode, this may be worth > looking into: > > https://github.com/mutbuerger/company-org-headings > > Keep in mind that I'm in the process of learning Elisp and > there has been little to no testing done on the package. Furthermore it > uses org-store-link instead of org-id-store-link. > > Regards, > Bernhard Pr=C3=B6ll > > > On Fri, 31. Jul 09:43, Xebar Saram wrote: > >> i also have a similar workflow and would love to hear Dominic if you >> found a >> solution for this or if anyone on the list has other suggestions? >> >> best >> >> Z >> >> On Tue, May 12, 2015 at 10:57 PM, Dominic Surano >> wrote: >> >> Hello, >> >> I use org-mode a lot like a wiki so links to other org-mode headings >> are >> very common. Currently, I navigate to the heading or pull it up in an >> agenda view, store the link with C-l, going back to where I want to >> insert the link, then insert the link with C-c C-l RET. This is a bit >> time consuming. >> >> Instead, I would prefer to map a key that allows me to insert a link = at >> the current point using tab completion similar to org-refile (C-c C-w= ). >> Looking through org-id.el, it seems like org-id-get-with-outline-path >> completion was designed for this purpose. I tried: >> >> (global-set-key "\C-ci" (lambda () (interactive) (org-id-get-with >> outline-path-completion))) >> >> but it didn't work as intended. Anyone have any ideas? >> >> Thanks! >> -D >> >> For reference, I have the following set in my configuration: >> >> ;; Use global IDs >> (require 'org-id) >> (setq org-id-link-to-org-use-id t) >> >> ;; Update ID file .org-id-locations on startup >> (org-id-update-id-locations) >> >> ;; Targets include this file and any file contributing to the agenda = - >> up to 9 levels deep >> (setq org-refile-targets (quote ((nil :maxlevel . 9) >> (org-agenda-files :maxlevel . 9)))) >> (setq org-refile-use-outline-path 'file) >> (setq org-outline-path-complete-in-steps t) >> (setq org-refile-allow-creating-parent-nodes t) >> >> >> >> >> --e89a8ffba12d6b50fd051c3fcd40 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thx so much Bernhard

this looks really = promising. i never had luck with either company or auto-complete t o get it= to work reliably (it often stops working even though its still in the mod = bar).
anyway i tried it and added this to my config (after clonin= g from git):

(add-to-list 'load-path &quo= t;/home/zeltak/.emacs.g/company-org-headings")
(add-hook = 9;org-mode-hook
=C2=A0(lambda () (set (make-local-variable 'company-ba= ckends)
= =C2=A0 =C2=A0 '((company-org-headings)))))
i dont see it completes on org heading, is there any keys i ne= ed to press or anything else in need to config? does this work only when yo= u try to insert a link?

best and thx so much, this= look awesome

P.S have you considered Helm for thi= s as well?

best

Z



On Sat, Aug 1, 2015 at 12:07 PM, Bernhard Pr=C3=B6ll <bmutbuerger@gmail.com> wrote:
Hi Saram,

I've been in the same boat and decided to write a company-backend for this purpose. So if you're already using company-mode, this may be wort= h
looking into:

https://github.com/mutbuerger/company-org-headings=

Keep in mind that I'm in the process of learning Elisp and
there has been little to no testing done on the package. Furthermore it
uses org-store-link instead of org-id-store-link.

Regards,
Bernhard Pr=C3=B6ll


On Fri, 31. Jul 09:43, Xebar Saram wrote:
i also have a similar workflow and would love to hear Dominic if you found = a
solution for this or if anyone on the list has other suggestions?

best

Z

On Tue, May 12, 2015 at 10:57 PM, Dominic Surano <sk8ingdom@gmail.com> wrote:

=C2=A0 =C2=A0Hello,

=C2=A0 =C2=A0I use org-mode a lot like a wiki so links to other org-mode he= adings are
=C2=A0 =C2=A0very common. Currently, I navigate to the heading or pull it u= p in an
=C2=A0 =C2=A0agenda view, store the link with C-l, going back to where I wa= nt to
=C2=A0 =C2=A0insert the link, then insert the link with C-c C-l RET. This i= s a bit
=C2=A0 =C2=A0time consuming.

=C2=A0 =C2=A0Instead, I would prefer to map a key that allows me to insert = a link at
=C2=A0 =C2=A0the current point using tab completion similar to org-refile (= C-c C-w).
=C2=A0 =C2=A0Looking through org-id.el, it seems like org-id-get-with-outli= ne-path
=C2=A0 =C2=A0completion was designed for this purpose. I tried:

=C2=A0 =C2=A0(global-set-key "\C-ci" (lambda () (interactive) (or= g-id-get-with
=C2=A0 =C2=A0outline-path-completion)))

=C2=A0 =C2=A0but it didn't work as intended. Anyone have any ideas?

=C2=A0 =C2=A0Thanks!
=C2=A0 =C2=A0-D

=C2=A0 =C2=A0For reference, I have the following set in my configuration:
=C2=A0 =C2=A0;; Use global IDs
=C2=A0 =C2=A0(require 'org-id)
=C2=A0 =C2=A0(setq org-id-link-to-org-use-id t)

=C2=A0 =C2=A0;; Update ID file .org-id-locations on startup
=C2=A0 =C2=A0(org-id-update-id-locations)

=C2=A0 =C2=A0;; Targets include this file and any file contributing to the = agenda -
=C2=A0 =C2=A0up to 9 levels deep
=C2=A0 =C2=A0(setq org-refile-targets (quote ((nil :maxlevel . 9)
=C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-agenda-files := maxlevel . 9))))
=C2=A0 =C2=A0(setq org-refile-use-outline-path 'file)
=C2=A0 =C2=A0(setq org-outline-path-complete-in-steps t)
=C2=A0 =C2=A0(setq org-refile-allow-creating-parent-nodes t)





--e89a8ffba12d6b50fd051c3fcd40--