Problem with Emacs and XMonad

Hi Since I started using Emacs 23 (from CVS) I've been having problems with it when using XMonad [1]. Is anyone else experiencing this problem? I talked to the people on the emacs-devel mailing list, but none of them seemed to know whether this is caused by Emacs or XMonad. Does anyone here know? [1] http://img40.imageshack.us/img40/7521/200906061652201280x800s.png -- Deniz Dogan

Hi
On Tue, Jun 9, 2009 at 6:13 PM, Deniz Dogan
Hi
Since I started using Emacs 23 (from CVS) I've been having problems with it when using XMonad [1]. Is anyone else experiencing this problem? I talked to the people on the emacs-devel mailing list, but none of them seemed to know whether this is caused by Emacs or XMonad. Does anyone here know?
[1] http://img40.imageshack.us/img40/7521/200906061652201280x800s.png
The solution is to set up emacs font in .Xresources, not in ~/.emacs -- WBR, Constantine

2009/6/9 Constantine Verutin
Hi On Tue, Jun 9, 2009 at 6:13 PM, Deniz Dogan
wrote: Hi
Since I started using Emacs 23 (from CVS) I've been having problems with it when using XMonad [1]. Is anyone else experiencing this problem? I talked to the people on the emacs-devel mailing list, but none of them seemed to know whether this is caused by Emacs or XMonad. Does anyone here know?
[1] http://img40.imageshack.us/img40/7521/200906061652201280x800s.png
The solution is to set up emacs font in .Xresources, not in ~/.emacs
-- WBR, Constantine
Thanks for your reply. This method worked just fine in earlier versions of Emacs 23, but since a few months ago, it doesn't seem to work anymore. Setting the font in ~/.emacs doesn't work either, so I'm kind of lost for ideas. -- Deniz Dogan

On Tue, Jun 09, 2009 at 05:29:30PM +0200, Deniz Dogan wrote:
2009/6/9 Constantine Verutin
: Hi On Tue, Jun 9, 2009 at 6:13 PM, Deniz Dogan
wrote: Hi
Since I started using Emacs 23 (from CVS) I've been having problems with it when using XMonad [1]. �Is anyone else experiencing this problem? �I talked to the people on the �emacs-devel mailing list, but none of them seemed to know whether this is caused by Emacs or XMonad. �Does anyone here know?
[1] http://img40.imageshack.us/img40/7521/200906061652201280x800s.png
The solution is to set up emacs font in .Xresources, not in ~/.emacs
-- WBR, Constantine
Thanks for your reply. This method worked just fine in earlier versions of Emacs 23, but since a few months ago, it doesn't seem to work anymore. Setting the font in ~/.emacs doesn't work either, so I'm kind of lost for ideas.
This method was reported to work by someone on IRC, but you may want to contact the author: http://github.com/Nafai77/config/blob/e7e2591a69160f90e95b00b69aac41954345eb... -sme

2009/6/9 Sean Escriva
On Tue, Jun 09, 2009 at 05:29:30PM +0200, Deniz Dogan wrote:
2009/6/9 Constantine Verutin
: Hi On Tue, Jun 9, 2009 at 6:13 PM, Deniz Dogan
wrote: Hi
Since I started using Emacs 23 (from CVS) I've been having problems with it when using XMonad [1]. Is anyone else experiencing this problem? I talked to the people on the emacs-devel mailing list, but none of them seemed to know whether this is caused by Emacs or XMonad. Does anyone here know?
[1] http://img40.imageshack.us/img40/7521/200906061652201280x800s.png
The solution is to set up emacs font in .Xresources, not in ~/.emacs
-- WBR, Constantine
Thanks for your reply. This method worked just fine in earlier versions of Emacs 23, but since a few months ago, it doesn't seem to work anymore. Setting the font in ~/.emacs doesn't work either, so I'm kind of lost for ideas.
This method was reported to work by someone on IRC, but you may want to contact the author:
http://github.com/Nafai77/config/blob/e7e2591a69160f90e95b00b69aac41954345eb...
-sme
Yeah, I talked to the same guy actually, but unfortunately that didn't do the trick for me. :( -- Deniz Dogan

