/[emacs]/emacs/lisp/dabbrev.el
ViewVC logotype

Diff of /emacs/lisp/dabbrev.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.64 by rms, Tue May 14 19:45:09 2002 UTC revision 1.64.2.1 by miles, Fri Apr 4 06:20:01 2003 UTC
# Line 751  DIRECTION = 0 means try both backward an Line 751  DIRECTION = 0 means try both backward an
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,
# Line 921  to record whether we upcased the expansi Line 921  to record whether we upcased the expansi
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
# Line 972  Leaves point at the location of the star Line 976  Leaves point at the location of the star
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

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.64.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26