emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

kill-word moves point if text is read-only.


From: lawrence mitchell
Subject: kill-word moves point if text is read-only.
Date: Sat, 21 Feb 2004 19:59:07 +0000
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50

In GNU Emacs 21.3.50.24 (i686-pc-linux-gnu, GTK+ Version 2.2.4)
 of 2004-02-14 on yam

If trying to delete text that is read-only with
backward-kill-word, say, point is moved to where it would have
been, were the word actually deleted.

I'd propose to make the following change to rectify this
behaviour.

Index: lisp/simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.631
diff -c -r1.631 simple.el
*** lisp/simple.el      18 Feb 2004 03:03:11 -0000      1.631
--- lisp/simple.el      21 Feb 2004 19:57:25 -0000
***************
*** 3174,3180 ****
    "Kill characters forward until encountering the end of a word.
  With argument, do this that many times."
    (interactive "p")
!   (kill-region (point) (progn (forward-word arg) (point))))
  
  (defun backward-kill-word (arg)
    "Kill characters backward until encountering the end of a word.
--- 3174,3180 ----
    "Kill characters forward until encountering the end of a word.
  With argument, do this that many times."
    (interactive "p")
!   (kill-region (point) (save-excursion (forward-word arg) (point))))
  
  (defun backward-kill-word (arg)
    "Kill characters backward until encountering the end of a word.

-- 
lawrence mitchell <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]