Unreadable buffer names in Emacs 23.2 - emacs

I just upgraded from Emacs 21.2 to 23.2 (on Windows XP) and while I managed to tweak my .emacs to fit the new changes, I couldn't find a solution for the unreadable buffer names:
Neither in the minibuffer, nor in the buffer menu can the characters be displayed normally. Instead, all I see are the infamous Unicode blank rectangles.
Any idea how to fix that?
Thanks.
Update: Again, all buffers are displayed perfectly (same font) - even with syntax highlighting. Buffers that contain buffer names also display everything properly, except for buffer names. Weird.
Could this possibly be related to the new feature introduced in Emacs 23.2 called "uniquify-buffer-name-style"?

The most likely explanation for rectangles is that your font doesn't have the required characters. The fix is to choose a different font (or install a more complete version of the same font).
Or is the problem that Emacs assumes the wrong encoding for file names? If so, please give more information, such as what encoding the file names are in, what it looks like Emacs is interpreting them as, and examples of working and non-working file names.

OK - with the help of Tim X from gnu.emacs.help, I found the offending lines in my .emacs that broke the new version (both statements need to be commented out!):
(setq default-frame-alist
(cons '(font . "-*-Lucida Console-normal-r-*-*-12-*-*-*-c-*-*-
iso8859-1")
default-frame-alist))
(set-default-font
"-*-Lucida Console-normal-r-*-*-12-*-*-*-c-*-*-iso8859-1")
Per Tim's advice, I used the Options menu to set the font and then save it to my .emacs. That resulted in appending the following 2-line single statement:
(custom-set-faces
'(default ((t (:inherit nil :stipple nil :background
"Black" :foreground "LightGray" :inverse-video nil :box nil :strike-
through nil :overline nil :underline nil :slant normal :weight
normal :height 90 :width normal :foundry "outline" :family "Lucida
Console")))))
By doing so, I am not sure my .emacs will continue working in Linux (as it did before - my .emacs was 100% cross-platform before).

Related

Something is overriding my emacs font size

In my .emacs file, I have (set-face-attribute 'default nil :height 200) as the last line.
When I start up emacs, I actually see the text flash briefly to this size, but then quickly get resized to the default size (height 110).
How can I discover what's overriding my font setting?
My OS is Raspbian GNU/Linux 10 (buster).
Update: I've tried removing everything from my .emacs file, and then using M-x customize-face default to make the font height 200, as suggested by #Drew. My .emacs file now looks like
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 200 :width normal :foundry "1ASC" :family "Liberation Mono")))))
However, I'm still seeing the same effect on startup. A brief flash of size 200 and the font getting resized by something after that.
set-face-attribute with nil for the frame sets a face attribute for the frame that's selected when that function is invoked. Don't use it in your init file unless you know which frame will be selected when it's invoked, and you want to change the face on that frame.
Either customize face default or customize default-frame-alist (its font, color, etc. parameters). I suggest M-x customize-face default. That affects face default in general - the default for all new frames.
Beyond that, it's possible that something in your init file is changing the font of the default face later on. When you do M-x customize-face default you can see what the latest value of the font attribute is.
If you think something in your init file is messing things up, bisect your init file to find it. You can use command comment-region to comment out a block of code or (with C-u) uncomment a block of code. Comment out 1/2 of your init file, then 3/4, 7/8, 15/16,... till you find the culprit.

Emacs 23.3.1 fixedsys font issue

