aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-02-10 20:21:28 +0000
committerStefan Monnier2007-02-10 20:21:28 +0000
commit5b0be7fc5021d27eb80a6923016b25ea59f140c0 (patch)
tree58420f47b726b95f3cdb58971e9eb83906c93bad
parent38966db70dcc7cb37c05aef08072d448112685b8 (diff)
downloademacs-5b0be7fc5021d27eb80a6923016b25ea59f140c0.tar.gz
emacs-5b0be7fc5021d27eb80a6923016b25ea59f140c0.zip
(gdb-script-font-lock-syntactic-keywords): Improve comments.
-rw-r--r--lisp/progmodes/gud.el27
1 files changed, 16 insertions, 11 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index b9de6fab9bb..312b7187225 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -3177,20 +3177,25 @@ class of the file (using s to separate nested class ids)."
3177 ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face)) 3177 ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face))
3178 ("^\\s-*\\(\\w\\(\\w\\|\\s_\\)*\\)" (1 font-lock-keyword-face)))) 3178 ("^\\s-*\\(\\w\\(\\w\\|\\s_\\)*\\)" (1 font-lock-keyword-face))))
3179 3179
3180;; FIXME: The keyword "end" associated with "document"
3181;; should have font-lock-keyword-face (currently font-lock-doc-face).
3182(defvar gdb-script-font-lock-syntactic-keywords 3180(defvar gdb-script-font-lock-syntactic-keywords
3183 '(("^document\\s-.*\\(\n\\)" (1 "< b")) 3181 '(("^document\\s-.*\\(\n\\)" (1 "< b"))
3184 ;; It would be best to change the \n in front, but it's more difficult.
3185 ("^end\\>" 3182 ("^end\\>"
3186 (0 (progn 3183 (0 (unless (eq (match-beginning 0) (point-min))
3187 (unless (eq (match-beginning 0) (point-min)) 3184 ;; We change the \n in front, which is more difficult, but results
3188 (put-text-property (1- (match-beginning 0)) (match-beginning 0) 3185 ;; in better highlighting. If the doc is empty, the single \n is
3189 'syntax-table (eval-when-compile 3186 ;; both the beginning and the end of the docstring, which can't be
3190 (string-to-syntax "> b"))) 3187 ;; expressed in syntax-tables. Instead, we place the "> b" after
3191 (put-text-property (1- (match-beginning 0)) (match-end 0) 3188 ;; placing the "< b", so the start marker is overwritten by the
3192 'font-lock-multiline t) 3189 ;; termination marker and in the end Emacs simply considers that
3193 nil)))))) 3190 ;; there's no docstring at all, which is fine.
3191 (put-text-property (1- (match-beginning 0)) (match-beginning 0)
3192 'syntax-table (eval-when-compile
3193 (string-to-syntax "> b")))
3194 ;; Make sure that rehighlighting the previous line won't erase our
3195 ;; syntax-table property.
3196 (put-text-property (1- (match-beginning 0)) (match-end 0)
3197 'font-lock-multiline t)
3198 nil)))))
3194 3199
3195(defun gdb-script-font-lock-syntactic-face (state) 3200(defun gdb-script-font-lock-syntactic-face (state)
3196 (cond 3201 (cond