751 |
IGNORE-CASE non-nil means ignore case when searching. |
IGNORE-CASE non-nil means ignore case when searching. |
752 |
This sets `dabbrev--last-direction' to 1 or -1 according |
This sets `dabbrev--last-direction' to 1 or -1 according |
753 |
to the direction in which the occurrence was actually found. |
to the direction in which the occurrence was actually found. |
754 |
It sets `dabbrev--last-expansion-location' to the location |
It sets `dabbrev--last-expansion-location' to the location |
755 |
of the start of the occurrence." |
of the start of the occurrence." |
756 |
(save-excursion |
(save-excursion |
757 |
;; If we were scanning something other than the current buffer, |
;; If we were scanning something other than the current buffer, |
921 |
;; record if we upcased or downcased the first word, |
;; record if we upcased or downcased the first word, |
922 |
;; in order to do likewise for subsequent words. |
;; in order to do likewise for subsequent words. |
923 |
(and record-case-pattern |
(and record-case-pattern |
924 |
(setq dabbrev--last-case-pattern |
(setq dabbrev--last-case-pattern |
925 |
(and use-case-replace |
(and use-case-replace |
926 |
(cond ((equal abbrev (upcase abbrev)) 'upcase) |
(cond ((equal abbrev (upcase abbrev)) 'upcase) |
927 |
((equal abbrev (downcase abbrev)) 'downcase))))) |
((equal abbrev (downcase abbrev)) 'downcase))))) |
928 |
|
|
929 |
;; Convert newlines to spaces. |
;; Convert whitespace to single spaces. |
930 |
(if dabbrev--eliminate-newlines |
(if dabbrev--eliminate-newlines |
931 |
(while (string-match "\n" expansion) |
;; Start searching at end of ABBREV so that any whitespace |
932 |
(setq expansion (replace-match " " nil nil expansion)))) |
;; carried over from the existing text is not changed. |
933 |
|
(let ((pos (length abbrev))) |
934 |
|
(while (string-match "[\n \t]+" expansion pos) |
935 |
|
(setq pos (1+ (match-beginning 0))) |
936 |
|
(setq expansion (replace-match " " nil nil expansion))))) |
937 |
|
|
938 |
(if old |
(if old |
939 |
(save-excursion |
(save-excursion |
976 |
"\\(" dabbrev--abbrev-char-regexp "\\)")) |
"\\(" dabbrev--abbrev-char-regexp "\\)")) |
977 |
(pattern2 (concat (regexp-quote abbrev) |
(pattern2 (concat (regexp-quote abbrev) |
978 |
"\\(\\(" dabbrev--abbrev-char-regexp "\\)+\\)")) |
"\\(\\(" dabbrev--abbrev-char-regexp "\\)+\\)")) |
979 |
|
;; This makes it possible to find matches in minibuffer prompts |
980 |
|
;; even when they are "inviolable". |
981 |
|
(inhibit-point-motion-hooks t) |
982 |
found-string result) |
found-string result) |
983 |
;; Limited search. |
;; Limited search. |
984 |
(save-restriction |
(save-restriction |