diff options
| author | Luc Teirlinck | 2004-09-23 22:12:15 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-09-23 22:12:15 +0000 |
| commit | 998733b3bfdf8648b3dda3002d1316609f719804 (patch) | |
| tree | 6b6198c87130f80235419081e4cbd7b40d249eca | |
| parent | 6db2bc0254d88bdeb22dc5549509f597cad825fb (diff) | |
| download | emacs-998733b3bfdf8648b3dda3002d1316609f719804.tar.gz emacs-998733b3bfdf8648b3dda3002d1316609f719804.zip | |
(enriched-default-text-properties-local-flag): New variable.
(enriched-mode): Make sure that enabling and disabling the mode is a no-op.
Doc fix.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/enriched.el | 20 |
2 files changed, 24 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0842def464e..55c648d3269 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2004-09-23 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * textmodes/enriched.el | ||
| 4 | (enriched-default-text-properties-local-flag): New variable. | ||
| 5 | (enriched-mode): Make sure that enabling and disabling the mode is | ||
| 6 | a no-op. Doc fix. | ||
| 7 | |||
| 1 | 2004-09-23 H,Ae(Bkon Malmedal <hmalmedal@yahoo.no> | 8 | 2004-09-23 H,Ae(Bkon Malmedal <hmalmedal@yahoo.no> |
| 2 | 9 | ||
| 3 | * calendar/holidays.el (holiday-advent): Report on a specified day | 10 | * calendar/holidays.el (holiday-advent): Report on a specified day |
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el index f25bec2d841..4db493803ef 100644 --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el | |||
| @@ -154,6 +154,12 @@ them and their old values to `enriched-old-bindings'." | |||
| 154 | The value is a list of \(VAR VALUE VAR VALUE...).") | 154 | The value is a list of \(VAR VALUE VAR VALUE...).") |
| 155 | (make-variable-buffer-local 'enriched-old-bindings) | 155 | (make-variable-buffer-local 'enriched-old-bindings) |
| 156 | 156 | ||
| 157 | ;; The next variable is buffer local if and only if Enriched mode is | ||
| 158 | ;; enabled. The buffer local value records whether | ||
| 159 | ;; `default-text-properties' should remain buffer local when disabling | ||
| 160 | ;; Enriched mode. For technical reasons, the default value should be t. | ||
| 161 | (defvar enriched-default-text-properties-local-flag t) | ||
| 162 | |||
| 157 | ;; Technical internal variable. Bound to t if `enriched-mode' is | 163 | ;; Technical internal variable. Bound to t if `enriched-mode' is |
| 158 | ;; being rerun by a major mode to allow it to restore buffer-local | 164 | ;; being rerun by a major mode to allow it to restore buffer-local |
| 159 | ;; variables and to correctly update `enriched-old-bindings'. | 165 | ;; variables and to correctly update `enriched-old-bindings'. |
| @@ -169,7 +175,7 @@ The value is a list of \(VAR VALUE VAR VALUE...).") | |||
| 169 | "Minor mode for editing text/enriched files. | 175 | "Minor mode for editing text/enriched files. |
| 170 | These are files with embedded formatting information in the MIME standard | 176 | These are files with embedded formatting information in the MIME standard |
| 171 | text/enriched format. | 177 | text/enriched format. |
| 172 | Turning the mode on runs `enriched-mode-hook'. | 178 | Turning the mode on or off runs `enriched-mode-hook'. |
| 173 | 179 | ||
| 174 | More information about Enriched mode is available in the file | 180 | More information about Enriched mode is available in the file |
| 175 | etc/enriched.doc in the Emacs distribution directory. | 181 | etc/enriched.doc in the Emacs distribution directory. |
| @@ -183,7 +189,11 @@ Commands: | |||
| 183 | (setq buffer-file-format (delq 'text/enriched buffer-file-format)) | 189 | (setq buffer-file-format (delq 'text/enriched buffer-file-format)) |
| 184 | ;; restore old variable values | 190 | ;; restore old variable values |
| 185 | (while enriched-old-bindings | 191 | (while enriched-old-bindings |
| 186 | (set (pop enriched-old-bindings) (pop enriched-old-bindings)))) | 192 | (set (pop enriched-old-bindings) (pop enriched-old-bindings))) |
| 193 | (unless enriched-default-text-properties-local-flag | ||
| 194 | (kill-local-variable 'default-text-properties)) | ||
| 195 | (kill-local-variable 'enriched-default-text-properties-local-flag) | ||
| 196 | (unless use-hard-newlines (use-hard-newlines 0))) | ||
| 187 | 197 | ||
| 188 | ((and (memq 'text/enriched buffer-file-format) | 198 | ((and (memq 'text/enriched buffer-file-format) |
| 189 | (not enriched-rerun-flag)) | 199 | (not enriched-rerun-flag)) |
| @@ -196,7 +206,11 @@ Commands: | |||
| 196 | ;; These will be restored if we exit Enriched mode. | 206 | ;; These will be restored if we exit Enriched mode. |
| 197 | (setq enriched-old-bindings | 207 | (setq enriched-old-bindings |
| 198 | (list 'buffer-display-table buffer-display-table | 208 | (list 'buffer-display-table buffer-display-table |
| 199 | 'default-text-properties default-text-properties)) | 209 | 'default-text-properties default-text-properties |
| 210 | 'use-hard-newlines use-hard-newlines)) | ||
| 211 | (make-local-variable 'enriched-default-text-properties-local-flag) | ||
| 212 | (setq enriched-default-text-properties-local-flag | ||
| 213 | (local-variable-p 'default-text-properties)) | ||
| 200 | (make-local-variable 'default-text-properties) | 214 | (make-local-variable 'default-text-properties) |
| 201 | (setq buffer-display-table enriched-display-table) | 215 | (setq buffer-display-table enriched-display-table) |
| 202 | (use-hard-newlines 1 (if enriched-rerun-flag 'never nil)) | 216 | (use-hard-newlines 1 (if enriched-rerun-flag 'never nil)) |