diff options
| author | Stefan Monnier | 2010-08-12 16:44:16 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2010-08-12 16:44:16 +0200 |
| commit | c5683ceb2cf80b5b7475f92236271eaeba662798 (patch) | |
| tree | 89c5f1d7b7b3eb972df9cea5aeecdbacd3fc3a69 /lisp | |
| parent | 856a6b7709a7257722a4e5b14859ca6a422dad52 (diff) | |
| download | emacs-c5683ceb2cf80b5b7475f92236271eaeba662798.tar.gz emacs-c5683ceb2cf80b5b7475f92236271eaeba662798.zip | |
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')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/octave-mod.el | 9 | ||||
| -rw-r--r-- | lisp/progmodes/scheme.el | 2 |
4 files changed, 12 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 018da138dde..868d9822b85 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2010-08-12 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2010-08-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * progmodes/octave-mod.el (octave-mode-syntax-table): Use the new "c" | ||
| 4 | comment style (bug#6834). | ||
| 5 | * progmodes/scheme.el (scheme-mode-syntax-table): | ||
| 6 | * emacs-lisp/lisp-mode.el (lisp-mode-syntax-table): Remove spurious | ||
| 7 | "b" flag in "' 14b" syntax. | ||
| 8 | |||
| 3 | * progmodes/octave-mod.el (octave-mode-map): Remove special bindings | 9 | * progmodes/octave-mod.el (octave-mode-map): Remove special bindings |
| 4 | for (un)commenting the region and performing completion. | 10 | for (un)commenting the region and performing completion. |
| 5 | (octave-mode-menu): Use standard commands for help and completion. | 11 | (octave-mode-menu): Use standard commands for help and completion. |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 02477baf74f..21a9f80fa90 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -85,7 +85,7 @@ | |||
| 85 | (let ((table (copy-syntax-table emacs-lisp-mode-syntax-table))) | 85 | (let ((table (copy-syntax-table emacs-lisp-mode-syntax-table))) |
| 86 | (modify-syntax-entry ?\[ "_ " table) | 86 | (modify-syntax-entry ?\[ "_ " table) |
| 87 | (modify-syntax-entry ?\] "_ " table) | 87 | (modify-syntax-entry ?\] "_ " table) |
| 88 | (modify-syntax-entry ?# "' 14b" table) | 88 | (modify-syntax-entry ?# "' 14" table) |
| 89 | (modify-syntax-entry ?| "\" 23bn" table) | 89 | (modify-syntax-entry ?| "\" 23bn" table) |
| 90 | table) | 90 | table) |
| 91 | "Syntax table used in `lisp-mode'.") | 91 | "Syntax table used in `lisp-mode'.") |
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.") | |||
| 294 | (modify-syntax-entry ?\" "\"" table) | 294 | (modify-syntax-entry ?\" "\"" table) |
| 295 | (modify-syntax-entry ?. "w" table) | 295 | (modify-syntax-entry ?. "w" table) |
| 296 | (modify-syntax-entry ?_ "w" table) | 296 | (modify-syntax-entry ?_ "w" table) |
| 297 | ;; FIXME: The "b" flag only applies to the second letter of the comstart | 297 | ;; The "b" flag only applies to the second letter of the comstart |
| 298 | ;; and the first letter of the comend, i.e. the "4b" below is ineffective. | 298 | ;; and the first letter of the comend, i.e. the "4b" below is ineffective. |
| 299 | ;; If we try to put `b' on the single-line comments, we get a similar | 299 | ;; If we try to put `b' on the single-line comments, we get a similar |
| 300 | ;; problem where the % and # chars appear as first chars of the 2-char | 300 | ;; problem where the % and # chars appear as first chars of the 2-char |
| 301 | ;; comend, so the multi-line ender is also turned into style-b. | 301 | ;; comend, so the multi-line ender is also turned into style-b. |
| 302 | ;; Really, we can't make it work without extending the syntax-tables, or | 302 | ;; So we need the new "c" comment style. |
| 303 | ;; via font-lock-syntactic-keywords. | ||
| 304 | (modify-syntax-entry ?\% "< 13" table) | 303 | (modify-syntax-entry ?\% "< 13" table) |
| 305 | (modify-syntax-entry ?\# "< 13" table) | 304 | (modify-syntax-entry ?\# "< 13" table) |
| 306 | (modify-syntax-entry ?\{ "(} 2b" table) | 305 | (modify-syntax-entry ?\{ "(} 2c" table) |
| 307 | (modify-syntax-entry ?\} "){ 4b" table) | 306 | (modify-syntax-entry ?\} "){ 4c" table) |
| 308 | (modify-syntax-entry ?\n ">" table) | 307 | (modify-syntax-entry ?\n ">" table) |
| 309 | table) | 308 | table) |
| 310 | "Syntax table in use in `octave-mode' buffers.") | 309 | "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 @@ | |||
| 107 | ;; Special characters | 107 | ;; Special characters |
| 108 | (modify-syntax-entry ?, "' " st) | 108 | (modify-syntax-entry ?, "' " st) |
| 109 | (modify-syntax-entry ?@ "' " st) | 109 | (modify-syntax-entry ?@ "' " st) |
| 110 | (modify-syntax-entry ?# "' 14b" st) | 110 | (modify-syntax-entry ?# "' 14" st) |
| 111 | (modify-syntax-entry ?\\ "\\ " st) | 111 | (modify-syntax-entry ?\\ "\\ " st) |
| 112 | st)) | 112 | st)) |
| 113 | 113 | ||