From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: camel.el, for CamelCase links Date: Thu, 05 Aug 2010 12:02:42 +0200 Message-ID: <87zkx14bst.fsf@gmx.de> References: <87sk2v3blh.fsf@gnu.org> <59E9801E-4A60-47A9-B374-0D4492729F70@gilbert.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=60052 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oh2Ne-0001UX-BI for emacs-orgmode@gnu.org; Thu, 05 Aug 2010 11:29:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oh2Nc-0002X9-Gt for emacs-orgmode@gnu.org; Thu, 05 Aug 2010 11:29:14 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:36684 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Oh2Nc-0002WW-6Q for emacs-orgmode@gnu.org; Thu, 05 Aug 2010 11:29:12 -0400 In-Reply-To: <59E9801E-4A60-47A9-B374-0D4492729F70@gilbert.org> (Michael Gilbert's message of "Wed, 4 Aug 2010 15:28:09 -0700") 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: Michael Gilbert Cc: emacs-orgmode Mailinglist --=-=-= Michael Gilbert writes: > On Aug 3,2010, at 9:27 AM, Bastien wrote: > >> "David O'Toole" writes: >> >>> http://github.com/dto/folio/blob/master/camel.el >>> Someone asked about this recently, i have some partially working code. >> >> I'm not a big fan of CamelCase links because it encourages the habit of >> creating many files -- but that may be useful for some. > > I'm on the fence about that one. I would definitely love an easier way > to create remote files and headings. This might help with the file end > of that. (Return key broken? No auto-fill-mode?) I don't see why typing [[file:xy.org]] and `C-b C-c C-0' to follow that link is to much. How about a function like this (just a quick hack): --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline Content-Transfer-Encoding: quoted-printable (defun org-create-link-and-file () "Ask for a file name and description for an Org link. Insert the link at point and open the file using `find-file'. If the file name entered does not end in \".org\", add the extension." (interactive) (let* ((ff (read-file-name "File: " nil nil 'confirm "")) (h (read-from-minibuffer "Headline (optional): " nil nil nil nil t t)) (f (file-relative-name (if (string-match "\\.org$" ff) ff (concat ff ".org")))) (d (read-from-minibuffer "Description: " (if (< 0 (length h)) h (file-name-nondirectory (file-name-sans-extension f)))))) (insert "[[file:" f (if (< 0 (length h)) (concat "::*" h) "") "][" d "]]") (find-file f) (when (< 0 (length h)) (end-of-buffer) (insert "\n* " h)))) --=-=-= and bind it to a sensible key, e.g `C-c M-l' This avoids any problems with camel case syntax and is easy to use. The function does not use the default link method yet (i.e. ID locations) but I couldn't make that work yet. Sebastian --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--