diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-09-11 12:00:37 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-09-11 12:00:37 -0400 |
commit | 656bd483888ec1620eafdb4037f65af8fe0276ef (patch) | |
tree | 5c196b8f0a9556ada1993bc78556543bb9b27610 /lisp/eshell | |
parent | 412a09723c5cf5f8b8a28fc0ef104750de3a6d7f (diff) | |
download | emacs-656bd483888ec1620eafdb4037f65af8fe0276ef.tar.gz |
* lisp/eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization.
(eshell-self-insert-command, eshell-send-invisible): Remove
unused argument.
(eshell-handle-control-codes): Remove unused var `orig'.
Avoid delete-backward-char.
Fixes: debbugs:15338
Diffstat (limited to 'lisp/eshell')
-rw-r--r-- | lisp/eshell/esh-mode.el | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 0d32dae7ddb..54a36428d58 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -267,19 +267,20 @@ This is used by `eshell-watch-for-password-prompt'." ;; All non-word multibyte characters should be `symbol'. (map-char-table (if (featurep 'xemacs) - (lambda (key val) + (lambda (key _val) (and (characterp key) (>= (char-int key) 256) (/= (char-syntax key) ?w) (modify-syntax-entry key "_ " st))) - (lambda (key val) + (lambda (key _val) (and (if (consp key) (and (>= (car key) 128) (/= (char-syntax (car key)) ?w)) (and (>= key 256) (/= (char-syntax key) ?w))) (modify-syntax-entry key "_ " st)))) - (standard-syntax-table)))) + (standard-syntax-table)) + st)) ;;; User Functions: @@ -451,8 +452,8 @@ and the hook `eshell-exit-hook'." (add-hook 'pre-command-hook 'eshell-intercept-commands t t) (message "Sending subprocess input directly"))) -(defun eshell-self-insert-command (N) - (interactive "i") +(defun eshell-self-insert-command () + (interactive) (process-send-string (eshell-interactive-process) (char-to-string (if (symbolp last-command-event) @@ -925,10 +926,10 @@ a key." (custom-add-option 'eshell-output-filter-functions 'eshell-truncate-buffer) -(defun eshell-send-invisible (str) +(defun eshell-send-invisible () "Read a string without echoing. Then send it to the process running in the current buffer." - (interactive "P") ; Defeat snooping via C-x ESC ESC + (interactive) ; Don't pass str as argument, to avoid snooping via C-x ESC ESC (let ((str (read-passwd (format "%s Password: " (process-name (eshell-interactive-process)))))) @@ -950,7 +951,7 @@ This function could be in the list `eshell-output-filter-functions'." (beginning-of-line) (if (re-search-forward eshell-password-prompt-regexp eshell-last-output-end t) - (eshell-send-invisible nil))))) + (eshell-send-invisible))))) (custom-add-option 'eshell-output-filter-functions 'eshell-watch-for-password-prompt) @@ -958,32 +959,30 @@ This function could be in the list `eshell-output-filter-functions'." (defun eshell-handle-control-codes () "Act properly when certain control codes are seen." (save-excursion - (let ((orig (point))) - (goto-char eshell-last-output-block-begin) - (unless (eolp) - (beginning-of-line)) - (while (< (point) eshell-last-output-end) - (let ((char (char-after))) - (cond - ((eq char ?\r) - (if (< (1+ (point)) eshell-last-output-end) - (if (memq (char-after (1+ (point))) - '(?\n ?\r)) - (delete-char 1) - (let ((end (1+ (point)))) - (beginning-of-line) - (delete-region (point) end))) - (add-text-properties (point) (1+ (point)) - '(invisible t)) - (forward-char))) - ((eq char ?\a) - (delete-char 1) - (beep)) - ((eq char ?\C-h) - (delete-backward-char 1) - (delete-char 1)) - (t - (forward-char)))))))) + (goto-char eshell-last-output-block-begin) + (unless (eolp) + (beginning-of-line)) + (while (< (point) eshell-last-output-end) + (let ((char (char-after))) + (cond + ((eq char ?\r) + (if (< (1+ (point)) eshell-last-output-end) + (if (memq (char-after (1+ (point))) + '(?\n ?\r)) + (delete-char 1) + (let ((end (1+ (point)))) + (beginning-of-line) + (delete-region (point) end))) + (add-text-properties (point) (1+ (point)) + '(invisible t)) + (forward-char))) + ((eq char ?\a) + (delete-char 1) + (beep)) + ((eq char ?\C-h) + (delete-region (1- (point)) (1+ (point)))) + (t + (forward-char))))))) (custom-add-option 'eshell-output-filter-functions 'eshell-handle-control-codes) |