Subject: bug#4895: 23.1; Incorrect font selected

From: Andrey Paramonov <[email-masked]>
Date: Mon, 09 Nov 2009 22:19:07 +0300

To reproduce:

0) emacs -Q
   
   My .Xresources:

   emacs*font: DejaVu Sans Mono-11

1) C-x C-f titledefs.dtx (attached)

   Latin characters are displayed with DejaVu Sans Mono, as expected.
   Cyrillic characters are not displayed properly. This is Ok yet,
   because the file is encoded in cp1251.

2) C-x RET r cp1251 RET
   yes RET
   
   Latin characters are displayed with DejaVu Sans Mono, as expected.
   Cyrillic characters are displayed, but not with DejaVu Sans Mono.
   Looks like they are displayed with Terminus.

3) C-x RET f utf-8 RET
   C-x C-w (enter filename)
   C-x C-f (new filename)

   All characters are displayed with DejaVu Sans Mono, as expected.

On step 2, all characters should be displayed with DejaVu Sans Mono.

I'm ready to provide any additional info,
Andrey Paramonov

In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-09-14 on raven, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10605000
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ru_RU.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

===File ~/titledefs.dtx======================
%    \begin{macrocode}

%<titledefs>\ProvidesFile{titledefs.rtx}

%<*titledefs>
%    \end{macrocode}
%
% \subsection{Ïîñòîÿííûå ÷àñòè çàãîëîâêîâ, òèòóëüíîãî ëèñòà è òåêñòà}
%
% \DescribeMacro{\abstractname}\index{Ìàêðîñû!\verb+\abstractname+}
% Àííîòàöèÿ
%    \begin{macrocode}
\def\abstractname{\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyri\cyrya}
%    \end{macrocode}
% \DescribeMacro{\titlepagename}\index{Ìàêðîñû!\verb+\titlepagename+}
% Òèòóëüíûé ëèñò
%    \begin{macrocode}
\def\titlepagename{\cyr\CYRT\cyri\cyrt\cyru\cyrl\cyrsftsn\cyrn\cyrery\cyrishrt\ %
\cyrl\cyri\cyrs\cyrt}
%    \end{macrocode}
% \DescribeMacro{\keywordsname}\index{Ìàêðîñû!\verb+\keywordsname+}
% \DescribeMacro{\keywordssep}\index{Ìàêðîñû!\verb+\keywordssep+}
% \DescribeMacro{\keywordslabel}\index{Ìàêðîñû!\verb+\keywordslabel+}
% Êëþ÷åâûå ñëîâà
%    \begin{macrocode}
\def\keywordsname{\cyr\CYRK\cyrk\cyryu\cyrch\cyre\cyrv\cyrery\cyre\ %
\cyrs\cyrl\cyro\cyrv\cyra}
\def\keywordssep{:}
\def\keywordslabel{\keywordsname\keywordssep}
%    \end{macrocode}
% \DescribeMacro{\workname}\index{Ìàêðîñû!\verb+\workname+}
% Äèññåðòàöèÿ
%    \begin{macrocode}
\def\workname{\cyr\CYRD\cyri\cyrs\cyrs\cyre\cyrr\cyrt\cyra\cyrc\cyri\cyrya}
%    \end{macrocode}
% \DescribeMacro{\approved}\index{Ìàêðîñû!\verb+\approved+}
% Äèññåðòàöèÿ äîïóùåíà ê çàùèòå (çàïèñü î äîïóñêå)
%    \begin{macrocode}
\def\approved{\workname\ \cyrd\cyro\cyrp\cyru\cyrshch\cyre\cyrn\cyra\ %
\cyrk\ \cyrz\cyra\cyrshch\cyri\cyrt\cyre}
%    \end{macrocode}
% \DescribeMacro{\appos}\index{Ìàêðîñû!\verb+\appos+}
% Äîëæíîñòü ëèöà, äîïóñêàþùåãî ê çàùèòå
%    \begin{macrocode}
\def\appos{\cyr\cyrz\cyra\cyrv.\ \cyrk\cyra\cyrf\cyre\cyrd\cyrr\cyro\cyrishrt}
%    \end{macrocode}
% \DescribeMacro{\groupname}\index{Ìàêðîñû!\verb+\groupname+}
% ãð. (ãðóïïà)
%    \begin{macrocode}
\def\groupname{\cyr\cyrg\cyrr.}
%    \end{macrocode}
% \DescribeMacro{\topicname}\index{Ìàêðîñû!\verb+\topicname+}
% \DescribeMacro{\topicsep}\index{Ìàêðîñû!\verb+\topicsep+}
% \DescribeMacro{\topiclabel}\index{Ìàêðîñû!\verb+\topiclabel+}
% Òåìà
%    \begin{macrocode}
\def\topicname{\cyr\CYRT\cyre\cyrm\cyra}
\def\topicsep{:\ }
\def\topiclabel{\topicname\topicsep}
%    \end{macrocode}
% \DescribeMacro{\coursename}\index{Ìàêðîñû!\verb+\coursename+}
% \DescribeMacro{\coursesep}\index{Ìàêðîñû!\verb+\coursesep+}
% \DescribeMacro{\courselabel}\index{Ìàêðîñû!\verb+\courselabel+}
% Íàïðàâëåíèå
%    \begin{macrocode}
\def\coursename{\cyr\CYRN\cyra\cyrp\cyrr\cyra\cyrv\cyrl\cyre\cyrn\cyri\cyre}
\def\coursesep{:}
\def\courselabel{\coursename\coursesep}
%    \end{macrocode}
% \DescribeMacro{\specname}\index{Ìàêðîñû!\verb+\specname+}
% \DescribeMacro{\specsep}\index{Ìàêðîñû!\verb+\specsep+}
% \DescribeMacro{\speclabel}\index{Ìàêðîñû!\verb+\speclabel+}
% Ñïåöèàëüíîñòü
%    \begin{macrocode}
\def\specname{%
\cyr\CYRS\cyrp\cyre\cyrc\cyri\cyra\cyrl\cyrsftsn\cyrn\cyro\cyrs\cyrt\cyrsftsn}
\def\specsep{:}
\def\speclabel{\specname\specsep}
%    \end{macrocode}
% \DescribeMacro{\masterprogname}\index{Ìàêðîñû!\verb+\masterprogname+}
% \DescribeMacro{\masterprogsep}\index{Ìàêðîñû!\verb+\masterprogsep+}
% \DescribeMacro{\masterproglabel}\index{Ìàêðîñû!\verb+\masterproglabel+}
% Ìàãèñòåðñêàÿ ïðîãðàììà
%    \begin{macrocode}
\def\masterprogname{%
\cyr\CYRM\cyra\cyrg\cyri\cyrs\cyrt\cyre\cyrr\cyrs\cyrk\cyra\cyrya\ %
\cyrp\cyrr\cyro\cyrg\cyrr\cyra\cyrm\cyrm\cyra}
\def\masterprogsep{:}
\def\masterproglabel{\masterprogname\masterprogsep}
%    \end{macrocode}
% \DescribeMacro{\studentname}\index{Ìàêðîñû!\verb+\studentname+}
% \DescribeMacro{\studentlabel}\index{Ìàêðîñû!\verb+\studentlabel+}
% Âûïîëíèë ñòóäåíò
%    \begin{macrocode}
\def\studentname{\cyr\CYRV\cyrery\cyrp\cyro\cyrl\cyrn\cyri\cyrl\ %
\cyrs\cyrt\cyru\cyrd\cyre\cyrn\cyrt}
\def\studentlabel{\studentname}
%    \end{macrocode}
% \DescribeMacro{\saname}\index{Ìàêðîñû!\verb+\saname+}
% \DescribeMacro{\salabel}\index{Ìàêðîñû!\verb+\salabel+}
% Íàó÷íûé ðóêîâîäèòåëü (sa -- ñîêð. îò scientific adviser)
%    \begin{macrocode}
\def\saname{\cyr\CYRN\cyra\cyru\cyrch\cyrn\cyrery\cyrishrt\ %
\cyrr\cyru\cyrk\cyro\cyrv\cyro\cyrd\cyri\cyrt\cyre\cyrl\cyrsftsn}
\def\salabel{\saname}
%    \end{macrocode}
% \DescribeMacro{\revname}\index{Ìàêðîñû!\verb+\revname+}
% \DescribeMacro{\revlabel}\index{Ìàêðîñû!\verb+\revlabel+}
% Ðåöåíçåíò
%    \begin{macrocode}
\def\revname{\cyr\CYRR\cyre\cyrc\cyre\cyrn\cyrz\cyre\cyrn\cyrt}
\def\revlabel{\revname}
%    \end{macrocode}
% \DescribeMacro{\conname}\index{Ìàêðîñû!\verb+\conname+}
% \DescribeMacro{\conlabel}\index{Ìàêðîñû!\verb+\conlabel+}
% Êîíñóëüòàíò
%    \begin{macrocode}
\def\conname{\cyr\CYRK\cyro\cyrn\cyrs\cyru\cyrl\cyrsftsn\cyrt\cyra\cyrn\cyrt}
\def\conlabel{\conname\ \cyrp\cyro\ \@conspec}
%    \end{macrocode}
% \DescribeMacro{\asmanuscriptname}\index{Ìàêðîñû!\verb+\asmanuscriptname+}
% Íà ïðàâàõ ðóêîïèñè
%    \begin{macrocode}
\def\asmanuscriptname{\cyr\CYRN\cyra\ \cyrp\cyrr\cyra\cyrv\cyra\cyrh\ %
\cyrr\cyru\cyrk\cyro\cyrp\cyri\cyrs\cyri}
%    \end{macrocode}
% \DescribeMacro{\libcatname}\index{Ìàêðîñû!\verb+\libcatname+}
% ÓÄÊ
%    \begin{macrocode}
\def\libcatname{\cyr\CYRU\CYRD\CYRK}
%    \end{macrocode}
% \DescribeMacro{\consultname}\index{Ìàêðîñû!\verb+\consultname+}
% Êîíñóëüòàíòû
%    \begin{macrocode}
\def\consultname{%
\cyr\CYRK\cyro\cyrn\cyrs\cyru\cyrl\cyrsftsn\cyrt\cyra\cyrn\cyrt\cyrery:}
%    \end{macrocode}
%
% \subsection{Èíòåðôåéñ äëÿ îïðåäåëåíèÿ ýëåìåíòîâ òèòóëüíîãî ëèñòà}
%
% \DescribeMacro{\institution}\index{Ìàêðîñû!\verb*+\institution+}
% Îðãàíèçàöèÿ
%    \begin{macrocode}
\def\institution#1{\gdef\@institution{#1}}\institution{}
%    \end{macrocode}
%
% \DescribeMacro{\spec}\index{Ìàêðîñû!\verb*+\spec+}
% Íàçâàíèå ñïåöèàëüíîñòè
%    \begin{macrocode}
\def\spec#1{\gdef\@spec{#1}}\spec{}
%    \end{macrocode}
% \DescribeMacro{\specnum}\index{Ìàêðîñû!\verb*+\specnum+}
% Íîìåð ñïåöèàëüíîñòè
%    \begin{macrocode}
\def\specnum#1{\gdef\@specnum{#1}}\specnum{}
%    \end{macrocode}
% \DescribeMacro{\course}\index{Ìàêðîñû!\verb*+\course+}
% Íàçâàíèå íàïðàâëåíèÿ
%    \begin{macrocode}
\def\course#1{\gdef\@course{#1}}\course{}
%    \end{macrocode}
% \DescribeMacro{\coursenum}\index{Ìàêðîñû!\verb*+\coursenum+}
% Íîìåð íàïðàâëåíèÿ
%    \begin{macrocode}
\def\coursenum#1{\gdef\@coursenum{#1}}\coursenum{}
%    \end{macrocode}
% \DescribeMacro{\keywords}\index{Ìàêðîñû!\verb*+\keywords+}
% Êëþ÷åâûå ñëîâà
%    \begin{macrocode}
\def\keywords#1{\gdef\@keywords{#1}}\keywords{}
%    \end{macrocode}
% \DescribeMacro{\title}\index{Ìàêðîñû!\verb*+\title+}
% Çàãîëîâîê
%    \begin{macrocode}
\def\title#1{\gdef\@title{#1}}\title{}
%    \end{macrocode}
% \DescribeMacro{\topic}\index{Ìàêðîñû!\verb*+\topic+}
% Òåìà
%    \begin{macrocode}
\def\topic#1{\gdef\@topic{#1}}\topic{}
%    \end{macrocode}
% \DescribeMacro{\author}\index{Ìàêðîñû!\verb*+\author+}
% Àâòîð
%    \begin{macrocode}
\def\author#1{\gdef\@author{#1}}\author{}
%    \end{macrocode}
% \DescribeMacro{\city}\index{Ìàêðîñû!\verb*+\city+}
% Ãîðîä
%    \begin{macrocode}
\def\city#1{\gdef\@city{#1}}\city{}
%    \end{macrocode}
% \DescribeMacro{\faculty}\index{Ìàêðîñû!\verb*+\faculty+}
% Ôàêóëüòåò
%    \begin{macrocode}
\def\faculty#1{\gdef\@faculty{#1}}\faculty{}
%    \end{macrocode}
% \DescribeMacro{\department}\index{Ìàêðîñû!\verb*+\department+}
% êàôåäðà
%    \begin{macrocode}
\def\department#1{\gdef\@department{#1}}\department{}
%    \end{macrocode}
% \DescribeMacro{\apname}\index{Ìàêðîñû!\verb*+\apname+}
% ÔÈÎ ëèöà, äîïóñêàþùåãî ê çàùèòå (çàâ. êàôåäðîé)
%    \begin{macrocode}
\def\apname#1{\gdef\@apname{#1}}\apname{}
%    \end{macrocode}
% \DescribeMacro{\libcatnum}\index{Ìàêðîñû!\verb*+\libcatnum+}
% Íîìåð ÓÄÊ
%    \begin{macrocode}
\def\libcatnum#1{\gdef\@libcatnum{#1}}\libcatnum{}
%    \end{macrocode}
% \DescribeMacro{\group}\index{Ìàêðîñû!\verb*+\group+}
% Àêàäåìè÷åñêàÿ ãðóïïà
%    \begin{macrocode}
\def\group#1{\gdef\@group{#1}}\group{}
%    \end{macrocode}
% \DescribeMacro{\masterprognum}\index{Ìàêðîñû!\verb*+\masterprognum+}
% Íîìåð ìàãèñòåðñêîé ïðîãðàììû
%    \begin{macrocode}
\def\masterprognum#1{\gdef\@masterprognum{#1}}\masterprognum{}
%    \end{macrocode}
% \DescribeMacro{\masterprog}\index{Ìàêðîñû!\verb*+\masterprog+}
% Íàçâàíèå ìàãèñòåðñêîé ïðîãðàììû
%    \begin{macrocode}
\def\masterprog#1{\gdef\@masterprog{#1}}\masterprog{}
%    \end{macrocode}
% Çíà÷åíèå |\data| ïî óìîë÷àíèþ
%    \begin{macrocode}
\date{\number\year}

