help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get rid of some font effects


From: Michaël Grünewald
Subject: Re: How to get rid of some font effects
Date: Sun, 14 Oct 2007 23:05:47 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix)

Stefan Monnier <address@hidden> writes:

>> In the same vein, is there any way to globally disallow vertical
>> shifting of text? Being very specific, tex-mode shifts superscript and
>> subscript material vertically, and I find this inadequate. Is there
>> any clean way to turn this off? I have found this in tex-mode.el:
>
> You can play with font-lock-maximum-decoration (the super/subscript in
> latex-mode are only enabled with the very top decoration level).

Thank you for the tip. Meanwhile, I have used this *ugly* thing:

(require 'tex-mode)
(defun tex-font-lock-suscript (pos)
  (unless (or (memq (get-text-property pos 'face)
                    '(font-lock-constant-face font-lock-builtin-face
                      font-lock-comment-face tex-verbatim))
              ;; Check for backslash quoting
              (let ((odd nil)
                    (pos pos))
                (while (eq (char-before pos) ?\\)
                  (setq pos (1- pos) odd (not odd)))
                odd))
    (if (eq (char-after pos) ?_)
        '(face subscript display (raise -0.0))
      '(face superscript display (raise +0.0)))))

(see the nullified raise parameters?)

I am very happy to remove that from my dot.emacs file. Thank you
again!
-- 
Best wishes,
Michaël


reply via email to

[Prev in Thread] Current Thread [Next in Thread]