help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enclosing text in a box


From: Emanuel Berg
Subject: Re: Enclosing text in a box
Date: Wed, 16 Nov 2022 22:04:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii wrote:

>> Asking users to handle such conditions would be too hard [...]
>
> [...] this is Emacs Lisp programming

You better believe it - it's like at the very epicentrum
of things!

Only the very, very best can do it, and sometimes seven days
a week.

(defun sign (label &optional no-insert)
  (interactive "sLabel: \nP")
  (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)) )
    (if no-insert
        sgn
      (insert sgn) )))

;; +---------------------+
;; | This is not a bluff |
;; +---------------------+

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]