emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/dabbrev.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/dabbrev.el [emacs-unicode-2]
Date: Mon, 28 Jun 2004 04:56:48 -0400

Index: emacs/lisp/dabbrev.el
diff -c emacs/lisp/dabbrev.el:1.69.2.1 emacs/lisp/dabbrev.el:1.69.2.2
*** emacs/lisp/dabbrev.el:1.69.2.1      Fri Apr 16 12:49:48 2004
--- emacs/lisp/dabbrev.el       Mon Jun 28 07:28:28 2004
***************
*** 888,910 ****
      ;; matches the start of the expansion,
      ;; copy the expansion's case
      ;; instead of downcasing all the rest.
!     ;; Treat a one-capital-letter abbrev as "not all upper case",
!     ;; so as to force preservation of the expansion's pattern
!     ;; if the expansion starts with a capital letter.
!     (let ((expansion-rest (substring expansion 1)))
!       (if (and (not (and (or (string= expansion-rest (downcase 
expansion-rest))
!                            (string= expansion-rest (upcase expansion-rest)))
!                        (or (string= abbrev (downcase abbrev))
!                            (and (string= abbrev (upcase abbrev))
!                                 (> (length abbrev) 1)))))
!              (string= abbrev
!                       (substring expansion 0 (length abbrev))))
          (setq use-case-replace nil)))
  
      ;; If the abbrev and the expansion are both all-lower-case
      ;; then don't do any conversion.  The conversion would be a no-op
      ;; for this replacement, but it would carry forward to subsequent words.
!     ;; The goal of this is to preven that carrying forward.
      (if (and (string= expansion (downcase expansion))
             (string= abbrev (downcase abbrev)))
        (setq use-case-replace nil))
--- 888,915 ----
      ;; matches the start of the expansion,
      ;; copy the expansion's case
      ;; instead of downcasing all the rest.
!     ;;
!     ;; Treat a one-capital-letter (possibly with preceding non-letter
!     ;; characters) abbrev as "not all upper case", so as to force
!     ;; preservation of the expansion's pattern if the expansion starts
!     ;; with a capital letter.
!     (let ((expansion-rest (substring expansion 1))
!         (first-letter-position (string-match "[[:alpha:]]" abbrev)))
!       (if (or (null first-letter-position)
!             (and (not (and (or (string= expansion-rest (downcase 
expansion-rest))
!                                (string= expansion-rest (upcase 
expansion-rest)))
!                            (or (string= abbrev (downcase abbrev))
!                                (and (string= abbrev (upcase abbrev))
!                                     (> (- (length abbrev) 
first-letter-position)
!                                        1)))))
!                  (string= abbrev
!                           (substring expansion 0 (length abbrev)))))
          (setq use-case-replace nil)))
  
      ;; If the abbrev and the expansion are both all-lower-case
      ;; then don't do any conversion.  The conversion would be a no-op
      ;; for this replacement, but it would carry forward to subsequent words.
!     ;; The goal of this is to prevent that carrying forward.
      (if (and (string= expansion (downcase expansion))
             (string= abbrev (downcase abbrev)))
        (setq use-case-replace nil))




reply via email to

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