Subject: 26.3; rmail-summary-delete-forward: Wrong type argument: number-or-marker-p, nil

From: Ed Sabol <[email-masked]>
Date: Fri, 14 Feb 2020 20:19:04 -0500 (EST)

I kept getting the error "Wrong type argument: number-or-marker-p, nil" if I
tried to delete a message immediate after retrieving new messages. I finally
figured out a solution. In `rmail-summary-delete-forward', please change:

      (with-current-buffer rmail-buffer
	(rmail-delete-message)
	(setq del-msg rmail-current-message))

to

      (with-current-buffer rmail-buffer
	(setq del-msg rmail-current-message)
	(rmail-delete-message))

For some inexplicable reason, rmail-current-message becomes nil after
executing `rmail-delete-message' *sometimes*. I'm not sure under what
circumstances it does though, so I can't give you a precise recipe to
reproduce it. Changing the order of these two forms completely fixes this
problem for me though. I would really appreciate it if someone committed this
minor change.

Is the `(rmail-summary-mark-deleted del-msg)' on the following line even
needed? rmail-delete-message calls rmail-summary-mark-deleted. Seems like
duplicate effort. If you get rid of that line, then you don't need the
del-msg variable at all, which would simplify this code considerably and also
eliminate the problem.

In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit)
 of 2019-11-19 built on heabox
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description:	Scientific Linux release 7.7 (Nitrogen)

Recent messages:
Expunging deleted messages...done
Computing summary lines...done
Saving file /Home/lhea2/sabol/Mail/cron...
Wrote /Home/lhea2/sabol/Mail/cron [2 times]
Computing summary lines...done
Auto-saving...done
Mark set [2 times]
Region copied to kill buffer.
Making completion list... [2 times]
Region copied to kill buffer.

Configured using:
 'configure --prefix=/software/usr/contrib
 --exec-prefix=/software/usr/contrib/linux-7.x --with-x-toolkit=lucid
 --with-xft=yes --with-toolkit-scroll-bars=no --with-jpeg=no --with-gif=no
 --with-tiff=no --with-gnutls=no'

Configured features:
XAW3D XPM PNG SOUND GSETTINGS GLIB NOTIFY LIBSELINUX LIBXML2 FREETYPE XFT
ZLIB LUCID X11 XDBE XIM THREADS

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

Major mode: Messages

Minor modes in effect:
  show-paren-mode: t
  diff-auto-refine-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/software/usr/contrib/share/emacs/26.x/site-lisp/dockerfile-mode hides /Home/lhea2/sabol/.emacs.d/elpa/dockerfile-mode-1.2/dockerfile-mode
/software/usr/contrib/share/emacs/26.x/site-lisp/perlcritic hides /software/usr/contrib/share/emacs/site-lisp/perlcritic
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-region hides /software/usr/contrib/share/emacs/site-lisp/mmm-region
/software/usr/contrib/share/emacs/26.x/site-lisp/tidy hides /software/usr/contrib/share/emacs/site-lisp/tidy
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-vars hides /software/usr/contrib/share/emacs/site-lisp/mmm-vars
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-noweb hides /software/usr/contrib/share/emacs/site-lisp/mmm-noweb
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-utils hides /software/usr/contrib/share/emacs/site-lisp/mmm-utils
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-cweb hides /software/usr/contrib/share/emacs/site-lisp/mmm-cweb
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-univ hides /software/usr/contrib/share/emacs/site-lisp/mmm-univ
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-rpm hides /software/usr/contrib/share/emacs/site-lisp/mmm-rpm
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-mason hides /software/usr/contrib/share/emacs/site-lisp/mmm-mason
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-sample hides /software/usr/contrib/share/emacs/site-lisp/mmm-sample
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-mode hides /software/usr/contrib/share/emacs/site-lisp/mmm-mode
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-cmds hides /software/usr/contrib/share/emacs/site-lisp/mmm-cmds
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-class hides /software/usr/contrib/share/emacs/site-lisp/mmm-class
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-compat hides /software/usr/contrib/share/emacs/site-lisp/mmm-compat
/Home/lhea2/sabol/.emacs.d/elpa/mmm-mode-0.5.7/mmm-auto hides /software/usr/contrib/share/emacs/site-lisp/mmm-auto
/software/usr/contrib/share/emacs/26.x/site-lisp/mode-compile hides /software/usr/contrib/share/emacs/site-lisp/mode-compile
/software/usr/contrib/share/emacs/26.x/site-lisp/heasarc-info-mode hides /software/usr/contrib/share/emacs/site-lisp/heasarc-info-mode
/software/usr/contrib/share/emacs/26.x/site-lisp/simple-vc hides /software/usr/contrib/share/emacs/site-lisp/simple-vc
/software/usr/contrib/share/emacs/site-lisp/css-mode hides /software/usr/contrib/share/emacs/26.3/lisp/textmodes/css-mode
/software/usr/contrib/share/emacs/site-lisp/flymake hides /software/usr/contrib/share/emacs/26.3/lisp/progmodes/flymake
/Home/lhea2/sabol/.emacs.d/elpa/nadvice-0.3/nadvice hides /software/usr/contrib/share/emacs/26.3/lisp/emacs-lisp/nadvice

Features:
(shadow mailalias mail-hist emacsbug sendmail help-mode cl-print debug
misearch multi-isearch thingatpt browse-url pp qp rmailsum rmailmm elec-pair
dockerfile-mode sh-script smie paren psvn wid-edit cl log-edit message rmc
puny format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader ring add-log
diff-mode executable mmm-auto mmm-vars mmm-utils mmm-compat imenu mm-util
mail-prsvr time advice server restart-session dired dired-loaddefs pcvs
vc-cvs pcvs-parse pcvs-info pcvs-defs easy-mmode pcvs-util ewoc finder-inf
package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode
register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded
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 threads inotify dynamic-setting
system-font-setting font-render-setting x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 360821 39122)
 (symbols 48 29118 1)
 (miscs 40 22245 2147)
 (strings 32 124604 9006)
 (string-bytes 1 4759719)
 (vectors 16 25408)
 (vector-slots 8 875886 26110)
 (floats 8 147 448)
 (intervals 56 3156 806)
 (buffers 992 38)
 (heap 1024 71981 3392))