Mercurial > emacs
diff lisp/dabbrev.el @ 89909:68c22ea6027c
Sync to HEAD
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 16 Apr 2004 12:51:06 +0000 |
parents | 375f2633d815 |
children | 4c90ffeb71c5 |
line wrap: on
line diff
--- a/lisp/dabbrev.el Thu Apr 15 01:08:34 2004 +0000 +++ b/lisp/dabbrev.el Fri Apr 16 12:51:06 2004 +0000 @@ -1,6 +1,6 @@ ;;; dabbrev.el --- dynamic abbreviation package -;; Copyright (C) 1985, 86, 92, 94, 96, 1997, 2000, 01, 2003 +;; Copyright (C) 1985, 86, 92, 94, 96, 1997, 2000, 01, 03, 2004 ;; Free Software Foundation, Inc. ;; Author: Don Morrison @@ -529,7 +529,7 @@ ;; Take the following word, with intermediate separators, ;; as our expansion this time. (re-search-forward - (concat "\\(\\(" dabbrev--abbrev-char-regexp "\\)+\\)")) + (concat "\\(?:" dabbrev--abbrev-char-regexp "\\)+")) (setq expansion (buffer-substring-no-properties dabbrev--last-expansion-location (point))) @@ -793,10 +793,7 @@ ;; Walk through the buffers till we find a match. (let (expansion) (while (and (not expansion) dabbrev--friend-buffer-list) - (setq dabbrev--last-buffer - (car dabbrev--friend-buffer-list)) - (setq dabbrev--friend-buffer-list - (cdr dabbrev--friend-buffer-list)) + (setq dabbrev--last-buffer (pop dabbrev--friend-buffer-list)) (set-buffer dabbrev--last-buffer) (dabbrev--scanning-message) (setq dabbrev--last-expansion-location (point-min)) @@ -851,7 +848,8 @@ (defun dabbrev--safe-replace-match (string &optional fixedcase literal) (if (eq major-mode 'picture-mode) - (picture-replace-match string fixedcase literal) + (with-no-warnings + (picture-replace-match string fixedcase literal)) (replace-match string fixedcase literal))) ;;;---------------------------------------------------------------- @@ -999,8 +997,7 @@ nil ;; We have a truly valid match. Find the end. (re-search-forward pattern2) - (setq found-string (buffer-substring-no-properties - (match-beginning 0) (match-end 0))) + (setq found-string (match-string-no-properties 0)) (setq result found-string) (and ignore-case (setq found-string (downcase found-string))) ;; Ignore this match if it's already in the table. @@ -1009,9 +1006,7 @@ (string= found-string table-string)) (setq found-string nil))) ;; Prepare to continue searching. - (if reverse - (goto-char (match-beginning 0)) - (goto-char (match-end 0)))) + (goto-char (if reverse (match-beginning 0) (match-end 0)))) ;; If we found something, use it. (when found-string ;; Put it into `dabbrev--last-table' @@ -1027,4 +1022,5 @@ (provide 'dabbrev) +;;; arch-tag: 29e58596-f080-4306-a409-70296cf9d46f ;;; dabbrev.el ends here