From mboxrd@z Thu Jan 1 00:00:00 1970 From: phillip.lord@newcastle.ac.uk (Phillip Lord) Subject: Re: Lentic.0.6 and org mode Date: Fri, 09 Jan 2015 19:18:50 +0000 Message-ID: <87iogfyd7p.fsf@newcastle.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9fun-0001OT-RY for emacs-orgmode@gnu.org; Fri, 09 Jan 2015 15:12:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9fuk-0007ta-Tf for emacs-orgmode@gnu.org; Fri, 09 Jan 2015 15:12:13 -0500 Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:50987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9fuk-0007tU-N5 for emacs-orgmode@gnu.org; Fri, 09 Jan 2015 15:12:10 -0500 Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1Y9f5H-0002xy-Ex for emacs-orgmode@gnu.org; Fri, 09 Jan 2015 19:18:59 +0000 Received: from cpc7-benw10-2-0-cust228.16-2.cable.virginm.net ([77.98.254.229] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Y9f5H-0000ZK-F6 for emacs-orgmode@gnu.org; Fri, 09 Jan 2015 19:18:59 +0000 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: emacs-orgmode@gnu.org > On 2015-01-09 17:12, address@hidden (Phillip Lord) writes: > > > It's configurable, though. By default, the two windows share the same > > text (which is nearly the same behaviour as indirect buffers). But they > > can also be different (but related). I use a file or dir-local variable > > for this. So, the lentic source code uses: > > > > ((emacs-lisp-mode > > . > > ((lentic-init . lentic-orgel-org-init) > > (eval . (require 'm-buffer-macro))))) > > I've used a similar configuration > > #+begin_src emacs-lisp > (add-hook 'emacs-lisp-mode-hook (lambda () (setq lentic-init > 'lentic-orgel-org-init))) > #+end_src Personally, I wouldn't do that! At the moment, my transformation doesn't work nicely for all el files. At a minimum, you need code markers at the before the first line of lisp and the after the last. Otherwise, all the code gets treated by org as text; if you run, say, "fill-paragraph" in the org-mode lentic view then it will do bad things when all the code gets refilled. > > but it's not as nice as in the demo. For instance, the following: > > #+begin_src emacs-lisp > ;;; Code: > > ;; ** Startup > > ;; #+begin_src emacs-lisp > > ;; Turn off mouse interface early in startup to avoid momentary display > > (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) > (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) > #+end_src > > becomes > > #+begin_src org > * Code > > ;; ** Startup > > ;; #+begin_src emacs-lisp > > ;; Turn off mouse interface early in startup to avoid momentary display > > (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) > (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) > #+end_src > > Why the "Startup" is not promoted at the org level? If your example is complete, I think it's because your code markers are unbalanced. Look in the *lentic-log* buffer and you should see lots of "delimiters do not match". Put a ";; #+end_src" in place and it should fix itself. This should probably be smoothed over in the user interface. I could tell the user when the lentic buffer is created. You've also uncovered a bug -- when the delimiters do not match, it's should be doing the safest transformation of all which is a direct copy; so the "* Code" line should have been left alone also. Phil