Subject: 24.1.50; delete-trailing-whitespace now removes empty lines at end of file

From: Matt Arsenault <[email-masked]>
Date: Sun, 8 Jul 2012 00:35:52 -0700

This is a regression from emacs 23.

In emacs 24, delete-trailing-whitespace remove blank lines at the end of a buffer. Previously this function would remove trailing whitespace on a line, but not change the number of lines.

Steps to reproduce: 
   1. Open a new buffer
   2. Enter a few lines of text
   3. Enter a few blank lines after the text
   4. Run M-x delete-trailing-whitespace

Expected behavior: 
   Number of lines to be unchanged. Blank lines at end of text should be there which was the behavior in emacs 23 and previous versions.

Observed behavior:
  Blank lines after the text  are removed. If the buffer is only blank lines, the first one survives the delete-trailing-whitespace.

The report may appear in public locations.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Applications/Aquamacs.app/Contents/Resources/etc/DEBUG.

In GNU Emacs 24.1.50.3 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
of 2012-07-07 on braeburn.aquamacs.org - Aquamacs Distribution 3.xdev
Windowing system distributor `Apple', version 10.3.1138
Configured using:
`configure '--with-ns' '--without-x' 'CFLAGS=-arch i386 -g -O0 '
'LDFLAGS=-arch i386 -g -O0 ''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  global-linum-mode: t
  linum-mode: t
  savehist-mode: t
  smart-frame-positioning-mode: t
  aquamacs-autoface-mode: t
  recentf-mode: t
  osx-key-mode: t
  tabbar-mwheel-mode: t
  tabbar-mode: t
  show-paren-mode: t
  cua-mode: t
  tooltip-mode: t
  mouse-wheel-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:

Features:
(shadow sort mail-extr emacsbug message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader dired-aux
cua-rect rect help-mode novice js json moz imenu dired etags
multi-isearch desktop vc-git network-stream starttls url-http tls
url-auth mail-parse rfc2231 url-gw url-cache url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse auth-source eieio gnus-util password-cache url-vars mailcap
windmove protobuf-mode cc-langs cc-mode cc-fonts cc-guess cc-menus
cc-cmds cmake-mode flymake camelCase gtk2hs haskell-ghci inf-haskell
haskell-mode derived pp compile shell pcomplete comint ring
goto-last-change cc-styles cc-align cc-engine cc-vars cc-defs edmacro
kmacro ansi-color linum auto-complete-clang load-emacs-plugins
aquamacs-mode-defaults auctex-config server preview-latex tex-site
auto-loads aquamacs-aux savehist mouse-sel one-buffer-one-frame
smart-frame-positioning drews_init color-theme-autoloads view saveplace
visual-line aquamacs-bug aquamacs-autoface-mode aquamacs-editing
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
recentf tree-widget cus-edit osxkeys emulate-mac-keyboard-mode
frame-cmds strings misc-fns thingatpt+ thingatpt frame-fns avoid
aquamacs-mac-fontsets fit-frame aquamacs-frame-setup aquamacs-tabbar
tabbar-window cl cus-start cus-load tabbar warnings
load-emacs-pre-plugins aquamacs-site-start cocoa-compatibility
matlab-load smart-dnd revive filladapt aquamacs-redo check-for-updates
aquamacs-menu osx_defaults aquamacs aquamacs-tool-bar time-date
mac-extra-functions aquamacs-tools aquamacs-macros parse-time timezone
paren delsel cua-base wid-edit advice advice-preload byte-opt bytecomp
byte-compile debug help-fns macroexp cconv image-file disp-table
easymenu easy-mmode tooltip ediff-hook vc-hooks lisp-float-type mwheel
ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-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 loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)