From mboxrd@z Thu Jan 1 00:00:00 1970 From: tony day Subject: Re: [PATCH] org-insert-link: allow ido usage when inserting links Date: Fri, 12 Oct 2012 14:56:10 +1100 Message-ID: <0CADA13B-8A22-4F34-91B1-2232997C1F04@gmail.com> References: <9264AF9E-715F-45FF-88D1-8EAB5E94E751@gmail.com> <87k3ux42pr.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMWMD-0004v6-5B for emacs-orgmode@gnu.org; Thu, 11 Oct 2012 23:56:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMWMB-00067M-Sd for emacs-orgmode@gnu.org; Thu, 11 Oct 2012 23:56:17 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:51641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMWMB-00067F-ML for emacs-orgmode@gnu.org; Thu, 11 Oct 2012 23:56:15 -0400 Received: by mail-pa0-f41.google.com with SMTP id fa10so2686355pad.0 for ; Thu, 11 Oct 2012 20:56:14 -0700 (PDT) In-Reply-To: <87k3ux42pr.fsf@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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On 11 Oct 2012, at 23:23, Nicolas Goaziou wrote: > Thanks for submitting a patch. Here are a few comments. Hi Nicolas, thanks for taking the time to go through the code. I will = resubmit the patch in a separate mail (I didn't know whether I could = respond to your suggestions and submit a new patch in the same mail). > Entries should end with a period (not the title, though). Also, if you > haven't signed FSF papers yet, you should append "TINYCHANGE" on a = line > on its own. I have signed the FSF papers and they have been processed. > I don't see the interest of this change nor how it is related to > allowing ido usage to insert links. Can >=20 > (append > (mapcar (lambda (x) (list (concat x ":"))) all-prefixes) > (mapcar 'car org-stored-links) > (mapcar 'cadr org-stored-links)) >=20 > contain nil values? >=20 > If so, adding a (delq nil (append ...)) should be enough. This should = be > a separate patch anyway. The problem is actualy the list bit, which causes a bug when using ido = (but not when using normal completion). Having gone through it again, I don't think the append can contain nil = values, so I removed that bit. > Shouldn't `read-file-name' become > `org-iread-file-name'?=20 Agreed and changed. I don't think the patch can be split into two - the bug from list is = only a bug if ido is used. Here's some test code it case it helps: - unit test #+begin_src emacs-lisp ;;(setq org-stored-links nil) (setq org-stored-links=20 '((#("file:~/stuff/org/bugz.org::*current debugging" 28 35 = (fontified t org-category "bugz" line-prefix #("*" 0 1 (face org-hide)) = wrap-prefix #(" " 0 4 (face org-indent)) face org-level-2) 36 45 = (fontified t org-category "bugz" line-prefix #("*" 0 1 (face org-hide)) = wrap-prefix #(" " 0 4 (face org-indent)) face org-level-2)) "current = debugging"))) ;;(setq org-stored-links ;; '((#("file:~/stuff/org/bugz.org::*test link 2" 28 32 = (fontified t line-prefix #("**" 0 2 (face org-hide)) wrap-prefix #(" = " 0 6 (face org-indent)) face org-level-3) 33 37 (fontified t = line-prefix #("**" 0 2 (face org-hide)) wrap-prefix #(" " 0 6 (face = org-indent)) face org-level-3) 38 39 (fontified t line-prefix #("**" 0 2 = (face org-hide)) wrap-prefix #(" " 0 6 (face org-indent)) face = org-level-3)) "test link 2") (#("file:~/stuff/org/bugz.org::*test link = 1" 28 32 (fontified t line-prefix #("**" 0 2 (face org-hide)) = wrap-prefix #(" " 0 6 (face org-indent)) face org-level-3) 33 37 = (fontified t line-prefix #("**" 0 2 (face org-hide)) wrap-prefix #(" = " 0 6 (face org-indent)) face org-level-3) 38 39 (fontified t = line-prefix #("**" 0 2 (face org-hide)) wrap-prefix #(" " 0 6 (face = org-indent)) face org-level-3)) "test link 1"))) (setq abbrevs org-link-abbrev-alist-local) (setq all-prefixes (append org-link-types (mapcar 'car abbrevs) (mapcar 'car org-link-abbrev-alist))) (setq all-links (append (mapcar 'cadr org-stored-links) (mapcar (lambda (x) (concat x ":")) all-prefixes) (mapcar 'car org-stored-links))) ;;(setq all-links (delete nil all-links)) (print (loop for link in all-links collect (list link))) =20 =20 #+end_src Tony