Deniz Dogan
2009/6/9 Constantine Verutin
:
[...]
The solution is to set up emacs font in .Xresources, not in ~/.emacs
Thanks for your reply. This method worked just fine in earlier versions of Emacs 23, but since a few months ago, it doesn't seem to work anymore. Setting the font in ~/.emacs doesn't work either, so I'm kind of lost for ideas.
Works for me, though I use .Xdefaults rather than .Xresources, and (probably critically) I have "xrdb -merge ~/.Xdefaults" executed during X session startup. The problem I have is with emacs frames that turn on toolbar-mode. Mostly I don't use it, but for one frame (the one I use for gnus) I do. When the toolbar appears, it is as though the frame sticks out below the screen until I switch workspaces, then stuff seems to get resized correctly. (Probably it would be easiest just to turn off toolbar-mode entirely, of course.)

2009/6/9 Bruce Stephens
Deniz Dogan
writes: 2009/6/9 Constantine Verutin
: [...]
The solution is to set up emacs font in .Xresources, not in ~/.emacs
Thanks for your reply. This method worked just fine in earlier versions of Emacs 23, but since a few months ago, it doesn't seem to work anymore. Setting the font in ~/.emacs doesn't work either, so I'm kind of lost for ideas.
Works for me, though I use .Xdefaults rather than .Xresources, and (probably critically) I have "xrdb -merge ~/.Xdefaults" executed during X session startup.
Even when merging .Xdefaults it doesn't work. Are you by any chance using emacsclient? Because this only seems to happen with the first frame opened with normal Emacs. Any additional frames in the same Emacs instances behave correctly.
The problem I have is with emacs frames that turn on toolbar-mode. Mostly I don't use it, but for one frame (the one I use for gnus) I do. When the toolbar appears, it is as though the frame sticks out below the screen until I switch workspaces, then stuff seems to get resized correctly. (Probably it would be easiest just to turn off toolbar-mode entirely, of course.)
I turn off pretty much everything in ~/.emacs (scrollbars, toolbar, menubar, fringes). -- Deniz Dogan PS. Sorry for replying directly to you, Bruce.

Deniz Dogan wrote:
2009/6/9 Bruce Stephens
: Deniz Dogan
writes: 2009/6/9 Constantine Verutin
: [...] The solution is to set up emacs font in .Xresources, not in ~/.emacs Thanks for your reply. This method worked just fine in earlier versions of Emacs 23, but since a few months ago, it doesn't seem to work anymore. Setting the font in ~/.emacs doesn't work either, so I'm kind of lost for ideas. Works for me, though I use .Xdefaults rather than .Xresources, and (probably critically) I have "xrdb -merge ~/.Xdefaults" executed during X session startup.
Even when merging .Xdefaults it doesn't work. Are you by any chance using emacsclient? Because this only seems to happen with the first frame opened with normal Emacs. Any additional frames in the same Emacs instances behave correctly.
This works for me, worth a try (I think the key is the window-setup-hook, the documentation of which says not to touch, but oh well... :]): (setq zsol-default-font "-xos4-terminus-medium-r-normal--12-120-72-72-c-60-iso10646-1") (add-hook 'window-setup-hook 'set-font-and-color) (add-hook 'after-make-frame-functions (lambda (frame) (select-frame frame) (set-font-and-color))) (defun set-font-and-color () (if window-system (progn (color-theme-arjen) (set-face-font 'default zsol-default-font)) (color-theme-tty-dark))) Zsolt P.s.: Sorry if it gets through twice, my MUA went crazy..

Hey,
The solution is to set up emacs font in .Xresources, not in ~/.emacs
-- WBR, Constantine
Thanks for your reply. This method worked just fine in earlier versions of Emacs 23, but since a few months ago, it doesn't seem to work anymore. Setting the font in ~/.emacs doesn't work either, so I'm kind of lost for ideas.
Well, I'm using emacs23 too(emacs-snapshot debian package, I believe it's the CVS snapshot), and this solution still works for me. So, just re-check if you're not changing any fonts in your ~/.emacs (Actually, the problem here is that if you re-define your fonts in ~/.emacs, then emacs will start with default(or defined in .Xresources/.Xdefaults) fonts and only then fonts will be changed to the ones defined in dot-emacs file and that drives emacs crazy in tiled WMs) Again, first do not change any font settings in ~/.emacs, and then check if there will be any success -- WBR, Constantine

