2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
+ * dabbrev.el (dabbrev--ignore-case-p): New function.
+ (dabbrev-completion, dabbrev-expand, dabbrev--substitute-expansion):
+ Use it.
+
* files.el (automount-dir-prefix): Mark as obsolete.
2012-05-04 Glenn Morris <rgm@gnu.org>
;;??? Do we want this?
;;;###autoload (define-key esc-map [?\C-/] 'dabbrev-completion)
+(defun dabbrev--ignore-case-p (abbrev)
+ (and (if (eq dabbrev-case-fold-search 'case-fold-search)
+ case-fold-search
+ dabbrev-case-fold-search)
+ (or (not dabbrev-upcase-means-case-search)
+ (string= abbrev (downcase abbrev)))))
+
;;;###autoload
(defun dabbrev-completion (&optional arg)
"Completion on current word.
(abbrev (dabbrev--abbrev-at-point))
(beg (progn (search-backward abbrev) (point)))
(end (progn (search-forward abbrev) (point)))
- (ignore-case-p
- (and (if (eq dabbrev-case-fold-search 'case-fold-search)
- case-fold-search
- dabbrev-case-fold-search)
- (or (not dabbrev-upcase-means-case-search)
- (string= abbrev (downcase abbrev)))))
+ (ignore-case-p (dabbrev--ignore-case-p abbrev))
(list 'uninitialized)
(table
(lambda (s p a)
(setq expansion
(dabbrev--find-expansion
abbrev direction
- (and (if (eq dabbrev-case-fold-search 'case-fold-search)
- case-fold-search
- dabbrev-case-fold-search)
- (or (not dabbrev-upcase-means-case-search)
- (string= abbrev (downcase abbrev))))))))
+ (dabbrev--ignore-case-p abbrev)))))
(cond
((not expansion)
(dabbrev--reset-global-variables)
to record whether we upcased the expansion, downcased it, or did neither."
;;(undo-boundary)
(let ((use-case-replace
- (and (if (eq dabbrev-case-fold-search 'case-fold-search)
- case-fold-search
- dabbrev-case-fold-search)
- (or (not dabbrev-upcase-means-case-search)
- (string= abbrev (downcase abbrev)))
+ (and (dabbrev--ignore-case-p abbrev)
(if (eq dabbrev-case-replace 'case-replace)
case-replace
dabbrev-case-replace))))