Comments on InteractivelyDoThings

Add your comment here. I’m using Distel for my erlang development but the function that is used for completion is printing its output in an ibuffer. I would like to get it in the minibuffer with ido support instead, does anyone know of a way to do it?

Here is the code:

(defun erl-complete (node)
  "Complete the module or remote function name at point."
  (interactive (list (erl-target-node)))
  (let ((win (get-buffer-window "*Completions*" 0)))
    (if win (with-selected-window win (bury-buffer))))
  (let ((end (point))
	(beg (ignore-errors 
	       (save-excursion (backward-sexp 1)
			       ;; FIXME: see erl-goto-end-of-call-name
			       (when (eql (char-before) ?:)
				 (backward-sexp 1))
			       (point)))))
    (when beg
      (let* ((str (buffer-substring-no-properties beg end))
	     (buf (current-buffer))
	     (continuing (equal last-command (cons 'erl-complete str))))
	(setq this-command (cons 'erl-complete str))
	(if (string-match "^\\(.*\\):\\(.*\\)$" str)
	    ;; completing function in module:function
	    (let ((mod (intern (match-string 1 str)))
		  (pref (match-string 2 str))
		  (beg (+ beg (match-beginning 2))))
	      (erl-spawn
		(erl-send-rpc node 'distel 'functions (list mod pref))
		(&erl-receive-completions "function" beg end pref buf
					  continuing
					  #'erl-complete-sole-function)))
	  ;; completing just a module
	  (erl-spawn
	    (erl-send-rpc node 'distel 'modules (list str))
	    (&erl-receive-completions "module" beg end str buf continuing
				      #'erl-complete-sole-module)))))))

(defun &erl-receive-completions (what beg end prefix buf continuing sole)
  (let ((state (erl-async-state buf)))
    (erl-receive (what state beg end prefix buf continuing sole)
	((['rex ['ok completions]]
	  (when (equal state (erl-async-state buf))
	    (with-current-buffer buf
	      (erl-complete-thing what continuing beg end prefix
				  completions sole))))
	 (['rex ['error reason]]
	  (message "Error: %s" reason))
	 (other
	  (message "Unexpected reply: %S" other))))))

SpaceOgre 2013-06-18 12:28 UTC


if i want to open a file by filename ,this is my way:” C-x C-f M-s” in vim i doit by “,p” (command-t) or “ ‘p “ (CtrlP)

yxsongbo 2014-03-01 02:52 UTC


Is there a way to open all files in a directory with ido?

MathiasCiarlo 2015-11-01 17:16 UTC


Moving from emacs 24.3 to emacs 24.4, I get errors while exiting emacs because saving .ido.history fails.

Attached is the trace. Not sure if much can be gleaned from it, but would appreciate any help.

Debugger entered--Lisp error: (wrong-type-argument listp 436)
  #[0 "\302	\300\242@\"\207" [(436) buffer-file-name set-file-modes] 3 "\n\n(fn)"]()
  funcall(#[0 "\302	\300\242@\"\207" [(436) buffer-file-name set-file-modes] 3 "\n\n(fn)"])
  #[0 "\302\303\304\305\306\307\310\300!\311\"\312\313%D\314\303\315\302EDC\217?\205\" \316	\300\242A@\"\207" [(436) buffer-file-name err funcall make-byte-code 0 "\302	\300\242@\"\207" vconcat vector [buffer-file-name set-file-modes] 3 "\n\n(fn)" (debug error) #[257 "\300\301 \"\210\302\207" [message "Error: %S" nil] 4 "\n\n(fn ERR)"] set-file-extended-attributes] 8 "\n\n(fn)"]()
  funcall(#[0 "\302\303\304\305\306\307\310\300!\311\"\312\313%D\314\303\315\302EDC\217?\205\" \316	\300\242A@\"\207" [(436) buffer-file-name err funcall make-byte-code 0 "\302	\300\242@\"\207" vconcat vector [buffer-file-name set-file-modes] 3 "\n\n(fn)" (debug error) #[257 "\300\301 \"\210\302\207" [message "Error: %S" nil] 4 "\n\n(fn ERR)"] set-file-extended-attributes] 8 "\n\n(fn)"])
  basic-save-buffer()
  save-buffer()
  write-file("/home/amit/.ido.last" nil)
  ido-save-history()
  ido-kill-emacs-hook()
  kill-emacs()
  save-buffers-kill-emacs(nil)
  save-buffers-kill-terminal(nil)
  #<subr call-interactively>(save-buffers-kill-terminal nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> save-buffers-kill-terminal nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (save-buffers-kill-terminal nil nil))
  call-interactively(save-buffers-kill-terminal nil nil)
  command-execute(save-buffers-kill-terminal)

– Anonymous 2016-01-27 00:33 UTC


I’d probably use Edebug and instrument ‘basic-save-buffer’ in order to get an idea of what the byte code up there is trying to do.

AlexSchroeder 2016-01-27 15:00 UTC


Please make sure you contribute only your own work. IP numbers are made available via the page history. If you want to keep it a secret, you need to use Tor. See TextFormattingRules for how to format text. See StyleGuide for the suggested writing style on this wiki.

To save this page you must answer this question:

What is the greatest editor out there?