1524 |
'(0 . 0))) |
'(0 . 0))) |
1525 |
'(0 . 0))) |
'(0 . 0))) |
1526 |
|
|
1527 |
|
(defvar undo-extra-outer-limit nil |
1528 |
|
"If non-nil, an extra level of size that's ok in an undo item. |
1529 |
|
We don't ask the user about truncating the undo list until the |
1530 |
|
current item gets bigger than this amount.") |
1531 |
|
(make-variable-buffer-local 'undo-extra-outer-limit) |
1532 |
|
|
1533 |
;; When the first undo batch in an undo list is longer than undo-outer-limit, |
;; When the first undo batch in an undo list is longer than undo-outer-limit, |
1534 |
;; this function gets called to ask the user what to do. |
;; this function gets called to ask the user what to do. |
1535 |
;; Garbage collection is inhibited around the call, |
;; Garbage collection is inhibited around the call, |
1536 |
;; so it had better not do a lot of consing. |
;; so it had better not do a lot of consing. |
1537 |
(setq undo-outer-limit-function 'undo-outer-limit-truncate) |
(setq undo-outer-limit-function 'undo-outer-limit-truncate) |
1538 |
(defun undo-outer-limit-truncate (size) |
(defun undo-outer-limit-truncate (size) |
1539 |
(if (let (use-dialog-box) |
(when (or (null undo-extra-outer-limit) |
1540 |
(yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " |
(> size undo-extra-outer-limit)) |
1541 |
(buffer-name) size))) |
;; Don't ask the question again unless it gets even bigger. |
1542 |
(progn (setq buffer-undo-list nil) t) |
;; This applies, in particular, if the user quits from the question. |
1543 |
nil)) |
;; Such a quit quits out of GC, but something else will call GC |
1544 |
|
;; again momentarily. It will call this function again, |
1545 |
|
;; but we don't want to ask the question again. |
1546 |
|
(setq undo-extra-outer-limit (+ size 50000)) |
1547 |
|
(if (let (use-dialog-box) |
1548 |
|
(yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " |
1549 |
|
(buffer-name) size))) |
1550 |
|
(progn (setq buffer-undo-list nil) |
1551 |
|
(setq undo-extra-outer-limit nil) |
1552 |
|
t) |
1553 |
|
nil))) |
1554 |
|
|
1555 |
(defvar shell-command-history nil |
(defvar shell-command-history nil |
1556 |
"History list for some commands that read shell commands.") |
"History list for some commands that read shell commands.") |
3589 |
(interactive "p") |
(interactive "p") |
3590 |
(forward-word (- (or arg 1)))) |
(forward-word (- (or arg 1)))) |
3591 |
|
|
3592 |
(defun mark-word (&optional arg) |
(defun mark-word (&optional arg allow-extend) |
3593 |
"Set mark ARG words away from point. |
"Set mark ARG words away from point. |
3594 |
The place mark goes is the same place \\[forward-word] would |
The place mark goes is the same place \\[forward-word] would |
3595 |
move to with the same argument. |
move to with the same argument. |
3596 |
If this command is repeated or mark is active in Transient Mark mode, |
Interactively, if this command is repeated |
3597 |
|
or (in Transient Mark mode) if the mark is active, |
3598 |
it marks the next ARG words after the ones already marked." |
it marks the next ARG words after the ones already marked." |
3599 |
(interactive "P") |
(interactive "P\np") |
3600 |
(cond ((or (and (eq last-command this-command) (mark t)) |
(cond ((and allow-extend |
3601 |
(and transient-mark-mode mark-active)) |
(or (and (eq last-command this-command) (mark t)) |
3602 |
|
(and transient-mark-mode mark-active))) |
3603 |
(setq arg (if arg (prefix-numeric-value arg) |
(setq arg (if arg (prefix-numeric-value arg) |
3604 |
(if (< (mark) (point)) -1 1))) |
(if (< (mark) (point)) -1 1))) |
3605 |
(set-mark |
(set-mark |