diff options
author | Jonathan Yavner <jyavner@member.fsf.org> | 2005-02-20 05:02:54 +0000 |
---|---|---|
committer | Jonathan Yavner <jyavner@member.fsf.org> | 2005-02-20 05:02:54 +0000 |
commit | eedeacb3074baad8ce752a506f9f435c98e42ff4 (patch) | |
tree | 023278d781d1c3fba51fe245fa5aaad367b7d348 /lisp/ses.el | |
parent | 50d9c3962f301bc50be3319abbc8412b992fbfea (diff) | |
download | emacs-eedeacb3074baad8ce752a506f9f435c98e42ff4.tar.gz |
(undo-more): restore defadvice, but only the part that allows changes
outside the restricted area of the buffer.
Diffstat (limited to 'lisp/ses.el')
-rw-r--r-- | lisp/ses.el | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/lisp/ses.el b/lisp/ses.el index c2239327e1c..502acf868dc 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -1281,34 +1281,20 @@ to each symbol." ;; This should be unnecessary, because the feature is now built in. -;;; (defadvice undo-more (around ses-undo-more activate preactivate) -;;; "Define a meaning for conses in buffer-undo-list whose car is a symbol -;;; other than t or nil. To undo these, apply the car--a function--to the -;;; cdr--its arglist." -;;; (let ((ses-count (ad-get-arg 0))) -;;; (catch 'undo -;;; (dolist (ses-x pending-undo-list) -;;; (unless ses-x -;;; ;;End of undo boundary -;;; (setq ses-count (1- ses-count)) -;;; (if (<= ses-count 0) -;;; ;;We've seen enough boundaries - stop undoing -;;; (throw 'undo nil))) -;;; (and (consp ses-x) (symbolp (car ses-x)) (fboundp (car ses-x)) -;;; ;;Undo using apply -;;; (apply (car ses-x) (cdr ses-x))))) -;;; (if (not (eq major-mode 'ses-mode)) -;;; ad-do-it -;;; ;;Here is some extra code for SES mode. -;;; (setq ses--deferred-narrow -;;; (or ses--deferred-narrow (ses-narrowed-p))) -;;; (widen) -;;; (condition-case x -;;; ad-do-it -;;; (error -;;; ;;Restore narrow if appropriate -;;; (ses-command-hook) -;;; (signal (car x) (cdr x))))))) +(defadvice undo-more (around ses-undo-more activate preactivate) + "For SES mode, allow undo outside of narrowed buffer range." + (if (not (eq major-mode 'ses-mode)) + ad-do-it + ;;Here is some extra code for SES mode. + (setq ses--deferred-narrow + (or ses--deferred-narrow (ses-narrowed-p))) + (widen) + (condition-case x + ad-do-it + (error + ;;Restore narrow if appropriate + (ses-command-hook) + (signal (car x) (cdr x)))))) (defun ses-begin-change () "For undo, remember point before we start changing hidden stuff." |