emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105895: For moving backward sentence


From: Richard Stallman
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105895: For moving backward sentences,
Date: Fri, 23 Sep 2011 19:55:52 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105895
committer: Richard Stallman <address@hidden>
branch nick: trunk
timestamp: Fri 2011-09-23 19:55:52 -0400
message:
  For moving backward sentences,
  distinguish start of paragraph from start of its text.
modified:
  lisp/ChangeLog
  lisp/textmodes/paragraphs.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-23 23:47:27 +0000
+++ b/lisp/ChangeLog    2011-09-23 23:55:52 +0000
@@ -1,5 +1,8 @@
 2011-09-23  Richard Stallman  <address@hidden>
 
+       * textmodes/paragraphs.el (forward-sentence): For backwards case,
+       distinguish start of paragraph from start of its text.
+
        * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Autoload.
 
        * mail/rmail.el (rmail-view-buffer-kill-buffer-hook): New function.

=== modified file 'lisp/textmodes/paragraphs.el'
--- a/lisp/textmodes/paragraphs.el      2011-09-22 13:34:02 +0000
+++ b/lisp/textmodes/paragraphs.el      2011-09-23 23:55:52 +0000
@@ -456,19 +456,23 @@
         (sentence-end (sentence-end)))
     (while (< arg 0)
       (let ((pos (point))
-           (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))))
+           par-beg par-text-beg)
+       (save-excursion
+         (start-of-paragraph-text)
+         ;; Start of real text in the paragraph.
+         ;; We move back to here if we don't see a sentence-end.
+         (setq par-text-beg (point))
+         ;; Start of the first line of the paragraph.
+         ;; We use this as the search limit
+         ;; to allow s1entence-end to match if it is anchored at
+         ;; BOL and the paragraph starts indented.
+         (beginning-of-line)
+         (setq par-beg (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)))
+         (goto-char par-text-beg)))
       (setq arg (1+ arg)))
     (while (> arg 0)
       (let ((par-end (save-excursion (end-of-paragraph-text) (point))))


reply via email to

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