unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
@ 2014-05-23 15:02 Ken Olum
  2014-05-23 15:31 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Olum @ 2014-05-23 15:02 UTC (permalink / raw)
  To: 17560

Under a recent change, rmail-delete-forward takes an optional repeat
count.  If not specified, the count defaults to nil, giving an error.
This function is called with no arguments in several places including
rmail-output (if rmail-delete-after-output is set).


emacs -Q
M-X rmail
set rmail-delete-after-output to t
press "o"
Give output filename
Get error: Wrong type argument: number-or-marker-p, nil

In GNU Emacs 24.4.50.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 of 2014-05-22 on cosmos
Repository revision: 117139 eggert@cs.ucla.edu-20140522164035-y1m18x4smoxvgy58
Windowing system distributor `The Cygwin/X Project', version 11.0.10903000
System Description:	Ubuntu 12.04.4 LTS

Configured features:
XPM JPEG TIFF GIF PNG SOUND NOTIFY LIBXML2 FREETYPE XFT ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r t - b u g <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
delete-backward-char: Text is read-only

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
inotify dynamic-setting font-render-setting x-toolkit x multi-tty emacs)

Memory information:
((conses 16 75357 6383)
 (symbols 48 17734 0)
 (miscs 40 37 152)
 (strings 32 11042 3962)
 (string-bytes 1 287633)
 (vectors 16 9192)
 (vector-slots 8 374109 11495)
 (floats 8 68 264)
 (intervals 56 190 4)
 (buffers 960 11)
 (heap 1024 38120 1325))





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-23 15:02 bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set Ken Olum
@ 2014-05-23 15:31 ` Eli Zaretskii
  2014-05-23 15:50   ` Ken Olum
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2014-05-23 15:31 UTC (permalink / raw)
  To: Ken Olum; +Cc: 17560

> From: Ken Olum <kdo@cosmos.phy.tufts.edu>
> Date: Fri, 23 May 2014 11:02:18 -0400
> 
> Under a recent change, rmail-delete-forward takes an optional repeat
> count.  If not specified, the count defaults to nil, giving an error.
> This function is called with no arguments in several places including
> rmail-output (if rmail-delete-after-output is set).

Could you perhaps suggest a patch to fix this?  TIA.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-23 15:31 ` Eli Zaretskii
@ 2014-05-23 15:50   ` Ken Olum
  2014-05-23 17:37     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Olum @ 2014-05-23 15:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17560

I'd put

(if (not count) (setq count 1))

in rmail-delete-forward and for consistency make the argument of
rmail-delete-backward optional and add the same code there.

Unfortunately, that is not consistent with rmail-next-message, for
example.  The alternative would be to make the argument not optional and
change all callers to say (rmail-delete-forward 1).  Unfortunately, in
previous versions of emacs this would mean to move backward, so new
calls would be incompatible with the old definition, which I think
argues against this plan.

                                        Ken





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-23 15:50   ` Ken Olum
@ 2014-05-23 17:37     ` Eli Zaretskii
  2014-05-23 18:48       ` Ken Olum
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2014-05-23 17:37 UTC (permalink / raw)
  To: Ken Olum; +Cc: 17560

> From: Ken Olum <kdo@cosmos.phy.tufts.edu>
> Cc: 17560@debbugs.gnu.org
> Date: Fri, 23 May 2014 11:50:59 -0400
> 
> I'd put
> 
> (if (not count) (setq count 1))
> 
> in rmail-delete-forward and for consistency make the argument of
> rmail-delete-backward optional and add the same code there.
> 
> Unfortunately, that is not consistent with rmail-next-message, for
> example.  The alternative would be to make the argument not optional and
> change all callers to say (rmail-delete-forward 1).

The alternative is what I had in mind, yes.

> Unfortunately, in previous versions of emacs this would mean to move
> backward, so new calls would be incompatible with the old
> definition, which I think argues against this plan.

I don't think this problem should bother us, as the change in
rmail-delete-forward is backward-incompatible anyway.  Which reminds
me: could you also make a suitable entry in NEWS?

TIA





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-23 17:37     ` Eli Zaretskii
@ 2014-05-23 18:48       ` Ken Olum
  2014-05-23 19:53         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Olum @ 2014-05-23 18:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17560

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

OK.  Here is a patch, including NEWS and ChangeLog entries.  I made the
argument to rmail-delete-forward not optional, and fixed callers.

                                        Ken


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rmail-delete.patch --]
[-- Type: text/x-diff, Size: 3107 bytes --]

