From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: Lentic.0.6 and org mode Date: Sat, 10 Jan 2015 13:35:51 +0100 Message-ID: References: <87iogfyd7p.fsf@newcastle.ac.uk> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9vGp-0005Qe-3O for emacs-orgmode@gnu.org; Sat, 10 Jan 2015 07:36:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9vGl-0005AQ-Tt for emacs-orgmode@gnu.org; Sat, 10 Jan 2015 07:35:59 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]:47655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9vGl-00059k-JN for emacs-orgmode@gnu.org; Sat, 10 Jan 2015 07:35:55 -0500 In-Reply-To: <87iogfyd7p.fsf@newcastle.ac.uk> (Phillip Lord's message of "Fri, 09 Jan 2015 19:18:50 +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: Phillip Lord Cc: emacs-orgmode@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2015-01-09 19:18, phillip.lord@newcastle.ac.uk (Phillip Lord) writes: >> I've used a similar configuration >>=20 >> #+begin_src emacs-lisp >> (add-hook 'emacs-lisp-mode-hook (lambda () (setq lentic-init=20 >> '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=20 > when all the code gets refilled. What are those markers? The "#+begin_src" one? Would you recommend using file-local variables for lentic files? I gave it a try with this file: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=lentic_test.el Content-Transfer-Encoding: quoted-printable ;; this is a test ;;; Code: ;; a comment ;; ** a subsection ;; #+begin_src emacs-lisp (message "foo") ;; #+end_src ;; Local Variables: ;; lentic-init: lentic-orgel-org-init ;; End: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable and it work well, with the exception of the file local variables that remain as text. >> but it's not as nice as in the demo. For instance, the following: >>=20 >> #+begin_src emacs-lisp >> ;;; Code: >>=20 >> ;; ** Startup >>=20 >> ;; #+begin_src emacs-lisp >>=20 >> ;; Turn off mouse interface early in startup to avoid momentary display >>=20 >> (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) >> (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) >> #+end_src >>=20 >> becomes >>=20 >> #+begin_src org >> * Code >>=20 >> ;; ** Startup >>=20 >> ;; #+begin_src emacs-lisp >>=20 >> ;; Turn off mouse interface early in startup to avoid momentary display >>=20 >> (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) >> (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) >> #+end_src >>=20 >> 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 was not a full example, so there was the end marker. But as there is a lot of code below it as well (without markers), this may be the issue. The small example above works well. > 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. By the way, what is the correct way of exiting lentic mode? For the moment I kill the buffer and the window, but it would be nice to have a function that exits lentic. Thanks, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBCgAGBQJUsRysAAoJEAQNCjtO0uXHD98IAJOPTKcxult/TkjOykOEpvDi Zd/nw9qvgn8r7lTtaIReJFjlF1s8REKsx+ROo8CxhsaiP26Ww4NhvnjXgbxel4Be HWff7mLZ1yx7CaZXtuyoyhEztf5a3G2MVahRZfYCn/Vag/VFAX0NL1NAWzdjUDrD aWmoV+wU94ILEbHk6HiyA3Xr9AgXHF5UkiSxPIM2HKlqdeYs9uY6HrGZ1H2vVMPB M3CaSAkuz6Jhv6aFcRxMXN4FN5rFOZIcF8VDCXpKpklsgS1jtg66Y78QWeSBbvd8 NwC2UaNThWMRaedEUhOR/L2cKUMSNUjIhVHu8UY9RrkLu/JUigxZbGN+MSdwi1I= =moRk -----END PGP SIGNATURE----- --==-=-=--