diff options
| author | Kenichi Handa | 2013-09-12 23:48:18 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2013-09-12 23:48:18 +0900 |
| commit | 56d968a488c68563c5eae8264b7d3adfee9dc684 (patch) | |
| tree | 712adf1c2f7e12ac9d169958ea63760ad42fc6ce /lisp/eshell | |
| parent | b5623270b6047528786d4550cebe0b228ecadb6b (diff) | |
| parent | 4dfa4b9bd944fa385b248b5b0b56e95979119420 (diff) | |
| download | emacs-56d968a488c68563c5eae8264b7d3adfee9dc684.tar.gz emacs-56d968a488c68563c5eae8264b7d3adfee9dc684.zip | |
merge trunk
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-alias.el | 17 | ||||
| -rw-r--r-- | lisp/eshell/em-glob.el | 5 | ||||
| -rw-r--r-- | lisp/eshell/em-ls.el | 38 | ||||
| -rw-r--r-- | lisp/eshell/em-pred.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/em-rebind.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/em-unix.el | 6 | ||||
| -rw-r--r-- | lisp/eshell/esh-arg.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/esh-cmd.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/esh-mode.el | 210 | ||||
| -rw-r--r-- | lisp/eshell/esh-opt.el | 59 | ||||
| -rw-r--r-- | lisp/eshell/esh-util.el | 10 | ||||
| -rw-r--r-- | lisp/eshell/esh-var.el | 128 | ||||
| -rw-r--r-- | lisp/eshell/eshell.el | 2 |
13 files changed, 228 insertions, 255 deletions
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index a46b48c01b3..9a9cc4cd567 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el | |||
| @@ -221,18 +221,11 @@ file named by `eshell-aliases-file'.") | |||
| 221 | (let ((alias (eshell-lookup-alias command))) | 221 | (let ((alias (eshell-lookup-alias command))) |
| 222 | (if alias | 222 | (if alias |
| 223 | (throw 'eshell-replace-command | 223 | (throw 'eshell-replace-command |
| 224 | (list | 224 | `(let ((eshell-command-name ',eshell-last-command-name) |
| 225 | 'let | 225 | (eshell-command-arguments ',eshell-last-arguments) |
| 226 | (list | 226 | (eshell-prevent-alias-expansion |
| 227 | (list 'eshell-command-name | 227 | ',(cons command eshell-prevent-alias-expansion))) |
| 228 | (list 'quote eshell-last-command-name)) | 228 | ,(eshell-parse-command (nth 1 alias)))))))) |
| 229 | (list 'eshell-command-arguments | ||
| 230 | (list 'quote eshell-last-arguments)) | ||
| 231 | (list 'eshell-prevent-alias-expansion | ||
| 232 | (list 'quote | ||
| 233 | (cons command | ||
| 234 | eshell-prevent-alias-expansion)))) | ||
| 235 | (eshell-parse-command (nth 1 alias)))))))) | ||
| 236 | 229 | ||
| 237 | (defun eshell-alias-completions (name) | 230 | (defun eshell-alias-completions (name) |
| 238 | "Find all possible completions for NAME. | 231 | "Find all possible completions for NAME. |
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index a58c7730ded..b5ca8119470 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el | |||
| @@ -180,6 +180,8 @@ interpretation." | |||
| 180 | (goto-char (1+ end)))))))))) | 180 | (goto-char (1+ end)))))))))) |
| 181 | 181 | ||
| 182 | (defvar eshell-glob-chars-regexp nil) | 182 | (defvar eshell-glob-chars-regexp nil) |
| 183 | (defvar eshell-glob-matches) | ||
| 184 | (defvar message-shown) | ||
| 183 | 185 | ||
| 184 | (defun eshell-glob-regexp (pattern) | 186 | (defun eshell-glob-regexp (pattern) |
| 185 | "Convert glob-pattern PATTERN to a regular expression. | 187 | "Convert glob-pattern PATTERN to a regular expression. |
| @@ -262,9 +264,6 @@ the form: | |||
| 262 | (error "No matches found: %s" glob) | 264 | (error "No matches found: %s" glob) |
| 263 | glob)))) | 265 | glob)))) |
| 264 | 266 | ||
| 265 | (defvar eshell-glob-matches) | ||
| 266 | (defvar message-shown) | ||
| 267 | |||
| 268 | ;; FIXME does this really need to abuse eshell-glob-matches, message-shown? | 267 | ;; FIXME does this really need to abuse eshell-glob-matches, message-shown? |
| 269 | (defun eshell-glob-entries (path globs &optional recurse-p) | 268 | (defun eshell-glob-entries (path globs &optional recurse-p) |
| 270 | "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil." | 269 | "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil." |
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 41db4cd03d1..3dee1adb58a 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el | |||
| @@ -268,6 +268,25 @@ scope during the evaluation of TEST-SEXP." | |||
| 268 | :type '(repeat (cons function face)) | 268 | :type '(repeat (cons function face)) |
| 269 | :group 'eshell-ls) | 269 | :group 'eshell-ls) |
| 270 | 270 | ||
| 271 | (defvar block-size) | ||
| 272 | (defvar dereference-links) | ||
| 273 | (defvar dir-literal) | ||
| 274 | (defvar error-func) | ||
| 275 | (defvar flush-func) | ||
| 276 | (defvar human-readable) | ||
| 277 | (defvar ignore-pattern) | ||
| 278 | (defvar insert-func) | ||
| 279 | (defvar listing-style) | ||
| 280 | (defvar numeric-uid-gid) | ||
| 281 | (defvar reverse-list) | ||
| 282 | (defvar show-all) | ||
| 283 | (defvar show-almost-all) | ||
| 284 | (defvar show-recursive) | ||
| 285 | (defvar show-size) | ||
| 286 | (defvar sort-method) | ||
| 287 | (defvar ange-cache) | ||
| 288 | (defvar dired-flag) | ||
| 289 | |||
| 271 | ;;; Functions: | 290 | ;;; Functions: |
| 272 | 291 | ||
| 273 | (defun eshell-ls-insert-directory | 292 | (defun eshell-ls-insert-directory |
| @@ -315,25 +334,6 @@ instead." | |||
| 315 | 334 | ||
| 316 | (put 'eshell/ls 'eshell-no-numeric-conversions t) | 335 | (put 'eshell/ls 'eshell-no-numeric-conversions t) |
| 317 | 336 | ||
| 318 | (defvar block-size) | ||
| 319 | (defvar dereference-links) | ||
| 320 | (defvar dir-literal) | ||
| 321 | (defvar error-func) | ||
| 322 | (defvar flush-func) | ||
| 323 | (defvar human-readable) | ||
| 324 | (defvar ignore-pattern) | ||
| 325 | (defvar insert-func) | ||
| 326 | (defvar listing-style) | ||
| 327 | (defvar numeric-uid-gid) | ||
| 328 | (defvar reverse-list) | ||
| 329 | (defvar show-all) | ||
| 330 | (defvar show-almost-all) | ||
| 331 | (defvar show-recursive) | ||
| 332 | (defvar show-size) | ||
| 333 | (defvar sort-method) | ||
| 334 | (defvar ange-cache) | ||
| 335 | (defvar dired-flag) | ||
| 336 | |||
| 337 | (declare-function eshell-glob-regexp "em-glob" (pattern)) | 337 | (declare-function eshell-glob-regexp "em-glob" (pattern)) |
| 338 | 338 | ||
| 339 | (defun eshell-do-ls (&rest args) | 339 | (defun eshell-do-ls (&rest args) |
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index 3a7f46ebe83..14d3020530f 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el | |||
| @@ -307,7 +307,7 @@ functions. PRED-FUNCS take a filename and return t if the test | |||
| 307 | succeeds; MOD-FUNCS take any string and preform a modification, | 307 | succeeds; MOD-FUNCS take any string and preform a modification, |
| 308 | returning the resultant string." | 308 | returning the resultant string." |
| 309 | (let (result negate follow preds mods) | 309 | (let (result negate follow preds mods) |
| 310 | (condition-case err | 310 | (condition-case nil |
| 311 | (while (not (eobp)) | 311 | (while (not (eobp)) |
| 312 | (let ((char (char-after))) | 312 | (let ((char (char-after))) |
| 313 | (cond | 313 | (cond |
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el index 341191fc62f..a526d590307 100644 --- a/lisp/eshell/em-rebind.el +++ b/lisp/eshell/em-rebind.el | |||
| @@ -218,7 +218,7 @@ lock it at that." | |||
| 218 | (cdar bindings)) | 218 | (cdar bindings)) |
| 219 | (setq bindings (cdr bindings))))) | 219 | (setq bindings (cdr bindings))))) |
| 220 | 220 | ||
| 221 | (defun eshell-delete-backward-char (n &optional killflag) | 221 | (defun eshell-delete-backward-char (n) |
| 222 | "Delete the last character, unless it's part of the output." | 222 | "Delete the last character, unless it's part of the output." |
| 223 | (interactive "P") | 223 | (interactive "P") |
| 224 | (let ((count (prefix-numeric-value n))) | 224 | (let ((count (prefix-numeric-value n))) |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index af54d875cb0..b9b1c1635a5 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -714,6 +714,8 @@ available..." | |||
| 714 | (goto-char (point-min)) | 714 | (goto-char (point-min)) |
| 715 | (resize-temp-buffer-window)))))) | 715 | (resize-temp-buffer-window)))))) |
| 716 | 716 | ||
| 717 | (defvar compilation-scroll-output) | ||
| 718 | |||
| 717 | (defun eshell-grep (command args &optional maybe-use-occur) | 719 | (defun eshell-grep (command args &optional maybe-use-occur) |
| 718 | "Generic service function for the various grep aliases. | 720 | "Generic service function for the various grep aliases. |
| 719 | It calls Emacs's grep utility if the command is not redirecting output, | 721 | It calls Emacs's grep utility if the command is not redirecting output, |
| @@ -989,7 +991,7 @@ Show wall-clock time elapsed during execution of COMMAND.") | |||
| 989 | (setq args nil) | 991 | (setq args nil) |
| 990 | (setcdr (last args 3) nil)) | 992 | (setcdr (last args 3) nil)) |
| 991 | (with-current-buffer | 993 | (with-current-buffer |
| 992 | (condition-case err | 994 | (condition-case nil |
| 993 | (diff-no-select | 995 | (diff-no-select |
| 994 | old new | 996 | old new |
| 995 | (nil-blank-string (eshell-flatten-and-stringify args))) | 997 | (nil-blank-string (eshell-flatten-and-stringify args))) |
| @@ -1014,6 +1016,8 @@ Show wall-clock time elapsed during execution of COMMAND.") | |||
| 1014 | 1016 | ||
| 1015 | (put 'eshell/diff 'eshell-no-numeric-conversions t) | 1017 | (put 'eshell/diff 'eshell-no-numeric-conversions t) |
| 1016 | 1018 | ||
| 1019 | (defvar locate-history-list) | ||
| 1020 | |||
| 1017 | (defun eshell/locate (&rest args) | 1021 | (defun eshell/locate (&rest args) |
| 1018 | "Alias \"locate\" to call Emacs `locate' function." | 1022 | "Alias \"locate\" to call Emacs `locate' function." |
| 1019 | (if (or eshell-plain-locate-behavior | 1023 | (if (or eshell-plain-locate-behavior |
diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index d7dfd27d8d3..e3a12d5ece5 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el | |||
| @@ -278,7 +278,7 @@ Point is left at the end of the arguments." | |||
| 278 | (eshell-resolve-current-argument) | 278 | (eshell-resolve-current-argument) |
| 279 | eshell-current-argument)) | 279 | eshell-current-argument)) |
| 280 | 280 | ||
| 281 | (defsubst eshell-operator (&rest args) | 281 | (defsubst eshell-operator (&rest _args) |
| 282 | "A stub function that generates an error if a floating operator is found." | 282 | "A stub function that generates an error if a floating operator is found." |
| 283 | (error "Unhandled operator in input text")) | 283 | (error "Unhandled operator in input text")) |
| 284 | 284 | ||
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index ef8a53f3c0b..c2922983ae2 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el | |||
| @@ -650,7 +650,7 @@ For an external command, it means an exit code of 0." | |||
| 650 | (looking-at eshell-lisp-regexp)) | 650 | (looking-at eshell-lisp-regexp)) |
| 651 | (let* ((here (point)) | 651 | (let* ((here (point)) |
| 652 | (obj | 652 | (obj |
| 653 | (condition-case err | 653 | (condition-case nil |
| 654 | (read (current-buffer)) | 654 | (read (current-buffer)) |
| 655 | (end-of-file | 655 | (end-of-file |
| 656 | (throw 'eshell-incomplete ?\())))) | 656 | (throw 'eshell-incomplete ?\())))) |
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index ed5fecf09ff..54a36428d58 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el | |||
| @@ -220,74 +220,67 @@ This is used by `eshell-watch-for-password-prompt'." | |||
| 220 | (defvar eshell-last-output-end nil) | 220 | (defvar eshell-last-output-end nil) |
| 221 | 221 | ||
| 222 | (defvar eshell-currently-handling-window nil) | 222 | (defvar eshell-currently-handling-window nil) |
| 223 | (defvar eshell-mode-syntax-table nil) | ||
| 224 | (defvar eshell-mode-abbrev-table nil) | ||
| 225 | 223 | ||
| 226 | (define-abbrev-table 'eshell-mode-abbrev-table ()) | 224 | (define-abbrev-table 'eshell-mode-abbrev-table ()) |
| 227 | 225 | ||
| 228 | (if (not eshell-mode-syntax-table) | 226 | (defvar eshell-mode-syntax-table |
| 229 | (let ((i 0)) | 227 | (let ((st (make-syntax-table)) |
| 230 | (setq eshell-mode-syntax-table (make-syntax-table)) | 228 | (i 0)) |
| 231 | (while (< i ?0) | 229 | (while (< i ?0) |
| 232 | (modify-syntax-entry i "_ " eshell-mode-syntax-table) | 230 | (modify-syntax-entry i "_ " st) |
| 233 | (setq i (1+ i))) | 231 | (setq i (1+ i))) |
| 234 | (setq i (1+ ?9)) | 232 | (setq i (1+ ?9)) |
| 235 | (while (< i ?A) | 233 | (while (< i ?A) |
| 236 | (modify-syntax-entry i "_ " eshell-mode-syntax-table) | 234 | (modify-syntax-entry i "_ " st) |
| 237 | (setq i (1+ i))) | 235 | (setq i (1+ i))) |
| 238 | (setq i (1+ ?Z)) | 236 | (setq i (1+ ?Z)) |
| 239 | (while (< i ?a) | 237 | (while (< i ?a) |
| 240 | (modify-syntax-entry i "_ " eshell-mode-syntax-table) | 238 | (modify-syntax-entry i "_ " st) |
| 241 | (setq i (1+ i))) | 239 | (setq i (1+ i))) |
| 242 | (setq i (1+ ?z)) | 240 | (setq i (1+ ?z)) |
| 243 | (while (< i 128) | 241 | (while (< i 128) |
| 244 | (modify-syntax-entry i "_ " eshell-mode-syntax-table) | 242 | (modify-syntax-entry i "_ " st) |
| 245 | (setq i (1+ i))) | 243 | (setq i (1+ i))) |
| 246 | (modify-syntax-entry ? " " eshell-mode-syntax-table) | 244 | (modify-syntax-entry ? " " st) |
| 247 | (modify-syntax-entry ?\t " " eshell-mode-syntax-table) | 245 | (modify-syntax-entry ?\t " " st) |
| 248 | (modify-syntax-entry ?\f " " eshell-mode-syntax-table) | 246 | (modify-syntax-entry ?\f " " st) |
| 249 | (modify-syntax-entry ?\n "> " eshell-mode-syntax-table) | 247 | (modify-syntax-entry ?\n "> " st) |
| 250 | ;; Give CR the same syntax as newline, for selective-display. | 248 | ;; Give CR the same syntax as newline, for selective-display. |
| 251 | (modify-syntax-entry ?\^m "> " eshell-mode-syntax-table) | 249 | (modify-syntax-entry ?\^m "> " st) |
| 252 | ;;; (modify-syntax-entry ?\; "< " eshell-mode-syntax-table) | 250 | ;; (modify-syntax-entry ?\; "< " st) |
| 253 | (modify-syntax-entry ?` "' " eshell-mode-syntax-table) | 251 | (modify-syntax-entry ?` "' " st) |
| 254 | (modify-syntax-entry ?' "' " eshell-mode-syntax-table) | 252 | (modify-syntax-entry ?' "' " st) |
| 255 | (modify-syntax-entry ?, "' " eshell-mode-syntax-table) | 253 | (modify-syntax-entry ?, "' " st) |
| 256 | ;; Used to be singlequote; changed for flonums. | 254 | ;; Used to be singlequote; changed for flonums. |
| 257 | (modify-syntax-entry ?. "_ " eshell-mode-syntax-table) | 255 | (modify-syntax-entry ?. "_ " st) |
| 258 | (modify-syntax-entry ?- "_ " eshell-mode-syntax-table) | 256 | (modify-syntax-entry ?- "_ " st) |
| 259 | (modify-syntax-entry ?| ". " eshell-mode-syntax-table) | 257 | (modify-syntax-entry ?| ". " st) |
| 260 | (modify-syntax-entry ?# "' " eshell-mode-syntax-table) | 258 | (modify-syntax-entry ?# "' " st) |
| 261 | (modify-syntax-entry ?\" "\" " eshell-mode-syntax-table) | 259 | (modify-syntax-entry ?\" "\" " st) |
| 262 | (modify-syntax-entry ?\\ "/ " eshell-mode-syntax-table) | 260 | (modify-syntax-entry ?\\ "/ " st) |
| 263 | (modify-syntax-entry ?\( "() " eshell-mode-syntax-table) | 261 | (modify-syntax-entry ?\( "() " st) |
| 264 | (modify-syntax-entry ?\) ")( " eshell-mode-syntax-table) | 262 | (modify-syntax-entry ?\) ")( " st) |
| 265 | (modify-syntax-entry ?\{ "(} " eshell-mode-syntax-table) | 263 | (modify-syntax-entry ?\{ "(} " st) |
| 266 | (modify-syntax-entry ?\} "){ " eshell-mode-syntax-table) | 264 | (modify-syntax-entry ?\} "){ " st) |
| 267 | (modify-syntax-entry ?\[ "(] " eshell-mode-syntax-table) | 265 | (modify-syntax-entry ?\[ "(] " st) |
| 268 | (modify-syntax-entry ?\] ")[ " eshell-mode-syntax-table) | 266 | (modify-syntax-entry ?\] ")[ " st) |
| 269 | ;; All non-word multibyte characters should be `symbol'. | 267 | ;; All non-word multibyte characters should be `symbol'. |
| 270 | (if (featurep 'xemacs) | 268 | (map-char-table |
| 271 | (map-char-table | 269 | (if (featurep 'xemacs) |
| 272 | (function | 270 | (lambda (key _val) |
| 273 | (lambda (key val) | 271 | (and (characterp key) |
| 274 | (and (characterp key) | 272 | (>= (char-int key) 256) |
| 275 | (>= (char-int key) 256) | 273 | (/= (char-syntax key) ?w) |
| 276 | (/= (char-syntax key) ?w) | 274 | (modify-syntax-entry key "_ " st))) |
| 277 | (modify-syntax-entry key "_ " | 275 | (lambda (key _val) |
| 278 | eshell-mode-syntax-table)))) | 276 | (and (if (consp key) |
| 279 | (standard-syntax-table)) | 277 | (and (>= (car key) 128) |
| 280 | (map-char-table | 278 | (/= (char-syntax (car key)) ?w)) |
| 281 | (function | 279 | (and (>= key 256) |
| 282 | (lambda (key val) | 280 | (/= (char-syntax key) ?w))) |
| 283 | (and (if (consp key) | 281 | (modify-syntax-entry key "_ " st)))) |
| 284 | (and (>= (car key) 128) | 282 | (standard-syntax-table)) |
| 285 | (/= (char-syntax (car key)) ?w)) | 283 | st)) |
| 286 | (and (>= key 256) | ||
| 287 | (/= (char-syntax key) ?w))) | ||
| 288 | (modify-syntax-entry key "_ " | ||
| 289 | eshell-mode-syntax-table)))) | ||
| 290 | (standard-syntax-table))))) | ||
| 291 | 284 | ||
| 292 | ;;; User Functions: | 285 | ;;; User Functions: |
| 293 | 286 | ||
| @@ -303,25 +296,18 @@ and the hook `eshell-exit-hook'." | |||
| 303 | (run-hooks 'eshell-exit-hook)) | 296 | (run-hooks 'eshell-exit-hook)) |
| 304 | 297 | ||
| 305 | ;;;###autoload | 298 | ;;;###autoload |
| 306 | (defun eshell-mode () | 299 | (define-derived-mode eshell-mode fundamental-mode "EShell" |
| 307 | "Emacs shell interactive mode. | 300 | "Emacs shell interactive mode." |
| 308 | 301 | (setq-local eshell-mode t) | |
| 309 | \\{eshell-mode-map}" | ||
| 310 | (kill-all-local-variables) | ||
| 311 | |||
| 312 | (setq major-mode 'eshell-mode) | ||
| 313 | (setq mode-name "EShell") | ||
| 314 | (set (make-local-variable 'eshell-mode) t) | ||
| 315 | 302 | ||
| 316 | (make-local-variable 'eshell-mode-map) | 303 | ;; FIXME: What the hell!? |
| 317 | (setq eshell-mode-map (make-sparse-keymap)) | 304 | (setq-local eshell-mode-map (make-sparse-keymap)) |
| 318 | (use-local-map eshell-mode-map) | 305 | (use-local-map eshell-mode-map) |
| 319 | 306 | ||
| 320 | (when eshell-status-in-mode-line | 307 | (when eshell-status-in-mode-line |
| 321 | (make-local-variable 'eshell-command-running-string) | 308 | (make-local-variable 'eshell-command-running-string) |
| 322 | (let ((fmt (copy-sequence mode-line-format))) | 309 | (let ((fmt (copy-sequence mode-line-format))) |
| 323 | (make-local-variable 'mode-line-format) | 310 | (setq-local mode-line-format fmt)) |
| 324 | (setq mode-line-format fmt)) | ||
| 325 | (let ((mode-line-elt (memq 'mode-line-modified mode-line-format))) | 311 | (let ((mode-line-elt (memq 'mode-line-modified mode-line-format))) |
| 326 | (if mode-line-elt | 312 | (if mode-line-elt |
| 327 | (setcar mode-line-elt 'eshell-command-running-string)))) | 313 | (setcar mode-line-elt 'eshell-command-running-string)))) |
| @@ -331,11 +317,9 @@ and the hook `eshell-exit-hook'." | |||
| 331 | (define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output) | 317 | (define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output) |
| 332 | (define-key eshell-mode-map [(control ?a)] 'eshell-bol) | 318 | (define-key eshell-mode-map [(control ?a)] 'eshell-bol) |
| 333 | 319 | ||
| 334 | (set (make-local-variable 'eshell-command-prefix) | 320 | (setq-local eshell-command-prefix (make-symbol "eshell-command-prefix")) |
| 335 | (make-symbol "eshell-command-prefix")) | ||
| 336 | (fset eshell-command-prefix (make-sparse-keymap)) | 321 | (fset eshell-command-prefix (make-sparse-keymap)) |
| 337 | (set (make-local-variable 'eshell-command-map) | 322 | (setq-local eshell-command-map (symbol-function eshell-command-prefix)) |
| 338 | (symbol-function eshell-command-prefix)) | ||
| 339 | (define-key eshell-mode-map [(control ?c)] eshell-command-prefix) | 323 | (define-key eshell-mode-map [(control ?c)] eshell-command-prefix) |
| 340 | 324 | ||
| 341 | ;; without this, find-tag complains about read-only text being | 325 | ;; without this, find-tag complains about read-only text being |
| @@ -359,7 +343,6 @@ and the hook `eshell-exit-hook'." | |||
| 359 | (define-key eshell-command-map [(control ?y)] 'eshell-repeat-argument) | 343 | (define-key eshell-command-map [(control ?y)] 'eshell-repeat-argument) |
| 360 | 344 | ||
| 361 | (setq local-abbrev-table eshell-mode-abbrev-table) | 345 | (setq local-abbrev-table eshell-mode-abbrev-table) |
| 362 | (set-syntax-table eshell-mode-syntax-table) | ||
| 363 | 346 | ||
| 364 | (set (make-local-variable 'dired-directory) default-directory) | 347 | (set (make-local-variable 'dired-directory) default-directory) |
| 365 | (set (make-local-variable 'list-buffers-directory) | 348 | (set (make-local-variable 'list-buffers-directory) |
| @@ -442,7 +425,6 @@ and the hook `eshell-exit-hook'." | |||
| 442 | 425 | ||
| 443 | (if eshell-first-time-p | 426 | (if eshell-first-time-p |
| 444 | (run-hooks 'eshell-first-time-mode-hook)) | 427 | (run-hooks 'eshell-first-time-mode-hook)) |
| 445 | (run-mode-hooks 'eshell-mode-hook) | ||
| 446 | (run-hooks 'eshell-post-command-hook)) | 428 | (run-hooks 'eshell-post-command-hook)) |
| 447 | 429 | ||
| 448 | (put 'eshell-mode 'mode-class 'special) | 430 | (put 'eshell-mode 'mode-class 'special) |
| @@ -470,8 +452,8 @@ and the hook `eshell-exit-hook'." | |||
| 470 | (add-hook 'pre-command-hook 'eshell-intercept-commands t t) | 452 | (add-hook 'pre-command-hook 'eshell-intercept-commands t t) |
| 471 | (message "Sending subprocess input directly"))) | 453 | (message "Sending subprocess input directly"))) |
| 472 | 454 | ||
| 473 | (defun eshell-self-insert-command (N) | 455 | (defun eshell-self-insert-command () |
| 474 | (interactive "i") | 456 | (interactive) |
| 475 | (process-send-string | 457 | (process-send-string |
| 476 | (eshell-interactive-process) | 458 | (eshell-interactive-process) |
| 477 | (char-to-string (if (symbolp last-command-event) | 459 | (char-to-string (if (symbolp last-command-event) |
| @@ -944,10 +926,10 @@ a key." | |||
| 944 | (custom-add-option 'eshell-output-filter-functions | 926 | (custom-add-option 'eshell-output-filter-functions |
| 945 | 'eshell-truncate-buffer) | 927 | 'eshell-truncate-buffer) |
| 946 | 928 | ||
| 947 | (defun eshell-send-invisible (str) | 929 | (defun eshell-send-invisible () |
| 948 | "Read a string without echoing. | 930 | "Read a string without echoing. |
| 949 | Then send it to the process running in the current buffer." | 931 | Then send it to the process running in the current buffer." |
| 950 | (interactive "P") ; Defeat snooping via C-x ESC ESC | 932 | (interactive) ; Don't pass str as argument, to avoid snooping via C-x ESC ESC |
| 951 | (let ((str (read-passwd | 933 | (let ((str (read-passwd |
| 952 | (format "%s Password: " | 934 | (format "%s Password: " |
| 953 | (process-name (eshell-interactive-process)))))) | 935 | (process-name (eshell-interactive-process)))))) |
| @@ -969,7 +951,7 @@ This function could be in the list `eshell-output-filter-functions'." | |||
| 969 | (beginning-of-line) | 951 | (beginning-of-line) |
| 970 | (if (re-search-forward eshell-password-prompt-regexp | 952 | (if (re-search-forward eshell-password-prompt-regexp |
| 971 | eshell-last-output-end t) | 953 | eshell-last-output-end t) |
| 972 | (eshell-send-invisible nil))))) | 954 | (eshell-send-invisible))))) |
| 973 | 955 | ||
| 974 | (custom-add-option 'eshell-output-filter-functions | 956 | (custom-add-option 'eshell-output-filter-functions |
| 975 | 'eshell-watch-for-password-prompt) | 957 | 'eshell-watch-for-password-prompt) |
| @@ -977,32 +959,30 @@ This function could be in the list `eshell-output-filter-functions'." | |||
| 977 | (defun eshell-handle-control-codes () | 959 | (defun eshell-handle-control-codes () |
| 978 | "Act properly when certain control codes are seen." | 960 | "Act properly when certain control codes are seen." |
| 979 | (save-excursion | 961 | (save-excursion |
| 980 | (let ((orig (point))) | 962 | (goto-char eshell-last-output-block-begin) |
| 981 | (goto-char eshell-last-output-block-begin) | 963 | (unless (eolp) |
| 982 | (unless (eolp) | 964 | (beginning-of-line)) |
| 983 | (beginning-of-line)) | 965 | (while (< (point) eshell-last-output-end) |
| 984 | (while (< (point) eshell-last-output-end) | 966 | (let ((char (char-after))) |
| 985 | (let ((char (char-after))) | 967 | (cond |
| 986 | (cond | 968 | ((eq char ?\r) |
| 987 | ((eq char ?\r) | 969 | (if (< (1+ (point)) eshell-last-output-end) |
| 988 | (if (< (1+ (point)) eshell-last-output-end) | 970 | (if (memq (char-after (1+ (point))) |
| 989 | (if (memq (char-after (1+ (point))) | 971 | '(?\n ?\r)) |
| 990 | '(?\n ?\r)) | 972 | (delete-char 1) |
| 991 | (delete-char 1) | 973 | (let ((end (1+ (point)))) |
| 992 | (let ((end (1+ (point)))) | 974 | (beginning-of-line) |
| 993 | (beginning-of-line) | 975 | (delete-region (point) end))) |
| 994 | (delete-region (point) end))) | 976 | (add-text-properties (point) (1+ (point)) |
| 995 | (add-text-properties (point) (1+ (point)) | 977 | '(invisible t)) |
| 996 | '(invisible t)) | 978 | (forward-char))) |
| 997 | (forward-char))) | 979 | ((eq char ?\a) |
| 998 | ((eq char ?\a) | 980 | (delete-char 1) |
| 999 | (delete-char 1) | 981 | (beep)) |
| 1000 | (beep)) | 982 | ((eq char ?\C-h) |
| 1001 | ((eq char ?\C-h) | 983 | (delete-region (1- (point)) (1+ (point)))) |
| 1002 | (delete-backward-char 1) | 984 | (t |
| 1003 | (delete-char 1)) | 985 | (forward-char))))))) |
| 1004 | (t | ||
| 1005 | (forward-char)))))))) | ||
| 1006 | 986 | ||
| 1007 | (custom-add-option 'eshell-output-filter-functions | 987 | (custom-add-option 'eshell-output-filter-functions |
| 1008 | 'eshell-handle-control-codes) | 988 | 'eshell-handle-control-codes) |
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el index 33625433022..c62cbc7e1dc 100644 --- a/lisp/eshell/esh-opt.el +++ b/lisp/eshell/esh-opt.el | |||
| @@ -28,11 +28,11 @@ | |||
| 28 | (require 'esh-ext) | 28 | (require 'esh-ext) |
| 29 | 29 | ||
| 30 | ;; Unused. | 30 | ;; Unused. |
| 31 | ;;; (defgroup eshell-opt nil | 31 | ;; (defgroup eshell-opt nil |
| 32 | ;;; "The options processing code handles command argument parsing for | 32 | ;; "The options processing code handles command argument parsing for |
| 33 | ;;; Eshell commands implemented in Lisp." | 33 | ;; Eshell commands implemented in Lisp." |
| 34 | ;;; :tag "Command options processing" | 34 | ;; :tag "Command options processing" |
| 35 | ;;; :group 'eshell) | 35 | ;; :group 'eshell) |
| 36 | 36 | ||
| 37 | ;;; User Functions: | 37 | ;;; User Functions: |
| 38 | 38 | ||
| @@ -103,32 +103,25 @@ interned variable `args' (created using a `let' form)." | |||
| 103 | macro-args | 103 | macro-args |
| 104 | (list 'eshell-stringify-list | 104 | (list 'eshell-stringify-list |
| 105 | (list 'eshell-flatten-list macro-args))))) | 105 | (list 'eshell-flatten-list macro-args))))) |
| 106 | (let ,(append (delq nil (mapcar (lambda (opt) | 106 | (let ,(delq nil (mapcar (lambda (opt) |
| 107 | (and (listp opt) (nth 3 opt))) | 107 | (and (listp opt) (nth 3 opt))) |
| 108 | (cadr options))) | 108 | (cadr options))) |
| 109 | '(usage-msg last-value ext-command args)) | ||
| 110 | ;; FIXME: `options' ends up hiding some variable names under `quote', | 109 | ;; FIXME: `options' ends up hiding some variable names under `quote', |
| 111 | ;; which is incompatible with lexical scoping!! | 110 | ;; which is incompatible with lexical scoping!! |
| 112 | (eshell-do-opt ,name ,options (lambda () ,@body-forms))))) | 111 | (eshell-do-opt ,name ,options (lambda (args) ,@body-forms) temp-args)))) |
| 113 | 112 | ||
| 114 | ;;; Internal Functions: | 113 | ;;; Internal Functions: |
| 115 | 114 | ||
| 116 | (defvar temp-args) | ||
| 117 | (defvar last-value) | ||
| 118 | (defvar usage-msg) | ||
| 119 | (defvar ext-command) | ||
| 120 | ;; Documented part of the interface; see eshell-eval-using-options. | 115 | ;; Documented part of the interface; see eshell-eval-using-options. |
| 121 | (defvar args) | 116 | (defvar eshell--args) |
| 122 | 117 | ||
| 123 | (defun eshell-do-opt (name options body-fun) | 118 | (defun eshell-do-opt (name options body-fun args) |
| 124 | "Helper function for `eshell-eval-using-options'. | 119 | "Helper function for `eshell-eval-using-options'. |
| 125 | This code doesn't really need to be macro expanded everywhere." | 120 | This code doesn't really need to be macro expanded everywhere." |
| 126 | (setq args temp-args) | 121 | (let* (last-value |
| 127 | (if (setq | 122 | (ext-command |
| 128 | ext-command | ||
| 129 | (catch 'eshell-ext-command | 123 | (catch 'eshell-ext-command |
| 130 | (when (setq | 124 | (let ((usage-msg |
| 131 | usage-msg | ||
| 132 | (catch 'eshell-usage | 125 | (catch 'eshell-usage |
| 133 | (setq last-value nil) | 126 | (setq last-value nil) |
| 134 | (if (and (= (length args) 0) | 127 | (if (and (= (length args) 0) |
| @@ -136,12 +129,14 @@ This code doesn't really need to be macro expanded everywhere." | |||
| 136 | (throw 'eshell-usage | 129 | (throw 'eshell-usage |
| 137 | (eshell-show-usage name options))) | 130 | (eshell-show-usage name options))) |
| 138 | (setq args (eshell-process-args name args options) | 131 | (setq args (eshell-process-args name args options) |
| 139 | last-value (funcall body-fun)) | 132 | last-value (funcall body-fun args)) |
| 140 | nil)) | 133 | nil))) |
| 141 | (error "%s" usage-msg)))) | 134 | (when usage-msg |
| 135 | (error "%s" usage-msg)))))) | ||
| 136 | (if ext-command | ||
| 142 | (throw 'eshell-external | 137 | (throw 'eshell-external |
| 143 | (eshell-external-command ext-command args)) | 138 | (eshell-external-command ext-command args)) |
| 144 | last-value)) | 139 | last-value))) |
| 145 | 140 | ||
| 146 | (defun eshell-show-usage (name options) | 141 | (defun eshell-show-usage (name options) |
| 147 | "Display the usage message for NAME, using OPTIONS." | 142 | "Display the usage message for NAME, using OPTIONS." |
| @@ -197,12 +192,13 @@ will be modified." | |||
| 197 | (if (not (nth 3 opt)) | 192 | (if (not (nth 3 opt)) |
| 198 | (eshell-show-usage name options) | 193 | (eshell-show-usage name options) |
| 199 | (if (eq (nth 2 opt) t) | 194 | (if (eq (nth 2 opt) t) |
| 200 | (if (> ai (length args)) | 195 | (if (> ai (length eshell--args)) |
| 201 | (error "%s: missing option argument" name) | 196 | (error "%s: missing option argument" name) |
| 202 | (set (nth 3 opt) (nth ai args)) | 197 | (set (nth 3 opt) (nth ai eshell--args)) |
| 203 | (if (> ai 0) | 198 | (if (> ai 0) |
| 204 | (setcdr (nthcdr (1- ai) args) (nthcdr (1+ ai) args)) | 199 | (setcdr (nthcdr (1- ai) eshell--args) |
| 205 | (setq args (cdr args)))) | 200 | (nthcdr (1+ ai) eshell--args)) |
| 201 | (setq eshell--args (cdr eshell--args)))) | ||
| 206 | (set (nth 3 opt) (or (nth 2 opt) t))))) | 202 | (set (nth 3 opt) (or (nth 2 opt) t))))) |
| 207 | 203 | ||
| 208 | (defun eshell-process-option (name switch kind ai options) | 204 | (defun eshell-process-option (name switch kind ai options) |
| @@ -232,14 +228,15 @@ switch is unrecognized." | |||
| 232 | (setq extcmd (eshell-search-path (cadr extcmd))) | 228 | (setq extcmd (eshell-search-path (cadr extcmd))) |
| 233 | (if extcmd | 229 | (if extcmd |
| 234 | (throw 'eshell-ext-command extcmd) | 230 | (throw 'eshell-ext-command extcmd) |
| 235 | (if (characterp switch) | 231 | (error (if (characterp switch) "%s: unrecognized option -%c" |
| 236 | (error "%s: unrecognized option -%c" name switch) | 232 | "%s: unrecognized option --%s") |
| 237 | (error "%s: unrecognized option --%s" name switch)))))))) | 233 | name switch))))))) |
| 238 | 234 | ||
| 239 | (defun eshell-process-args (name args options) | 235 | (defun eshell-process-args (name args options) |
| 240 | "Process the given ARGS using OPTIONS. | 236 | "Process the given ARGS using OPTIONS. |
| 241 | This assumes that symbols have been intern'd by `eshell-eval-using-options'." | 237 | This assumes that symbols have been intern'd by `eshell-eval-using-options'." |
| 242 | (let ((ai 0) arg) | 238 | (let ((ai 0) arg |
| 239 | (eshell--args args)) | ||
| 243 | (while (< ai (length args)) | 240 | (while (< ai (length args)) |
| 244 | (setq arg (nth ai args)) | 241 | (setq arg (nth ai args)) |
| 245 | (if (not (and (stringp arg) | 242 | (if (not (and (stringp arg) |
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index dd344eb50a2..968d1ebad79 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Code: | 24 | ;;; Code: |
| 25 | 25 | ||
| 26 | (eval-when-compile (require 'cl-lib)) | ||
| 27 | |||
| 26 | (defgroup eshell-util nil | 28 | (defgroup eshell-util nil |
| 27 | "This is general utility code, meant for use by Eshell itself." | 29 | "This is general utility code, meant for use by Eshell itself." |
| 28 | :tag "General utilities" | 30 | :tag "General utilities" |
| @@ -484,12 +486,12 @@ list." | |||
| 484 | (while (re-search-forward | 486 | (while (re-search-forward |
| 485 | "^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t) | 487 | "^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t) |
| 486 | (if (match-string 1) | 488 | (if (match-string 1) |
| 487 | (add-to-list 'hosts (match-string 1))) | 489 | (cl-pushnew (match-string 1) hosts :test #'equal)) |
| 488 | (if (match-string 2) | 490 | (if (match-string 2) |
| 489 | (add-to-list 'hosts (match-string 2))) | 491 | (cl-pushnew (match-string 2) hosts :test #'equal)) |
| 490 | (if (match-string 4) | 492 | (if (match-string 4) |
| 491 | (add-to-list 'hosts (match-string 4))))) | 493 | (cl-pushnew (match-string 4) hosts :test #'equal)))) |
| 492 | (sort hosts 'string-lessp))) | 494 | (sort hosts #'string-lessp))) |
| 493 | 495 | ||
| 494 | (defun eshell-read-hosts (file result-var timestamp-var) | 496 | (defun eshell-read-hosts (file result-var timestamp-var) |
| 495 | "Read the contents of /etc/passwd for user names." | 497 | "Read the contents of /etc/passwd for user names." |
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 188b8165248..75c36a68544 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el | |||
| @@ -395,12 +395,9 @@ process any indices that come after the variable reference." | |||
| 395 | indices (and (not (eobp)) | 395 | indices (and (not (eobp)) |
| 396 | (eq (char-after) ?\[) | 396 | (eq (char-after) ?\[) |
| 397 | (eshell-parse-indices)) | 397 | (eshell-parse-indices)) |
| 398 | value (list 'let | 398 | value `(let ((indices ',indices)) ,value)) |
| 399 | (list (list 'indices | ||
| 400 | (list 'quote indices))) | ||
| 401 | value)) | ||
| 402 | (if get-len | 399 | (if get-len |
| 403 | (list 'length value) | 400 | `(length ,value) |
| 404 | value))) | 401 | value))) |
| 405 | 402 | ||
| 406 | (defun eshell-parse-variable-ref () | 403 | (defun eshell-parse-variable-ref () |
| @@ -414,67 +411,68 @@ Possible options are: | |||
| 414 | <LONG-NAME> disambiguates the length of the name | 411 | <LONG-NAME> disambiguates the length of the name |
| 415 | {COMMAND} result of command is variable's value | 412 | {COMMAND} result of command is variable's value |
| 416 | (LISP-FORM) result of Lisp form is variable's value" | 413 | (LISP-FORM) result of Lisp form is variable's value" |
| 417 | (let (end) | 414 | (cond |
| 418 | (cond | 415 | ((eq (char-after) ?{) |
| 419 | ((eq (char-after) ?{) | 416 | (let ((end (eshell-find-delimiter ?\{ ?\}))) |
| 420 | (let ((end (eshell-find-delimiter ?\{ ?\}))) | 417 | (if (not end) |
| 421 | (if (not end) | 418 | (throw 'eshell-incomplete ?\{) |
| 422 | (throw 'eshell-incomplete ?\{) | 419 | (prog1 |
| 423 | (prog1 | 420 | (list 'eshell-convert |
| 424 | (list 'eshell-convert | 421 | (list 'eshell-command-to-value |
| 425 | (list 'eshell-command-to-value | 422 | (list 'eshell-as-subcommand |
| 426 | (list 'eshell-as-subcommand | 423 | (eshell-parse-command |
| 427 | (eshell-parse-command | 424 | (cons (1+ (point)) end))))) |
| 428 | (cons (1+ (point)) end))))) | 425 | (goto-char (1+ end)))))) |
| 429 | (goto-char (1+ end)))))) | 426 | ((memq (char-after) '(?\' ?\")) |
| 430 | ((memq (char-after) '(?\' ?\")) | 427 | (let ((name (if (eq (char-after) ?\') |
| 431 | (let ((name (if (eq (char-after) ?\') | 428 | (eshell-parse-literal-quote) |
| 432 | (eshell-parse-literal-quote) | 429 | (eshell-parse-double-quote)))) |
| 433 | (eshell-parse-double-quote)))) | 430 | (if name |
| 434 | (if name | ||
| 435 | (list 'eshell-get-variable (eval name) 'indices)))) | 431 | (list 'eshell-get-variable (eval name) 'indices)))) |
| 436 | ((eq (char-after) ?\<) | 432 | ((eq (char-after) ?\<) |
| 437 | (let ((end (eshell-find-delimiter ?\< ?\>))) | 433 | (let ((end (eshell-find-delimiter ?\< ?\>))) |
| 438 | (if (not end) | 434 | (if (not end) |
| 439 | (throw 'eshell-incomplete ?\<) | 435 | (throw 'eshell-incomplete ?\<) |
| 440 | (let* ((temp (make-temp-file temporary-file-directory)) | 436 | (let* ((temp (make-temp-file temporary-file-directory)) |
| 441 | (cmd (concat (buffer-substring (1+ (point)) end) | 437 | (cmd (concat (buffer-substring (1+ (point)) end) |
| 442 | " > " temp))) | 438 | " > " temp))) |
| 443 | (prog1 | 439 | (prog1 |
| 444 | (list | 440 | (list |
| 445 | 'let (list (list 'eshell-current-handles | 441 | 'let (list (list 'eshell-current-handles |
| 446 | (list 'eshell-create-handles temp | 442 | (list 'eshell-create-handles temp |
| 447 | (list 'quote 'overwrite)))) | 443 | (list 'quote 'overwrite)))) |
| 448 | (list | 444 | (list |
| 449 | 'progn | 445 | 'progn |
| 450 | (list 'eshell-as-subcommand | 446 | (list 'eshell-as-subcommand |
| 451 | (eshell-parse-command cmd)) | 447 | (eshell-parse-command cmd)) |
| 452 | (list 'ignore | 448 | (list 'ignore |
| 453 | (list 'nconc 'eshell-this-command-hook | 449 | (list 'nconc 'eshell-this-command-hook |
| 454 | (list 'list | 450 | (list 'list |
| 455 | (list 'function | 451 | (list 'function |
| 456 | (list 'lambda nil | 452 | (list 'lambda nil |
| 457 | (list 'delete-file temp)))))) | 453 | (list 'delete-file temp)))))) |
| 458 | (list 'quote temp))) | 454 | (list 'quote temp))) |
| 459 | (goto-char (1+ end))))))) | 455 | (goto-char (1+ end))))))) |
| 460 | ((eq (char-after) ?\() | 456 | ((eq (char-after) ?\() |
| 461 | (condition-case err | 457 | (condition-case nil |
| 462 | (list 'eshell-command-to-value | 458 | (list 'eshell-command-to-value |
| 463 | (list 'eshell-lisp-command | 459 | (list 'eshell-lisp-command |
| 464 | (list 'quote (read (current-buffer))))) | 460 | (list 'quote (read (current-buffer))))) |
| 465 | (end-of-file | 461 | (end-of-file |
| 466 | (throw 'eshell-incomplete ?\()))) | 462 | (throw 'eshell-incomplete ?\()))) |
| 467 | ((assoc (char-to-string (char-after)) | 463 | ((assoc (char-to-string (char-after)) |
| 468 | eshell-variable-aliases-list) | 464 | eshell-variable-aliases-list) |
| 469 | (forward-char) | 465 | (forward-char) |
| 470 | (list 'eshell-get-variable | 466 | (list 'eshell-get-variable |
| 471 | (char-to-string (char-before)) 'indices)) | 467 | (char-to-string (char-before)) 'indices)) |
| 472 | ((looking-at eshell-variable-name-regexp) | 468 | ((looking-at eshell-variable-name-regexp) |
| 473 | (prog1 | 469 | (prog1 |
| 474 | (list 'eshell-get-variable (match-string 0) 'indices) | 470 | (list 'eshell-get-variable (match-string 0) 'indices) |
| 475 | (goto-char (match-end 0)))) | 471 | (goto-char (match-end 0)))) |
| 476 | (t | 472 | (t |
| 477 | (error "Invalid variable reference"))))) | 473 | (error "Invalid variable reference")))) |
| 474 | |||
| 475 | (defvar eshell-glob-function) | ||
| 478 | 476 | ||
| 479 | (defun eshell-parse-indices () | 477 | (defun eshell-parse-indices () |
| 480 | "Parse and return a list of list of indices." | 478 | "Parse and return a list of list of indices." |
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 9bdf8b3eb68..e3f8f0d11bc 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el | |||
| @@ -300,7 +300,7 @@ buffer selected (or created)." | |||
| 300 | (get-buffer-create eshell-buffer-name))))) | 300 | (get-buffer-create eshell-buffer-name))))) |
| 301 | (cl-assert (and buf (buffer-live-p buf))) | 301 | (cl-assert (and buf (buffer-live-p buf))) |
| 302 | (pop-to-buffer-same-window buf) | 302 | (pop-to-buffer-same-window buf) |
| 303 | (unless (eq major-mode 'eshell-mode) | 303 | (unless (derived-mode-p 'eshell-mode) |
| 304 | (eshell-mode)) | 304 | (eshell-mode)) |
| 305 | buf)) | 305 | buf)) |
| 306 | 306 | ||