unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24745: 25.1.50; whitespace.el: fix beginning/end of buffer checks
@ 2016-10-20 12:32 Reuben Thomas
  2016-10-20 22:43 ` Dmitry Gutov
       [not found] ` <handler.24745.B.14769667565022.ack@debbugs.gnu.org>
  0 siblings, 2 replies; 15+ messages in thread
From: Reuben Thomas @ 2016-10-20 12:32 UTC (permalink / raw)
  To: 24745

Tags: patch


whitespace-report-region currently (Emacs 25.1, and identically in
master) fails correctly to detect whitespace at the start and end of the
buffer. This is because the relevant regexps,
whitespace-empty-at-{bob,eob}-regexp, are not anchored to the start and
end of the buffer. Hence, whitespace-report-region finds spurious
matches (for example, diagnosing blank lines at the end of the buffer
whenever there is space at the start of any line).

This behavior is intentional: for highlighting and cleanup purposes,
these regexps are applied explicitly to the start and end of the buffer,
and so both highlighting and cleanup work correctly.

However, I suggest that the intention is wrong: the variables’ names and
documentation refer to the start and end of the buffer, not of the
current region; and further, whitespace at the start or end of a region
is not usually considered a problem.

The fix, therefore, is simple: anchor the default value of the patterns
to the start and end of the buffer respectively. This fixes the bug in
whitespace-report-region when used on the whole buffer, while also
making the behavior for non-whole-buffer regions be what one might
expect: empty lines are only diagnosed if the region includes the start
or end of the buffer.

I attach a patch with this fix.

If the maintainers disagree with my analysis; specifically, if you think
that the empty checks should work at the start and end of the region,
then the fix will be a little more complex, as whitespace-report-region
will have to treat those checks specially, as other parts of the code
do.



In GNU Emacs 25.1.50.9 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2016-10-15 built on skwd
Repository revision: 4eb4463abf1db904f9e8cdc35156a66f8a10125c
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.1 LTS

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_MONETARY: en_GB.utf8
  value of $LC_NUMERIC: en_GB.utf8
  value of $LC_TIME: en_GB.utf8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  buffer-face-mode: t
  flyspell-mode: t
  goto-address-mode: t
  smart-quotes-mode: t
  show-paren-mode: t
  savehist-mode: t
  recentf-mode: t
  minibuffer-electric-default-mode: t
  global-auto-revert-mode: t
  electric-pair-mode: t
  desktop-save-mode: t
  global-whitespace-mode: t
  diff-auto-refine-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  helm-mode: t
  shell-dirtrack-mode: t
  helm-autoresize-mode: t
  async-bytecomp-package-mode: t
  dtrt-indent-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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

Recent messages:
Type C-c C-c to finish, or C-c C-k to cancel
Quit [5 times]
Mark set [2 times]
previous-line: Beginning of buffer [5 times]
Mark activated
Auto-saving...done
Saving file /home/rrt/.local/var/repo/emacs/.git/COMMIT_EDITMSG...
Wrote /home/rrt/.emacs.d/undo-tree/.!home!rrt!.local!var!repo!emacs!.git!COMMIT_EDITMSG.~undo-tree~
Wrote /home/rrt/.local/var/repo/emacs/.git/COMMIT_EDITMSG
Git finished [2 times]

