vm / vm-undo.el

Diff from to

vm-undo.el

-;;; Commands to undo message attribute changes in VM.
+;;; Commands to undo message attribute changes in VM
 ;;; Copyright (C) 1989-1995 Kyle E. Jones
 ;;;
 ;;; This program is free software; you can redistribute it and/or modify
 names are compared case-insensitively.
 
 A numeric prefix argument COUNT causes the current message and
-the next COUNT-1 message to have the labels added.  A
+the next COUNT-1 messages to have the labels added.  A
 negative COUNT arg causes the current message and the previous
 COUNT-1 messages to be altered.  COUNT defaults to one."
   (interactive
   (let ((m-list (vm-select-marked-or-prefixed-messages count))
 	(action-labels (vm-parse string
 "[\000-\040,\177-\377]*\\([^\000-\040,\177-\377]+\\)[\000-\040,\177-\377]*"))
+	(ignored-labels nil)
 	labels act-labels m mm-list)
     (if (and add m-list)
 	(if (eq add 'all)
 	    (setq act-labels action-labels)
 	    (while act-labels
 	      (if (intern-soft (car act-labels) vm-label-obarray)
-		  (setq newlist (cons (car act-labels) newlist)))
+		  (setq newlist (cons (car act-labels) newlist))
+		(setq ignored-labels (cons (car act-labels) ignored-labels)))
 	      (setq act-labels (cdr act-labels)))
 	    (setq action-labels newlist))))
+    (if (null action-labels)
+	(setq m-list nil))
     (while m-list
       (setq m (car m-list))
       (if (and add (vm-virtual-message-p m))
       (if add
 	  (setq labels (vm-delete-duplicates labels)))
       (vm-set-labels (car m-list) labels)
-      (setq m-list (cdr m-list))))
-  (vm-update-summary-and-mode-line))
+      (setq m-list (cdr m-list)))
+    (vm-update-summary-and-mode-line)
+    ignored-labels))
 
 (defun vm-set-xxxx-flag (m flag norecord function attr-index)
   (let ((m-list nil) vmp)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.