]> code.delx.au - gnu-emacs/commitdiff
* lisp/ielm.el (ielm-tab): Retarget.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 3 Jan 2014 05:10:52 +0000 (00:10 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 3 Jan 2014 05:10:52 +0000 (00:10 -0500)
(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
lisp/ChangeLog
lisp/ielm.el

index 4246fb3a535a9e495bdb443bfec428398c008677..1ef042ede2aac97bb5e70ed94bf6f4f84e792e3b 100644 (file)
@@ -1,5 +1,12 @@
 2014-01-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * 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 (bug#16224).
+
        * emacs-lisp/pcase.el (pcase--split-equal, pcase--split-member):
        Beware signals raised by predicates (bug#16201).
 
index 83142257a58c08e39725b46401951c4a43376d0b..c53f9e76d4e55271b398c51c1335a4fd4792ab06 100644 (file)
@@ -168,7 +168,7 @@ This variable is buffer-local.")
 
 (defvar ielm-map
   (let ((map (make-sparse-keymap)))
-    (define-key map "\t" 'completion-at-point)
+    (define-key map "\t" 'ielm-tab)
     (define-key map "\C-m" 'ielm-return)
     (define-key map "\e\C-m" 'ielm-return-for-effect)
     (define-key map "\C-j" 'ielm-send-input)
@@ -201,36 +201,19 @@ This variable is buffer-local.")
 
 ;;; Completion stuff
 
-(defun ielm-tab nil
-  "Possibly indent the current line as Lisp code."
+(defun ielm-tab ()
+  "Indent or complete."
   (interactive)
-  (when (or (eq (preceding-char) ?\n)
-            (eq (char-syntax (preceding-char)) ?\s))
-    (ielm-indent-line)
-    t))
-
-(defun ielm-complete-symbol nil
-  "Complete the Lisp symbol before point."
-  ;; A wrapper for completion-at-point that returns non-nil if
-  ;; completion has occurred
-  (let* ((btick (buffer-modified-tick))
-         (cbuffer (get-buffer "*Completions*"))
-         (ctick (and cbuffer (buffer-modified-tick cbuffer)))
-         (completion-at-point-functions '(lisp-completion-at-point)))
-    (completion-at-point)
-     ;; completion has occurred if:
-    (or
-     ;; the buffer has been modified
-     (not (= btick (buffer-modified-tick)))
-     ;; a completions buffer has been modified or created
-     (if cbuffer
-         (not (= ctick (buffer-modified-tick cbuffer)))
-       (get-buffer "*Completions*")))))
+  (if (or (eq (preceding-char) ?\n)
+          (eq (char-syntax (preceding-char)) ?\s))
+      (ielm-indent-line)
+    (completion-at-point)))
+
 
 (defun ielm-complete-filename nil
   "Dynamically complete filename before point, if in a string."
   (when (nth 3 (parse-partial-sexp comint-last-input-start (point)))
-    (comint-dynamic-complete-filename)))
+    (comint-filename-completion)))
 
 (defun ielm-indent-line nil
   "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:
   (setq comint-input-sender 'ielm-input-sender)
   (setq comint-process-echoes nil)
   (set (make-local-variable 'completion-at-point-functions)
-       '(ielm-tab comint-replace-by-expanded-history
-         ielm-complete-filename ielm-complete-symbol))
+       '(comint-replace-by-expanded-history
+         ielm-complete-filename lisp-completion-at-point))
   (set (make-local-variable 'ielm-prompt-internal) ielm-prompt)
   (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only)
   (setq comint-get-old-input 'ielm-get-old-input)