diff options
| author | Richard M. Stallman | 1995-04-19 06:37:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-19 06:37:49 +0000 |
| commit | dfc4f59b16b55639d8737c504ca1dfec5aaffabe (patch) | |
| tree | 96439218cdda279c153e90b9886d290bf7b33970 /lisp/progmodes/cpp.el | |
| parent | 673a6211ed1bdd2e7ffff2ce1eba1ac7bec6a64b (diff) | |
| download | emacs-dfc4f59b16b55639d8737c504ca1dfec5aaffabe.tar.gz emacs-dfc4f59b16b55639d8737c504ca1dfec5aaffabe.zip | |
(cpp-edit-reset): Fix typo.
(cpp-signal-read-only, cpp-grow-overlay): Update to new calling conventions.
(cpp-make-overlay-hidden): Don't allow insertion before a read-only overlay.
Diffstat (limited to 'lisp/progmodes/cpp.el')
| -rw-r--r-- | lisp/progmodes/cpp.el | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 2320a775462..5ddb1739540 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el | |||
| @@ -332,7 +332,8 @@ A prefix arg suppresses display of that buffer." | |||
| 332 | (overlay-put overlay 'intangible t) | 332 | (overlay-put overlay 'intangible t) |
| 333 | ;; Unfortunately `intangible' is not implemented for overlays yet, | 333 | ;; Unfortunately `intangible' is not implemented for overlays yet, |
| 334 | ;; so we make is read-only instead. | 334 | ;; so we make is read-only instead. |
| 335 | (overlay-put overlay 'modification-hooks '(cpp-signal-read-only))) | 335 | (overlay-put overlay 'modification-hooks '(cpp-signal-read-only)) |
| 336 | (overlay-put overlay 'insert-in-front-hooks '(cpp-signal-read-only))) | ||
| 336 | 337 | ||
| 337 | (defun cpp-make-overlay-read-only (overlay) | 338 | (defun cpp-make-overlay-read-only (overlay) |
| 338 | ;; Make overlay read only. | 339 | ;; Make overlay read only. |
| @@ -345,18 +346,20 @@ A prefix arg suppresses display of that buffer." | |||
| 345 | (overlay-put overlay 'insert-in-front-hooks '(cpp-grow-overlay)) | 346 | (overlay-put overlay 'insert-in-front-hooks '(cpp-grow-overlay)) |
| 346 | (overlay-put overlay 'insert-behind-hooks '(cpp-grow-overlay))) | 347 | (overlay-put overlay 'insert-behind-hooks '(cpp-grow-overlay))) |
| 347 | 348 | ||
| 348 | (defun cpp-signal-read-only (overlay start end) | 349 | (defun cpp-signal-read-only (overlay after start end &optional len) |
| 349 | ;; Only allow deleting the whole overlay. | 350 | ;; Only allow deleting the whole overlay. |
| 350 | ;; Trying to change a read-only overlay. | 351 | ;; Trying to change a read-only overlay. |
| 351 | (if (or (< (overlay-start overlay) start) | 352 | (if (and (not after) |
| 352 | (> (overlay-end overlay) end)) | 353 | (or (< (overlay-start overlay) start) |
| 354 | (> (overlay-end overlay) end))) | ||
| 353 | (error "This text is read only"))) | 355 | (error "This text is read only"))) |
| 354 | 356 | ||
| 355 | (defun cpp-grow-overlay (overlay start end) | 357 | (defun cpp-grow-overlay (overlay after start end &optional len) |
| 356 | ;; Make OVERLAY grow to contain range START to END. | 358 | ;; Make OVERLAY grow to contain range START to END. |
| 357 | (move-overlay overlay | 359 | (if after |
| 358 | (min start (overlay-start overlay)) | 360 | (move-overlay overlay |
| 359 | (max end (overlay-end overlay)))) | 361 | (min start (overlay-start overlay)) |
| 362 | (max end (overlay-end overlay))))) | ||
| 360 | 363 | ||
| 361 | ;;; Edit Buffer: | 364 | ;;; Edit Buffer: |
| 362 | 365 | ||
| @@ -483,7 +486,7 @@ You can also use the keyboard accelerators indicated like this: [K]ey." | |||
| 483 | (setq cpp-edit-list (delq entry cpp-edit-list) | 486 | (setq cpp-edit-list (delq entry cpp-edit-list) |
| 484 | entry nil)) | 487 | entry nil)) |
| 485 | 488 | ||
| 486 | (if (> (length symbol) 29) | 489 | (if (> (length symbol) 39) |
| 487 | (insert (substring symbol 0 39) ": ") | 490 | (insert (substring symbol 0 39) ": ") |
| 488 | (insert (format "%39s: " symbol))) | 491 | (insert (format "%39s: " symbol))) |
| 489 | 492 | ||