changeset 35636:4eb554667665

(dabbrev--substitute-expansion): 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.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 27 Jan 2001 12:05:36 +0000
parents 11e5d55ea163
children 0cd7267c45ae
files lisp/dabbrev.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dabbrev.el	Sat Jan 27 11:53:09 2001 +0000
+++ b/lisp/dabbrev.el	Sat Jan 27 12:05:36 2001 +0000
@@ -1,6 +1,6 @@
 ;;; dabbrev.el --- dynamic abbreviation package
 
-;; Copyright (C) 1985, 86, 92, 94, 96, 1997, 2000
+;; Copyright (C) 1985, 86, 92, 94, 96, 1997, 2000, 2001
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Don Morrison
@@ -835,11 +835,15 @@
     ;; 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))
-			     (string= abbrev (upcase abbrev)))))
+			     (and (string= abbrev (upcase abbrev))
+				  (> (length abbrev) 1)))))
 	       (string= abbrev
 			(substring expansion 0 (length abbrev))))
 	  (setq use-case-replace nil)))