summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-10-03 21:21:35 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-10-03 21:21:35 +0000
commit6c715ec53e10208fa909328affb24c1b53b55aa3 (patch)
tree78a26ea7de81bf147fc38099f2eef3a4190dbfe7
parentb63f6e81f7f0c1a97374cf31bbb99dca0b6eb686 (diff)
downloademacs-6c715ec53e10208fa909328affb24c1b53b55aa3.tar.gz
(c-setup-paragraph-variables): Make sure we do
not change the global value of those vars.
-rw-r--r--lisp/progmodes/cc-styles.el51
1 files changed, 26 insertions, 25 deletions
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index f0a7a2c4b7c..f20eb8e57de 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -498,33 +498,34 @@ variables."
(let ((comment-line-prefix
(concat "[ \t]*\\(" c-current-comment-prefix "\\)[ \t]*")))
- (setq paragraph-start (concat comment-line-prefix
- c-paragraph-start
- "\\|"
- page-delimiter)
- paragraph-separate (concat comment-line-prefix
- c-paragraph-separate
- "\\|"
- page-delimiter)
- paragraph-ignore-fill-prefix t
- adaptive-fill-mode t
- adaptive-fill-regexp
- (concat comment-line-prefix
- (if (default-value 'adaptive-fill-regexp)
- (concat "\\("
- (default-value 'adaptive-fill-regexp)
- "\\)")
- "")))
+ (set (make-local-variable 'paragraph-start)
+ (concat comment-line-prefix
+ c-paragraph-start
+ "\\|"
+ page-delimiter))
+ (set (make-local-variable 'paragraph-separate)
+ (concat comment-line-prefix
+ c-paragraph-separate
+ "\\|"
+ page-delimiter))
+ (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
+ (set (make-local-variable 'adaptive-fill-mode) t)
+ (set (make-local-variable 'adaptive-fill-regexp)
+ (concat comment-line-prefix
+ (if (default-value 'adaptive-fill-regexp)
+ (concat "\\("
+ (default-value 'adaptive-fill-regexp)
+ "\\)")
+ "")))
(when (boundp 'adaptive-fill-first-line-regexp)
;; XEmacs (20.x) adaptive fill mode doesn't have this.
- (make-local-variable 'adaptive-fill-first-line-regexp)
- (setq adaptive-fill-first-line-regexp
- (concat "\\`" comment-line-prefix
- ;; Maybe we should incorporate the old value here,
- ;; but then we have to do all sorts of kludges to
- ;; deal with the \` and \' it probably contains.
- "\\'")))))
+ (set (make-local-variable 'adaptive-fill-first-line-regexp)
+ (concat "\\`" comment-line-prefix
+ ;; Maybe we should incorporate the old value here,
+ ;; but then we have to do all sorts of kludges to
+ ;; deal with the \` and \' it probably contains.
+ "\\'")))))
;; Helper for setting up Filladapt mode. It's not used by CC Mode itself.
@@ -626,5 +627,5 @@ any reason to call this function directly."
(cc-provide 'cc-styles)
-;;; arch-tag: c764f61a-96ba-484a-a68f-101c0e9d5d2c
+;; arch-tag: c764f61a-96ba-484a-a68f-101c0e9d5d2c
;;; cc-styles.el ends here