You are not logged in.

#1 2009-09-16 21:00:15

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Emacs change font, strange window sizes with tiling wm

I have been trying to change the font in emacs GUI to one I like, such as Courier 10 or Terminus 9. However, whenever I do this and start up emacs in tiling mode of dwm, I get strange sizing issues. Either the buffer is far too small for the window (making the minibuffer huge) as seen in the attached screenshot, or the window is too big and part of it (usually the minibuffer) is cut off the screen. I am also trying to hide the toolbar by default, but choosing Show/Hide>Toolbar and then clicking Save Options does not work for me for some reason.

2009-09-15-162702_1280x800_scrot.png


Can anyone explain this and help me fix it?

Last edited by Allamgir (2009-09-18 01:35:11)


дɭɭɑӎɠїɾ

Offline

#2 2009-09-16 21:57:03

renato_garcia
Member
From: Brazil
Registered: 2009-08-14
Posts: 24

Re: Emacs change font, strange window sizes with tiling wm

I'm having this same problem in awesome. As a workaroud, I full screen the emacs, and come back to tiling. This resolve the problem. Until the next emacs startup :-)

Offline

#3 2009-09-16 22:04:46

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Emacs change font, strange window sizes with tiling wm

That's not really much of a solution, is it? I really don't want to switch back to vim since I'm finally starting to get the hang of emacs' keyboard macro paradigm and learn some of the basic shortcuts, but little things like this bother me. I'm sure there are other emacs users in tiling environments. Do they just use emacs in the terminal or has a solution been found?


дɭɭɑӎɠїɾ

Offline

#4 2009-09-16 22:20:49

Lich
Member
Registered: 2009-09-13
Posts: 437

Re: Emacs change font, strange window sizes with tiling wm

Same thing here in xmonad. As a workaround I used to do the same thing, float then tile again. But it works fine in Ion3 smile


Archlinux | ratpoison + evilwm | urxvtc | tmux

Offline

#5 2009-09-16 22:42:59

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Emacs change font, strange window sizes with tiling wm

Well, I've been experimenting, and nothing has worked so far. How can so many emacs users simply put up with this kind of stuff and "work around it" instead of solving the problem? I don't want to appear trollish or anything, but I'm just saying there must be a fix that someone has concocted over all this time people have used emacs in tiling window managers.


дɭɭɑӎɠїɾ

Offline

#6 2009-09-16 23:46:51

renato_garcia
Member
From: Brazil
Registered: 2009-08-14
Posts: 24

Re: Emacs change font, strange window sizes with tiling wm

Yes, you have reason, it isn't a solution. And I wish fix it also, this kind of problem bother me too.
But I don't know how fix it, and my tip was a workaround while someone or one of us don't find how do it.
This is ugly, but better than nothing, I think. wink

Offline

#7 2009-09-17 02:09:05

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Emacs change font, strange window sizes with tiling wm

I'm using a recent CVS checkout of Emacs with Xmonad and do not see this behaviour.

Are you using emacs from the repos?  What method(s) are you using to specify the font?

As for disabling the toolbar, try something like this in your ~/.emacs:

(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))

Offline

#8 2009-09-17 09:35:39

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Emacs change font, strange window sizes with tiling wm

It's a problem with the font, http://bbs.archlinux.org/viewtopic.php?id=77213


You need to install an RTFM interface.

Offline

#9 2009-09-17 20:51:08

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Emacs change font, strange window sizes with tiling wm

I see. I'll try it with some different fonts I like (maybe monaco or Envy Code R from the AUR) and let you know how that works.


дɭɭɑӎɠїɾ

Offline

#10 2009-09-18 00:03:23

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Emacs change font, strange window sizes with tiling wm

