[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] own macro coloring?
From: |
Ivan Andrus |
Subject: |
Re: [AUCTeX] own macro coloring? |
Date: |
Wed, 17 Jul 2013 18:48:39 -0600 |
Forgot to CC the list.
On Jul 17, 2013, at 6:28 PM, ivo welch <address@hidden> wrote:
> thx, ivan. this M-: (customize-group 'font-latex-keywords) RET is
> definitely new wizardry for me. to show much of a novice I am, let me
> describe my experience.
It's hard to tell how much someone knows about Emacs. So I'm glad
you learned something today. :-)
> this opens an interesting window with a lot of choices. I can see how
> this can make emacs more userfriendly in the future, but it's still
> tough going.
>
> clicking on any of the triangles on the left brings up a choice, where
> most variables seem to describe themselves as being set to "STANDARD".
> Clicking on "INS" yields a dialog with "Keyword" and "Format". I
> presume this is where I have to add my "\myboldface{}" and presumably
> the right place is "Font Latex Match Bold Command Keywords" and once I
> have it working, the button at the top that says "save for future
> sessions" will add it to my .emacs file. correct?
That's right. Though several of these particular variables
require restarting Emacs.
> unfortunately, there are no full examples that show what the dialog
> expects as inputs for keyword and format. <tab> does not show
> options, but moves onto the next field. the description starts out
> well: each element has to be a list..., so I gather that "myboldface"
> (which is my \myboldface{hello} latex macro) goes into the keyword
> field. alas, the emacs format specifier is a mystery to me. it
> refers to the doc string of font-latex-user-keyword-classes, but after
> staring at font-latex.el for a while, I still have not figured out
> what it wants. it would be much nicer if there was an example in the
> docs, such as "myboldface" and "bold" right where it prompts for the
> list entry.
Unfortunately, it doesn't contain all of the documentation about the
format. I thought it did. Anyway, the simplest case for one of my
macros \defn[...]{...} will look like this:
INS DEL List:
Keyword: defn
Format: [{
Notice that you don't include the initial backslash. The format is
described in the documentation for `font-latex-user-keyword-classes'.
> after I have entered the correct values, presumably I would click on
> "set for current session"---can I then visit a latex file in another
> emacs buffer here and expect to see the effect of my change?
Yes, except that some of these might require restarting Emacs.
> ;;; if there is a full entry for .emacs which would "just work", I
> would love to hear it, too. ultimately, this is what I will do
> anyway.
Untested:
(setq font-latex-match-bold-command-keywords
'(("defn" "[{") ("phandefn" "[{")))
> regards,
>
> /iaw
>
> (In "More", I randomly stumbled over the fact that the "Generated by
> `...`" is actually a clickable link, which in turn provides a
> clickable link to font-latex.el. this was not visually highlighted.)
You're right. It seems like it should be. You can report a bug with
M-x report-emacs-bug RET if you would like.
-Ivan