all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Subject: Using temporary buffers to display messages
Date: Thu, 29 Mar 2012 04:36:20 +0200	[thread overview]
Message-ID: <87vclogml7.fsf@wanadoo.es> (raw)

`sunrise-sunset' contains this code, that displays the text on the
minibuffer if the frame is wide enough and on a temporary buffer
otherwise:

(if (<= (length msg) (frame-width))
        (message "%s" msg)
      (with-output-to-temp-buffer "*temp*"
        (princ (concat date-string "\n" time-string)))
      (message "%s"
               (substitute-command-keys
                (if one-window
                    (if pop-up-windows
                        "Type \\[delete-other-windows] to remove temp window."
                      "Type \\[switch-to-buffer] RET to remove temp window.")
                  "Type \\[switch-to-buffer-other-window] RET to restore old \
contents of temp window."))))

Is it correct nowadays to use a temporary buffer for displaying
informative text when it doesn't fit on a single line or is it a vestige
of the times when the minibuffer lacked autoexpand capabilities?

(There is another issue with the code above: if the minibuffer is on a
separate frame with different width, the function may end displaying the
text on a way that is not what the original developer intended.)




             reply	other threads:[~2012-03-29  2:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  2:36 Óscar Fuentes [this message]
2012-03-29 14:31 ` Using temporary buffers to display messages Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vclogml7.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.