993 |
(if all (save-excursion (set-buffer (other-buffer)))) |
(if all (save-excursion (set-buffer (other-buffer)))) |
994 |
(set-buffer-modified-p (buffer-modified-p))) |
(set-buffer-modified-p (buffer-modified-p))) |
995 |
|
|
996 |
(defun momentary-string-display (string pos &optional exit-char message) |
(defun momentary-string-display (string pos &optional exit-char message) |
997 |
"Momentarily display STRING in the buffer at POS. |
"Momentarily display STRING in the buffer at POS. |
998 |
Display remains until next character is typed. |
Display remains until next character is typed. |
999 |
If the char is EXIT-CHAR (optional third arg, default is SPC) it is swallowed; |
If the char is EXIT-CHAR (optional third arg, default is SPC) it is swallowed; |
1037 |
(set-buffer-modified-p modified)))) |
(set-buffer-modified-p modified)))) |
1038 |
|
|
1039 |
|
|
1040 |
|
;;;; Overlay operations |
1041 |
|
|
1042 |
|
(defun copy-overlay (o) |
1043 |
|
"Return a copy of overlay O." |
1044 |
|
(let ((o1 (make-overlay (overlay-start o) (overlay-end o) |
1045 |
|
;; FIXME: there's no easy way to find the |
1046 |
|
;; insertion-type of the two markers. |
1047 |
|
(overlay-buffer o))) |
1048 |
|
(props (overlay-properties o))) |
1049 |
|
(while props |
1050 |
|
(overlay-put o1 (pop props) (pop props))) |
1051 |
|
o1)) |
1052 |
|
|
1053 |
|
(defun remove-overlays (beg end name val) |
1054 |
|
"Clear BEG and END of overlays whose property NAME has value VAL. |
1055 |
|
Overlays might be moved and or split." |
1056 |
|
(if (< end beg) |
1057 |
|
(setq beg (prog1 end (setq end beg)))) |
1058 |
|
(save-excursion |
1059 |
|
(dolist (o (overlays-in beg end)) |
1060 |
|
(when (eq (overlay-get o name) val) |
1061 |
|
;; Either push this overlay outside beg...end |
1062 |
|
;; or split it to exclude beg...end |
1063 |
|
;; or delete it entirely (if it is contained in beg...end). |
1064 |
|
(if (< (overlay-start o) beg) |
1065 |
|
(if (> (overlay-end o) end) |
1066 |
|
(progn |
1067 |
|
(move-overlay (copy-overlay o) |
1068 |
|
(overlay-start o) beg) |
1069 |
|
(move-overlay o end (overlay-end o))) |
1070 |
|
(move-overlay o (overlay-start o) beg)) |
1071 |
|
(if (> (overlay-end o) end) |
1072 |
|
(move-overlay o end (overlay-end o)) |
1073 |
|
(delete-overlay o))))))) |
1074 |
|
|
1075 |
;;;; Miscellanea. |
;;;; Miscellanea. |
1076 |
|
|
1077 |
;; A number of major modes set this locally. |
;; A number of major modes set this locally. |