Mercurial > hg > xemacs-beta
comparison lisp/vm/vm-delete.el @ 98:0d2f883870bc r20-1b1
Import from CVS: tag r20-1b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:13:56 +0200 |
parents | c0c698873ce1 |
children | 4be1180a9e89 |
comparison
equal
deleted
inserted
replaced
97:498bf5da1c90 | 98:0d2f883870bc |
---|---|
1 ;;; Delete and expunge commands for VM. | 1 ;;; Delete and expunge commands for VM. |
2 ;;; Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995 Kyle E. Jones | 2 ;;; Copyright (C) 1989-1997 Kyle E. Jones |
3 ;;; | 3 ;;; |
4 ;;; This program is free software; you can redistribute it and/or modify | 4 ;;; This program is free software; you can redistribute it and/or modify |
5 ;;; it under the terms of the GNU General Public License as published by | 5 ;;; it under the terms of the GNU General Public License as published by |
6 ;;; the Free Software Foundation; either version 1, or (at your option) | 6 ;;; the Free Software Foundation; either version 1, or (at your option) |
7 ;;; any later version. | 7 ;;; any later version. |
22 | 22 |
23 The message will be physically deleted from the current folder the next | 23 The message will be physically deleted from the current folder the next |
24 time the current folder is expunged. | 24 time the current folder is expunged. |
25 | 25 |
26 With a prefix argument COUNT, the current message and the next | 26 With a prefix argument COUNT, the current message and the next |
27 COUNT - 1 messages are deleted. A negative argument means the | 27 COUNT - 1 messages are deleted. A negative argument means |
28 the current message and the previous |COUNT| - 1 messages are | 28 the current message and the previous |COUNT| - 1 messages are |
29 deleted. | 29 deleted. |
30 | 30 |
31 When invoked on marked messages (via vm-next-command-uses-marks), | 31 When invoked on marked messages (via vm-next-command-uses-marks), |
32 only marked messages are deleted, other messages are ignored." | 32 only marked messages are deleted, other messages are ignored." |
69 | 69 |
70 (defun vm-undelete-message (count) | 70 (defun vm-undelete-message (count) |
71 "Remove the `deleted' attribute from the current message. | 71 "Remove the `deleted' attribute from the current message. |
72 | 72 |
73 With a prefix argument COUNT, the current message and the next | 73 With a prefix argument COUNT, the current message and the next |
74 COUNT - 1 messages are undeleted. A negative argument means the | 74 COUNT - 1 messages are undeleted. A negative argument means |
75 the current message and the previous |COUNT| - 1 messages are | 75 the current message and the previous |COUNT| - 1 messages are |
76 deleted. | 76 deleted. |
77 | 77 |
78 When invoked on marked messages (via vm-next-command-uses-marks), | 78 When invoked on marked messages (via vm-next-command-uses-marks), |
79 only marked messages are undeleted, other messages are ignored." | 79 only marked messages are undeleted, other messages are ignored." |
105 (if (and vm-move-after-undeleting (not used-marks)) | 105 (if (and vm-move-after-undeleting (not used-marks)) |
106 (let ((vm-circular-folders (and vm-circular-folders | 106 (let ((vm-circular-folders (and vm-circular-folders |
107 (eq vm-move-after-undeleting t)))) | 107 (eq vm-move-after-undeleting t)))) |
108 (vm-next-message count t executing-kbd-macro))))) | 108 (vm-next-message count t executing-kbd-macro))))) |
109 | 109 |
110 (defun vm-kill-subject () | 110 (defun vm-kill-subject (&optional arg) |
111 "Delete all messages with the same subject as the current message. | 111 "Delete all messages with the same subject as the current message. |
112 Message subjects are compared after ignoring parts matched by | 112 Message subjects are compared after ignoring parts matched by |
113 the variables vm-subject-ignored-prefix and vm-subject-ignored-suffix." | 113 the variables vm-subject-ignored-prefix and vm-subject-ignored-suffix. |
114 (interactive) | 114 |
115 The optional prefix argument ARG specifies the direction to move | |
116 if vm-move-after-killing is non-nil. The default direction is | |
117 forward. A positive prefix argument means move forward, a | |
118 negative arugment means move backward, a zero argument means | |
119 don't move at all." | |
120 (interactive "p") | |
115 (vm-follow-summary-cursor) | 121 (vm-follow-summary-cursor) |
116 (vm-select-folder-buffer) | 122 (vm-select-folder-buffer) |
117 (vm-check-for-killed-summary) | 123 (vm-check-for-killed-summary) |
118 (vm-error-if-folder-read-only) | 124 (vm-error-if-folder-read-only) |
119 (vm-error-if-folder-empty) | 125 (vm-error-if-folder-empty) |
131 (and (interactive-p) | 137 (and (interactive-p) |
132 (if (zerop n) | 138 (if (zerop n) |
133 (message "No messages deleted.") | 139 (message "No messages deleted.") |
134 (message "%d message%s deleted" n (if (= n 1) "" "s"))))) | 140 (message "%d message%s deleted" n (if (= n 1) "" "s"))))) |
135 (vm-display nil nil '(vm-kill-subject) '(vm-kill-subject)) | 141 (vm-display nil nil '(vm-kill-subject) '(vm-kill-subject)) |
136 (vm-update-summary-and-mode-line)) | 142 (vm-update-summary-and-mode-line) |
143 (cond ((or (not (numberp arg)) (> arg 0)) | |
144 (setq arg 1)) | |
145 ((< arg 0) | |
146 (setq arg -1)) | |
147 (t (setq arg 0))) | |
148 (if vm-move-after-killing | |
149 (let ((vm-circular-folders (and vm-circular-folders | |
150 (eq vm-move-after-deleting t)))) | |
151 (vm-next-message arg t executing-kbd-macro)))) | |
137 | 152 |
138 (defun vm-expunge-folder (&optional shaddap) | 153 (defun vm-expunge-folder (&optional shaddap) |
139 "Expunge messages with the `deleted' attribute. | 154 "Expunge messages with the `deleted' attribute. |
140 For normal folders this means that the deleted messages are | 155 For normal folders this means that the deleted messages are |
141 removed from the message list and the message contents are | 156 removed from the message list and the message contents are |
271 (mapatoms | 286 (mapatoms |
272 (function | 287 (function |
273 (lambda (buffer) | 288 (lambda (buffer) |
274 (set-buffer (symbol-name buffer)) | 289 (set-buffer (symbol-name buffer)) |
275 (if (null vm-system-state) | 290 (if (null vm-system-state) |
276 (if (null vm-message-pointer) | 291 (progn |
277 ;; folder is now empty | 292 (vm-garbage-collect-message) |
278 (progn (setq vm-folder-type nil) | 293 (if (null vm-message-pointer) |
279 (vm-update-summary-and-mode-line)) | 294 ;; folder is now empty |
280 (vm-preview-current-message)) | 295 (progn (setq vm-folder-type nil) |
296 (vm-update-summary-and-mode-line)) | |
297 (vm-preview-current-message))) | |
281 (vm-update-summary-and-mode-line)) | 298 (vm-update-summary-and-mode-line)) |
282 (if (not (eq major-mode 'vm-virtual-mode)) | 299 (if (not (eq major-mode 'vm-virtual-mode)) |
283 (setq vm-message-order-changed | 300 (setq vm-message-order-changed |
284 (or vm-message-order-changed | 301 (or vm-message-order-changed |
285 vm-message-order-header-present))) | 302 vm-message-order-header-present))) |