emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Lentic.0.6 and org mode
@ 2015-01-08 13:55 Phillip Lord
  2015-01-08 22:24 ` Thierry Banel
  0 siblings, 1 reply; 18+ messages in thread
From: Phillip Lord @ 2015-01-08 13:55 UTC (permalink / raw)
  To: emacs-orgmode



I thought some of you might be interested in the new release of my
package, lentic. One of the things that it now does is allow
multi-modal of editing of Emacs source, using org mode for the
documentation. I realise that it's already possible to use ELPA
org-babel to write literate el files, or to use outorg.el, but lentic
provides a different form of interaction. You can edit the org form or
the emacs-lisp form as you choose. The source code of lentic is, itself,
written in this way. There is a screen cast linked below which shows
what the interaction looks like.

Available on MELPA-stable, MELPA and Marmalade
https://github.com/phillord/lentic
http://www.russet.org.uk/blog/3035
https://vimeo.com/116078853

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Lentic.0.6 and org mode
@ 2015-01-09 17:12 Phillip Lord
  2015-01-09 17:57 ` Alan Schmitt
  0 siblings, 1 reply; 18+ messages in thread
From: Phillip Lord @ 2015-01-09 17:12 UTC (permalink / raw)
  To: emacs-orgmode



I normally do

(global-lentic-start-mode)

which just adds some keybindings for you.

Then, do one of

lentic-mode-create-in-selected-window, (C-c,h)
lentic-mode-split-window-below, (C-c,b)
lentic-mode-split-window-right (C-c,r)

Or there are menu items which does the same.

All of these create the "lentic" view, and put in a window as you might
guess. By default, it does indeed come up in fundamental mode (probably
that's not sensible, and I should set it to the same mode as the
starting buffer.

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

This gives the behaviour shown in this screen cast.

https://vimeo.com/116078853

The eval thing is just to make sure some macros are loaded, so that that
they indent properly, which is an orthogonal issue.

None of this is org or Emacs-lisp specific. I just added that because I
could, and it wasn't that much effort (okay, so it was more effort than
I expected, but there you go). I wrote it in the first place for Clojure
and asciidoc, but am actually using it with clojure and latex.

Phil


> Nice!
> 
> I spent some time figuring out how to use it.
> 
> This is what I did eventually:
>   M-xlentic-mode
>   M-xlentic-mode   ;; twice
>   M-x lentic-mode-split-window-below
> Then change the new buffer to the desired mode (Java mode, C++ mode,
> whatever).
> (I was created in fundamental mode).
> 
> Is this the standard way to use it?
> 
> Thierry

> Le 08/01/2015 14:55, Phillip Lord a écrit :
> > I thought some of you might be interested in the new release of my
> > package, lentic. One of the things that it now does is allow
> > multi-modal of editing of Emacs source, using org mode for the
> > documentation. I realise that it's already possible to use ELPA
> > org-babel to write literate el files, or to use outorg.el, but lentic
> > provides a different form of interaction. You can edit the org form or
> > the emacs-lisp form as you choose. The source code of lentic is, itself,
> > written in this way. There is a screen cast linked below which shows
> > what the interaction looks like.
> >
> > Available on MELPA-stable, MELPA and Marmalade
> > https://github.com/phillord/lentic
> > http://www.russet.org.uk/blog/3035
> > https://vimeo.com/116078853
> >
> >

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Lentic.0.6 and org mode
@ 2015-01-09 19:18 Phillip Lord
  2015-01-10 12:35 ` Alan Schmitt
  0 siblings, 1 reply; 18+ messages in thread
From: Phillip Lord @ 2015-01-09 19:18 UTC (permalink / raw)
  To: emacs-orgmode

> 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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-01-16 23:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 13:55 Lentic.0.6 and org mode 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
  -- 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-09 19:18 Phillip Lord
2015-01-10 12:35 ` Alan Schmitt
2015-01-15 15:54   ` Phillip Lord
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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