From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Set-window-point in append-to-buffer Date: Tue, 21 Apr 2015 13:19:21 +0200 Message-ID: <87a8y1n2yu.fsf@web.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429615194 6401 80.91.229.3 (21 Apr 2015 11:19:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Apr 2015 11:19:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 21 13:19:47 2015 Return-path: Envelope-to: geh-help-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 1YkWDR-0003Dd-Vw for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Apr 2015 13:19:46 +0200 Original-Received: from localhost ([::1]:57872 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkWDR-0006dQ-4z for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Apr 2015 07:19:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkWDG-0006dJ-0N for help-gnu-emacs@gnu.org; Tue, 21 Apr 2015 07:19:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkWDC-0002od-0Y for help-gnu-emacs@gnu.org; Tue, 21 Apr 2015 07:19:33 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkWDB-0002oH-Pj for help-gnu-emacs@gnu.org; Tue, 21 Apr 2015 07:19:29 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YkWDA-000322-1d for help-gnu-emacs@gnu.org; Tue, 21 Apr 2015 13:19:28 +0200 Original-Received: from dslb-094-217-114-052.094.217.pools.vodafone-ip.de ([94.217.114.52]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Apr 2015 13:19:28 +0200 Original-Received: from michael_heerdegen by dslb-094-217-114-052.094.217.pools.vodafone-ip.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Apr 2015 13:19:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-094-217-114-052.094.217.pools.vodafone-ip.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:oyEkhAW1Cw1mmjc5cuVyzd1NKds= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103901 Archived-At: Steve Schooler writes: > The append-to-buffer function's definition ends with: > > (dolist (window windows) > (when (= (window-point window) point) > (set-window-point window (point)))))))) > > What is the purpose of this? AFAICT the purpose is to make what the doc of `append-to-buffer' says: "Append to specified buffer the text of the region. It is inserted into that buffer before its point." valid for the window points of all windows displaying the target buffer. > Experimenting, I commented out this code and re-ran, but could detect > no difference in functionality? Try again with this snipped for example: --8<---------------cut here---------------start------------->8--- (let ((buffer-to-modify (get-buffer-create "Test")) (buffer-with-text (get-buffer-create "Text"))) (with-current-buffer buffer-to-modify (erase-buffer)) (switch-to-buffer buffer-with-text) (erase-buffer) (insert "TextText") (display-buffer-pop-up-window buffer-to-modify '()) (append-to-buffer buffer-to-modify (point-min) (point-max))) --8<---------------cut here---------------end--------------->8--- Michael.