comparison lisp/vm/vm-undo.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents ec9a17fef872
children 0d2f883870bc
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;;; Commands to undo message attribute changes in VM 1 ;;; Commands to undo message attribute changes in VM
2 ;;; Copyright (C) 1989-1995 Kyle E. Jones 2 ;;; Copyright (C) 1989, 1990, 1993, 1994 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.
358 (not (save-excursion 358 (not (save-excursion
359 (set-buffer 359 (set-buffer
360 (vm-buffer-of 360 (vm-buffer-of
361 (vm-real-message-of m))) 361 (vm-real-message-of m)))
362 vm-folder-read-only)))) 362 vm-folder-read-only))))
363 (aset (vm-attributes-of m) attr-index flag)
364 (vm-mark-for-summary-update m)
363 (cond 365 (cond
364 ((not norecord) 366 ((not norecord)
367 (if (eq vm-flush-interval t)
368 (vm-stuff-virtual-attributes m)
369 (vm-set-modflag-of m t))
365 (setq vmp (cons (vm-real-message-of m) (vm-virtual-messages-of m))) 370 (setq vmp (cons (vm-real-message-of m) (vm-virtual-messages-of m)))
366 (while vmp 371 (while vmp
367 (if (eq (vm-attributes-of m) (vm-attributes-of (car vmp))) 372 (if (eq (vm-attributes-of m) (vm-attributes-of (car vmp)))
368 (setq m-list (cons (car vmp) m-list))) 373 (setq m-list (cons (car vmp) m-list)))
369 (setq vmp (cdr vmp))) 374 (setq vmp (cdr vmp)))
376 (vm-set-buffer-modified-p t) 381 (vm-set-buffer-modified-p t)
377 (vm-undo-record (list 'vm-set-buffer-modified-p nil)))) 382 (vm-undo-record (list 'vm-set-buffer-modified-p nil))))
378 (vm-undo-record (list function (car m-list) (not flag))) 383 (vm-undo-record (list function (car m-list) (not flag)))
379 (vm-undo-boundary) 384 (vm-undo-boundary)
380 (vm-increment vm-modification-counter)) 385 (vm-increment vm-modification-counter))
381 (setq m-list (cdr m-list))))) 386 (setq m-list (cdr m-list)))))))))
382 (aset (vm-attributes-of m) attr-index flag)
383 (vm-mark-for-summary-update m)
384 (if (not norecord)
385 (if (eq vm-flush-interval t)
386 (vm-stuff-virtual-attributes m)
387 (vm-set-modflag-of m t)))))))
388
389 387
390 (defun vm-set-labels (m labels) 388 (defun vm-set-labels (m labels)
391 (let ((m-list nil) 389 (let ((m-list nil)
392 (old-labels (vm-labels-of m)) 390 (old-labels (vm-labels-of m))
393 vmp) 391 vmp)
397 (not (save-excursion 395 (not (save-excursion
398 (set-buffer 396 (set-buffer
399 (vm-buffer-of 397 (vm-buffer-of
400 (vm-real-message-of m))) 398 (vm-real-message-of m)))
401 vm-folder-read-only)))) 399 vm-folder-read-only))))
400 (vm-set-labels-of m labels)
401 (vm-set-label-string-of m nil)
402 (vm-mark-for-summary-update m)
403 (if (eq vm-flush-interval t)
404 (vm-stuff-virtual-attributes m)
405 (vm-set-modflag-of m t))
402 (setq vmp (cons (vm-real-message-of m) (vm-virtual-messages-of m))) 406 (setq vmp (cons (vm-real-message-of m) (vm-virtual-messages-of m)))
403 (while vmp 407 (while vmp
404 (if (eq (vm-attributes-of m) (vm-attributes-of (car vmp))) 408 (if (eq (vm-attributes-of m) (vm-attributes-of (car vmp)))
405 (setq m-list (cons (car vmp) m-list))) 409 (setq m-list (cons (car vmp) m-list)))
406 (setq vmp (cdr vmp))) 410 (setq vmp (cdr vmp)))
413 (vm-set-buffer-modified-p t) 417 (vm-set-buffer-modified-p t)
414 (vm-undo-record (list 'vm-set-buffer-modified-p nil)))) 418 (vm-undo-record (list 'vm-set-buffer-modified-p nil))))
415 (vm-undo-record (list 'vm-set-labels m old-labels)) 419 (vm-undo-record (list 'vm-set-labels m old-labels))
416 (vm-undo-boundary) 420 (vm-undo-boundary)
417 (vm-increment vm-modification-counter)) 421 (vm-increment vm-modification-counter))
418 (setq m-list (cdr m-list))) 422 (setq m-list (cdr m-list)))))))
419 (vm-set-labels-of m labels)
420 (vm-set-label-string-of m nil)
421 (vm-mark-for-summary-update m)
422 (if (eq vm-flush-interval t)
423 (vm-stuff-virtual-attributes m)
424 (vm-set-modflag-of m t))))))
425
426 423
427 (defun vm-set-new-flag (m flag &optional norecord) 424 (defun vm-set-new-flag (m flag &optional norecord)
428 (vm-set-xxxx-flag m flag norecord 'vm-set-new-flag 0)) 425 (vm-set-xxxx-flag m flag norecord 'vm-set-new-flag 0))
429 426
430 (defun vm-set-unread-flag (m flag &optional norecord) 427 (defun vm-set-unread-flag (m flag &optional norecord)