Load-path shadows:
/home/rrt/.emacs.d/elpa/sws-mode-20150317.1245/sws-mode hides /home/rrt/.emacs.d/el-get/jade-mode/sws-mode
/home/rrt/.emacs.d/el-get/emacs-async/async-pkg hides /home/rrt/.emacs.d/el-get/async/async-pkg
/home/rrt/.emacs.d/el-get/emacs-async/dired-async hides /home/rrt/.emacs.d/el-get/async/dired-async
/home/rrt/.emacs.d/el-get/emacs-async/smtpmail-async hides /home/rrt/.emacs.d/el-get/async/smtpmail-async
/home/rrt/.emacs.d/el-get/emacs-async/async-bytecomp hides /home/rrt/.emacs.d/el-get/async/async-bytecomp
/home/rrt/.emacs.d/el-get/emacs-async/async hides /home/rrt/.emacs.d/el-get/async/async
/home/rrt/.emacs.d/elpa/cmake-mode-3.6.2/cmake-mode hides /usr/local/share/emacs/25.1.50/site-lisp/cmake-data/cmake-mode
/home/rrt/.local/share/emacs/site-lisp/whitespace hides /usr/local/share/emacs/25.1.50/lisp/whitespace
/home/rrt/.emacs.d/el-get/cperl-mode/cperl-mode hides /usr/local/share/emacs/25.1.50/lisp/progmodes/cperl-mode
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org hides /usr/local/share/emacs/25.1.50/lisp/org/org
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-mouse hides /usr/local/share/emacs/25.1.50/lisp/org/org-mouse
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-ruby hides /usr/local/share/emacs/25.1.50/lisp/org/ob-ruby
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-asymptote hides /usr/local/share/emacs/25.1.50/lisp/org/ob-asymptote
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-man hides /usr/local/share/emacs/25.1.50/lisp/org/ox-man
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-eval hides /usr/local/share/emacs/25.1.50/lisp/org/ob-eval
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-footnote hides /usr/local/share/emacs/25.1.50/lisp/org/org-footnote
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-shen hides /usr/local/share/emacs/25.1.50/lisp/org/ob-shen
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-lisp hides /usr/local/share/emacs/25.1.50/lisp/org/ob-lisp
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-C hides /usr/local/share/emacs/25.1.50/lisp/org/ob-C
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-sass hides /usr/local/share/emacs/25.1.50/lisp/org/ob-sass
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-css hides /usr/local/share/emacs/25.1.50/lisp/org/ob-css
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-sqlite hides /usr/local/share/emacs/25.1.50/lisp/org/ob-sqlite
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-loaddefs hides /usr/local/share/emacs/25.1.50/lisp/org/org-loaddefs
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-org hides /usr/local/share/emacs/25.1.50/lisp/org/ob-org
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-org hides /usr/local/share/emacs/25.1.50/lisp/org/ox-org
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-ditaa hides /usr/local/share/emacs/25.1.50/lisp/org/ob-ditaa
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-screen hides /usr/local/share/emacs/25.1.50/lisp/org/ob-screen
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-io hides /usr/local/share/emacs/25.1.50/lisp/org/ob-io
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-fortran hides /usr/local/share/emacs/25.1.50/lisp/org/ob-fortran
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-list hides /usr/local/share/emacs/25.1.50/lisp/org/org-list
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-macro hides /usr/local/share/emacs/25.1.50/lisp/org/org-macro
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-latex hides /usr/local/share/emacs/25.1.50/lisp/org/ob-latex
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-ascii hides /usr/local/share/emacs/25.1.50/lisp/org/ox-ascii
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-install hides /usr/local/share/emacs/25.1.50/lisp/org/org-install
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-picolisp hides /usr/local/share/emacs/25.1.50/lisp/org/ob-picolisp
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-R hides /usr/local/share/emacs/25.1.50/lisp/org/ob-R
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-latex hides /usr/local/share/emacs/25.1.50/lisp/org/ox-latex
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-eshell hides /usr/local/share/emacs/25.1.50/lisp/org/org-eshell
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-odt hides /usr/local/share/emacs/25.1.50/lisp/org/ox-odt
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-keys hides /usr/local/share/emacs/25.1.50/lisp/org/ob-keys
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-ref hides /usr/local/share/emacs/25.1.50/lisp/org/ob-ref
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-datetree hides /usr/local/share/emacs/25.1.50/lisp/org/org-datetree
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-exp hides /usr/local/share/emacs/25.1.50/lisp/org/ob-exp
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-beamer hides /usr/local/share/emacs/25.1.50/lisp/org/ox-beamer
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-emacs-lisp hides /usr/local/share/emacs/25.1.50/lisp/org/ob-emacs-lisp
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-matlab hides /usr/local/share/emacs/25.1.50/lisp/org/ob-matlab
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob hides /usr/local/share/emacs/25.1.50/lisp/org/ob
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-indent hides /usr/local/share/emacs/25.1.50/lisp/org/org-indent
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-perl hides /usr/local/share/emacs/25.1.50/lisp/org/ob-perl
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-habit hides /usr/local/share/emacs/25.1.50/lisp/org/org-habit
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-entities hides /usr/local/share/emacs/25.1.50/lisp/org/org-entities
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-rmail hides /usr/local/share/emacs/25.1.50/lisp/org/org-rmail
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-md hides /usr/local/share/emacs/25.1.50/lisp/org/ox-md
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-clojure hides /usr/local/share/emacs/25.1.50/lisp/org/ob-clojure
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-makefile hides /usr/local/share/emacs/25.1.50/lisp/org/ob-makefile
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-plantuml hides /usr/local/share/emacs/25.1.50/lisp/org/ob-plantuml
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-table hides /usr/local/share/emacs/25.1.50/lisp/org/org-table
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-mobile hides /usr/local/share/emacs/25.1.50/lisp/org/org-mobile
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-mhe hides /usr/local/share/emacs/25.1.50/lisp/org/org-mhe
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-lob hides /usr/local/share/emacs/25.1.50/lisp/org/ob-lob
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-capture hides /usr/local/share/emacs/25.1.50/lisp/org/org-capture
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-version hides /usr/local/share/emacs/25.1.50/lisp/org/org-version
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-core hides /usr/local/share/emacs/25.1.50/lisp/org/ob-core
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-table hides /usr/local/share/emacs/25.1.50/lisp/org/ob-table
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-faces hides /usr/local/share/emacs/25.1.50/lisp/org/org-faces
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-compat hides /usr/local/share/emacs/25.1.50/lisp/org/org-compat
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-publish hides /usr/local/share/emacs/25.1.50/lisp/org/ox-publish
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-agenda hides /usr/local/share/emacs/25.1.50/lisp/org/org-agenda
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-maxima hides /usr/local/share/emacs/25.1.50/lisp/org/ob-maxima
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-dot hides /usr/local/share/emacs/25.1.50/lisp/org/ob-dot
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-python hides /usr/local/share/emacs/25.1.50/lisp/org/ob-python
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-crypt hides /usr/local/share/emacs/25.1.50/lisp/org/org-crypt
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-protocol hides /usr/local/share/emacs/25.1.50/lisp/org/org-protocol
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-scheme hides /usr/local/share/emacs/25.1.50/lisp/org/ob-scheme
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-awk hides /usr/local/share/emacs/25.1.50/lisp/org/ob-awk
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-w3m hides /usr/local/share/emacs/25.1.50/lisp/org/org-w3m
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-bbdb hides /usr/local/share/emacs/25.1.50/lisp/org/org-bbdb
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-html hides /usr/local/share/emacs/25.1.50/lisp/org/ox-html
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-gnus hides /usr/local/share/emacs/25.1.50/lisp/org/org-gnus
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-js hides /usr/local/share/emacs/25.1.50/lisp/org/ob-js
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-mscgen hides /usr/local/share/emacs/25.1.50/lisp/org/ob-mscgen
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-ocaml hides /usr/local/share/emacs/25.1.50/lisp/org/ob-ocaml
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-icalendar hides /usr/local/share/emacs/25.1.50/lisp/org/ox-icalendar
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-gnuplot hides /usr/local/share/emacs/25.1.50/lisp/org/ob-gnuplot
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-irc hides /usr/local/share/emacs/25.1.50/lisp/org/org-irc
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-haskell hides /usr/local/share/emacs/25.1.50/lisp/org/ob-haskell
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-docview hides /usr/local/share/emacs/25.1.50/lisp/org/org-docview
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-clock hides /usr/local/share/emacs/25.1.50/lisp/org/org-clock
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-lilypond hides /usr/local/share/emacs/25.1.50/lisp/org/ob-lilypond
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-ctags hides /usr/local/share/emacs/25.1.50/lisp/org/org-ctags
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox hides /usr/local/share/emacs/25.1.50/lisp/org/ox
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-bibtex hides /usr/local/share/emacs/25.1.50/lisp/org/org-bibtex
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-element hides /usr/local/share/emacs/25.1.50/lisp/org/org-element
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-id hides /usr/local/share/emacs/25.1.50/lisp/org/org-id
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-archive hides /usr/local/share/emacs/25.1.50/lisp/org/org-archive
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-octave hides /usr/local/share/emacs/25.1.50/lisp/org/ob-octave
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-calc hides /usr/local/share/emacs/25.1.50/lisp/org/ob-calc
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-attach hides /usr/local/share/emacs/25.1.50/lisp/org/org-attach
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-src hides /usr/local/share/emacs/25.1.50/lisp/org/org-src
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-comint hides /usr/local/share/emacs/25.1.50/lisp/org/ob-comint
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-ledger hides /usr/local/share/emacs/25.1.50/lisp/org/ob-ledger
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-plot hides /usr/local/share/emacs/25.1.50/lisp/org/org-plot
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-tangle hides /usr/local/share/emacs/25.1.50/lisp/org/ob-tangle
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-info hides /usr/local/share/emacs/25.1.50/lisp/org/org-info
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-macs hides /usr/local/share/emacs/25.1.50/lisp/org/org-macs
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-pcomplete hides /usr/local/share/emacs/25.1.50/lisp/org/org-pcomplete
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-scala hides /usr/local/share/emacs/25.1.50/lisp/org/ob-scala
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-sql hides /usr/local/share/emacs/25.1.50/lisp/org/ob-sql
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-timer hides /usr/local/share/emacs/25.1.50/lisp/org/org-timer
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-inlinetask hides /usr/local/share/emacs/25.1.50/lisp/org/org-inlinetask
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ob-java hides /usr/local/share/emacs/25.1.50/lisp/org/ob-java
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-feed hides /usr/local/share/emacs/25.1.50/lisp/org/org-feed
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/org-colview hides /usr/local/share/emacs/25.1.50/lisp/org/org-colview
/usr/local/share/emacs/25.1.50/site-lisp/org-mode/ox-texinfo hides /usr/local/share/emacs/25.1.50/lisp/org/ox-texinfo

