diff options
| author | Miles Bader | 2007-11-11 00:56:44 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-11-11 00:56:44 +0000 |
| commit | f23d76bdefbd4c06e14d69e99e50d35ce91c8226 (patch) | |
| tree | ded28d1da6df2d0135514bac83074f4ca1c9099a /lisp/eshell | |
| parent | e2d092da5980a7d05a5428074f8eb4925fa801e8 (diff) | |
| parent | a457417ee5ba797ab1c91d35ee957bb7a7f8d4b6 (diff) | |
| download | emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.tar.gz emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.zip | |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-dirs.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/em-glob.el | 3 | ||||
| -rw-r--r-- | lisp/eshell/esh-mode.el | 62 | ||||
| -rw-r--r-- | lisp/eshell/esh-proc.el | 56 |
4 files changed, 61 insertions, 62 deletions
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 0000cae5adf..02556661b1b 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el | |||
| @@ -319,7 +319,7 @@ in the minibuffer: | |||
| 319 | (before translate-multiple-dots | 319 | (before translate-multiple-dots |
| 320 | (filename &optional directory) activate) | 320 | (filename &optional directory) activate) |
| 321 | (setq filename (eshell-expand-multiple-dots filename)))" | 321 | (setq filename (eshell-expand-multiple-dots filename)))" |
| 322 | (while (string-match "\\.\\.\\(\\.+\\)" path) | 322 | (while (string-match "\\(?:^\\|/\\)\\.\\.\\(\\.+\\)\\(?:$\\|/\\)" path) |
| 323 | (let* ((extra-dots (match-string 1 path)) | 323 | (let* ((extra-dots (match-string 1 path)) |
| 324 | (len (length extra-dots)) | 324 | (len (length extra-dots)) |
| 325 | replace-text) | 325 | replace-text) |
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index 5d68fdf9437..2e95aaefae0 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el | |||
| @@ -258,7 +258,7 @@ the form: | |||
| 258 | (eshell-glob-entries (file-name-as-directory ".") paths)) | 258 | (eshell-glob-entries (file-name-as-directory ".") paths)) |
| 259 | (if message-shown | 259 | (if message-shown |
| 260 | (message nil))) | 260 | (message nil))) |
| 261 | (or (and matches (nreverse matches)) | 261 | (or (and matches (sort matches #'string<)) |
| 262 | (if eshell-error-if-no-glob | 262 | (if eshell-error-if-no-glob |
| 263 | (error "No matches found: %s" glob) | 263 | (error "No matches found: %s" glob) |
| 264 | glob)))) | 264 | glob)))) |
| @@ -267,6 +267,7 @@ the form: | |||
| 267 | (defvar matches) | 267 | (defvar matches) |
| 268 | (defvar message-shown)) | 268 | (defvar message-shown)) |
| 269 | 269 | ||
| 270 | ;; FIXME does this really need to abuse matches, message-shown? | ||
| 270 | (defun eshell-glob-entries (path globs &optional recurse-p) | 271 | (defun eshell-glob-entries (path globs &optional recurse-p) |
| 271 | "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil." | 272 | "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil." |
| 272 | (let* ((entries (ignore-errors | 273 | (let* ((entries (ignore-errors |
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 0a8c8be697f..8b7338f8833 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el | |||
| @@ -778,38 +778,36 @@ This is done after all necessary filtering has been done." | |||
| 778 | (setq string (funcall (car functions) string)) | 778 | (setq string (funcall (car functions) string)) |
| 779 | (setq functions (cdr functions)))) | 779 | (setq functions (cdr functions)))) |
| 780 | (if (and string oprocbuf (buffer-name oprocbuf)) | 780 | (if (and string oprocbuf (buffer-name oprocbuf)) |
| 781 | (let ((obuf (current-buffer)) | 781 | (let (opoint obeg oend) |
| 782 | opoint obeg oend) | 782 | (with-current-buffer oprocbuf |
| 783 | (set-buffer oprocbuf) | 783 | (setq opoint (point)) |
| 784 | (setq opoint (point)) | 784 | (setq obeg (point-min)) |
| 785 | (setq obeg (point-min)) | 785 | (setq oend (point-max)) |
| 786 | (setq oend (point-max)) | 786 | (let ((buffer-read-only nil) |
| 787 | (let ((buffer-read-only nil) | 787 | (nchars (length string)) |
| 788 | (nchars (length string)) | 788 | (ostart nil)) |
| 789 | (ostart nil)) | 789 | (widen) |
| 790 | (widen) | 790 | (goto-char eshell-last-output-end) |
| 791 | (goto-char eshell-last-output-end) | 791 | (setq ostart (point)) |
| 792 | (setq ostart (point)) | 792 | (if (<= (point) opoint) |
| 793 | (if (<= (point) opoint) | 793 | (setq opoint (+ opoint nchars))) |
| 794 | (setq opoint (+ opoint nchars))) | 794 | (if (< (point) obeg) |
| 795 | (if (< (point) obeg) | 795 | (setq obeg (+ obeg nchars))) |
| 796 | (setq obeg (+ obeg nchars))) | 796 | (if (<= (point) oend) |
| 797 | (if (<= (point) oend) | 797 | (setq oend (+ oend nchars))) |
| 798 | (setq oend (+ oend nchars))) | 798 | (insert-before-markers string) |
| 799 | (insert-before-markers string) | 799 | (if (= (window-start (selected-window)) (point)) |
| 800 | (if (= (window-start (selected-window)) (point)) | 800 | (set-window-start (selected-window) |
| 801 | (set-window-start (selected-window) | 801 | (- (point) nchars))) |
| 802 | (- (point) nchars))) | 802 | (if (= (point) eshell-last-input-end) |
| 803 | (if (= (point) eshell-last-input-end) | 803 | (set-marker eshell-last-input-end |
| 804 | (set-marker eshell-last-input-end | 804 | (- eshell-last-input-end nchars))) |
| 805 | (- eshell-last-input-end nchars))) | 805 | (set-marker eshell-last-output-start ostart) |
| 806 | (set-marker eshell-last-output-start ostart) | 806 | (set-marker eshell-last-output-end (point)) |
| 807 | (set-marker eshell-last-output-end (point)) | 807 | (force-mode-line-update)) |
| 808 | (force-mode-line-update)) | 808 | (narrow-to-region obeg oend) |
| 809 | (narrow-to-region obeg oend) | 809 | (goto-char opoint) |
| 810 | (goto-char opoint) | 810 | (eshell-run-output-filters)))))) |
| 811 | (eshell-run-output-filters) | ||
| 812 | (set-buffer obuf))))) | ||
| 813 | 811 | ||
| 814 | (defun eshell-run-output-filters () | 812 | (defun eshell-run-output-filters () |
| 815 | "Run the `eshell-output-filter-functions' on the current output." | 813 | "Run the `eshell-output-filter-functions' on the current output." |
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index fb226cf51fb..7338756e3f8 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el | |||
| @@ -335,39 +335,39 @@ Used only on systems which do not support async subprocesses.") | |||
| 335 | PROC is the process for which we're inserting output. STRING is the | 335 | PROC is the process for which we're inserting output. STRING is the |
| 336 | output." | 336 | output." |
| 337 | (when (buffer-live-p (process-buffer proc)) | 337 | (when (buffer-live-p (process-buffer proc)) |
| 338 | (set-buffer (process-buffer proc)) | 338 | (with-current-buffer (process-buffer proc) |
| 339 | (let ((entry (assq proc eshell-process-list))) | 339 | (let ((entry (assq proc eshell-process-list))) |
| 340 | (when entry | 340 | (when entry |
| 341 | (setcar (nthcdr 3 entry) | 341 | (setcar (nthcdr 3 entry) |
| 342 | (concat (nth 3 entry) string)) | 342 | (concat (nth 3 entry) string)) |
| 343 | (unless (nth 4 entry) ; already being handled? | 343 | (unless (nth 4 entry) ; already being handled? |
| 344 | (while (nth 3 entry) | 344 | (while (nth 3 entry) |
| 345 | (let ((data (nth 3 entry))) | 345 | (let ((data (nth 3 entry))) |
| 346 | (setcar (nthcdr 3 entry) nil) | 346 | (setcar (nthcdr 3 entry) nil) |
| 347 | (setcar (nthcdr 4 entry) t) | 347 | (setcar (nthcdr 4 entry) t) |
| 348 | (eshell-output-object data nil (cadr entry)) | 348 | (eshell-output-object data nil (cadr entry)) |
| 349 | (setcar (nthcdr 4 entry) nil)))))))) | 349 | (setcar (nthcdr 4 entry) nil))))))))) |
| 350 | 350 | ||
| 351 | (defun eshell-sentinel (proc string) | 351 | (defun eshell-sentinel (proc string) |
| 352 | "Generic sentinel for command processes. Reports only signals. | 352 | "Generic sentinel for command processes. Reports only signals. |
| 353 | PROC is the process that's exiting. STRING is the exit message." | 353 | PROC is the process that's exiting. STRING is the exit message." |
| 354 | (when (buffer-live-p (process-buffer proc)) | 354 | (when (buffer-live-p (process-buffer proc)) |
| 355 | (set-buffer (process-buffer proc)) | 355 | (with-current-buffer (process-buffer proc) |
| 356 | (unwind-protect | 356 | (unwind-protect |
| 357 | (let* ((entry (assq proc eshell-process-list))) | 357 | (let* ((entry (assq proc eshell-process-list))) |
| 358 | ; (if (not entry) | 358 | ; (if (not entry) |
| 359 | ; (error "Sentinel called for unowned process `%s'" | 359 | ; (error "Sentinel called for unowned process `%s'" |
| 360 | ; (process-name proc)) | 360 | ; (process-name proc)) |
| 361 | (when entry | 361 | (when entry |
| 362 | (unwind-protect | 362 | (unwind-protect |
| 363 | (progn | 363 | (progn |
| 364 | (unless (string= string "run") | 364 | (unless (string= string "run") |
| 365 | (unless (string-match "^\\(finished\\|exited\\)" string) | 365 | (unless (string-match "^\\(finished\\|exited\\)" string) |
| 366 | (eshell-insertion-filter proc string)) | 366 | (eshell-insertion-filter proc string)) |
| 367 | (eshell-close-handles (process-exit-status proc) 'nil | 367 | (eshell-close-handles (process-exit-status proc) 'nil |
| 368 | (cadr entry)))) | 368 | (cadr entry)))) |
| 369 | (eshell-remove-process-entry entry)))) | 369 | (eshell-remove-process-entry entry)))) |
| 370 | (run-hook-with-args 'eshell-kill-hook proc string)))) | 370 | (run-hook-with-args 'eshell-kill-hook proc string))))) |
| 371 | 371 | ||
| 372 | (defun eshell-process-interact (func &optional all query) | 372 | (defun eshell-process-interact (func &optional all query) |
| 373 | "Interact with a process, using PROMPT if more than one, via FUNC. | 373 | "Interact with a process, using PROMPT if more than one, via FUNC. |