diff options
| author | Stefan Monnier | 2013-09-11 12:00:37 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-09-11 12:00:37 -0400 |
| commit | 656bd483888ec1620eafdb4037f65af8fe0276ef (patch) | |
| tree | 5c196b8f0a9556ada1993bc78556543bb9b27610 | |
| parent | 412a09723c5cf5f8b8a28fc0ef104750de3a6d7f (diff) | |
| download | emacs-656bd483888ec1620eafdb4037f65af8fe0276ef.tar.gz emacs-656bd483888ec1620eafdb4037f65af8fe0276ef.zip | |
* 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
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/eshell/esh-mode.el | 67 |
2 files changed, 41 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f5c4ee1b19e..7a79110f4a0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization | ||
| 4 | (bug#15338). | ||
| 5 | (eshell-self-insert-command, eshell-send-invisible): Remove | ||
| 6 | unused argument. | ||
| 7 | (eshell-handle-control-codes): Remove unused var `orig'. | ||
| 8 | Avoid delete-backward-char. | ||
| 9 | |||
| 3 | * files.el (set-auto-mode): Simplify a bit further. | 10 | * files.el (set-auto-mode): Simplify a bit further. |
| 4 | 11 | ||
| 5 | 2013-09-11 Glenn Morris <rgm@gnu.org> | 12 | 2013-09-11 Glenn Morris <rgm@gnu.org> |
| @@ -74,7 +81,7 @@ | |||
| 74 | 2013-09-10 Stefan Monnier <monnier@iro.umontreal.ca> | 81 | 2013-09-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 75 | 82 | ||
| 76 | * simple.el: Use set-temporary-overlay-map for universal-argument. | 83 | * simple.el: Use set-temporary-overlay-map for universal-argument. |
| 77 | (universal-argument-map): Don't use default-bindings. | 84 | (universal-argument-map): Don't use default-bindings (bug#15317). |
| 78 | Bind switch-frame explicitly. Replace universal-argument-minus with | 85 | Bind switch-frame explicitly. Replace universal-argument-minus with |
| 79 | a conditional binding. | 86 | a conditional binding. |
| 80 | (universal-argument-num-events, saved-overriding-map): Remove. | 87 | (universal-argument-num-events, saved-overriding-map): Remove. |
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'." | |||
| 267 | ;; All non-word multibyte characters should be `symbol'. | 267 | ;; All non-word multibyte characters should be `symbol'. |
| 268 | (map-char-table | 268 | (map-char-table |
| 269 | (if (featurep 'xemacs) | 269 | (if (featurep 'xemacs) |
| 270 | (lambda (key val) | 270 | (lambda (key _val) |
| 271 | (and (characterp key) | 271 | (and (characterp key) |
| 272 | (>= (char-int key) 256) | 272 | (>= (char-int key) 256) |
| 273 | (/= (char-syntax key) ?w) | 273 | (/= (char-syntax key) ?w) |
| 274 | (modify-syntax-entry key "_ " st))) | 274 | (modify-syntax-entry key "_ " st))) |
| 275 | (lambda (key val) | 275 | (lambda (key _val) |
| 276 | (and (if (consp key) | 276 | (and (if (consp key) |
| 277 | (and (>= (car key) 128) | 277 | (and (>= (car key) 128) |
| 278 | (/= (char-syntax (car key)) ?w)) | 278 | (/= (char-syntax (car key)) ?w)) |
| 279 | (and (>= key 256) | 279 | (and (>= key 256) |
| 280 | (/= (char-syntax key) ?w))) | 280 | (/= (char-syntax key) ?w))) |
| 281 | (modify-syntax-entry key "_ " st)))) | 281 | (modify-syntax-entry key "_ " st)))) |
| 282 | (standard-syntax-table)))) | 282 | (standard-syntax-table)) |
| 283 | st)) | ||
| 283 | 284 | ||
| 284 | ;;; User Functions: | 285 | ;;; User Functions: |
| 285 | 286 | ||
| @@ -451,8 +452,8 @@ and the hook `eshell-exit-hook'." | |||
| 451 | (add-hook 'pre-command-hook 'eshell-intercept-commands t t) | 452 | (add-hook 'pre-command-hook 'eshell-intercept-commands t t) |
| 452 | (message "Sending subprocess input directly"))) | 453 | (message "Sending subprocess input directly"))) |
| 453 | 454 | ||
| 454 | (defun eshell-self-insert-command (N) | 455 | (defun eshell-self-insert-command () |
| 455 | (interactive "i") | 456 | (interactive) |
| 456 | (process-send-string | 457 | (process-send-string |
| 457 | (eshell-interactive-process) | 458 | (eshell-interactive-process) |
| 458 | (char-to-string (if (symbolp last-command-event) | 459 | (char-to-string (if (symbolp last-command-event) |
| @@ -925,10 +926,10 @@ a key." | |||
| 925 | (custom-add-option 'eshell-output-filter-functions | 926 | (custom-add-option 'eshell-output-filter-functions |
| 926 | 'eshell-truncate-buffer) | 927 | 'eshell-truncate-buffer) |
| 927 | 928 | ||
| 928 | (defun eshell-send-invisible (str) | 929 | (defun eshell-send-invisible () |
| 929 | "Read a string without echoing. | 930 | "Read a string without echoing. |
| 930 | Then send it to the process running in the current buffer." | 931 | Then send it to the process running in the current buffer." |
| 931 | (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 |
| 932 | (let ((str (read-passwd | 933 | (let ((str (read-passwd |
| 933 | (format "%s Password: " | 934 | (format "%s Password: " |
| 934 | (process-name (eshell-interactive-process)))))) | 935 | (process-name (eshell-interactive-process)))))) |
| @@ -950,7 +951,7 @@ This function could be in the list `eshell-output-filter-functions'." | |||
| 950 | (beginning-of-line) | 951 | (beginning-of-line) |
| 951 | (if (re-search-forward eshell-password-prompt-regexp | 952 | (if (re-search-forward eshell-password-prompt-regexp |
| 952 | eshell-last-output-end t) | 953 | eshell-last-output-end t) |
| 953 | (eshell-send-invisible nil))))) | 954 | (eshell-send-invisible))))) |
| 954 | 955 | ||
| 955 | (custom-add-option 'eshell-output-filter-functions | 956 | (custom-add-option 'eshell-output-filter-functions |
| 956 | 'eshell-watch-for-password-prompt) | 957 | 'eshell-watch-for-password-prompt) |
| @@ -958,32 +959,30 @@ This function could be in the list `eshell-output-filter-functions'." | |||
| 958 | (defun eshell-handle-control-codes () | 959 | (defun eshell-handle-control-codes () |
| 959 | "Act properly when certain control codes are seen." | 960 | "Act properly when certain control codes are seen." |
| 960 | (save-excursion | 961 | (save-excursion |
| 961 | (let ((orig (point))) | 962 | (goto-char eshell-last-output-block-begin) |
| 962 | (goto-char eshell-last-output-block-begin) | 963 | (unless (eolp) |
| 963 | (unless (eolp) | 964 | (beginning-of-line)) |
| 964 | (beginning-of-line)) | 965 | (while (< (point) eshell-last-output-end) |
| 965 | (while (< (point) eshell-last-output-end) | 966 | (let ((char (char-after))) |
| 966 | (let ((char (char-after))) | 967 | (cond |
| 967 | (cond | 968 | ((eq char ?\r) |
| 968 | ((eq char ?\r) | 969 | (if (< (1+ (point)) eshell-last-output-end) |
| 969 | (if (< (1+ (point)) eshell-last-output-end) | 970 | (if (memq (char-after (1+ (point))) |
| 970 | (if (memq (char-after (1+ (point))) | 971 | '(?\n ?\r)) |
| 971 | '(?\n ?\r)) | 972 | (delete-char 1) |
| 972 | (delete-char 1) | 973 | (let ((end (1+ (point)))) |
| 973 | (let ((end (1+ (point)))) | 974 | (beginning-of-line) |
| 974 | (beginning-of-line) | 975 | (delete-region (point) end))) |
| 975 | (delete-region (point) end))) | 976 | (add-text-properties (point) (1+ (point)) |
| 976 | (add-text-properties (point) (1+ (point)) | 977 | '(invisible t)) |
| 977 | '(invisible t)) | 978 | (forward-char))) |
| 978 | (forward-char))) | 979 | ((eq char ?\a) |
| 979 | ((eq char ?\a) | 980 | (delete-char 1) |
| 980 | (delete-char 1) | 981 | (beep)) |
| 981 | (beep)) | 982 | ((eq char ?\C-h) |
| 982 | ((eq char ?\C-h) | 983 | (delete-region (1- (point)) (1+ (point)))) |
| 983 | (delete-backward-char 1) | 984 | (t |
| 984 | (delete-char 1)) | 985 | (forward-char))))))) |
| 985 | (t | ||
| 986 | (forward-char)))))))) | ||
| 987 | 986 | ||
| 988 | (custom-add-option 'eshell-output-filter-functions | 987 | (custom-add-option 'eshell-output-filter-functions |
| 989 | 'eshell-handle-control-codes) | 988 | 'eshell-handle-control-codes) |