;;; 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>
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)))
+ (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))))
+
+ ;; This hack is for backward compatibility with Bash 4.3 and
+ ;; earlier. It can break common uses of 'configure', so
+ ;; remove it once Bash 4.4 or later is common.
+ (unless (getenv "EMACS")
+ (list "EMACS=t"))
+
(list (format "INSIDE_EMACS=%s,comint" emacs-version))
process-environment))
(default-directory
(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))))