[ESS] Evaulate Buffer Error

Sparapani, Rodney rsparapa at mcw.edu
Tue Feb 25 15:44:28 CET 2014


On Tue, 2014-02-25 at 14:41 +0000, Sparapani, Rodney wrote:
> Hello,
> 
> The evaluate buffer shortcut, C-c C-b is not functioning correctly in emacs
> version:
> GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.18.9) of
> 2013-07-17 on lxdist02
> with ess version:
> ess-version: 13.09-1 [<unknown>] (loaded from /usr/share/emacs/site-lisp/)
> 
> The error obtained when C-C C-b is run is:
> Symbol's function definition is void: with-silent-modifications
> The error obtained when eval-buffer is:
> Symbol's value as variable is void: a
> (in the case that I try to evaluate a buffer with just "a = 3" in it)
> 
> Additionally, the evaluate function shortcut also fails to function
> properly. In both cases, the correct region flashes as if highlighted,
> before the error mentioned appears.
> 
> The ess function C-c C-r, to evaluate a region, in contrast seems to work
> properly.
> 
> Thanks for your help!
> Loki11

Dear Bob Dole:

This is because the macro with-silent-modifications does not exist
in Emacs 23.1.1  Try placing this in your .emacs

(defmacro with-silent-modifications (&rest body)
  "Execute BODY, pretending it does not modify the buffer.
If BODY performs real modifications to the buffer's text, other
than cosmetic ones, undo data may become corrupted.

This macro will run BODY normally, but doesn't count its buffer
modifications as being buffer modifications.  This affects things
like buffer-modified-p, checking whether the file is locked by
someone else, running buffer modification hooks, and other things
of that nature.

Typically used around modifications of text-properties which do
not really affect the buffer's content."
  (declare (debug t) (indent 0))
  (let ((modified (make-symbol "modified")))
    `(let* ((,modified (buffer-modified-p))
            (buffer-undo-list t)
            (inhibit-read-only t)
            (inhibit-modification-hooks t)
            deactivate-mark
            ;; Avoid setting and removing file locks and checking
            ;; buffer's uptodate-ness w.r.t the underlying file.
            buffer-file-name
            buffer-file-truename)
       (unwind-protect
           (progn
             , at body)
         (unless ,modified
           (restore-buffer-modified-p nil))))))

PS.  If you are not Bob Dole, then don't be an ass.





More information about the ESS-help mailing list