all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org, Alan Mackenzie  <acm@muc.de>
Subject: Fixing C-x DEL bug
Date: Thu, 18 Aug 2011 19:43:27 -0400	[thread overview]
Message-ID: <E1QuCFD-0001Rd-Vo@fencepost.gnu.org> (raw)

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/



             reply	other threads:[~2011-08-18 23:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18 23:43 Richard Stallman [this message]
2011-08-19  0:16 ` Fixing C-x DEL bug 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

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

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

  git send-email \
    --in-reply-to=E1QuCFD-0001Rd-Vo@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.