diff options
| author | Glenn Morris | 2007-03-29 03:24:36 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-03-29 03:24:36 +0000 |
| commit | 660fd6fb69c669aa2f4db42e72a93af2ffacb1db (patch) | |
| tree | 8fa71093b7a03378da4b7815289a335c2a97d371 | |
| parent | aae26e176f22223be91ca251f5ee3762b8b2c79c (diff) | |
| download | emacs-660fd6fb69c669aa2f4db42e72a93af2ffacb1db.tar.gz emacs-660fd6fb69c669aa2f4db42e72a93af2ffacb1db.zip | |
(partial-completion-mode): Set PC-do-completion-end to nil after use.
(PC-lisp-complete-symbol): Create and use a marker at `end',
rather than using point-marker.
| -rw-r--r-- | lisp/complete.el | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/complete.el b/lisp/complete.el index e0ed2e49010..1cdff0d9acd 100644 --- a/lisp/complete.el +++ b/lisp/complete.el | |||
| @@ -244,7 +244,9 @@ second TAB brings up the `*Completions*' buffer." | |||
| 244 | (lambda (choice buffer mini-p base-size) | 244 | (lambda (choice buffer mini-p base-size) |
| 245 | (if mini-p (goto-char (point-max)) | 245 | (if mini-p (goto-char (point-max)) |
| 246 | ;; Need a similar hack for the non-minibuffer-case -- gm. | 246 | ;; Need a similar hack for the non-minibuffer-case -- gm. |
| 247 | (if PC-do-completion-end (goto-char PC-do-completion-end))) | 247 | (when PC-do-completion-end |
| 248 | (goto-char PC-do-completion-end) | ||
| 249 | (setq PC-do-completion-end nil))) | ||
| 248 | nil)) | 250 | nil)) |
| 249 | ;; Build the env-completion and mapping table. | 251 | ;; Build the env-completion and mapping table. |
| 250 | (when (and partial-completion-mode (null PC-env-vars-alist)) | 252 | (when (and partial-completion-mode (null PC-env-vars-alist)) |
| @@ -820,6 +822,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 820 | (setq quit-flag nil | 822 | (setq quit-flag nil |
| 821 | unread-command-events '(7)))))))) | 823 | unread-command-events '(7)))))))) |
| 822 | 824 | ||
| 825 | ;; Does not need to be buffer-local (?) because only used when one | ||
| 826 | ;; PC-l-c-s immediately follows another. | ||
| 823 | (defvar PC-lisp-complete-end nil | 827 | (defvar PC-lisp-complete-end nil |
| 824 | "Internal variable used by `PC-lisp-complete-symbol'.") | 828 | "Internal variable used by `PC-lisp-complete-symbol'.") |
| 825 | 829 | ||
| @@ -834,6 +838,12 @@ Otherwise, all symbols with function definitions, values | |||
| 834 | or properties are considered." | 838 | or properties are considered." |
| 835 | (interactive) | 839 | (interactive) |
| 836 | (let* ((end (point)) | 840 | (let* ((end (point)) |
| 841 | ;; To complete the word under point, rather than just the portion | ||
| 842 | ;; before point, use this: | ||
| 843 | ;;; (save-excursion | ||
| 844 | ;;; (with-syntax-table lisp-mode-syntax-table | ||
| 845 | ;;; (forward-sexp 1) | ||
| 846 | ;;; (point)))) | ||
| 837 | (beg (save-excursion | 847 | (beg (save-excursion |
| 838 | (with-syntax-table lisp-mode-syntax-table | 848 | (with-syntax-table lisp-mode-syntax-table |
| 839 | (backward-sexp 1) | 849 | (backward-sexp 1) |
| @@ -877,8 +887,9 @@ or properties are considered." | |||
| 877 | ;; the same way as beg. That would change the behaviour though. | 887 | ;; the same way as beg. That would change the behaviour though. |
| 878 | (if (equal last-command 'PC-lisp-complete-symbol) | 888 | (if (equal last-command 'PC-lisp-complete-symbol) |
| 879 | (PC-do-completion nil beg PC-lisp-complete-end) | 889 | (PC-do-completion nil beg PC-lisp-complete-end) |
| 880 | (setq PC-lisp-complete-end (point-marker)) | 890 | (if PC-lisp-complete-end |
| 881 | (set-marker-insertion-type PC-lisp-complete-end t) | 891 | (move-marker PC-lisp-complete-end end) |
| 892 | (setq PC-lisp-complete-end (copy-marker end t))) | ||
| 882 | (PC-do-completion nil beg end)))) | 893 | (PC-do-completion nil beg end)))) |
| 883 | 894 | ||
| 884 | (defun PC-complete-as-file-name () | 895 | (defun PC-complete-as-file-name () |