%    \end{macrocode}
% \DescribeMacro{\yearname}\index{Ìàêðîñû!\verb*+\yearname+}
% Ñîêðàùåíèå ãîäà <<ã.>>
%    \begin{macrocode}
\def\yearname{\cyr\cyrg.}
%    \end{macrocode}
% \DescribeMacro{\commonsect}\index{Ìàêðîñû!\verb*+\commonsect+}
% \DescribeMacro{\postcommonsect}\index{Ìàêðîñû!\verb*+\postcommonsect+}
% Ôîðìàò çàãîëîâêîâ îáùåãî òåêñòà <<Ââåäåíèÿ>> è àâòîðåôåðàòà.
%    \begin{macrocode}
\let\commonsect=\textbf
\def\postcommonsect{\ }
%    \end{macrocode}
%
% \subsubsection{Íàó÷íûé ðóêîâîäèòåëü}
% \DescribeMacro{\sa}\index{Ìàêðîñû!\verb*+\sa+}
% ÔÈÎ
%    \begin{macrocode}
\def\sa#1{\gdef\@sa{#1}}\sa{}
%    \end{macrocode}
% \DescribeMacro{\sastatus}\index{Ìàêðîñû!\verb*+\sastatus+}
% Ó÷¸íîå çâàíèå
%    \begin{macrocode}
\def\sastatus#1{\gdef\@sastatus{#1}}\sastatus{}
%    \end{macrocode}
%
% \subsubsection{Ðåöåíçåíò}
% \DescribeMacro{\rev}\index{Ìàêðîñû!\verb*+\rev+}
% ÔÈÎ
%    \begin{macrocode}
\def\rev#1{\gdef\@rev{#1}}\rev{}
%    \end{macrocode}
% \DescribeMacro{\revstatus}\index{Ìàêðîñû!\verb*+\revstatus+}
% ó÷¸íîå çâàíèå
%    \begin{macrocode}
\def\revstatus#1{\gdef\@revstatus{#1}}\revstatus{}
%    \end{macrocode}
%
% \subsubsection{Êîíñóëüòàíò}
%
% \DescribeMacro{\conspec}\index{Ìàêðîñû!\verb*+\conspec+}
% Ñïåöèàëüíîñòü
%    \begin{macrocode}
\def\conspec#1{\gdef\@conspec{#1}}
%    \end{macrocode}
% \DescribeMacro{\con}\index{Ìàêðîñû!\verb*+\con+}
% ÔÈÎ
%    \begin{macrocode}
\def\con#1{\gdef\@con{#1}}
%    \end{macrocode}
% \DescribeMacro{\constatus}\index{Ìàêðîñû!\verb*+\constatus+}
% Ó÷¸íîå çâàíèå è ñòåïåíü
%    \begin{macrocode}
\def\constatus#1{\gdef\@constatus{#1}}