=== modified file 'etc/NEWS'
--- etc/NEWS	2014-05-17 08:11:31 +0000
+++ etc/NEWS	2014-05-23 18:14:27 +0000
@@ -130,6 +130,9 @@
 
 ** You can access the slots of structures using `cl-struct-slot-value'.
 
+** Functions `rmail-delete-forward' and `rmail-delete-backward' take a
+repeat-count argument.
+
 \f
 * Changes in Emacs 24.5 on Non-Free Operating Systems
 

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2014-05-23 15:54:44 +0000
+++ lisp/ChangeLog	2014-05-23 18:26:24 +0000
@@ -1,3 +1,12 @@
+2014-05-23  Ken Olum  <kdo@cosmos.phy.tufts.edu>
+
+	* mail/rmail.el: (rmail-delete-forward) make `count' arg not optional.
+	(rmail-auto-file):
+	* mail/rmailout.el: (rmail-output, rmail-output-as-seen)
+	(rmail-output-body-to-file): 
+	* mail/rmailout.el: (undigestify-rmail-message):
+	Supply `count' arg to rmail-delete-forward.
+
 2014-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* minibuffer.el (completion--sreverse): Remove.

=== modified file 'lisp/mail/rmail.el'
--- lisp/mail/rmail.el	2014-05-05 01:08:54 +0000
+++ lisp/mail/rmail.el	2014-05-23 18:22:56 +0000
@@ -3078,7 +3078,7 @@
 	;; If there are no directives left, then it was a complete match.
 	(if (null directive-loop)
 	    (if (null folder)
-		(rmail-delete-forward)
+		(rmail-delete-forward 1)
 	      (if (string= "/dev/null" folder)
 		  (rmail-delete-message)
 		(rmail-output folder 1)
@@ -3474,7 +3474,7 @@
 		(rmail-summary-mark-undeleted msg))))))
     (rmail-maybe-display-summary)))
 
-(defun rmail-delete-forward (&optional count)
+(defun rmail-delete-forward (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;

=== modified file 'lisp/mail/rmailout.el'
--- lisp/mail/rmailout.el	2014-02-10 01:34:22 +0000
+++ lisp/mail/rmailout.el	2014-05-23 18:03:25 +0000
@@ -514,7 +514,7 @@
 	  (setq count (1- count))
 	  (let ((next-message-p
 		 (if rmail-delete-after-output
-		     (rmail-delete-forward)
+		     (rmail-delete-forward 1)
 		   (if (> count 0)
 		       (rmail-next-undeleted-message 1))))
 		(num-appended (- orig-count count)))
@@ -581,7 +581,7 @@
 	(setq count (1- count))
 	(let ((next-message-p
 	       (if rmail-delete-after-output
-		   (rmail-delete-forward)
+		   (rmail-delete-forward 1)
 		 (if (> count 0)
 		     (rmail-next-undeleted-message 1))))
 	      (num-appended (- orig-count count)))
@@ -630,6 +630,6 @@
 	 (error "Operation aborted"))
     (write-region (point) (point-max) file-name))
   (if rmail-delete-after-output
-      (rmail-delete-forward)))
+      (rmail-delete-forward 1)))
 
 ;;; rmailout.el ends here

=== modified file 'lisp/mail/undigest.el'
--- lisp/mail/undigest.el	2014-02-10 01:34:22 +0000
+++ lisp/mail/undigest.el	2014-05-23 18:02:49 +0000
@@ -217,7 +217,7 @@
 	    (rmail-set-message-counters)
 	    (set-buffer-modified-p t)
 	    (rmail-show-message current)
-	    (rmail-delete-forward)
+	    (rmail-delete-forward 1)
 	    (if (rmail-summary-exists)
 		(rmail-select-summary (rmail-update-summary))))
 	(when error


^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-23 18:48       ` Ken Olum
@ 2014-05-23 19:53         ` Eli Zaretskii
  2014-05-23 20:04           ` Ken Olum
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2014-05-23 19:53 UTC (permalink / raw)
  To: Ken Olum; +Cc: 17560

> From: Ken Olum <kdo@cosmos.phy.tufts.edu>
> Cc: 17560@debbugs.gnu.org
> Date: Fri, 23 May 2014 14:48:25 -0400
> 
> OK.  Here is a patch, including NEWS and ChangeLog entries.  I made the
> argument to rmail-delete-forward not optional, and fixed callers.

Thanks.

But on second thought, what exactly was wrong with making nil mean 1?
What did you mean by "not consistent with rmail-next-message"?

Sorry for not asking that earlier.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-23 19:53         ` Eli Zaretskii
@ 2014-05-23 20:04           ` Ken Olum
  2014-05-24  6:54             ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Olum @ 2014-05-23 20:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17560

What I meant was that you cannot say (rmail-next-message) to go forward
one message.  You have to say (rmail-next-message 1).  So I wasn't sure
whether it would be a good idea to allow (rmail-delete-forward) to
default to deleting one message.

On the other hand, I now see that rmail-search has a repeat count that
is optional.

                                        Ken





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-23 20:04           ` Ken Olum
@ 2014-05-24  6:54             ` Eli Zaretskii
  2014-05-27 15:08               ` Ken Olum
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2014-05-24  6:54 UTC (permalink / raw)
  To: Ken Olum; +Cc: 17560

> From: Ken Olum <kdo@cosmos.phy.tufts.edu>
> Cc: 17560@debbugs.gnu.org
> Date: Fri, 23 May 2014 16:04:56 -0400
> 
> What I meant was that you cannot say (rmail-next-message) to go forward
> one message.  You have to say (rmail-next-message 1).  So I wasn't sure
> whether it would be a good idea to allow (rmail-delete-forward) to
> default to deleting one message.
> 
> On the other hand, I now see that rmail-search has a repeat count that
> is optional.

I see.  So that was my misunderstanding, and it is better to go with
your first alternative, since it is backward-compatible, and requires
less changes.

Again, sorry for not bringing this up earlier.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-24  6:54             ` Eli Zaretskii
@ 2014-05-27 15:08               ` Ken Olum
  2014-05-30  9:35                 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Olum @ 2014-05-27 15:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17560

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]

OK.  Here is a different patch making the arguments to
rmail-delete-forward and rmail-delete-backward optional and defaulting
to 1.  NEWS and ChangeLog are included.

                                        Ken


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rmail-delete.patch --]
[-- Type: text/x-diff, Size: 1738 bytes --]

=== modified file 'etc/NEWS'
--- etc/NEWS	2014-05-17 08:11:31 +0000
+++ etc/NEWS	2014-05-27 14:50:48 +0000
@@ -130,6 +130,9 @@
 
 ** 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.
+
 \f
 * Changes in Emacs 24.5 on Non-Free Operating Systems
 

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2014-05-23 15:54:44 +0000
+++ lisp/ChangeLog	2014-05-27 15:04:59 +0000
@@ -1,3 +1,8 @@
+2014-05-27  Ken Olum  <kdo@cosmos.phy.tufts.edu>
+
+	* mail/rmail.el (rmail-delete-forward): Default `count' to 1.
+	(rmail-delete-forward): Argument `count' optional, default to 1.
+
 2014-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* minibuffer.el (completion--sreverse): Remove.

=== modified file 'lisp/mail/rmail.el'
--- lisp/mail/rmail.el	2014-05-05 01:08:54 +0000
+++ lisp/mail/rmail.el	2014-05-27 14:53:00 +0000
@@ -3482,6 +3482,7 @@
 
 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))
@@ -3496,7 +3497,7 @@
     (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;
@@ -3505,6 +3506,7 @@
 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)))
 \f
 ;; Expunging.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set
  2014-05-27 15:08               ` Ken Olum
@ 2014-05-30  9:35                 ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-05-30  9:35 UTC (permalink / raw)
  To: Ken Olum; +Cc: 17560-done

> From: Ken Olum <kdo@cosmos.phy.tufts.edu>
> Cc: 17560@debbugs.gnu.org
> Date: Tue, 27 May 2014 11:08:06 -0400
> 
> OK.  Here is a different patch making the arguments to
> rmail-delete-forward and rmail-delete-backward optional and defaulting
> to 1.  NEWS and ChangeLog are included.

Thanks, committed as trunk revision 117204.





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-30  9:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 15:02 bug#17560: 24.4.50; wrong type argument if rmail-delete-after-output set Ken Olum
2014-05-23 15:31 ` Eli Zaretskii
2014-05-23 15:50   ` Ken Olum
2014-05-23 17:37     ` Eli Zaretskii
2014-05-23 18:48       ` Ken Olum
2014-05-23 19:53         ` Eli Zaretskii
2014-05-23 20:04           ` Ken Olum
2014-05-24  6:54             ` Eli Zaretskii
2014-05-27 15:08               ` Ken Olum
2014-05-30  9:35                 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).