X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/412f24b9ddf1e07022f8c5fe05f0717f130c4c02..0d8863b3b1829f8e53da8dff9ffc2dab60390da6:/lisp/eshell/em-alias.el diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index 4e1dbd4104..210d71be9c 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el @@ -1,6 +1,6 @@ -;;; em-alias.el --- creation and management of command aliases +;;; em-alias.el --- creation and management of command aliases -*- lexical-binding:t -*- -;; Copyright (C) 1999-2011 Free Software Foundation, Inc. +;; Copyright (C) 1999-2013 Free Software Foundation, Inc. ;; Author: John Wiegley @@ -74,7 +74,7 @@ ;; session, it is likely that they are experiencing a spelling ;; difficulty associated with a certain command. To combat this, ;; Eshell will offer to automatically define an alias for that -;; mispelled command, once a given tolerance threshold has been +;; misspelled command, once a given tolerance threshold has been ;; reached. ;; Whenever the same bad command name is encountered @@ -90,16 +90,15 @@ ;;; Code: -(eval-when-compile - (require 'esh-util)) (require 'eshell) ;;;###autoload -(eshell-defgroup eshell-alias nil +(progn +(defgroup eshell-alias nil "Command aliases allow for easy definition of alternate commands." :tag "Command aliases" ;; :link '(info-link "(eshell)Command aliases") - :group 'eshell-module) + :group 'eshell-module)) (defcustom eshell-aliases-file (expand-file-name "alias" eshell-directory-name) "The file in which aliases are kept. @@ -132,10 +131,10 @@ Each element of this alias is a list of the form: Where NAME is the textual name of the alias, and DEFINITION is the command string to replace that command with. -Note: this list should not be modified in your '.emacs' file. Rather, -any desired alias definitions should be declared using the `alias' -command, which will automatically write them to the file named by -`eshell-aliases-file'.") +Note: this list should not be modified in your init file. +Rather, any desired alias definitions should be declared using +the `alias' command, which will automatically write them to the +file named by `eshell-aliases-file'.") (put 'eshell-command-aliases-list 'risky-local-variable t) @@ -222,18 +221,11 @@ command, which will automatically write them to the file named by (let ((alias (eshell-lookup-alias command))) (if alias (throw 'eshell-replace-command - (list - 'let - (list - (list 'eshell-command-name - (list 'quote eshell-last-command-name)) - (list 'eshell-command-arguments - (list 'quote eshell-last-arguments)) - (list 'eshell-prevent-alias-expansion - (list 'quote - (cons command - eshell-prevent-alias-expansion)))) - (eshell-parse-command (nth 1 alias)))))))) + `(let ((eshell-command-name ',eshell-last-command-name) + (eshell-command-arguments ',eshell-last-arguments) + (eshell-prevent-alias-expansion + ',(cons command eshell-prevent-alias-expansion))) + ,(eshell-parse-command (nth 1 alias)))))))) (defun eshell-alias-completions (name) "Find all possible completions for NAME.