emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: phillip.lord@newcastle.ac.uk (Phillip Lord)
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Lentic.0.6 and org mode
Date: Thu, 15 Jan 2015 15:54:41 +0000	[thread overview]
Message-ID: <87y4p482f2.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <m2387ivmmw.fsf@polytechnique.org> (Alan Schmitt's message of "Sat, 10 Jan 2015 13:35:51 +0100")

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> On 2015-01-09 19:18, phillip.lord@newcastle.ac.uk (Phillip Lord) writes:
>>> 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.
> What are those markers? The "#+begin_src" one?

Sorry for the delay in replying.

Yep -- lentic is using the org-mode delimiters.

> Would you recommend using file-local variables for lentic files?

This works well. There is a function `lentic-mode-insert-file-local'
which helps with this. I am generally moving toward dir-locals though,
as this is less typing and generally easier.

> I gave it a try with this file:
> and it work well, with the exception of the file local variables that
> remain as text.

You have to double comment the file-local like so:

;; # Local Variables:
;; # lentic-init: lentic-orgel-org-init
;; # End:

Then it is commented in both forms.

>> 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.

Good. If you find any examples which fail, I'd be happy to look.

>> 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.

At the moment, killing one or the other lentic buffers does the job.
Lentic checks for the killed buffer and all should be good. An "exit
lentic" command might be nice, indeed. It could close all lentic buffers
except the first (currently lentic only supports one buffer, but
eventually it should support many). But killing the buffer works fine


  reply	other threads:[~2015-01-15 15:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 19:18 Lentic.0.6 and org mode Phillip Lord
2015-01-10 12:35 ` Alan Schmitt
2015-01-15 15:54   ` Phillip Lord [this message]
2015-01-15 17:24     ` Alan Schmitt
2015-01-15 22:28       ` Phillip Lord
2015-01-16 10:15         ` Alan Schmitt
2015-01-16 11:01           ` Phillip Lord
  -- strict thread matches above, loose matches on Subject: below --
2015-01-09 17:12 Phillip Lord
2015-01-09 17:57 ` Alan Schmitt
2015-01-08 13:55 Phillip Lord
2015-01-08 22:24 ` Thierry Banel
2015-01-11 12:33   ` joakim
2015-01-15 16:11     ` Phillip Lord
2015-01-15 20:53       ` Thierry Banel
2015-01-15 22:41         ` Phillip Lord
2015-01-16 18:43           ` Thierry Banel
2015-01-16 20:18             ` Thomas S. Dye
2015-01-16 23:46               ` Phillip Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y4p482f2.fsf@newcastle.ac.uk \
    --to=phillip.lord@newcastle.ac.uk \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).