I have downloaded the Fixedsys.TTF font.
I have moved the font into the /usr/share/fonts/truetype directory.
I have opened Emacs and navigated to Options > Set Default Font... and selected
FixedsysTTF and specified Monospaced and size 11. I then used Options > Save Options.
I have noticed in my .emacs file:
'(default ((t (:stipple nil :background "#232323"
:foreground "#e6e1de" :inverse-video nil :box nil
:strike-through nil :overline nil :underline nil
:slant normal :weight semi-bold :height 110
:width normal :foundry "unknown" :family "FixedsysTTF"))))
I do some work in Emacs and close it with Ctrl+c Ctrl+x.
I then reopen Emacs and it does not produce the same font. Rather, if I follow step 2. again I find that Emacs has defaulted to Monospace Regular 10. Although the font that is actually shown is not even Monospace Regular 10.
In order to correct this situation I am required to manually follow step 2. again and then everything is fine until I exit and startup again.
My question is whether or not there is a simple fix for this? Or, what lisp functions are being called in the background when I do step 2 so I can just hack the .emacs file to forcefully load fixedsys.
PS: I did try the font Fixedsys Excelsior, which is perfect BUT for the fact that in said version of Emacs (that is not to say that this happens in ONLY said version, but I am restricted to 23.3.1) the 'A' character causes the proceeding character to overlap the 'A'. However, this version of Fixedsys does not cause a problem with Emacs, and it remembers the font on exiting and the re-opening. Therefore, it is either: correct the situation with the overlapping 'A', or get the other version of Fixedsys (the one linked in step 1) to work. I do actually prefer Fixedsys Excelsior, but I cannot live with an overlapping 'A'. FYI, when I use Fixedsys Excelsior I get the following in my .emacs file:
'(default ((t (:stipple nil :background "#232323"
:foreground "#e6e1de" :inverse-video nil :box nil
:strike-through nil :overline nil :underline nil :slant normal
:weight normal :height 117 :width normal :foundry "unknown"
:family "Fixedsys Excelsior 3.01"))))
Again, the font is downloaded from the Fixedsys Excelsior link above and then the TTF moved into /usr/share/fonts/truetype.
Can someone help sort out either of these issues?
I have found out how to solve this issue:
Downloaded this modified version of FixedSYS
Moved to /usr/share/fonts/truetype
Injected:
(set-face-attribute 'default nil :font "Fixedsys Excelsior 3.01-L-12") into my .emacs file
Just to let you know, your links to Fixedsys.TTF font are pointing to a video site with questionable credentials.
Chris

Bold attribute doesn't work

I'm trying to make font in Emacs a little bolder. I use Inconsolata and here is a snippet from my .emacs:
(when window-system
(set-face-attribute 'default
nil
:font "Inconsolata"
:height 120
:weight 'bold) ; <- this line does not affect rendering
(require 'color-theme-solarized)
(color-theme-solarized-dark)
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_FULLSCREEN" 0)))
I know that Inconsolata can be rendered bold, but for some reason Emacs always renders it with normal weight. Maybe I should enable something before trying to change font?
Unfortunately, original Inconsolata does not have bold variant, applications emulate Inconsolata Bold by increasing character width. This is why one can use 'bold' variant of Inconsolata in some of them.
According to this Wikipedia article:
when Inconsolata was added to Google Fonts, it was fully hinted and a bold variant was added
So it is important which version of the font one uses. I've removed original Inconsolata and installed Google Fonts this way (Arch Linux):
# yaourt -S ttf-google-fonts-git
If you encounter such a problem, try searching for a similar package for your Linux distribution.
(when window-system
(set-face-attribute 'default
nil
:font "Inconsolata"
:height 120
:bold t)
(require 'color-theme-solarized)
(color-theme-solarized-dark)
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_FULLSCREEN" 0)))
Old thread, but I ended up here trying to find update of what I'm
doing now (haven't found yet)... but this simple trick may be
useful (year 2019 linux X, emacs 26.1 Gtk+3, and xft fonts):
emacs -xrm Xft.embolden:true -fn Inconsolata-14
This makes all variabts (regular, italics, bold, bolditalics)
(even) bolder when such variants exist. -fn Inconsolate-15:weight=bold affected only regular for me (without that -xrm ... option).

Emacs colors. why it is gray on current line? zenburn theme

I installed Prelude on my emacs24. I'm using ubuntu 12.04
It worked perfectly the first time I used it, but all the next times it doesn't.
On my current line the font color is gray so it's hard to see what I write. Previously it was a Bold case, keeping any color the line had for reserved words.
How can I fix this?
or also the empty lines with spaces are all yellow
I've been trying to fix it on the:
~/.emacs.d/elpa/zenburn-theme-20130716.1457/zenburn-theme.el
file but I can't find a solution... I think the problem could be between this lines:
;;;;; hl-line-mode
`(hl-line-face ((,class (:background ,zenburn-bg-05))
(t :weight bold)))
`(hl-line ((,class (:background ,zenburn-bg-05)) ; old emacsen
(t :weight bold)))
Thanks!
You can change the background and foreground to whatever you want, or turn it off completely. You can add bold or underline or overline or slant, or whatever floats your boat. One of my very first projects was to take the settings from color-theme and put it into my .emacs file and I haven't used a specific color theme since. Oh, and of course you want to open your .emacs or init file to see if there are any settings that conflict with the color theme you are using.
(global-hl-line-mode 1) ;; highlight current line -- see hl-line.el
(custom-set-faces
'(highlight ((t (:background "grey80" :foreground "black" :bold t)))) ;; highlight current line
)
Important:
Add to .bashrc file:
export TERM=xterm-256color
and I found the perfect configuration for me. Here it goes:
;;;;; hl-line-mode
(custom-set-faces
'(highlight ((t (:background "grey20" :foreground nil :bold t)))) ;; highligh\
t current line
)
This way you keep every color for reserved words all bold and a gray background for the current line. Everything will be beautiful =)

Emacs customize-face loses/fails to recognise font-name it wrote to my .emacs itself

I used the Options/Set Default Font menu item to set my default emacs font to be LMMonoLtCond10 (it brought up a nice font-selector GUI widget to let me do this). My emacs immediately adopted the new font, and I was very happy. I then did Options/Save Options, and on inspecting my .emacs.d/init.el file saw that it had written the following there:
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal
:weight light :height 120 :width normal :foundry "unknown" :family "LMMonoLtCond10"))))
(There are a couple of other faces I've defined below that.)
Unfortunately, if I quit emacs, and restart, it completely fails to recreate the font configuration that I had selected. Instead, I think it's giving me LMRoman-12. Am I doing something wrong, or is this an emacs bug.
I'm using Emacs 23.1.1:
(emacs-version)
"GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
of 2011-03-05 on palmer, modified by Debian"
on an Ubuntu system.
Sounds like it might be a bug. M-x report-emacs-bug