emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105876: Fix bug that C-x DEL deleted


From: Richard Stallman
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105876: Fix bug that C-x DEL deleted a newline before paragraph.
Date: Thu, 22 Sep 2011 09:34:02 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105876
committer: Richard Stallman <address@hidden>
branch nick: trunk
timestamp: Thu 2011-09-22 09:34:02 -0400
message:
  Fix bug that C-x DEL deleted a newline before paragraph.
modified:
  lisp/ChangeLog
  lisp/textmodes/paragraphs.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-22 10:00:07 +0000
+++ b/lisp/ChangeLog    2011-09-22 13:34:02 +0000
@@ -1,3 +1,8 @@
+2011-09-22  Richard Stallman  <address@hidden>
+
+       * textmodes/paragraphs.el (forward-sentence): When setting PAR-BEG,
+       move back only to line beg, don't move back over blank lines.
+
 2011-09-22  Michael Albinus  <address@hidden>
 
        * files.el (copy-directory): Set directory attributes only in case

=== modified file 'lisp/textmodes/paragraphs.el'
--- a/lisp/textmodes/paragraphs.el      2011-08-27 11:14:50 +0000
+++ b/lisp/textmodes/paragraphs.el      2011-09-22 13:34:02 +0000
@@ -456,21 +456,25 @@
         (sentence-end (sentence-end)))
     (while (< arg 0)
       (let ((pos (point))
-           ;; We used to use (start-of-paragraph-text), but this can
-           ;; prevent sentence-end from matching if it is anchored at
-           ;; BOL and the paragraph starts indented.
-           (par-beg (save-excursion (backward-paragraph) (point))))
-       (if (and (re-search-backward sentence-end par-beg t)
-               (or (< (match-end 0) pos)
-                   (re-search-backward sentence-end par-beg t)))
-          (goto-char (match-end 0))
-        (goto-char par-beg)))
+           (par-beg
+            (save-excursion
+              (start-of-paragraph-text)
+              ;; Move PAR-BEG back over indentation
+              ;; to allow s1entence-end to match if it is anchored at
+              ;; BOL and the paragraph starts indented.
+              (beginning-of-line)
+              (point))))
+       (if (and (re-search-backward sentence-end par-beg t)
+                (or (< (match-end 0) pos)
+                    (re-search-backward sentence-end par-beg t)))
+           (goto-char (match-end 0))
+         (goto-char par-beg)))
       (setq arg (1+ arg)))
     (while (> arg 0)
       (let ((par-end (save-excursion (end-of-paragraph-text) (point))))
-       (if (re-search-forward sentence-end par-end t)
-          (skip-chars-backward " \t\n")
-        (goto-char par-end)))
+       (if (re-search-forward sentence-end par-end t)
+           (skip-chars-backward " \t\n")
+         (goto-char par-end)))
       (setq arg (1- arg)))
     (constrain-to-field nil opoint t)))
 


reply via email to

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