diff options
| author | Ken Manheimer | 2011-02-07 15:43:36 -0500 |
|---|---|---|
| committer | Ken Manheimer | 2011-02-07 15:43:36 -0500 |
| commit | 4ec28e14ba2d74743419aa17490064c77b42ad3e (patch) | |
| tree | a70e5de072e49ff9c306fc1bb665416d4c7d9ddc /lisp | |
| parent | 61c72b067b6ee7f66bab31097423bcce95af90e0 (diff) | |
| download | emacs-4ec28e14ba2d74743419aa17490064c77b42ad3e.tar.gz emacs-4ec28e14ba2d74743419aa17490064c77b42ad3e.zip | |
allout.el (allout-after-copy-or-kill-hook): New hook for extension-specific
processing of killed text.
(allout-mode): Include new allout-after-copy-or-kill-hook among mentioned
hooks.
(allout-kill-line) (allout-kill-topic): Ensure that processing after kill
happens even if barf-if-buffer-read-only is raised. Include new
allout-after-copy-or-kill-hook among that subsequent processing.
(allout-deannotate-hidden): Actually remove the annotation text properties.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/allout.el | 48 |
2 files changed, 39 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8be9b10faa7..a55a656af80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,16 @@ | |||
| 1 | 2011-02-07 Ken Manheimer <ken.manheimer@gmail.com> | 1 | 2011-02-07 Ken Manheimer <ken.manheimer@gmail.com> |
| 2 | 2 | ||
| 3 | * allout.el (allout-after-copy-or-kill-hook): New hook for | ||
| 4 | extension-specific processing of killed text. | ||
| 5 | (allout-mode): Include new allout-after-copy-or-kill-hook among | ||
| 6 | mentioned hooks. | ||
| 7 | (allout-kill-line) (allout-kill-topic): Ensure that processing | ||
| 8 | after kill happens even if barf-if-buffer-read-only is raised. | ||
| 9 | Include new allout-after-copy-or-kill-hook among that subsequent | ||
| 10 | processing. | ||
| 11 | (allout-deannotate-hidden): Actually remove the annotation text | ||
| 12 | properties. | ||
| 13 | |||
| 3 | * allout.el (allout-listify-exposed): Copy text sans text properties. | 14 | * allout.el (allout-listify-exposed): Copy text sans text properties. |
| 4 | 15 | ||
| 5 | 2011-02-07 Michael Albinus <michael.albinus@gmx.de> | 16 | 2011-02-07 Michael Albinus <michael.albinus@gmx.de> |
diff --git a/lisp/allout.el b/lisp/allout.el index a0bd8f7339c..49c2dba322a 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -1437,6 +1437,13 @@ Some edits that shift items can be missed by this hook: specifically edits | |||
| 1437 | that native allout routines do not control. | 1437 | that native allout routines do not control. |
| 1438 | 1438 | ||
| 1439 | This hook might be invoked multiple times by a single command.") | 1439 | This hook might be invoked multiple times by a single command.") |
| 1440 | ;;;_ = allout-after-copy-or-kill-hook | ||
| 1441 | (defvar allout-after-copy-or-kill-hook nil | ||
| 1442 | "*Hook that's run after copying outline text. | ||
| 1443 | |||
| 1444 | Functions on the hook should take two arguments: | ||
| 1445 | |||
| 1446 | START, END -- integers indicating the span containing the copied text.") | ||
| 1440 | ;;;_ = allout-outside-normal-auto-fill-function | 1447 | ;;;_ = allout-outside-normal-auto-fill-function |
| 1441 | (defvar allout-outside-normal-auto-fill-function nil | 1448 | (defvar allout-outside-normal-auto-fill-function nil |
| 1442 | "Value of normal-auto-fill-function outside of allout mode. | 1449 | "Value of normal-auto-fill-function outside of allout mode. |
| @@ -1908,6 +1915,7 @@ without changes to the allout core. Here are key ones: | |||
| 1908 | `allout-structure-added-hook' | 1915 | `allout-structure-added-hook' |
| 1909 | `allout-structure-deleted-hook' | 1916 | `allout-structure-deleted-hook' |
| 1910 | `allout-structure-shifted-hook' | 1917 | `allout-structure-shifted-hook' |
| 1918 | `allout-after-copy-or-kill-hook' | ||
| 1911 | 1919 | ||
| 1912 | Terminology | 1920 | Terminology |
| 1913 | 1921 | ||
| @@ -4382,17 +4390,19 @@ subtopics into siblings of the item." | |||
| 4382 | (depth (allout-depth))) | 4390 | (depth (allout-depth))) |
| 4383 | 4391 | ||
| 4384 | (allout-annotate-hidden beg end) | 4392 | (allout-annotate-hidden beg end) |
| 4385 | (if (and (not beg-hidden) (not end-hidden)) | 4393 | (unwind-protect |
| 4386 | (allout-unprotected (kill-line arg)) | 4394 | (if (and (not beg-hidden) (not end-hidden)) |
| 4387 | (kill-line arg)) | 4395 | (allout-unprotected (kill-line arg)) |
| 4388 | (allout-deannotate-hidden beg end) | 4396 | (kill-line arg)) |
| 4389 | 4397 | (run-hook-with-args 'allout-after-copy-or-kill-hook beg end) | |
| 4390 | (if allout-numbered-bullet | 4398 | (allout-deannotate-hidden beg end) |
| 4391 | (save-excursion ; Renumber subsequent topics if needed: | 4399 | |
| 4392 | (if (not (save-match-data (looking-at allout-regexp))) | 4400 | (if allout-numbered-bullet |
| 4393 | (allout-next-heading)) | 4401 | (save-excursion ; Renumber subsequent topics if needed: |
| 4394 | (allout-renumber-to-depth depth))) | 4402 | (if (not (save-match-data (looking-at allout-regexp))) |
| 4395 | (run-hook-with-args 'allout-structure-deleted-hook depth (point))))) | 4403 | (allout-next-heading)) |
| 4404 | (allout-renumber-to-depth depth))) | ||
| 4405 | (run-hook-with-args 'allout-structure-deleted-hook depth (point)))))) | ||
| 4396 | ;;;_ > allout-copy-line-as-kill () | 4406 | ;;;_ > allout-copy-line-as-kill () |
| 4397 | (defun allout-copy-line-as-kill () | 4407 | (defun allout-copy-line-as-kill () |
| 4398 | "Like allout-kill-topic, but save to kill ring instead of deleting." | 4408 | "Like allout-kill-topic, but save to kill ring instead of deleting." |
| @@ -4433,15 +4443,14 @@ Topic exposure is marked with text-properties, to be used by | |||
| 4433 | (forward-char 1))) | 4443 | (forward-char 1))) |
| 4434 | 4444 | ||
| 4435 | (allout-annotate-hidden beg (setq end (point))) | 4445 | (allout-annotate-hidden beg (setq end (point))) |
| 4436 | (unwind-protect | 4446 | (unwind-protect ; for possible barf-if-buffer-read-only. |
| 4437 | (allout-unprotected (kill-region beg end)) | 4447 | (allout-unprotected (kill-region beg end)) |
| 4438 | (if buffer-read-only | 4448 | (allout-deannotate-hidden beg end) |
| 4439 | ;; eg, during copy-as-kill. | 4449 | (run-hook-with-args 'allout-after-copy-or-kill-hook beg end) |
| 4440 | (allout-deannotate-hidden beg end))) | ||
| 4441 | 4450 | ||
| 4442 | (save-excursion | 4451 | (save-excursion |
| 4443 | (allout-renumber-to-depth depth)) | 4452 | (allout-renumber-to-depth depth)) |
| 4444 | (run-hook-with-args 'allout-structure-deleted-hook depth (point)))) | 4453 | (run-hook-with-args 'allout-structure-deleted-hook depth (point))))) |
| 4445 | ;;;_ > allout-copy-topic-as-kill () | 4454 | ;;;_ > allout-copy-topic-as-kill () |
| 4446 | (defun allout-copy-topic-as-kill () | 4455 | (defun allout-copy-topic-as-kill () |
| 4447 | "Like `allout-kill-topic', but save to kill ring instead of deleting." | 4456 | "Like `allout-kill-topic', but save to kill ring instead of deleting." |
| @@ -4494,8 +4503,7 @@ Topic exposure is marked with text-properties, to be used by | |||
| 4494 | (allout-unprotected | 4503 | (allout-unprotected |
| 4495 | (let ((inhibit-read-only t) | 4504 | (let ((inhibit-read-only t) |
| 4496 | (buffer-undo-list t)) | 4505 | (buffer-undo-list t)) |
| 4497 | ;(remove-text-properties begin end '(allout-was-hidden t)) | 4506 | (remove-text-properties begin end '(allout-was-hidden t))))) |
| 4498 | ))) | ||
| 4499 | ;;;_ > allout-hide-by-annotation (begin end) | 4507 | ;;;_ > allout-hide-by-annotation (begin end) |
| 4500 | (defun allout-hide-by-annotation (begin end) | 4508 | (defun allout-hide-by-annotation (begin end) |
| 4501 | "Translate text properties indicating exposure status into actual exposure." | 4509 | "Translate text properties indicating exposure status into actual exposure." |