[ESS] Fwd: change font-lock-string-face for back ticks

Vitalie Spinu spinuvit at gmail.com
Tue Feb 18 17:57:21 CET 2014


 >>> Peter Meilstrup on Tue, 18 Feb 2014 05:41:45 -0800 wrote:

[...]

 > Because it is legal to have infix operators like %'%, %`%, %a phrase
 > with spaces% and so on, which, if "%" is not treated as a quote, would
 > break highlighting and movement commands. I display it in something
 > other than string face (actually I make the % but not the contents
 > very low contrast as they are visually noisy, but that is not included
 > here.) I also have customized paredit to auto-pair %% and ``
 > characters.

Ok, this makes sense. Are there real-life examples of %'%? I am kind of
worried about your `%-weird-function` example if we decide to remove
quoting meaning of `.

Could you please post a full setup that you have for % customization?

 >> > ;; On the other hand ESS classes $ @ and : as word characters but they
 >> > ;; are really punctuation
 >> > (modify-syntax-entry ?$ ".")
 >> > (modify-syntax-entry ?@ ".")
 >> > (modify-syntax-entry ?: ".")
 >> 
 >> $, @, and : are of class symbol, as they should be. Making them
 >> punctuation will most likely screw a lot of stuff, most notably
 >> completion and eldoc for complex symbols like foo$bar.

 > "A$B" is not parsed as a single symbol by R but as a call. A$B in R
 > means the same thing as `$`(A,B). A and B the arguments and "$" is an
 > operator. "A$B" is not a symbol in R syntax unless it is surrounded by
 > backticks. Similarly with "?", "@", and ":", "::", ":::". If ESS
 > depends on having an incorrect model of R syntax that is interesting,
 > but completion appears to work for me.

While foo$boo is not a symbol in R, it functions semantically as a
symbol and when emacs/ESS operates on that symbol through commands like
symbol-at-point, forward-symbol etc, it better recognize it as a whole
entity. Unless there is a serious reason to change that, I would prefer
not to.

[...]

 >> 
 >> Modifying font-lock-syntactic-face-function just for the sake of % seems
 >> like an overkill, but could in principle be added if many more people
 >> find it annoying how %foo% is highlighted right now.

 > That would break on the example provided, `%weirdly-named-function` as
 > well as `weirdly"named-function` and things that regularly end up as
 > object component names like `a:b` and so on. I make heavy use of
 > paredit and sexp-level movement commands; if I issue
 > delete-forward-sexp it should not leave me with unbalanced backticks
 > or %, any more than it should leave me with unbalanced paren or
 > quotes.

I got confused here. Are you suggesting against accommodating % as a
quote, or against removing quoting behavior of ` ?


-- 
As an asside, I am using smart-parents with non-lisp code, and quite
frankly, a lot of times it is rather painfull, enough to offset the
benefits. Never got down to configuring it properly to my needs. What is
your trick with paredit? Are you using paredit-everywhere or cedit?
 

  Vitalie



More information about the ESS-help mailing list