emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114213: * lisp/eshell/esh-mode.el (eshell-mode-synt


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114213: * lisp/eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization.
Date: Wed, 11 Sep 2013 16:01:00 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114213
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15338
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-09-11 12:00:37 -0400
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/eshell/esh-mode.el        eshmode.el-20091113204419-o5vbwnq5f7feedwu-1848
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-11 12:36:59 +0000
+++ b/lisp/ChangeLog    2013-09-11 16:00:37 +0000
@@ -1,5 +1,12 @@
 2013-09-11  Stefan Monnier  <address@hidden>
 
+       * eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization
+       (bug#15338).
+       (eshell-self-insert-command, eshell-send-invisible): Remove
+       unused argument.
+       (eshell-handle-control-codes): Remove unused var `orig'.
+       Avoid delete-backward-char.
+
        * files.el (set-auto-mode): Simplify a bit further.
 
 2013-09-11  Glenn Morris  <address@hidden>
@@ -74,7 +81,7 @@
 2013-09-10  Stefan Monnier  <address@hidden>
 
        * simple.el: Use set-temporary-overlay-map for universal-argument.
-       (universal-argument-map): Don't use default-bindings.
+       (universal-argument-map): Don't use default-bindings (bug#15317).
        Bind switch-frame explicitly.  Replace universal-argument-minus with
        a conditional binding.
        (universal-argument-num-events, saved-overriding-map): Remove.

=== modified file 'lisp/eshell/esh-mode.el'
--- a/lisp/eshell/esh-mode.el   2013-09-11 03:31:56 +0000
+++ b/lisp/eshell/esh-mode.el   2013-09-11 16:00:37 +0000
@@ -267,19 +267,20 @@
     ;; 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 @@
     (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 @@
 (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 @@
       (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 @@
 (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)


reply via email to

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