Features:
(shadow sort mail-extr emacsbug rect linum magit-blame magit-stash
magit-bisect magit-remote magit-commit magit-sequence magit magit-apply
magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert
magit-process magit-popup magit-mode magit-git crm magit-section
magit-utils git-commit log-edit message sendmail rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log
with-editor dash image-file vc vc-dispatcher helm-command eieio-opt
helm-elisp helm-eval edebug misearch multi-isearch winner cperl-mode
css-mode smie face-remap flyspell ispell goto-addr smart-quotes
sgml-mode jka-compr flymake paredit server ox-odt rng-loc rng-uri
rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html ox-ascii
ox-publish ox org-element avl-tree tramp-cache tramp-sh yasnippet paren
savehist recentf tree-widget wid-edit minibuf-eldef autorevert
filenotify elec-pair desktop frameset cus-start cus-load iimage org
org-macro org-footnote org-pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs go-mode
find-file forth-mode etags xref project info-look speedbar sb-image
ezimage dframe whitespace bug-reference-github bug-reference vc-git
diff-mode undo-tree diff helm-mode helm-files rx image-dired tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
format-spec dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen
helm-tags helm-bookmark helm-adaptive helm-info bookmark helm-locate
helm-grep helm-regexp helm-external helm-net browse-url xml url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse auth-source gnus-util mm-util help-fns
mail-prsvr password-cache url-vars mailcap helm-utils compile comint
ansi-color ring helm-help helm-types helm derived helm-source
eieio-compat helm-multi-match easy-mmode helm-lib helm-config
helm-easymenu async-bytecomp async locate finder-inf tex-site
go-mode-autoloads info edmacro kmacro windows revive init-paredit
dtrt-indent csv init-eldoc eldoc-extension advice .loaddefs eieio
eieio-core cl-macs el-get el-get-autoloading el-get-list-packages
el-get-dependencies el-get-build el-get-status pp el-get-methods
el-get-fossil el-get-svn el-get-pacman el-get-github-zip
el-get-github-tar el-get-http-zip el-get-http-tar el-get-hg el-get-go
el-get-git-svn el-get-fink el-get-emacswiki el-get-http el-get-notify
el-get-emacsmirror el-get-github el-get-git el-get-elpa package
epg-config seq byte-opt el-get-darcs el-get-cvs el-get-bzr el-get-brew
el-get-builtin el-get-apt-get el-get-recipes el-get-byte-compile
el-get-custom cl-seq el-get-core autoload lisp-mnt bytecomp byte-compile
cl-extra help-mode easymenu cconv cl gv cl-loaddefs pcase cl-lib dired
debian-el debian-el-loaddefs org-install dpkg-dev-el
dpkg-dev-el-loaddefs devhelp user-site-loaddefs time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev 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 dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 900071 66624)
 (symbols 48 50698 0)
 (miscs 40 944 1231)
 (strings 32 197868 33051)
 (string-bytes 1 6425863)
 (vectors 16 76424)
 (vector-slots 8 1943239 128378)
 (floats 8 617 583)
 (intervals 56 19804 193)
 (buffers 976 55)
 (heap 1024 75902 7551))

