From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manish Subject: Re: [babel] Moving to babel the whole configuration Date: Wed, 27 Jan 2010 09:45:35 +0530 Message-ID: References: <877hrbxv7q.fsf@stats.ox.ac.uk> <87k4v47m5z.fsf@gmail.com> <87sk9sa9ln.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZzJy-0006al-JK for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 23:16:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZzJu-0006aZ-3a for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 23:16:02 -0500 Received: from [199.232.76.173] (port=49051 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZzJt-0006aW-Tw for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 23:15:57 -0500 Received: from mx20.gnu.org ([199.232.41.8]:35819) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZzJt-0003vL-OL for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 23:15:57 -0500 Received: from mail-iw0-f186.google.com ([209.85.223.186]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZzJs-0004a7-IJ for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 23:15:57 -0500 Received: by iwn16 with SMTP id 16so737333iwn.5 for ; Tue, 26 Jan 2010 20:15:55 -0800 (PST) In-Reply-To: <87sk9sa9ln.fsf@stats.ox.ac.uk> 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: Dan Davison Cc: emacs-orgmode@gnu.org, andrea On Wed, Jan 27, 2010 at 2:04 AM, Dan Davison wrote: > "Eric Schulte" writes: > >> Manish writes: >> >>> On Thu, Jan 21, 2010 at 10:15 PM, Dan Davison wrote: >>>> andrea writes: >>>> >>>>> I'm really tempted to move all my emacs configuration in >>>>> only one big file. This would also help me to make it more >>>>> consistent and readable. >>>>> >>>>> But I'm afraid to mess up something, in theory I just need: >>>>> - a simple org and babel loader - one big file containing >>>>> everything >>>>> >>>> >>>> Hi Andrea, >>>> >>>> I've used a single org mode file to keep all my emacs >>>> configuration code for the last 5 months or so and I have >>>> not had any problems at all. I highly recommend it. I am >>>> using a simple set up: >>>> >>>> My ~/.emacs contains >>>> >>>> ------------------------------------------------------------------ >>>> (add-to-list 'load-path "/usr/local/src/org-mode/lisp") >>>> (add-to-list 'load-path >>>> "/usr/local/src/org-mode/contrib/lisp") (require >>>> 'org-install) (require 'org-babel-init) (org-babel-load-file >>>> "~/config/emacs/emacs.org") >>>> ------------------------------------------------------------------ >>>> >>>> and all the rest of my emacs config code is in >>>> ~/config/emacs/emacs.org >>>> >>> >>> This works very nicely. Thank you. >>> >>> I am thinking about making my config a little leaner while I >>> reorganize without affecting functionality I have gotten used >>> to by preventing sections of config from loading. I thought >>> setting :tangle to `no' should help but the default is >>> already `no' and all my config is loaded. How would one go >>> about marking a section of configuration so that it remains >>> in the configuration file but does not get tangled while >>> Emacs boots? >>> >> >> Hi Manish, >> >> I think this will require a little development/bug-fixing on >> my part before it works easily. As I recall the elisp >> tangling in `org-babel-load-file' is fairly aggressive and may >> not respect tangle header arguments. But the method you >> described above (setting the tangle header argument to no -- >> either in a subtree property or by block) is certainly the >> correct approach. > > Hi Eric -- I believe you already have it working in exactly > this way :) > > Manish -- could you double check please? I use :tangle no to > exclude blocks of elisp from my emacs init file, and it is > working. > You are right. I just did not try it at all after reading that ":tangle no" was the default. My apologies. I ran some tests and here are the results. | SET AS | VALUE | RESULT | |---------------------------+-------+-------------| | not set | n/a | tangled | | property ":TANGLE:" | no | not tangled | | property ":TANGLE:" | yes | backtrace | | header argument ":tangle" | no | not tangled | | header argument ":tangle" | yes | backtrace | --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (void-variable compilation-mode-map) (define-key compilation-mode-map (kbd "n") (quote compilation-next-error)) eval-buffer(#> nil "d:/home/zms/.emacs.d/emacs.el" nil t) ; Reading at buffer position 3862 load-with-code-conversion("d:/home/zms/.emacs.d/emacs.el" "d:/home/zms/.emacs.d/emacs.el" nil nil) load("d:/home/zms/.emacs.d/emacs.el" nil nil t) load-file("~/.emacs.d/emacs.el") (let* ((base-name ...) (exported-file ...)) (unless (and ... ...) (org-babel-tangle-file file base-name "emacs-lisp")) (load-file exported-file) (message "loaded %s" exported-file)) (progn (fset (quote age) (function* ...)) (let* (... ...) (unless ... ...) (load-file exported-file) (message "loaded %s" exported-file))) (unwind-protect (progn (fset ... ...) (let* ... ... ... ...)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...))) (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ...) (if --cl-letf-bound-- ... ...))) (letf ((... ...)) (let* (... ...) (unless ... ...) (load-file exported-file) (message "loaded %s" exported-file))) (letf* ((... ...)) (let* (... ...) (unless ... ...) (load-file exported-file) (message "loaded %s" exported-file))) (flet ((age ... ...)) (let* (... ...) (unless ... ...) (load-file exported-file) (message "loaded %s" exported-file))) org-babel-load-file("~/.emacs.d/emacs.org") eval-buffer(# nil "d:/home/zms/.emacs.d/init.el" nil t) ; Reading at buffer position 1576 load-with-code-conversion("d:/home/zms/.emacs.d/init.el" "d:/home/zms/.emacs.d/init.el" t t) load("d:/home/zms/.emacs.d/init" t t) #[nil " --8<---------------cut here---------------end--------------->8--- Thanks -- Manish