%    \end{macrocode}
%
% \subsubsection{Íàçâàíèÿ íåíóìåðóåìûõ ãëàâ}
%
% \begin{itemize}
% \item Ñîäåðæàíèå
% \DescribeMacro{\contentsname}\index{Ìàêðîñû!\verb*+\contentsname+}
%    \begin{macrocode}
\AtBeginDocument{
  \addto\captionsrussian{%
    \def\contentsname{\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyri\cyre}
  }
}

%    \end{macrocode}
% \item Ââåäåíèå
% \DescribeMacro{\introname}\index{Ìàêðîñû!\verb*+\introname+}
% \DescribeMacro{\intro}\index{Ìàêðîñû!\verb*+\intro+}
%    \begin{macrocode}
\newcommand\introname{\cyr\CYRV\cyrv\cyre\cyrd\cyre\cyrn\cyri\cyre}
\newcommand\intro{\nchapter{\introname}}
%    \end{macrocode}
% \item Çàêëþ÷åíèå
% \DescribeMacro{\conclusionname}\index{Ìàêðîñû!\verb*+\conclusionname+}
%    \begin{macrocode}
\newcommand\conclusionname{%
\cyr\CYRZ\cyra\cyrk\cyrl\cyryu\cyrch\cyre\cyrn\cyri\cyre
}
\newcommand\conclusion{\nchapter{\conclusionname}}
%    \end{macrocode}
% \item Ñïèñîê èñïîëüçóåìûõ îáîçíà÷åíèé
% \DescribeMacro{\defsname}\index{Ìàêðîñû!\verb*+\defsname+}
% \end{itemize}
%    \begin{macrocode}
\newcommand\defsname{%
{\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk\ %
\cyri\cyrs\cyrp\cyro\cyrl\cyrsftsn\cyrz\cyru\cyre\cyrm\cyrery\cyrh\ %
\cyro\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyri\cyrishrt}
}
\newcommand\defs{\nchapter{\defsname}}

