summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-08-12 16:44:16 +0200
committerStefan Monnier <monnier@iro.umontreal.ca>2010-08-12 16:44:16 +0200
commitc5683ceb2cf80b5b7475f92236271eaeba662798 (patch)
tree89c5f1d7b7b3eb972df9cea5aeecdbacd3fc3a69 /lisp/progmodes
parent856a6b7709a7257722a4e5b14859ca6a422dad52 (diff)
downloademacs-c5683ceb2cf80b5b7475f92236271eaeba662798.tar.gz
Introduce a new comment style "c" flag.
* src/syntax.c (SYNTAX_FLAGS_COMMENT_STYLEB) (SYNTAX_FLAGS_COMMENT_STYLEC): New macros. (SYNTAX_FLAGS_COMMENT_STYLE): Use them, add an argument. (syntax_prefix_flag_p): New function. (Fstring_to_syntax): Understand new "c" flag. (Finternal_describe_syntax_value): Recognize new flag; use the SYNTAX_FLAGS_* macros. (scan_sexps_forward, Fparse_partial_sexp): Change representation of comment style to accomodate the new styles. (back_comment, forw_comment, Fforward_comment, scan_lists) (scan_sexps_forward): Update code to obey the new comment style flag. * src/syntax.h: Move SYNTAX_FLAGS_FOO() macros to syntax.c. * src/casefiddle.c (casify_region): Use the new syntax_prefix_flag_p. * lisp/progmodes/octave-mod.el (octave-mode-syntax-table): Use the new "c" comment style. * lisp/progmodes/scheme.el (scheme-mode-syntax-table): * lisp/emacs-lisp/lisp-mode.el (lisp-mode-syntax-table): Remove spurious "b" flag in "14b" syntax. Fixes: debbugs:6834
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/octave-mod.el9
-rw-r--r--lisp/progmodes/scheme.el2
2 files changed, 5 insertions, 6 deletions
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index e0f4a878a3e..5287eff1347 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -294,17 +294,16 @@ parenthetical grouping.")
(modify-syntax-entry ?\" "\"" table)
(modify-syntax-entry ?. "w" table)
(modify-syntax-entry ?_ "w" table)
- ;; FIXME: The "b" flag only applies to the second letter of the comstart
+ ;; The "b" flag only applies to the second letter of the comstart
;; and the first letter of the comend, i.e. the "4b" below is ineffective.
;; If we try to put `b' on the single-line comments, we get a similar
;; problem where the % and # chars appear as first chars of the 2-char
;; comend, so the multi-line ender is also turned into style-b.
- ;; Really, we can't make it work without extending the syntax-tables, or
- ;; via font-lock-syntactic-keywords.
+ ;; So we need the new "c" comment style.
(modify-syntax-entry ?\% "< 13" table)
(modify-syntax-entry ?\# "< 13" table)
- (modify-syntax-entry ?\{ "(} 2b" table)
- (modify-syntax-entry ?\} "){ 4b" table)
+ (modify-syntax-entry ?\{ "(} 2c" table)
+ (modify-syntax-entry ?\} "){ 4c" table)
(modify-syntax-entry ?\n ">" table)
table)
"Syntax table in use in `octave-mode' buffers.")
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index ce8a34220e4..da143db5ffb 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -107,7 +107,7 @@
;; Special characters
(modify-syntax-entry ?, "' " st)
(modify-syntax-entry ?@ "' " st)
- (modify-syntax-entry ?# "' 14b" st)
+ (modify-syntax-entry ?# "' 14" st)
(modify-syntax-entry ?\\ "\\ " st)
st))