aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/progmodes/etags.el19
-rw-r--r--lisp/progmodes/meta-mode.el29
3 files changed, 10 insertions, 40 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 002a04641b7..915ad94959f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12009-11-25 Stefan Monnier <monnier@iro.umontreal.ca> 12009-11-25 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * progmodes/meta-mode.el (meta-complete-symbol):
4 * progmodes/etags.el (complete-tag):
3 * mail/mailabbrev.el (mail-abbrev-complete-alias): 5 * mail/mailabbrev.el (mail-abbrev-complete-alias):
4 Use completion-in-region. 6 Use completion-in-region.
5 7
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index f3c37916330..2893fdfb766 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2047,28 +2047,13 @@ for \\[find-tag] (which see)."
2047 (get major-mode 'find-tag-default-function) 2047 (get major-mode 'find-tag-default-function)
2048 'find-tag-default))) 2048 'find-tag-default)))
2049 (comp-table (tags-lazy-completion-table)) 2049 (comp-table (tags-lazy-completion-table))
2050 beg 2050 beg)
2051 completion)
2052 (or pattern 2051 (or pattern
2053 (error "Nothing to complete")) 2052 (error "Nothing to complete"))
2054 (search-backward pattern) 2053 (search-backward pattern)
2055 (setq beg (point)) 2054 (setq beg (point))
2056 (forward-char (length pattern)) 2055 (forward-char (length pattern))
2057 (setq completion (try-completion pattern comp-table)) 2056 (completion-in-region beg (point) comp-table)))
2058 (cond ((eq completion t))
2059 ((null completion)
2060 (message "Can't find completion for \"%s\"" pattern)
2061 (ding))
2062 ((not (string= pattern completion))
2063 (delete-region beg (point))
2064 (insert completion))
2065 (t
2066 (message "Making completion list...")
2067 (with-output-to-temp-buffer "*Completions*"
2068 (display-completion-list
2069 (all-completions pattern comp-table nil)
2070 pattern))
2071 (message "Making completion list...%s" "done")))))
2072 2057
2073(dolist (x '("^No tags table in use; use .* to select one$" 2058(dolist (x '("^No tags table in use; use .* to select one$"
2074 "^There is no default tag$" 2059 "^There is no default tag$"
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index a52fd1d3d7e..ed6d87dcfae 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -487,29 +487,12 @@ If the list was changed, sort the list and remove duplicates first."
487 (close (nth 3 entry)) 487 (close (nth 3 entry))
488 (begin (match-beginning sub)) 488 (begin (match-beginning sub))
489 (end (match-end sub)) 489 (end (match-end sub))
490 (pattern (meta-match-buffer 0)) 490 (list (funcall (nth 2 entry))))
491 (symbol (buffer-substring begin end)) 491 (completion-in-region
492 (list (funcall (nth 2 entry))) 492 begin end
493 (completion (try-completion symbol list))) 493 (if (zerop (length close)) list
494 (cond ((eq completion t) 494 (apply-partially 'completion-table-with-terminator
495 (and close 495 close list))))
496 (not (looking-at (regexp-quote close)))
497 (insert close)))
498 ((null completion)
499 (error "Can't find completion for \"%s\"" pattern))
500 ((not (string-equal symbol completion))
501 (delete-region begin end)
502 (insert completion)
503 (and close
504 (eq (try-completion completion list) t)
505 (not (looking-at (regexp-quote close)))
506 (insert close)))
507 (t
508 (message "Making completion list...")
509 (let ((list (all-completions symbol list nil)))
510 (with-output-to-temp-buffer "*Completions*"
511 (display-completion-list list symbol)))
512 (message "Making completion list... done"))))
513 (funcall (nth 1 entry))))) 496 (funcall (nth 1 entry)))))
514 497
515 498