From: Feng Li <fengli@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Fixing a bug in pascal-mode
Date: Sun, 06 Apr 2014 20:40:50 +1000 [thread overview]
Message-ID: <86ha66aggd.fsf@gmail.com> (raw)
In-Reply-To: 868urjncwl.fsf@gmail.com
Feng Li <fengli@gmail.com> writes:
> Hi Emacs devs,
>
> I just fixed a small bug in pascal-mode. Here's the diff
>
> diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
> index a693295..4058826 100644
> --- a/lisp/progmodes/pascal.el
> +++ b/lisp/progmodes/pascal.el
> @@ -168,7 +168,7 @@
> ;; "record" "array" "file")
> (,(concat "\\<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|"
> "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\>")
> - font-lock-type-face)
> + . font-lock-type-face)
> ("\\<\\(label\\|external\\|forward\\)\\>" . font-lock-constant-face)
> ("\\<\\([0-9]+\\)[ \t]*:" 1 font-lock-function-name-face)
> ;; ("of" "to" "for" "if" "then" "else" "case" "while"
Another one, this fixes pascal variables that contain keywords
surrounded by '_' chars (eg. do_this):
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 4058826..10b7619 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -166,20 +166,20 @@
(3 font-lock-function-name-face))
;; ("type" "const" "real" "integer" "char" "boolean" "var"
;; "record" "array" "file")
- (,(concat "\\<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|"
- "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\>")
+ (,(concat "\\_<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|"
+ "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\_>")
. font-lock-type-face)
- ("\\<\\(label\\|external\\|forward\\)\\>" . font-lock-constant-face)
- ("\\<\\([0-9]+\\)[ \t]*:" 1 font-lock-function-name-face)
+ ("\\_<\\(label\\|external\\|forward\\)\\_>" . font-lock-constant-face)
+ ("\\_<\\([0-9]+\\)[ \t]*:" 1 font-lock-function-name-face)
;; ("of" "to" "for" "if" "then" "else" "case" "while"
;; "do" "until" "and" "or" "not" "in" "with" "repeat" "begin" "end")
- ,(concat "\\<\\("
+ ,(concat "\\_<\\("
"and\\|begin\\|case\\|do\\|e\\(lse\\|nd\\)\\|for\\|i[fn]\\|"
"not\\|o[fr]\\|repeat\\|t\\(hen\\|o\\)\\|until\\|w\\(hile\\|ith\\)"
- "\\)\\>")
- ("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?"
+ "\\)\\_>")
+ ("\\_<\\(goto\\)\\_>[ \t]*\\([0-9]+\\)?"
1 font-lock-keyword-face)
- ("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?"
+ ("\\_<\\(goto\\)\\_>[ \t]*\\([0-9]+\\)?"
2 font-lock-keyword-face t))
"Additional expressions to highlight in Pascal mode.")
--
Feng Li
next prev parent reply other threads:[~2014-04-06 10:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-06 7:19 Fixing a bug in pascal-mode Feng Li
2014-04-06 10:40 ` Feng Li [this message]
2014-04-06 17:36 ` Daniel Colascione
2014-04-06 23:25 ` Feng Li
2014-04-07 14:03 ` Stefan Monnier
2014-04-07 14:24 ` Feng Li
2014-04-10 13:57 ` Stefan Monnier
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=86ha66aggd.fsf@gmail.com \
--to=fengli@gmail.com \
--cc=emacs-devel@gnu.org \
/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.