emacs-devel
[Top][All Lists]
Advanced

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

Re: 3 dots vanish at end of filled line


From: Richard M. Stallman
Subject: Re: 3 dots vanish at end of filled line
Date: Thu, 20 Oct 2005 19:38:28 -0400

I think this is a cleaner way to implement what Texinfo mode needs.
Does it work?

*** paragraphs.el       06 Aug 2005 14:38:37 -0400      1.79
--- paragraphs.el       20 Oct 2005 18:52:37 -0400      
***************
*** 159,178 ****
    :group 'paragraphs
    :type '(choice regexp (const :tag "Use default value" nil)))
  
  (defun sentence-end ()
    "Return the regexp describing the end of a sentence.
  
  This function returns either the value of the variable `sentence-end'
  if it is non-nil, or the default value constructed from the
! variables `sentence-end-double-space', `sentence-end-without-period'
! and `sentence-end-without-space'.  The default value specifies
! that in order to be recognized as the end of a sentence, the
! ending period, question mark, or exclamation point must be
! followed by two spaces, unless it's inside some sort of quotes or
! parenthesis.  See Info node `(elisp)Standard Regexps'."
    (or sentence-end
        (concat (if sentence-end-without-period "\\w  \\|")
!               "\\([.?!][]\"'\xd0c9\x5397d)}]*"
                (if sentence-end-double-space
                    "\\($\\| $\\|\t\\|  \\)" "\\($\\|[\t ]\\)")
                "\\|[" sentence-end-without-space "]+\\)"
--- 159,185 ----
    :group 'paragraphs
    :type '(choice regexp (const :tag "Use default value" nil)))
  
+ (defcustom sentence-end-base "\\([.?!][]\"'\xd0c9\x5397d)}]*"
+   "*Regexp matching the basic end of a sentence, not including following 
space."
+   :group 'paragraphs
+   :type 'string
+   :version "22.1")
+ 
  (defun sentence-end ()
    "Return the regexp describing the end of a sentence.
  
  This function returns either the value of the variable `sentence-end'
  if it is non-nil, or the default value constructed from the
! variables `sentence-end-base', `sentence-end-double-space',
! `sentence-end-without-period' and `sentence-end-without-space'.
! 
! The default value specifies that in order to be recognized as the
! end of a sentence, the ending period, question mark, or exclamation point
! must be followed by two spaces, with perhaps some closing delimiters
! in between.  See Infonode `(elisp)Standard Regexps'."
    (or sentence-end
        (concat (if sentence-end-without-period "\\w  \\|")
!             sentence-end-base
                (if sentence-end-double-space
                    "\\($\\| $\\|\t\\|  \\)" "\\($\\|[\t ]\\)")
                "\\|[" sentence-end-without-space "]+\\)"
*** texinfo.el  01 Sep 2005 01:53:14 -0400      1.111
--- texinfo.el  20 Oct 2005 18:54:35 -0400      
***************
*** 593,598 ****
--- 593,601 ----
        (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
    (make-local-variable 'paragraph-start)
    (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
+   (make-local-variable 'sentence-end-base)
+   (setq sentence-end-base
+       "\\(\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'\xd0c9\x5397d)}]*"
    (make-local-variable 'adaptive-fill-mode)
    (setq adaptive-fill-mode nil)
    (make-local-variable 'fill-column)




reply via email to

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