all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

* 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.
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.