From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: weird font-lock / coding interaction Date: Mon, 29 Oct 2007 04:31:15 -0700 Organization: http://groups.google.com Message-ID: <1193657475.556169.94660@q3g2000prf.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1193658048 8027 80.91.229.12 (29 Oct 2007 11:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Oct 2007 11:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 29 12:40:50 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ImSz5-0007MG-4Z for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Oct 2007 12:40:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ImSyv-0000mN-Qf for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Oct 2007 07:40:33 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q3g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 131 Original-NNTP-Posting-Host: 69.236.97.82 Original-X-Trace: posting.google.com 1193657476 16629 127.0.0.1 (29 Oct 2007 11:31:16 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 29 Oct 2007 11:31:16 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419.3 (KHTML, like Gecko) Safari/419.3,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: q3g2000prf.googlegroups.com; posting-host=69.236.97.82; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:153412 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48897 Archived-At: On Oct 18, 7:30=C2=A0am, Sven Utcke wrote: > Hi, > > I like to use 10x20 as my font in Emacs, and never had any problem so > far. =C2=A0However, here at my new employee I see weird interactions > between font-lock and what might be a coding issue. =C2=A0If, e.g., I use > "\bf" in a LaTeX-mode file (deprecated, I know :-) I instead see what > looks roughtly like "=C2=A5bf" (it's actually a differently looking > Yen-symbol, presumably from a different font). > > Any idea what could be the reason and how to debug this? =C2=A0I never > before had any problem like this! As Tim said, in emacs 22 you can just use =E2=80=9CCtrl+u Ctrl+x =3D=E2=80= =9D. (invokes what-cursor-position) If you don't have 22, prob better to just upgrade. Might solve your prob too. I was trying to write a code to print the font used anyway, not successful but migth give you a start. here's the doc: http://xahlee.org/elisp/Text-Properties.html here the code i started with (defun xx () (interactive) (insert ;(get-char-property (point) "face") (text-properties-at (point)) ) ) as a after thought, pasted below is the what-cursor-position source code from emacs 22. Xah xah@xahlee.org =E2=88=91 http://xahlee.org/ (defun what-cursor-position (&optional detail) "Print info on cursor position (on screen and within buffer). Also describe the character after point, and give its character code in octal, decimal and hex. For a non-ASCII multibyte character, also give its encoding in the buffer's selected coding system if the coding system encodes the character safely. If the character is encoded into one byte, that code is shown in hex. If the character is encoded into more than one byte, just \"...\" is shown. In addition, with prefix argument, show details about that character in *Help* buffer. See also the command `describe-char'." (interactive "P") (let* ((char (following-char)) (beg (point-min)) (end (point-max)) (pos (point)) (total (buffer-size)) (percent (if (> total 50000) ;; Avoid overflow from multiplying by 100! (/ (+ (/ total 200) (1- pos)) (max (/ total 100) 1)) (/ (+ (/ total 2) (* 100 (1- pos))) (max total 1)))) (hscroll (if (=3D (window-hscroll) 0) "" (format " Hscroll=3D%d" (window-hscroll)))) (col (current-column))) (if (=3D pos end) (if (or (/=3D beg 1) (/=3D end (1+ total))) (message "point=3D%d of %d (%d%%) <%d-%d> column=3D%d%s" pos total percent beg end col hscroll) (message "point=3D%d of %d (EOB) column=3D%d%s" pos total col hscroll)) (let ((coding buffer-file-coding-system) encoded encoding-msg display-prop under-display) (if (or (not coding) (eq (coding-system-type coding) t)) (setq coding default-buffer-file-coding-system)) (if (not (char-valid-p char)) (setq encoding-msg (format "(%d, #o%o, #x%x, invalid)" char char char)) ;; Check if the character is displayed with some `display' ;; text property. In that case, set under-display to the ;; buffer substring covered by that property. (setq display-prop (get-text-property pos 'display)) (if display-prop (let ((to (or (next-single-property-change pos 'display) (point-max)))) (if (< to (+ pos 4)) (setq under-display "") (setq under-display "..." to (+ pos 4))) (setq under-display (concat (buffer-substring-no-properties pos to) under-display))) (setq encoded (and (>=3D char 128) (encode-coding-char char coding)))) (setq encoding-msg (if display-prop (if (not (stringp display-prop)) (format "(%d, #o%o, #x%x, part of display \"%s\")" char char char under-display) (format "(%d, #o%o, #x%x, part of display \"%s\"->\"%s\")" char char char under-display display-prop)) (if encoded (format "(%d, #o%o, #x%x, file %s)" char char char (if (> (length encoded) 1) "..." (encoded-string-description encoded coding))) (format "(%d, #o%o, #x%x)" char char char))))) (if detail ;; We show the detailed information about CHAR. (describe-char (point))) (if (or (/=3D beg 1) (/=3D end (1+ total))) (message "Char: %s %s point=3D%d of %d (%d%%) <%d-%d> column=3D%d%s" (if (< char 256) (single-key-description char) (buffer-substring-no-properties (point) (1+ (point)))) encoding-msg pos total percent beg end col hscroll) (message "Char: %s %s point=3D%d of %d (%d%%) column=3D%d%s" (if enable-multibyte-characters (if (< char 128) (single-key-description char) (buffer-substring-no-properties (point) (1+ (point)))) (single-key-description char)) encoding-msg pos total percent col hscroll))))))