-- 
http://rrt.sc3d.org/

===File /home/rrt/.local/var/repo/emacs/0001-whitespace-fix-bob-eob-checks.patch===
From 0f0219bff7f1e365e8575e2e61983c0926cf787d Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Thu, 20 Oct 2016 13:17:58 +0100
Subject: [PATCH] whitespace: fix bob/eob checks

* whitespace.el: make `empty' checks work at beginning & end of buffer
in whitespace-report-region, and only there (i.e. they will never match
in regions that don't include the start or end of the buffer).
---
 lisp/whitespace.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 0f6b8df..f790ac5 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -828,7 +828,7 @@ whitespace-indentation-regexp
   :group 'whitespace)
 
 
-(defcustom whitespace-empty-at-bob-regexp "^\\(\\([ \t]*\n\\)+\\)"
+(defcustom whitespace-empty-at-bob-regexp "\\`\\(\\([ \t]*\n\\)+\\)"
   "Specify regexp for empty lines at beginning of buffer.
 
 Used when `whitespace-style' includes `empty'."
@@ -836,7 +836,7 @@ whitespace-empty-at-bob-regexp
   :group 'whitespace)
 
 
-(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)"
+(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)\\'"
   "Specify regexp for empty lines at end of buffer.
 
 Used when `whitespace-style' includes `empty'."
