[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

function `expand-command-name'

From: sen_ml
Subject: function `expand-command-name'
Date: Sat, 10 Nov 2001 23:46:55 +0900 (JST)

I was writing some code the other day and found it helpful to have a
function to expand a command name to its full-path -- somewhat like
`expand-file-name'.  I didn't manage to locate a function that does
this already so I wrote one.  Is there already something like this?

Below is one implementation:

(defun expand-command-name (name)
  "Expand command NAME to a full-path filename by searching `exec-path'."
  (let ((paths exec-path)
    (while (and paths (not path))
      (setq path (file-name-completion name (car paths)))
      (if path
          (setq full-path (concat (car paths) "/" name)))
      (setq paths (cdr paths)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]