unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "rgb" <rbielaws@i1.net>
Subject: Re: generic-mode: Keywords also highlight with an underscore
Date: 25 Aug 2005 10:55:34 -0700	[thread overview]
Message-ID: <1124992534.902756.226190@z14g2000cwz.googlegroups.com> (raw)
In-Reply-To: <dejmf0$9rd$02$1@news.t-online.com>

> >     (modify-syntax-entry ?\_ "w" st)
>
> Great, that works.
> Since I didn't know what to put in for st, I defined
>
> (defun syntax-table-for-fnord() (modify-syntax-entry ?\_ "w"))
>
I believe that you would use this to modify a modes table
from a mode hook.

(modify-syntax-entry ?\_ "w" (syntax-table))

When writing a mode I usually see it done like this:

(defvar tal-mode-syntax-table
  (let ((st (make-syntax-table)))
    (modify-syntax-entry ?\n ">" st)
     ... <zillion other lines snipped>
    (modify-syntax-entry ?\_ "w" st)
    (modify-syntax-entry ?\{ "." st)
    (modify-syntax-entry ?\| "." st)
    (modify-syntax-entry ?\} "." st)
    st)
  "Syntax table for `tal-mode'.")

Then this is in the tal-mode function:

  (set-syntax-table tal-mode-syntax-table)


> However, I'd rather have this fix globally. Is there
> a global syntax table that I can use for st in my .emacs?
>
I've never tried to modify the global map so I'm not
sure this is correct but looks to me like it should be.

(modify-syntax-entry ?\_ "w" (standard-syntax-table))

      reply	other threads:[~2005-08-25 17:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24  7:51 generic-mode: Keywords also highlight with an underscore "O. Wölfelschneider"
2005-08-24 22:52 ` rgb
2005-08-25  5:54   ` "O. Wölfelschneider"
2005-08-25 17:55     ` rgb [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1124992534.902756.226190@z14g2000cwz.googlegroups.com \
    --to=rbielaws@i1.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).