[ESS] Skeleton pair insert not working after upgrade.

Rodney Sparapani rsparapa at mcw.edu
Mon Sep 21 20:31:08 CEST 2009

Marc Schwartz wrote:
> Rodney,
> Just an FYI, that none of my ESS installation has been byte compiled, so 
> there would not be a presumptive conflict between the .el and .elc 
> versions of a given emacs lisp file. So modifying the .el file should 
> have been sufficient and the lack of a behavior change after doing so, 
> gave rise to my thinking that using the fully modified code base might 
> be required given dependencies elsewhere.
> The historical reason for this, in my case, is that when I was on Fedora 
> Linux, I went between Emacs version 22 and 23 until 23 became stable 
> enough to use all the time. Since byte compiling was not binary 
> compatible between the two versions, I simply did not byte compile. I 
> have, for better or worse, continued that habit, even now on OSX as I 
> have not found a material performance impact, at least in my typical use.
> Regards,
> Marc

Weird.  I don't byte-compile under OS X either (I use the simple 
installation instructions).  Anyways, I think I see how to fix {
with skeleton-pair.  It's just an either-or thing:

(defun ess-electric-brace (arg)
   "Insert character and correct line's indentation."
   (interactive "P")
;; skeleton-pair takes precedence
(if (and (boundp 'skeleton-pair) skeleton-pair (fboundp 
   (skeleton-pair-insert-maybe "{")
;; else
   (let (insertpos)
     (if (and (not arg)
	     (or (save-excursion
		   (skip-chars-backward " \t")
		 (if ess-auto-newline (progn (ess-indent-line) (newline) t) nil)))
	  (insert last-command-char)
	  (if ess-auto-newline
		;; (newline) may have done auto-fill
		(setq insertpos (- (point) 2))
	    (if insertpos (goto-char (1+ insertpos)))
	    (delete-char -1))))
     (if insertpos
	  (goto-char insertpos)
	  (self-insert-command (prefix-numeric-value arg)))
       (self-insert-command (prefix-numeric-value arg))))))

Now, checked in.  Will appear in ESS 5.5 RSN :o)

Rodney Sparapani      Center for Patient Care & Outcomes Research (PCOR)
Sr. Biostatistician              http://www.mcw.edu/pcor
4 wheels good, 2 wheels better!  Medical College of Wisconsin (MCW)
WWLD?:  What Would Lombardi Do?  Milwaukee, WI, USA

More information about the ESS-help mailing list