No luck. Envy Code R is an amazing font (I think I'll use that primarily now), but I still have the exact same problem with emacs.

Now I'm even considering going back to vim. The only reason I was checking out emacs was because of the AUCTeX macros, which I used a little bit before, but never really got into. Does anyone have some testimony as to how beneficial they are as to straight up typing the markup with vim?

EDIT: There's just something that keeps holding me to emacs. I don't know what or why, but it just does. Now if only I could fix this buffer problem. I tried what was posted in the thread someone linked to above, but it didn't work sad

Last edited by Allamgir (2009-09-18 01:34:41)


дɭɭɑӎɠїɾ

Offline

#11 2009-09-18 01:58:45

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: Emacs change font, strange window sizes with tiling wm

If you're planning to do a lot of writing in LaTeX, then yes, AUCTeX is a complete godsend that you soon won't be able to live without.  I tend to prefer vim to emacs, but AUCTeX is so indispensable that I use emacs anyway (there's a plugin for vim called vim-latex that tries to provide some of the same functionality, but is nowhere near as polished and useful, in my experience).  If you want to make your emacs experience more vim-like, try using Viper mode (emacs with vim-like modes and key bindings), along with Vimpulse, which adds even more vim-ness (like visual mode, which Viper lacks).  Both Viper and Vimpulse have decent documentation in terms of what you have to put in your .emacs, etc.

As for the tiling issue, I recently switched to Xmonad and had similar issues at first with emacs window sizing.  Try adding the following to your .emacs:

to get rid of the toolbar:

(tool-bar-mode 0)

to fix the vertical size, do some trial-and-error to figure out how many lines your screen holds with your favorite font/size, and then add the following (replacing 29 with whatever value you want, obviously):

(set-frame-height (selected-frame) 29)

Offline

#12 2009-09-18 02:15:26

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Emacs change font, strange window sizes with tiling wm

Well that did wonders for the height, working perfectly, but now I still have the problem with the width of the window. I experimented with (set-frame-width (selected-frame) 1000) or other numbers but it didn't work. If I start up emacs and start typing, the text goes and goes and goes, instead of conforming to the size of the window.


дɭɭɑӎɠїɾ

Offline

#13 2009-09-19 00:15:47

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: Emacs change font, strange window sizes with tiling wm

In LaTeX mode, you can enable column auto-fill, which breaks lines at 70 characters as you type, by putting the following in your .emacs:

(add-hook 'LaTeX-mode-hook 'turn-on-auto-fill)

Here is the official AUCTeX documentation on this:
http://www.gnu.org/software/auctex/manu … html#SEC52

In other modes, the relevant emacs term, I believe, is "fill-column"; try Googling that and you should come up with something relevant.

Edit: Removed part about needing needing AUCTeX for auto-fill in LaTeX mode, based on TU's comment below -- thanks! (But you'll probably want to load AUCTeX anyway, since it's awesome.)

Last edited by moose jaw (2009-09-19 16:59:55)

Offline

#14 2009-09-19 06:06:45

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Emacs change font, strange window sizes with tiling wm

Maybe I am getting wrong, but you do not need auctex to turn on auto-fill generally. You can turn it on in any mode you like (and , obviously, have).

Offline

#15 2010-03-24 12:34:10

upsidaisium
Member
From: Vietnam
Registered: 2006-09-16
Posts: 263
Website

Re: Emacs change font, strange window sizes with tiling wm

Sorry for bumping an oldish thread--it's more than 6 months old by 5 days, so I could get in trouble for this! big_smile--but I can't see any reason for creating a new one.

I'm running into similar frame size troubles with Emacs and dwm. But I tend to keep Emacs alone on it's own (cleverly named) emacs tag, and I've noticed that if I change to a different tag view and then return to viewing the emacs tag the problem is fixed.

But that's still not perfect; I'd rather it just displayed correctly right after being started. Has anybody got a better solution yet?


I've seen young people waste their time reading books about sensitive vampires. It's kinda sad. But you say it's not the end of the world... Well, maybe it is!

Offline

#16 2010-03-24 16:19:46

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Emacs change font, strange window sizes with tiling wm

I was never affected by this bug simply because I use the emacs daemon, and when an emacsclient frame is opened it always has the correct size.


You need to install an RTFM interface.

Offline

#17 2010-03-24 21:03:30

roy_hu
Member
Registered: 2009-10-29
Posts: 85

Re: Emacs change font, strange window sizes with tiling wm

I think I've run into the same issue. To solve it, instead of specifying the font in .emacs, you can do so in .Xresources. I have a line like this:

Emacs.font: Inconsolata-10

Offline

#18 2010-03-30 19:12:29

gammel.holte
Member
Registered: 2010-02-01
Posts: 53

Re: Emacs change font, strange window sizes with tiling wm

Hi,

I've run into the same issue today when setting up my first Arch install.

By creating a file ~/.Xdefaults and adding a line the issue was fixed:
Emacs.toolBar: -1

This removes the toolbar, which is something I wanted to do anyway, and this seems to be the correct way to do it according to the Xmonad wiki: http://www.haskell.org/haskellwiki/Xmon … _questions

Font settings may need to be done in the same way.

I hope this helps. I was really annoyed for a few hours having to create a new window and then close it to be able to see the minibuffer.

Offline

Board footer

Powered by FluxBB