diff options
| author | Stefan Monnier | 2014-01-03 00:10:52 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2014-01-03 00:10:52 -0500 |
| commit | 6ef9aed822746c3daf05313bbc0df7dfa9f08171 (patch) | |
| tree | b42191162a4053a09b5a7f7e8ac150c8009efa32 | |
| parent | 6f5475834a0862e93f9d6175bb1c4a56c287b93c (diff) | |
| download | emacs-6ef9aed822746c3daf05313bbc0df7dfa9f08171.tar.gz emacs-6ef9aed822746c3daf05313bbc0df7dfa9f08171.zip | |
* lisp/ielm.el (ielm-tab): Retarget.
(ielm-map): Use ielm-tab for tab.
(ielm-complete-filename): Use comint-filename-completion.
(ielm-complete-symbol): Remove.
(inferior-emacs-lisp-mode): Use lisp-completion-at-point instead and
remove ielm-tab from completion-at-point-functions.
Fixes: debbugs:16224
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/ielm.el | 39 |
2 files changed, 18 insertions, 28 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4246fb3a535..1ef042ede2a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2014-01-03 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2014-01-03 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * ielm.el (ielm-tab): Retarget. | ||
| 4 | (ielm-map): Use ielm-tab for tab. | ||
| 5 | (ielm-complete-filename): Use comint-filename-completion. | ||
| 6 | (ielm-complete-symbol): Remove. | ||
| 7 | (inferior-emacs-lisp-mode): Use lisp-completion-at-point instead and | ||
| 8 | remove ielm-tab from completion-at-point-functions (bug#16224). | ||
| 9 | |||
| 3 | * emacs-lisp/pcase.el (pcase--split-equal, pcase--split-member): | 10 | * emacs-lisp/pcase.el (pcase--split-equal, pcase--split-member): |
| 4 | Beware signals raised by predicates (bug#16201). | 11 | Beware signals raised by predicates (bug#16201). |
| 5 | 12 | ||
diff --git a/lisp/ielm.el b/lisp/ielm.el index 83142257a58..c53f9e76d4e 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el | |||
| @@ -168,7 +168,7 @@ This variable is buffer-local.") | |||
| 168 | 168 | ||
| 169 | (defvar ielm-map | 169 | (defvar ielm-map |
| 170 | (let ((map (make-sparse-keymap))) | 170 | (let ((map (make-sparse-keymap))) |
| 171 | (define-key map "\t" 'completion-at-point) | 171 | (define-key map "\t" 'ielm-tab) |
| 172 | (define-key map "\C-m" 'ielm-return) | 172 | (define-key map "\C-m" 'ielm-return) |
| 173 | (define-key map "\e\C-m" 'ielm-return-for-effect) | 173 | (define-key map "\e\C-m" 'ielm-return-for-effect) |
| 174 | (define-key map "\C-j" 'ielm-send-input) | 174 | (define-key map "\C-j" 'ielm-send-input) |
| @@ -201,36 +201,19 @@ This variable is buffer-local.") | |||
| 201 | 201 | ||
| 202 | ;;; Completion stuff | 202 | ;;; Completion stuff |
| 203 | 203 | ||
| 204 | (defun ielm-tab nil | 204 | (defun ielm-tab () |
| 205 | "Possibly indent the current line as Lisp code." | 205 | "Indent or complete." |
| 206 | (interactive) | 206 | (interactive) |
| 207 | (when (or (eq (preceding-char) ?\n) | 207 | (if (or (eq (preceding-char) ?\n) |
| 208 | (eq (char-syntax (preceding-char)) ?\s)) | 208 | (eq (char-syntax (preceding-char)) ?\s)) |
| 209 | (ielm-indent-line) | 209 | (ielm-indent-line) |
| 210 | t)) | 210 | (completion-at-point))) |
| 211 | 211 | ||
| 212 | (defun ielm-complete-symbol nil | ||
| 213 | "Complete the Lisp symbol before point." | ||
| 214 | ;; A wrapper for completion-at-point that returns non-nil if | ||
| 215 | ;; completion has occurred | ||
| 216 | (let* ((btick (buffer-modified-tick)) | ||
| 217 | (cbuffer (get-buffer "*Completions*")) | ||
| 218 | (ctick (and cbuffer (buffer-modified-tick cbuffer))) | ||
| 219 | (completion-at-point-functions '(lisp-completion-at-point))) | ||
| 220 | (completion-at-point) | ||
| 221 | ;; completion has occurred if: | ||
| 222 | (or | ||
| 223 | ;; the buffer has been modified | ||
| 224 | (not (= btick (buffer-modified-tick))) | ||
| 225 | ;; a completions buffer has been modified or created | ||
| 226 | (if cbuffer | ||
| 227 | (not (= ctick (buffer-modified-tick cbuffer))) | ||
| 228 | (get-buffer "*Completions*"))))) | ||
| 229 | 212 | ||
| 230 | (defun ielm-complete-filename nil | 213 | (defun ielm-complete-filename nil |
| 231 | "Dynamically complete filename before point, if in a string." | 214 | "Dynamically complete filename before point, if in a string." |
| 232 | (when (nth 3 (parse-partial-sexp comint-last-input-start (point))) | 215 | (when (nth 3 (parse-partial-sexp comint-last-input-start (point))) |
| 233 | (comint-dynamic-complete-filename))) | 216 | (comint-filename-completion))) |
| 234 | 217 | ||
| 235 | (defun ielm-indent-line nil | 218 | (defun ielm-indent-line nil |
| 236 | "Indent the current line as Lisp code if it is not a prompt line." | 219 | "Indent the current line as Lisp code if it is not a prompt line." |
| @@ -557,8 +540,8 @@ Customized bindings may be defined in `ielm-map', which currently contains: | |||
| 557 | (setq comint-input-sender 'ielm-input-sender) | 540 | (setq comint-input-sender 'ielm-input-sender) |
| 558 | (setq comint-process-echoes nil) | 541 | (setq comint-process-echoes nil) |
| 559 | (set (make-local-variable 'completion-at-point-functions) | 542 | (set (make-local-variable 'completion-at-point-functions) |
| 560 | '(ielm-tab comint-replace-by-expanded-history | 543 | '(comint-replace-by-expanded-history |
| 561 | ielm-complete-filename ielm-complete-symbol)) | 544 | ielm-complete-filename lisp-completion-at-point)) |
| 562 | (set (make-local-variable 'ielm-prompt-internal) ielm-prompt) | 545 | (set (make-local-variable 'ielm-prompt-internal) ielm-prompt) |
| 563 | (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only) | 546 | (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only) |
| 564 | (setq comint-get-old-input 'ielm-get-old-input) | 547 | (setq comint-get-old-input 'ielm-get-old-input) |