From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: How to set margins of buffer when window changes? Date: Wed, 08 Sep 2021 21:11:15 +0200 Message-ID: <87pmti511r.fsf@fastmail.fm> References: <20210908171222.Horde.S37YI7HmNoomvQZ1iZ9ma5I@www.vfemail.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="361"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.5; emacs 27.2 Cc: help-gnu-emacs@gnu.org To: edgar@openmail.cc Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 08 21:19:02 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mO364-000APJ-Gu for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 08 Sep 2021 21:19:02 +0200 Original-Received: from localhost ([::1]:38996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO362-0005rL-GW for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 08 Sep 2021 15:18:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO35P-0005pm-Al for help-gnu-emacs@gnu.org; Wed, 08 Sep 2021 15:18:20 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:51803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO35M-0000xy-HD for help-gnu-emacs@gnu.org; Wed, 08 Sep 2021 15:18:18 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id A37DE320096F; Wed, 8 Sep 2021 15:18:13 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 08 Sep 2021 15:18:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type; s=fm1; bh=OF/LzCuDMctZr+Dp8CXNqSQGKm L65gyQbWE+XuWqgws=; b=gXn27FyFqNZFQrXuyrUUmIOVs8PfjZkwWvlD3lc71+ jS5mpNLnIFfxdNlNPX/grKCNinHUq85KgpQw7/6jJK4EB6NzawRJcVB15/7779+N 5KfqRgqu0QbtcEDBRRsNrgXXD3IbfCGxSW12JUvmOXpA5OTV/W/qr9qwsPjTOPNh YSnwlLr0Q9ivGduavysv4NCrS6GWom6pJz7OmpM5K/ktIQABeYXGNhpqB4EbAFvB HUYV3gm7j/XqsFqiIdF7HDDS6NzuOVm2J6WBtxPCNmqfR2aI6p+EsecFmuA3eRoe vZ6BfYZIgKls0uT4toMVmDdwwfgvcKRrXbDJ3/jpqS1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=OF/LzC uDMctZr+Dp8CXNqSQGKmL65gyQbWE+XuWqgws=; b=L8IagDRGvrtNmdDKHNMv3b shEFxa57ciiIF7Wes+GJeYo8cTyswN12lLlo8cz/7SA6iXoYL8R+sB/cs69WnxBC mDLSvaD38K7QRNu0PKF1+vKEJWhfhenxLoKqRIlPbHkFp1hnmTeOeR6412cq39/g 0mH5Fu00869s89jsewUy6ZHj33h+FzJxh7sVe3yauL9dHw/SzSVbrmt2NQ5wToFV ylEUpJKT5ds3l+RW98YkM5Tmd5pB6eISAzqzRVFWHrPuL0Eqa3+sXMs5rWJO5x+o ZyI+5flfktSo69+2OyYOPBOPUtL/mthSi+uvwkyK8TaxzTAxKuMdh5dD0XzGkouQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudefjedgudefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddutddmnecujfgurhepfh gfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpeflohhoshhtucfmrhgvmhgv rhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqeenucggtffrrg htthgvrhhnpeevieelledtjeethfekveeikeekvefhtdffueevvedttefhtedutdejtdef vdejvdenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghs thhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Sep 2021 15:18:12 -0400 (EDT) In-reply-to: <20210908171222.Horde.S37YI7HmNoomvQZ1iZ9ma5I@www.vfemail.net> Received-SPF: pass client-ip=64.147.123.21; envelope-from=joostkremers@fastmail.fm; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132963 Archived-At: On Wed, Sep 08 2021, edgar@openmail.cc wrote: > I am trying to have some buffers centre the text. I figured that I could do it > with margins. I want this to adjust depending on the value of `fill-column' > (could be any other variable) and the width of the window (if it is too small, > don't centre). I've written a minor mode that does this: https://github.com/joostkremers/visual-fill-column To centre the text, set `visual-fill-column-center-text` to `t`. Feel free to adapt the code to your needs or simply use it for inspiration. :-) -- Joost Kremers Life has its moments