From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Bug: org-insert-link issues error when list of links is empty [6.33trans (release_6.33f.34.gf806)] Date: Wed, 25 Nov 2009 13:13:23 -0500 Message-ID: <200911251813.nAPIDNn3001193@gollum.intra.norang.ca> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDMMu-0007q0-Uy for emacs-orgmode@gnu.org; Wed, 25 Nov 2009 13:13:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDMMr-0007lR-5V for emacs-orgmode@gnu.org; Wed, 25 Nov 2009 13:13:32 -0500 Received: from [199.232.76.173] (port=54712 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDMMr-0007lO-0v for emacs-orgmode@gnu.org; Wed, 25 Nov 2009 13:13:29 -0500 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:62895) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NDMMq-0004gN-Ky for emacs-orgmode@gnu.org; Wed, 25 Nov 2009 13:13:28 -0500 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1NDMMn-0002kV-L6 for emacs-orgmode@gnu.org; Wed, 25 Nov 2009 18:13:25 +0000 Received: from gollum.intra.norang.ca (gollum.intra.norang.ca [192.168.1.5]) by mail.norang.ca (8.14.3/8.14.3/Debian-5) with ESMTP id nAPIDNWo030454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 25 Nov 2009 13:13:24 -0500 Received: from gollum.intra.norang.ca (localhost [127.0.0.1]) by gollum.intra.norang.ca (8.14.3/8.14.3/Debian-5) with ESMTP id nAPIDNJq001196 for ; Wed, 25 Nov 2009 13:13:23 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. ------------------------------------------------------------------------ C-c C-l RET when there are no links in the list gives the following backtrace. This should probably just report a more user-friendly error message. -Bernt --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (args-out-of-range "" -1 0) substring("" -1) (equal ":" (substring link -1)) (and (equal ":" (substring link -1)) (member (substring link 0 -1) all-prefixes) (setq link (substring link 0 -1))) (or (member link all-prefixes) (and (equal ":" ...) (member ... all-prefixes) (setq link ...))) (if (or (member link all-prefixes) (and ... ... ...)) (setq link (org-link-try-special-completion link))) (progn (setq link (let ... ...)) (if (or ... ...) (setq link ...))) (unwind-protect (progn (setq link ...) (if ... ...)) (set-window-configuration wcf) (kill-buffer "*Org Links*")) (cond (link-location) ((org-in-regexp org-bracket-link-regexp 1) (setq remove ...) (setq desc ...) (setq link ...)) ((or ... ...) (setq remove ... link ...)) ((member complete-file ...) (setq link ...)) (t (with-output-to-temp-buffer "*Org Links*" ... ...) (let ... ... ... ... ...) (setq tmphist ...) (setq all-prefixes ...) (unwind-protect ... ... ...) (setq entry ...) (or entry ...) (if ... ...) (setq desc ...))) (let* ((wcf ...) (region ...) (remove ...) (desc region) tmphist (link link-location) entry file all-prefixes) (cond (link-location) (... ... ... ...) (... ...) (... ...) (t ... ... ... ... ... ... ... ... ...)) (if (string-match org-plain-link-re link) (setq link ...)) (when (and buffer-file-name ...) (let* ... ...)) (when (string-match "^file:\\(.*\\)" link) (let* ... ... ... ...)) (if org-make-link-description-function (setq desc ...)) (setq desc (read-string "Description: " desc)) (unless (string-match "\\S-" desc) (setq desc nil)) (if remove (apply ... remove)) (insert (org-make-link-string link desc))) org-insert-link(nil) call-interactively(org-insert-link) --8<---------------cut here---------------end--------------->8--- Emacs : GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-09 on raven, modified by Debian Package: Org-mode version 6.33trans (release_6.33f.34.gf806)