From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wesley Dawson Newsgroups: gmane.emacs.bugs Subject: bug#11224: 23.2; `comint-history-isearch' with value 'dwim causes error when comint process is finished Date: Wed, 11 Apr 2012 02:49:06 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1334160362 6657 80.91.229.3 (11 Apr 2012 16:06:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2012 16:06:02 +0000 (UTC) To: 11224@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 11 18:06:02 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SI03R-0008Lb-D7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 18:05:57 +0200 Original-Received: from localhost ([::1]:40359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI03Q-0000pm-Lg for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 12:05:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI02a-0000b6-J3 for bug-gnu-emacs@gnu.org; Wed, 11 Apr 2012 12:05:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SI02Q-0005Dt-D9 for bug-gnu-emacs@gnu.org; Wed, 11 Apr 2012 12:05:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI02Q-0005DU-A5 for bug-gnu-emacs@gnu.org; Wed, 11 Apr 2012 12:04:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SI03V-0001Ty-JK for bug-gnu-emacs@gnu.org; Wed, 11 Apr 2012 12:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wesley Dawson Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Apr 2012 16:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11224 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13341603065618 (code B ref -1); Wed, 11 Apr 2012 16:06:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Apr 2012 16:05:06 +0000 Original-Received: from localhost ([127.0.0.1]:52295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SI02b-0001SY-R2 for submit@debbugs.gnu.org; Wed, 11 Apr 2012 12:05:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38026) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SHuCF-0001gh-Vb for submit@debbugs.gnu.org; Wed, 11 Apr 2012 05:50:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHuB5-00024q-Iu for submit@debbugs.gnu.org; Wed, 11 Apr 2012 05:49:33 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:36369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHuB5-00024m-Fd for submit@debbugs.gnu.org; Wed, 11 Apr 2012 05:49:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHuB0-0002UD-KV for bug-gnu-emacs@gnu.org; Wed, 11 Apr 2012 05:49:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHuAv-0001z6-7R for bug-gnu-emacs@gnu.org; Wed, 11 Apr 2012 05:49:22 -0400 Original-Received: from sandstorm.ocf.berkeley.edu ([128.32.129.218]:49586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHuAu-0001ri-UY for bug-gnu-emacs@gnu.org; Wed, 11 Apr 2012 05:49:17 -0400 Original-Received: from tsunami.ocf.berkeley.edu (tsunami.OCF.Berkeley.EDU [128.32.129.223]) by sandstorm.ocf.berkeley.edu (Postfix) with ESMTP id B457040392 for ; Wed, 11 Apr 2012 02:49:06 -0700 (PDT) Original-Received: by tsunami.ocf.berkeley.edu (Postfix, from userid 19319) id 6617F20038; Wed, 11 Apr 2012 02:49:06 -0700 (PDT) X-Virus-Scanned: clamav-milter 0.97.3 at sandstorm X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Wed, 11 Apr 2012 12:05:04 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Wed, 11 Apr 2012 12:05:55 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58820 Archived-At: Setting `comint-history-isearch' to 'dwim causes comint buffers where the process has exited to give the following error: (comint-after-pmark-p: Wrong type argument: processp, nil) isearch works as expected after the message, however. Following is a fix to `comint-after-pmark-p', which makes it simply return nil if the process has already ended: (defun comint-after-pmark-p () "Return t if point is after the process output marker. Return nil if the process has ended." (let* ((process (get-buffer-process (current-buffer))) (pmark (and process (process-mark process)))) (and pmark (<= (marker-position pmark) (point))))) It seems it is currently impossible to recover the input history once the process exits, so I believe this is the sensible thing to do. In addition, `async-shell-command' is often used to execute arbitrary long-running processes that don't require input but that you don't want to hang emacs, and so an input history won't even be available in those cases. Recipe for emacs -Q: (setq comint-history-isearch 'dwim) C-j M-x async-shell-command : RET C-x o C-s (comint-after-pmark-p: Wrong type argument: processp, nil) In GNU Emacs 23.2.1 (i486-pc-linux-gnu) of 2010-12-11 on raven, modified by Debian configured using `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=no' '--without-gconf' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: en_US.UTF-8 value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Shell Minor modes in effect: shell-dirtrack-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: ESC [ > 0 ; 2 7 7 ; 0 c ESC ] 1 1 ; r g b : a 5 a 5 / 2 a 2 a / 2 a 2 a ESC \ ( s e t q SPC c o m i n t - h i s t o r y - i s e a r c h SPC ' d w i m ) C-j ESC & : RET C-x o C-s ESC x r e p o r t - e m a c s - b u g RET Recent messages: ("emacs") For information about GNU Emacs and the GNU system, type C-h C-a. :: finished. comint-after-pmark-p: Wrong type argument: processp, nil Load-path shadows: /usr/share/emacs/23.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup Features: (shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml easymenu mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug shell comint ring ediff-hook vc-hooks lisp-float-type lisp-mode register page menu-bar rfn-eshadow timer select mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind multi-tty emacs)