all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to get rid of some font effects
@ 2007-10-01 17:43 Michaël Grünewald
  2007-10-10 16:18 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Michaël Grünewald @ 2007-10-01 17:43 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get rid of some font effects
  2007-10-01 17:43 How to get rid of some font effects Michaël Grünewald
@ 2007-10-10 16:18 ` Stefan Monnier
  2007-10-14 21:05   ` Michaël Grünewald
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2007-10-10 16:18 UTC (permalink / raw)
  To: help-gnu-emacs

> 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).


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get rid of some font effects
  2007-10-10 16:18 ` Stefan Monnier
@ 2007-10-14 21:05   ` Michaël Grünewald
  2007-10-17 18:12     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Michaël Grünewald @ 2007-10-14 21:05 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get rid of some font effects
  2007-10-14 21:05   ` Michaël Grünewald
@ 2007-10-17 18:12     ` Stefan Monnier
  2007-11-10  6:56       ` Michaël Grünewald
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2007-10-17 18:12 UTC (permalink / raw)
  To: help-gnu-emacs

>>> 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)))))

You could also just remove the " display (raise -0.0)" parts.
In Emacs-CVS (and maybe in Emacs-22.2 as well), you can just configure
tex-font-script-display instead.


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get rid of some font effects
  2007-10-17 18:12     ` Stefan Monnier
@ 2007-11-10  6:56       ` Michaël Grünewald
  0 siblings, 0 replies; 5+ messages in thread
From: Michaël Grünewald @ 2007-11-10  6:56 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> You could also just remove the " display (raise -0.0)" parts.
> In Emacs-CVS (and maybe in Emacs-22.2 as well), you can just configure
> tex-font-script-display instead.

Thanks for the tip; I did not find `tex-font-script-display' in
customize-variable.
-- 
Best regards,
Michaël

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-10  6:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-01 17:43 How to get rid of some font effects Michaël Grünewald
2007-10-10 16:18 ` Stefan Monnier
2007-10-14 21:05   ` Michaël Grünewald
2007-10-17 18:12     ` Stefan Monnier
2007-11-10  6:56       ` Michaël Grünewald

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.