[ESS] Introducing Polymode

Vitalie Spinu spinuvit at gmail.com
Wed Mar 27 12:49:20 CET 2013


Hi, 

Thanks for testing the stuff. 

  >> Ahmadou Dicko <dicko.ahmadou at gmail.com>
  >> on Wed, 27 Mar 2013 10:57:43 +0000 wrote:

  > Thank you Vitalie.
  > It's a fantatisc mode, I do a lot Rcpp/Rmd these few days and it's really
  > helpful to me.

Note that Rcpp is the most unreliable with the respect to
fontification. It has to do with the fact that C++-mode has a very
aggressive fontification style. I don't know how to properly fool it as
yet. cppR seems to be better.

  > - The fontification of chunk doesn't work everytime and I have to modify
  > that chunk before it fontifies  (TAB it for example, putting a space
  > before, etc.)

This is jit-lock. It fontifies something if it is not yet
fontified. First fontification happens at startup and the fact that
something is not fontified means that it failed before and you should
have seen some error messages in the messages buffer.

Some major modes don't have font lock. For example Rbrew or
ess-help. Then you have to navigate to one of the chunks to activate
them. But not to type anything.

  > -  At the begin of each R chunk in all the mode I have this message in my
  > minibuffer : "polymode error: Symbol's value as a variable is void: xcar"

Nope. Not in main repo. I cannot find any xcar occurrences. Make sure
you didn't type an "x" by mistake in your local sources.

  > - In Rnw mode the '<<>>' and '@'  are not fontified anymore

This is by design. The head and tail are placed in their own indirect
buffer and mode (fundamental by default). This will be useful in the
near future for special treatment of headers and tails, like
fontification, completion etc. It wasn't the priority as yet but I will
highlight them pretty soon.

  > - The ESS smarth underscore doesn't work while in a R chunk (in mode Rnw,
  > Rmd, cppR, etc.)

Indeed. It doesn't work with Rmd and cppR because smart underscore
thinks it is in a string or comment. I have made some adjustments on ESS
and polymode. Pull them both again and it should be fine.

  > I don't understand very well how all of this works for the moment but It's
  > really impressive.

  > If you don't have much time can you give me some references/hints to fix
  > these issues.

Thanks, but I don't think it is work to look into it right now. I will
document the interface and object hierarchy once I am sure the API is
stable. 

Keep reporting ;)

Thanks, 
    Vitalie

  > Thanks again

  > On Tue, Mar 26, 2013 at 6:26 PM, Vitalie Spinu <spinuvit at gmail.com> wrote:

  >> 
  >> Hi All,
  >> 
  >> I would like to announce a development version of new multi-major-mode
  >> called polymode. Source, screenshots and installation instructions are
  >> here:
  >> 
  >> https://github.com/vitoshka/polymode>
  >> 
  >> There is still some work to be done as it is not very stable as yet. I
  >> have just realized that I won't be able to pursue very active
  >> development for the weeks to come, so I decided to announce it right
  >> away. This includes some indentation issues and unstable font-lock in
  >> C++ submodes. C++R seems to work fine.
  >> 
  >> Currently it has builtin supports for Rnw, Rmd, Rhtml, Rbrew, Rcpp, cppR
  >> and "live" R examples in Rd and ess-help buffers. Adding new polymodes
  >> is literally about 25 lines of declarations. See "modes" directory and
  >> particularly poly-R.el. Also look in test directory for test
  >> examples. The interface is not fully settled as yet and thus, not
  >> documented.
  >> 
  >> There is also a default association with md extension. This basically
  >> means that as long as you have a proper declaration ```foo, and foo-mode
  >> function exists the chunk will be initialized with that mode.
  >> 
  >> It would be really nice if enthusiastic people can try it out and report
  >> bugs/comments/suggestions, either directly to me, or preferably on the
  >> github bug tracker. But please read the words warning first;)
  >> 
  >> Hopefully it will be useful to some people even at this stage.
  >> 
  >> Vitalie
  >> 
  >> ______________________________________________
  >> ESS-help at r-project.org mailing list
  >> https://stat.ethz.ch/mailman/listinfo/ess-help>



More information about the ESS-help mailing list