unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fixing C-x DEL bug
@ 2011-08-18 23:43 Richard Stallman
  2011-08-19  0:16 ` Wolfgang Jenkner
  2011-08-19  8:18 ` Fixing C-x DEL bug Alan Mackenzie
  0 siblings, 2 replies; 22+ messages in thread
From: Richard Stallman @ 2011-08-18 23:43 UTC (permalink / raw)
  To: emacs-devel, Alan Mackenzie

I decided to debug the C-x DEL bug I reported a few weeks ago.
I found that the problem is in this change:

    2009-01-12  Alan Mackenzie  <acm@muc.de>

	    * textmodes/paragraphs.el (forward-sentence): Change limit of
	    re-search-backward to allow values of `sentence-end' anchored at BOL.

I wrote a fix that handles my case right (see below), and maybe
handles that other case, but I can't be sure because the description
of that case is not very clear to me.

In fact, the idea of a sentence-end at the beginning of the line
seems rather bizarre.  Alan, what case is that meant for?

=== modified file 'lisp/textmodes/paragraphs.el'
*** lisp/textmodes/paragraphs.el	2011-02-28 01:07:29 +0000
--- lisp/textmodes/paragraphs.el	2011-08-18 02:45:53 +0000
***************
*** 456,476 ****
          (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)))
        (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)))
        (setq arg (1- arg)))
      (constrain-to-field nil opoint t)))
  
--- 456,480 ----
          (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))))
! 	(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)))
        (setq arg (1- arg)))
      (constrain-to-field nil opoint t)))
  




-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/



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

end of thread, other threads:[~2011-09-22 18:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-18 23:43 Fixing C-x DEL bug Richard Stallman
2011-08-19  0:16 ` Wolfgang Jenkner
2011-08-19 23:12   ` Richard Stallman
2011-08-19 23:48     ` Glenn Morris
2011-08-20  8:18       ` Eli Zaretskii
2011-08-20 15:56       ` Richard Stallman
2011-08-20 16:22         ` Glenn Morris
2011-08-22 14:48           ` Richard Stallman
2011-08-22 19:15     ` The bug tracker...again (was: Fixing C-x DEL bug) Deniz Dogan
2011-08-22 20:03       ` The bug tracker...again Glenn Morris
2011-08-22 20:05       ` Karl Fogel
2011-08-23 17:00         ` Richard Stallman
2011-08-23 18:54           ` Karl Fogel
2011-08-24  2:06             ` Chong Yidong
2011-08-19  8:18 ` Fixing C-x DEL bug Alan Mackenzie
2011-08-19  8:32   ` Eli Zaretskii
2011-08-19  8:34     ` Alan Mackenzie
2011-08-20 15:56   ` Richard Stallman
2011-08-21  8:50     ` Alan Mackenzie
2011-08-21 22:14       ` Richard Stallman
2011-08-22 11:26         ` Alan Mackenzie
2011-09-22 18:19           ` Wolfgang Jenkner

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