From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Compilation auto-jump bug Date: Wed, 23 Apr 2008 11:40:58 -0400 Message-ID: References: <87iqybasft.fsf@stupidchicken.com> <87fxte7q9f.fsf@jurta.org> <18445.9167.275354.249388@kahikatea.snap.net.nz> <87ej8xka66.fsf_-_@jurta.org> <87tzhtt0i1.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1208965284 1828 80.91.229.12 (23 Apr 2008 15:41:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Apr 2008 15:41:24 +0000 (UTC) Cc: Nick Roberts , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 23 17:41:59 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Joh6S-0007jB-AW for ged-emacs-devel@m.gmane.org; Wed, 23 Apr 2008 17:41:48 +0200 Original-Received: from localhost ([127.0.0.1]:49765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Joh5m-00038r-JX for ged-emacs-devel@m.gmane.org; Wed, 23 Apr 2008 11:41:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Joh5i-00038d-Iy for emacs-devel@gnu.org; Wed, 23 Apr 2008 11:41:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Joh5g-000383-CZ for emacs-devel@gnu.org; Wed, 23 Apr 2008 11:41:01 -0400 Original-Received: from [199.232.76.173] (port=57714 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Joh5g-00037y-2Y for emacs-devel@gnu.org; Wed, 23 Apr 2008 11:41:00 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Joh5f-0001P4-DH for emacs-devel@gnu.org; Wed, 23 Apr 2008 11:40:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8FAC/1DkhFxIud/2dsb2JhbACBUqwZ X-IronPort-AV: E=Sophos;i="4.25,699,1199682000"; d="scan'208";a="18944466" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 23 Apr 2008 11:40:58 -0400 Original-Received: from pastel.home ([69.196.139.157]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id DTL61358; Wed, 23 Apr 2008 11:40:58 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 70A368064; Wed, 23 Apr 2008 11:40:58 -0400 (EDT) In-Reply-To: <87tzhtt0i1.fsf@jurta.org> (Juri Linkov's message of "Wed, 23 Apr 2008 11:54:14 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:95845 Archived-At: >> (defun compilation-auto-jump (buffer pos) >> (with-current-buffer buffer >> (goto-char pos) >> (let ((win (get-buffer-window buffer 0))) >> (if win (set-window-point win pos))) >> (if compilation-auto-jump-to-first-error >> (compile-goto-error)))) > Yes, it works. Maybe we should add a primitive for this additional code > with a name like `save-window-point'? If this name can be confused with > a function that keeps the old window point before entering its body, then > maybe some other name would be more clear. We could provide (defun goto-char-window (pos) "Like `goto-char' but also moves `window-point'." (goto-char pos) (let ((win (get-buffer-window (current-buffer) 0))) (if win (set-window-point win pos)))) This kind of thing is needed at various places, so it might be a good idea. If someone could grep through the Elisp code to try and find the various places where we do something similar and try to see if the above function is a good fit, that would be helpful, Stefan