From e50e034033a3ec5eae90a7fbcb6d2da0b5111787 Mon Sep 17 00:00:00 2001 From: Ken Olum Date: Fri, 30 May 2014 12:33:43 +0300 Subject: [PATCH] Fix bug #17560 with backward-incompatible API change in rmail-delete-*. lisp/mail/rmail.el (rmail-delete-forward, rmail-delete-backward): The argument COUNT is now optional, to be more backward-compatible. Doc fix. etc/NEWS: Document the API change. --- etc/NEWS | 3 +++ lisp/ChangeLog | 6 ++++++ lisp/mail/rmail.el | 8 +++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2177b948c42..bebe71d37b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -146,6 +146,9 @@ permissions set to temporary values (e.g., for creating private files). ** You can access the slots of structures using `cl-struct-slot-value'. +** Functions `rmail-delete-forward' and `rmail-delete-backward' take an +optional repeat-count argument. + * Changes in Emacs 24.5 on Non-Free Operating Systems diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a94f977e755..eeca63a1bc9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-05-30 Ken Olum (tiny change) + + * mail/rmail.el (rmail-delete-forward, rmail-delete-backward): The + argument COUNT is now optional, to be more backward-compatible. + Doc fix. (Bug#17560) + 2014-05-29 Reuben Thomas * whitespace.el (whitespace-report-region): Simplify diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 2c5325dd4c5..f76920449f2 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3476,11 +3476,12 @@ STATE non-nil means mark as deleted." (defun rmail-delete-forward (&optional count) "Delete this message and move to next nondeleted one. Deleted messages stay in the file until the \\[rmail-expunge] command is given. -A prefix argument is a repeat count; +Optional argument COUNT (interactively, prefix argument) is a repeat count; negative argument means move backwards instead of forwards. Returns t if a new message is displayed after the delete, or nil otherwise." (interactive "p") + (if (not count) (setq count 1)) (let (value backward) (if (< count 0) (setq count (- count) backward t)) @@ -3495,15 +3496,16 @@ Returns t if a new message is displayed after the delete, or nil otherwise." (rmail-maybe-display-summary) value)) -(defun rmail-delete-backward (count) +(defun rmail-delete-backward (&optional count) "Delete this message and move to previous nondeleted one. Deleted messages stay in the file until the \\[rmail-expunge] command is given. -A prefix argument is a repeat count; +Optional argument COUNT (interactively, prefix argument) is a repeat count; negative argument means move forwards instead of backwards. Returns t if a new message is displayed after the delete, or nil otherwise." (interactive "p") + (if (not count) (setq count 1)) (rmail-delete-forward (- count))) ;; Expunging. -- 2.11.4.GIT