diff options
| author | Jonathan Yavner | 2005-02-20 05:02:54 +0000 |
|---|---|---|
| committer | Jonathan Yavner | 2005-02-20 05:02:54 +0000 |
| commit | eedeacb3074baad8ce752a506f9f435c98e42ff4 (patch) | |
| tree | 023278d781d1c3fba51fe245fa5aaad367b7d348 /lisp | |
| parent | 50d9c3962f301bc50be3319abbc8412b992fbfea (diff) | |
| download | emacs-eedeacb3074baad8ce752a506f9f435c98e42ff4.tar.gz emacs-eedeacb3074baad8ce752a506f9f435c98e42ff4.zip | |
(undo-more): restore defadvice, but only the part that allows changes
outside the restricted area of the buffer.
Diffstat (limited to 'lisp')
| -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." | |||
| 1281 | 1281 | ||
| 1282 | ;; This should be unnecessary, because the feature is now built in. | 1282 | ;; This should be unnecessary, because the feature is now built in. |
| 1283 | 1283 | ||
| 1284 | ;;; (defadvice undo-more (around ses-undo-more activate preactivate) | 1284 | (defadvice undo-more (around ses-undo-more activate preactivate) |
| 1285 | ;;; "Define a meaning for conses in buffer-undo-list whose car is a symbol | 1285 | "For SES mode, allow undo outside of narrowed buffer range." |
| 1286 | ;;; other than t or nil. To undo these, apply the car--a function--to the | 1286 | (if (not (eq major-mode 'ses-mode)) |
| 1287 | ;;; cdr--its arglist." | 1287 | ad-do-it |
| 1288 | ;;; (let ((ses-count (ad-get-arg 0))) | 1288 | ;;Here is some extra code for SES mode. |
| 1289 | ;;; (catch 'undo | 1289 | (setq ses--deferred-narrow |
| 1290 | ;;; (dolist (ses-x pending-undo-list) | 1290 | (or ses--deferred-narrow (ses-narrowed-p))) |
| 1291 | ;;; (unless ses-x | 1291 | (widen) |
| 1292 | ;;; ;;End of undo boundary | 1292 | (condition-case x |
| 1293 | ;;; (setq ses-count (1- ses-count)) | 1293 | ad-do-it |
| 1294 | ;;; (if (<= ses-count 0) | 1294 | (error |
| 1295 | ;;; ;;We've seen enough boundaries - stop undoing | 1295 | ;;Restore narrow if appropriate |
| 1296 | ;;; (throw 'undo nil))) | 1296 | (ses-command-hook) |
| 1297 | ;;; (and (consp ses-x) (symbolp (car ses-x)) (fboundp (car ses-x)) | 1297 | (signal (car x) (cdr x)))))) |
| 1298 | ;;; ;;Undo using apply | ||
| 1299 | ;;; (apply (car ses-x) (cdr ses-x))))) | ||
| 1300 | ;;; (if (not (eq major-mode 'ses-mode)) | ||
| 1301 | ;;; ad-do-it | ||
| 1302 | ;;; ;;Here is some extra code for SES mode. | ||
| 1303 | ;;; (setq ses--deferred-narrow | ||
| 1304 | ;;; (or ses--deferred-narrow (ses-narrowed-p))) | ||
| 1305 | ;;; (widen) | ||
| 1306 | ;;; (condition-case x | ||
| 1307 | ;;; ad-do-it | ||
| 1308 | ;;; (error | ||
| 1309 | ;;; ;;Restore narrow if appropriate | ||
| 1310 | ;;; (ses-command-hook) | ||
| 1311 | ;;; (signal (car x) (cdr x))))))) | ||
| 1312 | 1298 | ||
| 1313 | (defun ses-begin-change () | 1299 | (defun ses-begin-change () |
| 1314 | "For undo, remember point before we start changing hidden stuff." | 1300 | "For undo, remember point before we start changing hidden stuff." |