unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Romain Francoise <romain@orebokech.com>
Subject: Infinite loop in whitespace-buffer-trailing-cleanup
Date: Sun, 03 Jul 2005 14:13:35 +0200	[thread overview]
Message-ID: <87slyw6qa8.fsf@orebokech.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 826 bytes --]

There is a bug in `whitespace-buffer-trailing-cleanup' when trying to
remove trailing whitespace in a non-writable file with
`kill-read-only-ok' set to t.

Steps to reproduce this bug:
1. Create a file with only whitespace, e.g. echo -e "\n\n\n\n" >/tmp/foo
2. Make it non-writable: chmod a-w /tmp/foo
3. Open /tmp/foo in Emacs
4. M-x set-variable RET kill-read-only-ok RET t RET
5. M-: (require 'whitespace) RET
6. M-: (whitespace-buffer-trailing-cleanup) RET
7. Wait, don't interrupt.

In Emacs 21.4, this results in a segmentation fault after a few
seconds.  In Emacs from CVS, it results in the following backtrace:

Debugger entered--Lisp error: (error "Lisp nesting exceeds `max-lisp-eval-depth'")
  x-set-cut-buffer("\n" t)
  x-select-text("\n" t)
  kill-new("\n")
  copy-region-as-kill(3 4)
  byte-code("Ä\b	\"ˆÅ\x12\vƒ\x11

             reply	other threads:[~2005-07-03 12:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-03 12:13 Romain Francoise [this message]
2005-07-03 13:00 ` Infinite loop in whitespace-buffer-trailing-cleanup Romain Francoise
2005-07-04 14:51   ` Richard M. Stallman
2005-07-05 18:22     ` Romain Francoise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87slyw6qa8.fsf@orebokech.com \
    --to=romain@orebokech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).