@@ -1515,7 +1515,7 @@ whitespace-cleanup
 	    (when (looking-at whitespace-empty-at-bob-regexp)
 	      (delete-region (match-beginning 1) (match-end 1)))
 	    (when (re-search-forward
-		   (concat whitespace-empty-at-eob-regexp "\\'") nil t)
+                   whitespace-empty-at-eob-regexp nil t)
 	      (delete-region (match-beginning 1) (match-end 1)))))))
     ;; PROBLEM 3: 8 or more SPACEs at bol
     ;; PROBLEM 4: SPACEs before TAB
-- 
2.7.4

============================================================





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

end of thread, other threads:[~2016-11-03 12:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-20 12:32 bug#24745: 25.1.50; whitespace.el: fix beginning/end of buffer checks Reuben Thomas
2016-10-20 22:43 ` Dmitry Gutov
2016-10-21 14:42   ` Reuben Thomas
2016-10-21 14:45     ` Dmitry Gutov
2016-10-21 14:52       ` Reuben Thomas
2016-10-24 23:36         ` Dmitry Gutov
2016-10-25 18:44           ` Reuben Thomas
2016-10-25 22:45             ` Dmitry Gutov
2016-10-25 23:26               ` Reuben Thomas
2016-11-01 15:32                 ` Reuben Thomas
2016-11-03  1:07                   ` Dmitry Gutov
2016-11-03 12:39                     ` Reuben Thomas
2016-11-03  1:06                 ` Dmitry Gutov
2016-11-03 12:38                   ` Reuben Thomas
     [not found] ` <handler.24745.B.14769667565022.ack@debbugs.gnu.org>
2016-10-21 14:38   ` bug#24745: Acknowledgement (25.1.50; whitespace.el: fix beginning/end of buffer checks) Reuben Thomas

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).