unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Skip Montanaro <skip.montanaro@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Interactive window resize feedback?
Date: Fri, 26 May 2017 19:12:15 +0200	[thread overview]
Message-ID: <87lgpjpmog.fsf@rosalinde> (raw)
In-Reply-To: <CANc-5Uyc0-8deNNkEfw5VscNK=zBQzkPrKZUKK05DmUQE2R9NA@mail.gmail.com> (Skip Montanaro's message of "Fri, 26 May 2017 11:22:01 -0500")

On Fri, 26 May 2017 11:22:01 -0500 Skip Montanaro <skip.montanaro@gmail.com> wrote:

> I'm an old 80-column guy. Sometimes I need to widen a frame to view
> more text without truncation or line wrappage, though. Is it possible
> to get Emacs to provide a little interactive feedback as I resize the
> frame? Alternatively, can I display frame or window dimensions in the
> mode line? (I poked around some of the mode-line-format docs, but
> honestly didn't understand what I was looking at.)
>
> A bit of Googling and poking around in the customization didn't turn
> anything up. I'm stuck on Windows with Emacs running on a Linux
> server, so I can't go poking around window manager docs.

This will put frame-width and frame-height in the mode line:

(defvar my-frame-size-mode t)

(defun my-frame-size-mode (arg)
  "Toggle Frame Size mode.
With arg, turn Frame Size mode on iff arg is positive.  When
Frame Size mode is enabled, the frame's width and height appear
in the mode line."
  (interactive "P")
  (setq my-frame-size-mode
	(if (null arg) (not my-frame-size-mode)
	  (> (prefix-numeric-value arg) 0)))
  (force-mode-line-update))

(setq mode-line-position
      (append mode-line-position
	      '((my-frame-size-mode
		 (:eval (concat " W" (number-to-string
				      (frame-parameter nil 'width))
				" H" (number-to-string
				      (frame-parameter nil 'height))))))))

Steve Berman



  reply	other threads:[~2017-05-26 17:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 16:22 Interactive window resize feedback? Skip Montanaro
2017-05-26 17:12 ` Stephen Berman [this message]
2017-05-26 18:34   ` Skip Montanaro

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87lgpjpmog.fsf@rosalinde \
    --to=stephen.berman@gmx.net \
    --cc=help-gnu-emacs@gnu.org \
    --cc=skip.montanaro@gmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).