From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: [ERC] wanna have C-a take me to after prompt.. Date: 18 Jun 2002 16:36:09 +0900 Sender: emacs-devel-admin@gnu.org Message-ID: References: <87ofea6p5z.fsf@tc-1-100.kawasaki.gol.ne.jp> Reply-To: Miles Bader NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1024385989 20671 127.0.0.1 (18 Jun 2002 07:39:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 18 Jun 2002 07:39:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17KDaf-0005NI-00 for ; Tue, 18 Jun 2002 09:39:49 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17KE1G-0000sr-00 for ; Tue, 18 Jun 2002 10:07:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17KDa5-00024c-00; Tue, 18 Jun 2002 03:39:13 -0400 Original-Received: from tyo202.gate.nec.co.jp ([210.143.35.52]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17KDXG-0001vx-00; Tue, 18 Jun 2002 03:36:18 -0400 Original-Received: from mailgate4.nec.co.jp ([10.7.69.193]) by TYO202.gate.nec.co.jp (8.11.6/3.7W01080315) with ESMTP id g5I7aBe23088; Tue, 18 Jun 2002 16:36:11 +0900 (JST) Original-Received: from mailsv.nec.co.jp (mailgate51.nec.co.jp [10.7.69.196]) by mailgate4.nec.co.jp (8.11.6/3.7W-MAILGATE-NEC) with ESMTP id g5I7aAm25363; Tue, 18 Jun 2002 16:36:11 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp ([10.30.114.133]) by mailsv.nec.co.jp (8.11.6/3.7W-MAILSV-NEC) with ESMTP id g5I7aAh22654; Tue, 18 Jun 2002 16:36:10 +0900 (JST) Original-Received: from mcspd15.ucom.lsi.nec.co.jp (mcspd15 [10.30.114.174]) by mcsss2.ucom.lsi.nec.co.jp (8.10.2+Sun/3.7Wlsi_mx_6.0) with ESMTP id g5I7a9K10999; Tue, 18 Jun 2002 16:36:09 +0900 (JST) Original-Received: by mcspd15.ucom.lsi.nec.co.jp (Postfix, from userid 31295) id 1EC3337C8; Tue, 18 Jun 2002 16:36:09 +0900 (JST) Original-To: Roland Winkler System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: Original-Lines: 62 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4946 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4946 Roland Winkler writes: > I'd like to use the field properties to get the expected behavior > from `C-a' (comint-bol). But with the prompt being inserted by the > process filter function, this doesn't work. The reason is that processing of `comint-output-filter-functions' is done _after_ the prompt is set up. It's probably OK to move the filter processing after that point (though I'm not sure), but it will still require some care on your part if you do this sort of thing -- in particular, if you insert text after the process-mark, you have to be sure to move the process-mark to reflect that, or else it will be considered `after' the prompt. An example output-filter function that does this might be like: (defun of-foo (s) (unless (zerop (length s)) (save-excursion (insert (format "[foo]")) (set-marker (process-mark (get-buffer-process (current-buffer))) (point))))) Can you try the following patch to comint, and see if this makes things work correctly for you? Thanks, -Miles 2002-06-18 Miles Bader * comint.el (comint-output-filter): Run output-filter functions before setting up the prompt. --- comint.el.~1.277.~ Mon Jun 17 17:01:22 2002 +++ comint.el Tue Jun 18 16:29:25 2002 @@ -1660,6 +1660,9 @@ This function should be in the list `com ;; Advance process-mark (set-marker (process-mark process) (point)) + (run-hook-with-args 'comint-output-filter-functions string) + (goto-char (process-mark process)) ; in case a filter moved it + (unless comint-use-prompt-regexp-instead-of-fields (let ((inhibit-read-only t)) (add-text-properties comint-last-output-start (point) @@ -1684,9 +1687,7 @@ This function should be in the list `com (overlay-put comint-last-prompt-overlay 'font-lock-face 'comint-highlight-prompt)))) - (goto-char saved-point) - - (run-hook-with-args 'comint-output-filter-functions string))))))) + (goto-char saved-point))))))) (defun comint-preinput-scroll-to-bottom () "Go to the end of buffer in all windows showing it. -- Run away! Run away!