unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hans-Peter Deifel <hpdeifel@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: window-width, the terminal and linum-mode
Date: Tue, 25 Dec 2012 11:33:33 +0100	[thread overview]
Message-ID: <871ueezaiq.fsf@hpdeifel.de> (raw)

Hi group,

I was looking in "(elisp) Window Sizes" for a function to give me the
width of the text area of a window and found `window-body-width'.
However, this function gives me different results in terminal and GUI
modes, when linum-mode is enabled.

In terminal emacs, `window-body-width' includes the width of the line
number, while in gui emacs it doesn't. In both cases, the line number
width is returned correctly by `(window-margins)'.

So the question is: How can I get the width of the text-area (meaning,
in my case, without the line-numbers). I'd also like to avoid having to
distinguish X and terminal mode explicitly.

Thanks,
HP

--
Hans-Peter Deifel
GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.4)


             reply	other threads:[~2012-12-25 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-25 10:33 Hans-Peter Deifel [this message]
2012-12-25 11:12 ` window-width, the terminal and linum-mode Constantin Kulikov
2012-12-25 17:39 ` Eli Zaretskii
     [not found] ` <mailman.16102.1356457168.855.help-gnu-emacs@gnu.org>
2012-12-27 16:22   ` Hans-Peter Deifel

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=871ueezaiq.fsf@hpdeifel.de \
    --to=hpdeifel@gmx.de \
    --cc=help-gnu-emacs@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.
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).