%    \end{macrocode}
% Îáçîð ëèòåðàòóðû
% \DescribeMacro{\reviewname}\index{Ìàêðîñû!\verb*+\reviewname+}
%    \begin{macrocode}
\newcommand\reviewname{\cyr\CYRO\cyrb\cyrz\cyro\cyrr\ %
\cyrl\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyrery}
\newcommand\review{\nchapter{\reviewname}}

%    \end{macrocode}
%
% \subsubsection{Ïîëÿ òèòóëüíîãî ëèñòà}
%
% \DescribeMacro{\field}\index{Ìàêðîñû!\verb*+\field+}
% Ôîðìàò çàïèñåé äëÿ íàó÷íîãî ðóêîâîäèòåëÿ, ðåöåíçåíòà è êîíñóëüòàíòà
%    \begin{macrocode}
\def\field#1{%
  \csname #1label\endcsname,\\%
  \csname @#1status\endcsname\>
  \makebox[8.5cm][l]{\hrulefill\ \csname @#1\endcsname}
}
%    \end{macrocode}
%
% \DescribeMacro{\@approved}\index{Ìàêðîñû!\verb+"\"@approved+}
% \makeatother
% Äèññåðòàöèÿ äîïóùåíà ê çàùèòå
%    \begin{macrocode}
\def\@approved{
  \begin{tabbing}
    \hspace{8cm}\={\approved}
\\
    \>\appos
\\[9pt]
    \>\makebox[8.5cm][r]{\hrulefill\ \@apname}
\\[9pt]
    \>\makebox[1.5cm][r]{<<\hrulefill>>}
    \makebox[7cm][r]{\hrulefill\ \@date\,\yearname}
  \end{tabbing}
}

%    \end{macrocode}
% \DescribeMacro{\datefield}\index{Ìàêðîñû!\verb*+\datefield+}
% Ïîëå äëÿ çàïèñè äàòû. Äëÿ îòîáðàæåíèÿ ïðîèçâîëüíîãî ãîäà íóæíî
% ïðèñâîèòü çíà÷åíèå íåîáÿçàòåëüíîìó àðãóìåíòó.
%    \begin{macrocode}
\providecommand\datefield[1][\number\year]{<<\rule[0pt]{1cm}{.5pt}>>\ %
\rule[0pt]{3cm}{0.5pt}\ #1~\yearname}
%    \end{macrocode}
% \DescribeMacro{\mkcommonsect}\index{Ìàêðîñû!\verb*+\mkcommonsect+}
% Ãåíåðàòîð êîìàíä äëÿ îáùåãî òåêñòà äèññåðòàöèè è àâòîðåôåðàòà.
%    \begin{macrocode}
\providecommand\mkcommonsect[3]{%
  \@namedef{#1head}{#2}
  \@namedef{#1section}{\commonsect{\expandafter\csname #1head\endcsname}\postcommonsect}
  \@namedef{#1text}{#3}
}
\let\mkintrosect=\mkcommonsect

%    \end{macrocode}
% \DescribeMacro{\facsimile}\index{Ìàêðîñû!\verb*+\facsimile+}
% Êîìàíäà äëÿ âêëþ÷åíèÿ ãðàôè÷åñêîãî ôàéëà ñ ïîäïèñüþ äèññåðòàíòà.
%    \begin{macrocode}
\providecommand\facsimile{\vskip 6pt\includegraphics[width=3cm]{facsimile}}

%</titledefs>
%    \end{macrocode}
============================================================