LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-25-2011, 12:22 PM   #1
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Rep: Reputation: Disabled
emacs font setting


Hi,

I have following two lines in ~/.emacs file to set my own font size for Emacs in linux. However, the problem that I have is that, if I open up a new frame by choosing File -> New Frame in Emacs menu, the new frame opened does not have the same font setting. It seems to changed to some other settings. Please see my attached two emacs windows. The right one is the correct one. But the left one does not work. And the left one is a new frame opened from the right one. Why?

Thanks.
Attached Thumbnails
Click image for larger version

Name:	emacsfont.png
Views:	33
Size:	152.1 KB
ID:	8244  
 
Old 10-25-2011, 01:07 PM   #2
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
Need a bit more info. Distro, GUI and file manager you are using. Does it do it if you open the file in the same window? Or only when you open them in new windows?
 
Old 10-25-2011, 01:12 PM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,774

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by ridgeland View Post
Hi,

I have following two lines in ~/.emacs file to set my own font size for Emacs in linux.
Is that the (set-default-font ... line?

Quote:
However, the problem that I have is that, if I open up a new frame by choosing File -> New Frame in Emacs menu, the new frame opened does not have the same font setting... Why?
Code:
set-default-font is an alias for `set-frame-font' in `frame.el'.

(set-default-font FONT-NAME &optional KEEP-SIZE)

This function is obsolete since 23.1;
use `set-frame-font' instead.

Set the font of the selected frame to FONT-NAME.
When called interactively, prompt for the name of the font to use.
To get the frame's current default font, use `frame-parameters'.

The default behavior is to keep the numbers of lines and columns in
the frame, thus may change its pixel size.  If optional KEEP-SIZE is
non-nil (interactively, prefix argument) the current frame size (in
pixels) is kept by adjusting the numbers of the lines and columns.
Try (set-face-attribute 'default nil :font FONT) instead, from EmacsWiki - Globally Change the Default Font.

Last edited by ntubski; 10-25-2011 at 01:14 PM. Reason: better emphasis
 
Old 10-25-2011, 01:23 PM   #4
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AuroraZero View Post
Need a bit more info. Distro, GUI and file manager you are using. Does it do it if you open the file in the same window? Or only when you open them in new windows?
I am using KDE windown manager. The problem is that, when I open a file the first time in Emacs, it is ok. After that, in the existing Emacs window, I chose File -> New Frame from the menu. Then it will open up a second window which change the font from the first window. I don't know why?
 
Old 10-25-2011, 01:31 PM   #5
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled
I just tried both "set-frame-font" and (set-face-attribute 'default nil :font FONT). Neither work. I still have the same problem. The first window works. The second window opened from the first window does not.
 
Old 10-25-2011, 01:38 PM   #6
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
Try Options set default font. Let me know if that works.
 
Old 10-25-2011, 02:54 PM   #7
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AuroraZero View Post
Try Options set default font. Let me know if that works.
How to do that?
 
Old 10-25-2011, 03:11 PM   #8
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
Open up Emacs click options and have a look man.
 
Old 10-25-2011, 03:30 PM   #9
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AuroraZero View Post
Open up Emacs click options and have a look man.
The only related option I see is "save options". This will basically save your current setting, and save it into ~/.emacs file. I've already mentioned in my previous posts that I have a function to set the default font in ~/.emacs file. But that function does not work correctly. Do you know why that function does not work correctly? Look at the attached picture in the first note, which is ~/.emacs file I posted. The line "(set-default-font ...)" is the function that I am using. I also tried "(set-frame-font ...)" based on someone's suggestion. Does not work either. Any suggestion?
 
Old 10-25-2011, 03:38 PM   #10
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
Try adding this and removing what you have in the default font settings "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1". See of that syntax works.

Last edited by AuroraZero; 10-25-2011 at 03:44 PM.
 
Old 10-25-2011, 03:43 PM   #11
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AuroraZero View Post
What version of Emacs are you using?
GNU Emacs 21.4.1
 
Old 10-25-2011, 03:50 PM   #12
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
In the new one you can change the fonts from the menu. This takes away the need for the right names and syntax. You may want to look into the newest version which I believe is 23. I am not saying you have to change but it may be a good idea if you did change.
 
Old 10-25-2011, 04:04 PM   #13
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled
The problem is that, I don't have root password to install any newer version. by the way, where can I download a newer version Emacs?
 
Old 10-25-2011, 04:17 PM   #14
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
http://www.gnu.org/s/emacs/ Try that line I posted and see if it works.
 
Old 10-25-2011, 04:25 PM   #15
ridgeland
LQ Newbie
 
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled
Tried downloading it. But cannot install it without root password. Do you have the same problem as me in the newer version?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs - changing default font size and font type? neilcpp Linux - Software 16 05-20-2013 11:29 AM
[SOLVED] Name of the Default Emacs Font yaami Linux - Software 2 07-04-2010 06:49 AM
Changing Font in Emacs jraclarke Linux - Newbie 5 04-23-2010 12:36 PM
emacs font problem Andramalech Linux - Software 12 01-15-2005 03:17 PM
font size in emacs koyi Linux - Software 0 06-28-2004 08:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration