all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
Subject: Re: help with setq for specific file types....
Date: Mon, 30 Sep 2002 16:22:42 +0200	[thread overview]
Message-ID: <m3lm5jd0b1.fsf@ID-87814.user.dfncis.de> (raw)
In-Reply-To: mailman.1033331785.4656.help-gnu-emacs@gnu.org

twylie <twylie@charter.net> writes:
[...]
> 1. I want to be able to do a setq for specific file types. For example,
> any file that ends with .html I would like to use (setq-default
> line-spacing 12). I see how to add file suffixes to alist -- but not how
> to set setq values. Can someone help me here?

The way you explain it does not make sense for me at all. If you do
what you explain here literally, _all_ buffers would change their
line-spacing, whenever you open a file of a different type.

I presume that you want to have, say, all html buffers with a line
spacing of 12 and all Elisp buffers with a line spacing of 4. The
Emacsian way to do such things is via the corresponding major modes
and via  hooks. See the section about hooks in the Emacs manual:
`C-h i d m emacs RET i hook RET'. Or with the mouse:

Help ==> Read the Emacs manual ==> Customization ==> Variables 
==> Hooks.

For example to get a line spacing of four in every Elisp buffer, you
could add this to your .emacs:

(add-hook 'emacs-lisp-mode-hook
          (lambda () (setq line-spacing 4)))


> 2. Also, I would like to add color syntax for anything between quotes
> (") in text mode.

Uuh, I have not yet mastered the arcane mysteries of the ways of the
mighty Font Lock. But the following seems to work for me:

(add-hook 'text-mode-hook (lambda ()
			    (modify-syntax-entry ?\" "|" text-mode-syntax-table)
			    (make-local-variable 'font-lock-defaults)
			    (setq font-lock-defaults '(nil nil t))))

    -- Oliver

-- 
9 Vendémiaire an 211 de la Révolution
Liberté, Egalité, Fraternité!

       reply	other threads:[~2002-09-30 14:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1033331785.4656.help-gnu-emacs@gnu.org>
2002-09-30 14:22 ` Oliver Scholz [this message]
2002-09-30 14:40 ` help with setq for specific file types kgold
2002-09-29 20:33 twylie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3lm5jd0b1.fsf@ID-87814.user.dfncis.de \
    --to=alkibiades@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.