diff options
| author | Gerd Moellmann | 1999-12-12 13:18:54 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-12-12 13:18:54 +0000 |
| commit | b0622822866c30c0e6103b5728d74ec21b8aae5d (patch) | |
| tree | a2e85cccafe76c77fd052e5494c980a3441380d3 | |
| parent | 01511f50e3ca2d71a04675d0f1765e66d83863a8 (diff) | |
| download | emacs-b0622822866c30c0e6103b5728d74ec21b8aae5d.tar.gz emacs-b0622822866c30c0e6103b5728d74ec21b8aae5d.zip | |
Fix for when font-lock mode is active.
(sh-font-lock-unfontify-region-function): New function.
| -rw-r--r-- | lisp/progmodes/sh-script.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index e1f636f8238..5d00037484a 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1247,6 +1247,7 @@ with your script for an edit-interpret-debug cycle." | |||
| 1247 | (make-local-variable 'imenu-generic-expression) | 1247 | (make-local-variable 'imenu-generic-expression) |
| 1248 | (make-local-variable 'sh-electric-rparen-needed-here) | 1248 | (make-local-variable 'sh-electric-rparen-needed-here) |
| 1249 | (make-local-variable 'sh-indent-supported-here) | 1249 | (make-local-variable 'sh-indent-supported-here) |
| 1250 | (make-local-variable 'font-lock-unfontify-region-function) | ||
| 1250 | (setq major-mode 'sh-mode | 1251 | (setq major-mode 'sh-mode |
| 1251 | mode-name "Shell-script" | 1252 | mode-name "Shell-script" |
| 1252 | ;; not very clever, but enables wrapping skeletons around regions | 1253 | ;; not very clever, but enables wrapping skeletons around regions |
| @@ -1272,6 +1273,8 @@ with your script for an edit-interpret-debug cycle." | |||
| 1272 | nil nil | 1273 | nil nil |
| 1273 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil | 1274 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil |
| 1274 | (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)) | 1275 | (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)) |
| 1276 | font-lock-unfontify-region-function | ||
| 1277 | 'sh-font-lock-unfontify-region-function | ||
| 1275 | skeleton-pair-alist '((?` _ ?`)) | 1278 | skeleton-pair-alist '((?` _ ?`)) |
| 1276 | skeleton-pair-filter 'sh-quoted-p | 1279 | skeleton-pair-filter 'sh-quoted-p |
| 1277 | skeleton-further-elements '((< '(- (min sh-indentation | 1280 | skeleton-further-elements '((< '(- (min sh-indentation |
| @@ -3195,6 +3198,17 @@ Return values: | |||
| 3195 | Otherwise, we fontify something and font-lock overwrites it." | 3198 | Otherwise, we fontify something and font-lock overwrites it." |
| 3196 | ) | 3199 | ) |
| 3197 | 3200 | ||
| 3201 | ;; The default font-lock-unfontify-region-function removes | ||
| 3202 | ;; syntax-table properties, and so removes our information. | ||
| 3203 | (defun sh-font-lock-unfontify-region-function (beg end) | ||
| 3204 | (let* ((modified (buffer-modified-p)) (buffer-undo-list t) | ||
| 3205 | (inhibit-read-only t) (inhibit-point-motion-hooks t) | ||
| 3206 | before-change-functions after-change-functions | ||
| 3207 | deactivate-mark buffer-file-name buffer-file-truename) | ||
| 3208 | (remove-text-properties beg end '(face nil)) | ||
| 3209 | (when (and (not modified) (buffer-modified-p)) | ||
| 3210 | (set-buffer-modified-p nil)))) | ||
| 3211 | |||
| 3198 | (defun sh-set-char-syntax (where new-prop) | 3212 | (defun sh-set-char-syntax (where new-prop) |
| 3199 | "Set the character's syntax table property at WHERE to be NEW-PROP." | 3213 | "Set the character's syntax table property at WHERE to be NEW-PROP." |
| 3200 | (or where | 3214 | (or where |