Mercurial > emacs
comparison lisp/completion.el @ 91010:aaccdab0ee26
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 852-856)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 93-96)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 245)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-249
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 21 Aug 2007 04:54:03 +0000 |
parents | f55f9811f5d7 21f3916083ec |
children | 14c4a6aac623 |
comparison
equal
deleted
inserted
replaced
91009:e7395a700642 | 91010:aaccdab0ee26 |
---|---|
566 ;; Return completion if the length is reasonable. | 566 ;; Return completion if the length is reasonable. |
567 (if (and (<= completion-min-length | 567 (if (and (<= completion-min-length |
568 (- cmpl-symbol-end cmpl-symbol-start)) | 568 (- cmpl-symbol-end cmpl-symbol-start)) |
569 (<= (- cmpl-symbol-end cmpl-symbol-start) | 569 (<= (- cmpl-symbol-end cmpl-symbol-start) |
570 completion-max-length)) | 570 completion-max-length)) |
571 (buffer-substring cmpl-symbol-start cmpl-symbol-end)))))) | 571 (buffer-substring-no-properties |
572 cmpl-symbol-start cmpl-symbol-end)))))) | |
572 | 573 |
573 ;; tests for symbol-under-point | 574 ;; tests for symbol-under-point |
574 ;; `^' indicates cursor pos. where value is returned | 575 ;; `^' indicates cursor pos. where value is returned |
575 ;; simple-word-test | 576 ;; simple-word-test |
576 ;; ^^^^^^^^^^^^^^^^ --> simple-word-test | 577 ;; ^^^^^^^^^^^^^^^^ --> simple-word-test |
599 (setq cmpl-symbol-start (point)) | 600 (setq cmpl-symbol-start (point)) |
600 (goto-char cmpl-symbol-end))) | 601 (goto-char cmpl-symbol-end))) |
601 ;; Return value if long enough. | 602 ;; Return value if long enough. |
602 (if (>= cmpl-symbol-end | 603 (if (>= cmpl-symbol-end |
603 (+ cmpl-symbol-start completion-min-length)) | 604 (+ cmpl-symbol-start completion-min-length)) |
604 (buffer-substring cmpl-symbol-start cmpl-symbol-end))) | 605 (buffer-substring-no-properties |
606 cmpl-symbol-start cmpl-symbol-end))) | |
605 ((= cmpl-preceding-syntax ?w) | 607 ((= cmpl-preceding-syntax ?w) |
606 ;; chars to ignore at end | 608 ;; chars to ignore at end |
607 (let ((saved-point (point))) | 609 (let ((saved-point (point))) |
608 (setq cmpl-symbol-start (scan-sexps saved-point -1)) | 610 (setq cmpl-symbol-start (scan-sexps saved-point -1)) |
609 ;; take off chars. from end | 611 ;; take off chars. from end |
619 ;; Return completion if the length is reasonable | 621 ;; Return completion if the length is reasonable |
620 (if (and (<= completion-min-length | 622 (if (and (<= completion-min-length |
621 (- cmpl-symbol-end cmpl-symbol-start)) | 623 (- cmpl-symbol-end cmpl-symbol-start)) |
622 (<= (- cmpl-symbol-end cmpl-symbol-start) | 624 (<= (- cmpl-symbol-end cmpl-symbol-start) |
623 completion-max-length)) | 625 completion-max-length)) |
624 (buffer-substring cmpl-symbol-start cmpl-symbol-end))))))) | 626 (buffer-substring-no-properties |
627 cmpl-symbol-start cmpl-symbol-end))))))) | |
625 | 628 |
626 ;; tests for symbol-before-point | 629 ;; tests for symbol-before-point |
627 ;; `^' indicates cursor pos. where value is returned | 630 ;; `^' indicates cursor pos. where value is returned |
628 ;; simple-word-test | 631 ;; simple-word-test |
629 ;; ^ --> nil | 632 ;; ^ --> nil |
668 ;; Return completion if the length is reasonable. | 671 ;; Return completion if the length is reasonable. |
669 (if (and (<= completion-prefix-min-length | 672 (if (and (<= completion-prefix-min-length |
670 (- cmpl-symbol-end cmpl-symbol-start)) | 673 (- cmpl-symbol-end cmpl-symbol-start)) |
671 (<= (- cmpl-symbol-end cmpl-symbol-start) | 674 (<= (- cmpl-symbol-end cmpl-symbol-start) |
672 completion-max-length)) | 675 completion-max-length)) |
673 (buffer-substring cmpl-symbol-start cmpl-symbol-end)))))) | 676 (buffer-substring-no-properties |
677 cmpl-symbol-start cmpl-symbol-end)))))) | |
674 | 678 |
675 ;; tests for symbol-before-point-for-complete | 679 ;; tests for symbol-before-point-for-complete |
676 ;; `^' indicates cursor pos. where value is returned | 680 ;; `^' indicates cursor pos. where value is returned |
677 ;; simple-word-test | 681 ;; simple-word-test |
678 ;; ^ --> nil | 682 ;; ^ --> nil |