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

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

How to get rid of some font effects


From: Michaël Grünewald
Subject: How to get rid of some font effects
Date: Mon, 01 Oct 2007 19:43:00 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix)

Hi all,

I find some font attributes very annoying and I would like to turn
them globally off. More precisely I would like to allow only colour
change and bold face, and disallow any other stuff, like size change
or underline. Is there any way to do this?

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:

(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.3))
      '(face superscript display (raise +0.3)))))

(defun tex-font-lock-match-suscript (limit)
  "Match subscript and superscript patterns up to LIMIT."
  (when (re-search-forward "[_^] *\\([^\n\\{}]\\|\
\\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t)
    (when (match-end 3)
      (let ((beg (match-beginning 3))
            (end (save-restriction
                   (narrow-to-region (point-min) limit)
                   (condition-case nil (scan-lists (point) 1 1) (error nil)))))
        (store-match-data (if end
                              (list (match-beginning 0) end beg end)
                            (list beg beg beg beg)))))
    t))

I guess I can patch these functions in my dot.elisp file, but I would
not call this `clean'.

At a last resort, emacs -nw is a viable solution, anyway...
-- 
Thanks in advance for any help,
best wishes,
Michaël


reply via email to

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