emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Defadvice on undo-more in ses.el


From: Kim F. Storm
Subject: Defadvice on undo-more in ses.el
Date: Sun, 20 Feb 2005 21:12:34 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

We really don't want defadvice on built-in functions in packages
included with emacs.  

So we should find an alternative to this change:

2005-02-20  Jonathan Yavner  <address@hidden>

        * ses.el (undo-more): restore defadvice, but only the part that
        allows changes outside the restricted area of the buffer.


What about the following?

Replace the defadvice with this defun:

(defun ses-undo (fun &rest args)
  "For SES mode, allow undo outside of narrowed buffer range."
  (setq ses--deferred-narrow
     (or ses--deferred-narrow (ses-narrowed-p)))
  (widen)
  (condition-case x
      (apply fun args)
    (error
     ;;Restore narrow if appropriate
     (ses-command-hook)
     (signal (car x) (cdr x)))))

Then, wherever an entry is pushed onto the buffer-undo-list, make a
change like this:

From
      (push `(apply ses-vector-delete ses--cells ,row 1) buffer-undo-list)
to
      (push `(apply ses-undo ses-vector-delete ses--cells ,row 1) 
buffer-undo-list)
                    ^^^^^^^^


I haven't tested this, but I think it would work....

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]