From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Enclosing text in a box Date: Fri, 18 Nov 2022 16:48:50 +0200 Message-ID: <83y1s89v3h.fsf@gnu.org> References: <_AODCZ2cNjiSAkIvdrGzDgeSNSWqJoJ9xfXn-zFenyY-yTUYx-Ijx0k4-Lq46rN4CjdkyIrzIBD1h4YY23BAP089R0Tg0kzM9MOUnaEOFrs=@protonmail.com> <835yffgfwp.fsf@gnu.org> <83y1sbez2r.fsf@gnu.org> <83sfiig87w.fsf@gnu.org> <83k03ug0zr.fsf@gnu.org> <8335aifz4c.fsf@gnu.org> <87mt8q62mu.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30499"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 18 15:49:40 2022 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 1ow2gV-0007fz-Iu for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Nov 2022 15:49:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ow2ft-0007OT-Oo; Fri, 18 Nov 2022 09:49:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow2ff-0007Nz-GE for help-gnu-emacs@gnu.org; Fri, 18 Nov 2022 09:48:59 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow2ff-0005gB-6X for help-gnu-emacs@gnu.org; Fri, 18 Nov 2022 09:48:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=RzdOg7LAuZQzJipJGJJ5fMWbS0/b3TYbrPF8ftycCdo=; b=Yh1f9nytSQ8dSyW//56J YlG0q5b7o62RmbDBjnh9IE0NewAmRyoCs64l1c2H4UY0mLbIObATYGcu+txHcb5pdc8e1QOINVDRj WpHZWeXi80Pu9kchE60bJ2+vYigSwbPFYxLSxyJSy5xSa1uv2P26SkzK2PSBy/MMNA/x/3ZPMKDW7 fA9173O3qLVNE+fuUX8ggZSwXyW7onN8VWXY1iieBNLJqjDIRMMaBz9NBfJOd5vyfeQ5L0k0KoVan qPD4gD5xfvU7Zkx2z/IOKV2SBYaBHaIMl0Pas76sHQ6v6BXltzFhz8lHDXJWLiT/mqerkMrQPyt64 cOf5u65IcrkHyg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow2fe-0005EF-Qp for help-gnu-emacs@gnu.org; Fri, 18 Nov 2022 09:48:47 -0500 In-Reply-To: <87mt8q62mu.fsf@dataswamp.org> (message from Emanuel Berg on Wed, 16 Nov 2022 21:55:05 +0100) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141049 Archived-At: > From: Emanuel Berg > Date: Wed, 16 Nov 2022 21:55:05 +0100 > > Eli Zaretskii wrote: > > >> Asking users to handle such conditions would be too hard to > >> do repeatedly. > > > > This is not userland, this is Emacs Lisp programming for > > display, and yes, it is quite tricky > > (defun sign (label) > (interactive "sLabel: ") > (let*((vertical "|") > (horizontal ?-) > (corner "+") > (mid (format "%s %s %s" vertical label vertical)) > (len (length mid)) > (top (format "%s%s%s" corner (make-string (- len 2) horizontal) corner)) > (sgn (format "%s\n%s\n%s\n" top mid top)) ) > (insert sgn) )) > > ;; M-x sign This is not a bluff RET > ;; > ;; +---------------------+ > ;; | This is not a bluff | > ;; +---------------------+ And now try with "fullwidth" characters, like the below: M-x sign RET This is not a bluff RET This yields: +---------------------+ | This is not a bluff | +---------------------+ Hmm...