[ESS-bugs] Fwd: Re: problems with curly braces { }
Rodney Sparapani
rsparapa at mcw.edu
Tue Jul 13 16:25:47 CEST 2010
Hi Stephen:
I know you have taken a hands-off approach to XEmacs, but I'm wondering
if you have any thoughts about this recent thread?
Thanks,
Rodney
-------- Original Message --------
Subject: Re: problems with curly braces { }
Date: Thu, 27 May 2010 15:22:11 -0500
From: Rodney Sparapani <rsparapa at mcw.edu>
To: ess-help at stat.math.ethz.ch
Newsgroups: gmane.emacs.ess.general
References:
<AANLkTiknSj76kJr09twsdWjA1YJIUle6zgu-euftj6bg at mail.gmail.com>
<4BFEBF84.5000900 at mcw.edu>
On 05/27/10 01:52 PM, Rodney Sparapani wrote:
> Hi Josh:
>
> Very weird. I see the same thing. This is coming from ess-electric-brace
> from ess-mode.el This feature is discussed here
> http://ess.r-project.org/Manual/ess.html#Indenting
> But, the documentation gives no inkling of turning this feature off or
> what to do if it is broken?!?
>
Here's a workaround; use the definition of ess-electric-brace
below. It works, but it eats the next character. That is
usually a return and is handled correctly; but, if it's, say a
semicolon for a comment, then you have to do it twice.
I don't understand what this function is supposed
to be doing by looking at it's code and I don't know what
(interactive "P") is all about either.
(defun ess-electric-brace (arg)
"Insert character and correct line's indentation."
(interactive "c")
;; skeleton-pair takes precedence
(if (and (boundp 'skeleton-pair) skeleton-pair (featurep 'skeleton))
(skeleton-pair-insert-maybe "{")
;; else
(let (insertpos)
(if (and (not arg)
(eolp)
(or (save-excursion
(skip-chars-backward " \t")
(bolp))
(if ess-auto-newline (progn (ess-indent-line) (newline) t) nil)))
(progn
(insert last-command-event)
(ess-indent-line)
(if ess-auto-newline
(progn
(newline)
;; (newline) may have done auto-fill
(setq insertpos (- (point) 2))
(ess-indent-line)))
(save-excursion
(if insertpos (goto-char (1+ insertpos)))
(delete-char -1))))
(if insertpos
(save-excursion
(goto-char insertpos)
(self-insert-command (prefix-numeric-value arg)))
(self-insert-command (prefix-numeric-value arg))))))
More information about the ESS-bugs
mailing list