[ESS] Re: Filename completion becomes object completion

Brahm, David David.Brahm at geodecapital.com
Wed May 4 20:54:49 CEST 2005


I believe I found the cause of my filename completion problem, also
reported by
Giovanni d'Ario on 3/17/05.  Prior to ESS version 5.2.4, ess-inf.el
contained:

  (setq comint-dynamic-complete-functions
	'(ess-complete-filename
	  ess-complete-object-name
	  comint-replace-by-expanded-history))

Note the trial order was: 1) filename, 2) object, 3) history.

In 5.2.4, this was replaced by a hook.  The ChangeLog comment is:

  2004-11-09  Stephen Eglen  <stephen at gnu.org>
	* ess-inf.el (inferior-ess-mode): Add elements to
	comint-dynamic-complete-functions using `add-hook' rather than
	`setq', on advice from Emacs developers.

The code became (line 1462 of ess-inf.el in 5.2.7):

  (add-hook 'comint-dynamic-complete-functions
	    'ess-complete-object-name nil 'local)
  (add-hook 'comint-dynamic-complete-functions
	     'comint-replace-by-expanded-history 'append 'local)
  (add-hook 'comint-dynamic-complete-functions
	    'ess-complete-filename 'append 'local)

If you ask for the variable value, you get:

  (ess-complete-object-name t comint-replace-by-expanded-history
   ess-complete-filename)

Note that the trial order of functions has changed!  It is now:
  1) object, 2) history, 3) filename
There's also a random "t" stuck in the middle; I don't know if it
matters.

The following code works better for me, restoring the original order:

  ;; Order rearranged by DB: try 1) filename, 2) object, 3) history:
  (add-hook 'comint-dynamic-complete-functions
	    'comint-replace-by-expanded-history nil 'local)
  (add-hook 'comint-dynamic-complete-functions
	    'ess-complete-object-name           nil 'local)
  (add-hook 'comint-dynamic-complete-functions
	    'ess-complete-filename              nil 'local)

Now the (local) value of the variable is:

  (ess-complete-filename ess-complete-object-name
     comint-replace-by-expanded-history t)

-- David Brahm (brahm at alum.mit.edu)




More information about the ESS-help mailing list