Find the answer to your Linux question:
Page 1 of 5 1 2 3 4 5 LastLast
Results 1 to 10 of 41
Does anyone know how I can set a font in emacs using the .emacs file? Furthermore, I know that there is a file containing the aliases to the emacs fonts. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    emacs


    Does anyone know how I can set a font in emacs using the .emacs file? Furthermore, I know that there is a file containing the aliases to the emacs fonts. Does anyone know where that file lies?
    As always, all help is appreciated.
    The best things in life are free.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    If you just want to set emacs' default font, I suggest using your .Xresources file instead. Unless you have a special reason to use the .emacs file, that is?
    I haven't heard about that alias thing you're talking about. Are you sure that you aren't referring to X's font aliases?

  3. #3
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    .Xresources

    Dolda,

    If you recall, I posted a problem a few months ago regarding emacs fonts and X. Just to refresh your memory, check out these pics:
    http://rplaca.cs.qc.edu/~bpark/normal.jpg
    http://rplaca.cs.qc.edu/~bpark/weird.gif

    I'm currenty using .Xresources to manipulate it and this is what happens when I run Java for some strange reson. For example, once a Java application(GUI) or an applet is launched, that weird emacs becomes defaulted. The arrows there indicate that the height between those arrows have been doubled. Actually, the part that the bottom arrow is pointing is also double height.

    Now, I was hoping that I could maybe get away from this problem by using .emacs to set the default font. As for that alias file, can you name(abs path) that file anyway? I need to try and figure this out because it's a pain in the a** when I'm trying to work with Java. Of course there are other instances when this happens but launching a Java application(w/window) or an applet causes this. By the way, are you using .Xresources or .Xdefaults? For some reason, I need to either execute .Xresources using 'xrdb' or copy .Xresources to .Xdefaults in order for emacs to be defaulted.

    Just in case you want to see what my .Xresouces file looks like, here it is
    Code:
    #ifdef COLOR
    *customization: -color
    #endif
    
    emacs*Background: White
    emacs*Foreground: Black
    emacs*pointerColor: Black
    emacs*cursorColor: Black
    emacs*bitmapIcon: off
    emacs*font: lucidasanstypewriter-12
    The best things in life are free.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Now that you mention it, I do remember that problem.
    As for the font alias files: I don't remember which distro you're running (I think that should be added to the user's profile just like the Location thingy and be displayed by every post). Wasn't it RH7.2? At least on my RH8 system, the fonts are in /usr/X11R6/lib/X11/fonts. They can also be found by looking at the font server's config in /etc/X11/fs/config. In some subdirectories there is a file named fonts.alias, which specifies font aliases.
    Have you tried setting the "fixed" font for emacs?
    As for the .Xresources and .Xdefaults files, just check your X session scripts to see what files they're using.

  6. #5
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Dolda,

    I'm running debian 3.0 woody. I apologize for not mentioning that earlier.
    I located the fonts.alias file and for all I can see, I've replaced the alias in .Xresources to see if that made any difference but it didn't.
    How do I set "fixed" font for emacs? Does this mean I'll be losing my font that I want. For some reason, I'm very picky about emacs font. I'll only use the one I provided in the earlier example.
    I know this might differ since we have different distros but where can I find the X session script? What is the name of this file?
    The best things in life are free.

  7. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You can try the fixed font by running "emacs -font fixed". I mainly thought that you could try it to see where the error originates, not permenantly replacing it.

  8. #7
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    fixed

    Dolda,

    Funny thing, when I tried "fixed" font using .Xresources file, it stayed that way after running the usual Java test. All other fonts that I've tried had some other effects worse than the one I posted at the URL. Any ideas about what's causing this? I mailed this to xfree86 people but no one has replied at all.
    Can you tell me the X session script file?
    The best things in life are free.

  9. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I cannot imagine anything else than it being a bug in either the xf86 X server or the xf86 font server. No process should be able to affect another in that way. Try upgrading the related packages. I don't know what they're called in Debian, but I'm referring to those containing the X server and the font server.

    About the X session file, it's not just one. They're calling each other in a long chain of execs. If you're using gdm as your display manager, the files that begin the chain can be found in /etc/X11/gdm/Sessions. You'll have to know which one you're using to log in. Anyway, they're all sh scripts, so parsing them shouldn't be too hard.

  10. #9
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Dolda,

    Thanks for helping. I really appreciate this since I'm still new at all this.
    I know that you are using Redhat but what are the corresponding names for the X server and the font server in Redhat? I need some idea in order for me to find the right package.
    I'm pretty sure that Java applications and applets is not the REAL cause of the problem. I've seen this happen at other times although Java just seems to have the most consistent effect on this matter.
    The best things in life are free.

  11. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, I know that Java itself isn't the source of the problem. Probably they're just using a call that triggers a bug.
    The file names for the X and font servers are /usr/X11R6/bin/XFree86 and /usr/X11R6/bin/xfs, respectively. The RPM names for them are XFree86 and XFree86-xfs.
    I would experiment with other distros, too. It's just that my hard drive is broken and won't accept another one on the same IDE bus, so I have no possibility to do so.

Page 1 of 5 1 2 3 4 5 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •