1281 |
|
|
1282 |
;; This should be unnecessary, because the feature is now built in. |
;; This should be unnecessary, because the feature is now built in. |
1283 |
|
|
1284 |
;;; (defadvice undo-more (around ses-undo-more activate preactivate) |
(defadvice undo-more (around ses-undo-more activate preactivate) |
1285 |
;;; "Define a meaning for conses in buffer-undo-list whose car is a symbol |
"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 |
(if (not (eq major-mode 'ses-mode)) |
1287 |
;;; cdr--its arglist." |
ad-do-it |
1288 |
;;; (let ((ses-count (ad-get-arg 0))) |
;;Here is some extra code for SES mode. |
1289 |
;;; (catch 'undo |
(setq ses--deferred-narrow |
1290 |
;;; (dolist (ses-x pending-undo-list) |
(or ses--deferred-narrow (ses-narrowed-p))) |
1291 |
;;; (unless ses-x |
(widen) |
1292 |
;;; ;;End of undo boundary |
(condition-case x |
1293 |
;;; (setq ses-count (1- ses-count)) |
ad-do-it |
1294 |
;;; (if (<= ses-count 0) |
(error |
1295 |
;;; ;;We've seen enough boundaries - stop undoing |
;;Restore narrow if appropriate |
1296 |
;;; (throw 'undo nil))) |
(ses-command-hook) |
1297 |
;;; (and (consp ses-x) (symbolp (car ses-x)) (fboundp (car ses-x)) |
(signal (car x) (cdr 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))))))) |
|
1298 |
|
|
1299 |
(defun ses-begin-change () |
(defun ses-begin-change () |
1300 |
"For undo, remember point before we start changing hidden stuff." |
"For undo, remember point before we start changing hidden stuff." |