From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: How to change overlay arrow position silently? Date: Mon, 10 Aug 2009 01:55:33 +0300 Organization: JURTA Message-ID: <87iqgw1wkq.fsf@mail.jurta.org> References: <87ljm2nzdj.fsf@sphinx.net.ru> <87hbwqfhd7.fsf@dd.chalmers.se> <874ospda07.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249859918 24282 80.91.229.12 (9 Aug 2009 23:18:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Aug 2009 23:18:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 10 01:18:31 2009 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 1MaHep-0003wi-9Z for ged-emacs-devel@m.gmane.org; Mon, 10 Aug 2009 01:18:31 +0200 Original-Received: from localhost ([127.0.0.1]:54728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaHeo-0001Uo-CE for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 19:18:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaHdy-0000zh-D8 for emacs-devel@gnu.org; Sun, 09 Aug 2009 19:17:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaHds-0000uK-LL for emacs-devel@gnu.org; Sun, 09 Aug 2009 19:17:36 -0400 Original-Received: from [199.232.76.173] (port=35917 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaHds-0000uH-Ga for emacs-devel@gnu.org; Sun, 09 Aug 2009 19:17:32 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3]:56380 helo=mx1.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaHds-0002Bc-1w for emacs-devel@gnu.org; Sun, 09 Aug 2009 19:17:32 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.54.6.cable.starman.ee [82.131.54.6]) by mx1.starman.ee (Postfix) with ESMTP id D4BD43F4110; Mon, 10 Aug 2009 02:17:23 +0300 (EEST) In-Reply-To: (Stefan Monnier's message of "Tue, 04 Aug 2009 13:38:33 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:113891 Archived-At: >> Its docstring says it can be used non-interactively: > >> When called from Lisp code, the optional argument BUFFER >> ========================== >> specifies a buffer to switch to. > > It seems like even this `buffer' argument is very much an "interactive" > feature since it causes the buffer to be displayed, which may cause new > windows/frames to be created. > > Makes me wonder: does any code use this `buffer' argument? My guess is > that it's only used by things like the command-line-arg processing > (and/or the emacs-server). We had better make it more clear: do not use > it from Elisp unless you know what you're doing (i.e. add it to > byte-compile-interactive-only-functions). I can't find any code that uses this `buffer' argument, but there are more than 150 places in Emacs that call this `goto-line' function. So we can't easily prohibit using it non-interactively. But I think there is no harm when using non-interactively. A similar function "goto-char" has interactive/non-interactive duality with no problem. The only problem with "goto-line" is that it sets the mark and prints the message "Mark set". Using a new argument `interactivep' will allow the programmer to decide where to do this. When a command is just a wrapper around the `goto-line' (like the command `View-goto-line') then it should call `goto-line' with interactivep=t. -- Juri Linkov http://www.jurta.org/emacs/