;;; comint.el --- general command interpreter in a window stuff -*- lexical-binding: t -*-
-;; Copyright (C) 1988, 1990, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1990, 1992-2016 Free Software Foundation, Inc.
;; Author: Olin Shivers <shivers@cs.cmu.edu>
;; Simon Marshall <simon@gnu.org>
the remaining prompts will be accidentally messed up. You may
wish to put something like the following in your init file:
-\(add-hook 'comint-mode-hook
- (lambda ()
- (define-key comint-mode-map [remap kill-region] 'comint-kill-region)
- (define-key comint-mode-map [remap kill-whole-line]
- 'comint-kill-whole-line)))
+\(add-hook \\='comint-mode-hook
+ (lambda ()
+ (define-key comint-mode-map [remap kill-region] \\='comint-kill-region)
+ (define-key comint-mode-map [remap kill-whole-line]
+ \\='comint-kill-whole-line)))
If you sometimes use comint-mode on text-only terminals or with `emacs -nw',
you might wish to use another binding for `comint-kill-whole-line'."
(format "COLUMNS=%d" (window-width)))
(list "TERM=emacs"
(format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
- (unless (getenv "EMACS")
- (list "EMACS=t"))
(list (format "INSIDE_EMACS=%s,comint" emacs-version))
process-environment))
(default-directory
(let ((ch (read-event)))
(if (eq ch ?\s)
(set-window-configuration conf)
- (setq unread-command-events (list ch)))))))
+ (push ch unread-command-events))))))
(defun comint-regexp-arg (prompt)
(defun comint-within-quotes (beg end)
"Return t if the number of quotes between BEG and END is odd.
Quotes are single and double."
- (let ((countsq (comint-how-many-region "\\(^\\|[^\\\\]\\)\'" beg end))
+ (let ((countsq (comint-how-many-region "\\(^\\|[^\\\\]\\)'" beg end))
(countdq (comint-how-many-region "\\(^\\|[^\\\\]\\)\"" beg end)))
(or (= (mod countsq 2) 1) (= (mod countdq 2) 1))))
(add-text-properties prompt-start (point)
'(read-only t front-sticky (read-only)))))
(when comint-last-prompt
- (with-silent-modifications
- (font-lock--remove-face-from-text-property
- (car comint-last-prompt)
- (cdr comint-last-prompt)
- 'font-lock-face
- 'comint-highlight-prompt)))
+ ;; There might be some keywords here waiting for
+ ;; fontification, so no `with-silent-modifications'.
+ (font-lock--remove-face-from-text-property
+ (car comint-last-prompt)
+ (cdr comint-last-prompt)
+ 'font-lock-face
+ 'comint-highlight-prompt))
(setq comint-last-prompt
(cons (copy-marker prompt-start) (point-marker)))
- (with-silent-modifications
- (font-lock-prepend-text-property prompt-start (point)
- 'font-lock-face
- 'comint-highlight-prompt)
- (add-text-properties prompt-start (point) '(rear-nonsticky t))))
+ (font-lock-prepend-text-property prompt-start (point)
+ 'font-lock-face
+ 'comint-highlight-prompt)
+ (add-text-properties prompt-start (point) '(rear-nonsticky t)))
(goto-char saved-point)))))))
(defun comint-preinput-scroll-to-bottom ()
A typical use:
(interactive (comint-get-source \"Compile file: \" prev-lisp-dir/file
- '(lisp-mode) t))"
+ \\='(lisp-mode) t))"
(let* ((def (comint-source-default prev-dir/file source-modes))
(stringfile (comint-extract-string))
(sfile-p (and stringfile
(set-window-configuration comint-dynamic-list-completions-config))
(if (eq first ?\s)
(set-window-configuration comint-dynamic-list-completions-config)
- (setq unread-command-events (listify-key-sequence key)))))))
+ (setq unread-command-events
+ (nconc (listify-key-sequence key) unread-command-events)))))))
\f
(defun comint-get-next-from-history ()
"After fetching a line from input history, this fetches the following line.