2009/6/10 Constantine Verutin
Well, I'm using emacs23 too(emacs-snapshot debian package, I believe it's the CVS snapshot), and this solution still works for me. So, just re-check if you're not changing any fonts in your ~/.emacs (Actually, the problem here is that if you re-define your fonts in ~/.emacs, then emacs will start with default(or defined in .Xresources/.Xdefaults) fonts and only then fonts will be changed to the ones defined in dot-emacs file and that drives emacs crazy in tiled WMs)
Again, first do not change any font settings in ~/.emacs, and then check if there will be any success
I'm not familiar with how Debian snapshot packages work, but to be completely sure that we are running the same version of Emacs, you really ought to make a manual checkout and build it yourself. I have now tried all of the suggestions and all possible combinations of solutions, but none of them seem to work. What *really* is bothering me though is that not even "emacs -Q" with a clean .Xdefaults works properly. Even then the width/height are off!
From this, I draw the conclusion that there is something fundamentally wrong in either XMonad or Emacs, and I'm kind of leaning towards believing it is the latter.
-- Deniz Dogan

Deniz Dogan
What *really* is bothering me though is that not even "emacs -Q" with a clean .Xdefaults works properly. Even then the width/height are off!
From this, I draw the conclusion that there is something fundamentally wrong in either XMonad or Emacs, and I'm kind of leaning towards believing it is the latter.
It's surely nothing to do with xmonad. However, emacs seems to work for other people, which suggests it's not emacs. (That's not to say there aren't problems with this aspect of emacs---there surely are.) The debian package (which I'm also using, though I'm building my own from more recent checkouts) mostly adds a few patches to better fit in with the debian elisp packages and a few other things. Nothing relevant to this, as far as I can see.

2009/6/10 Bruce Stephens
Deniz Dogan
writes: [...]
What *really* is bothering me though is that not even "emacs -Q" with a clean .Xdefaults works properly. Even then the width/height are off!
From this, I draw the conclusion that there is something fundamentally wrong in either XMonad or Emacs, and I'm kind of leaning towards believing it is the latter.
It's surely nothing to do with xmonad. However, emacs seems to work for other people, which suggests it's not emacs. (That's not to say there aren't problems with this aspect of emacs---there surely are.)
I disagree. To me it seems that it does *not* work for a lot of other people; they have all had to apply hacks to *make* it work. But as you say, this probably has to do with Emacs rather than with XMonad. I'll just reopen the discussion on the emacs-devel mailing list then. -- Deniz Dogan

On Jun 10, 2009, at 04:41 , Bruce Stephens wrote:
It's surely nothing to do with xmonad. However, emacs seems to work for other people, which suggests it's not emacs. (That's not to say there aren't problems with this aspect of emacs---there surely are.)
*snort* emacs has always had weird problems with font sizing, and not just with xmonad (or even with tiling window managers or non- reparenting window managers). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

"Brandon S. Allbery KF8NH"
*snort* emacs has always had weird problems with font sizing, and not just with xmonad (or even with tiling window managers or non- reparenting window managers).
Sure. The right way to do it ought to be to use M-x list-fonts then customize default. But (last time I tried, anyway) that only worked for the first frame. But setting resources should work, and seems to for everyone. The issue turns out to be the tool-bar: Emacs seems to create its window with the correct size, then the tool-bar gets added and (with xmonad) the bottom of the frame is lost. I doubt that's an xmonad issue, it's presumably that emacs is assuming it can resize rather than asking in the proper way.
participants (6)
-
Brandon S. Allbery KF8NH
-
Bruce Stephens
-
Constantine Verutin
-
Deniz Dogan
-
Sean Escriva
-
Zsolt Dollenstein