/[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.2.4 by miles, Tue Apr 27 14:08:29 2004 UTC revision 1.64.2.5 by miles, Wed Dec 8 23:31:42 2004 UTC
# Line 516  See also `dabbrev-abbrev-char-regexp' an Line 516  See also `dabbrev-abbrev-char-regexp' an
516                ;; The "abbrev" to expand is just the space.                ;; The "abbrev" to expand is just the space.
517                (setq abbrev " ")                (setq abbrev " ")
518                (save-excursion                (save-excursion
519                  (if dabbrev--last-buffer                  (save-restriction
520                      (set-buffer dabbrev--last-buffer))                    (widen)
521                  ;; Find the end of the last "expansion" word.                    (if dabbrev--last-buffer
522                  (if (or (eq dabbrev--last-direction 1)                        (set-buffer dabbrev--last-buffer))
523                          (and (eq dabbrev--last-direction 0)                    ;; Find the end of the last "expansion" word.
524                               (< dabbrev--last-expansion-location (point))))                    (if (or (eq dabbrev--last-direction 1)
525                      (setq dabbrev--last-expansion-location                            (and (eq dabbrev--last-direction 0)
526                            (+ dabbrev--last-expansion-location                                 (< dabbrev--last-expansion-location (point))))
527                               (length dabbrev--last-expansion))))                        (setq dabbrev--last-expansion-location
528                  (goto-char dabbrev--last-expansion-location)                              (+ dabbrev--last-expansion-location
529                  ;; Take the following word, with intermediate separators,                                 (length dabbrev--last-expansion))))
530                  ;; as our expansion this time.                    (goto-char dabbrev--last-expansion-location)
531                  (re-search-forward                    ;; Take the following word, with intermediate separators,
532                   (concat "\\(?:" dabbrev--abbrev-char-regexp "\\)+"))                    ;; as our expansion this time.
533                  (setq expansion (buffer-substring-no-properties                    (re-search-forward
534                                   dabbrev--last-expansion-location (point)))                     (concat "\\(?:" dabbrev--abbrev-char-regexp "\\)+"))
535                      (setq expansion (buffer-substring-no-properties
536                                       dabbrev--last-expansion-location (point)))
537    
538                  ;; Record the end of this expansion, in case we repeat this.                    ;; Record the end of this expansion, in case we repeat this.
539                  (setq dabbrev--last-expansion-location (point)))                    (setq dabbrev--last-expansion-location (point))))
540                ;; Indicate that dabbrev--last-expansion-location is                ;; Indicate that dabbrev--last-expansion-location is
541                ;; at the end of the expansion.                ;; at the end of the expansion.
542                (setq dabbrev--last-direction -1))                (setq dabbrev--last-direction -1))

Legend:
Removed from v.1.64.2.4  
changed lines
  Added in v.1.64.2.5

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