-affects all Fortran buffers, and also the default."
- (interactive "p")
- (let (new)
- (mapc (lambda (buff)
- (with-current-buffer buff
- (when (eq major-mode 'fortran-mode)
- (setq fortran-line-length nchars
- fill-column fortran-line-length
- new (fortran-font-lock-syntactic-keywords))
- ;; Refontify only if necessary.
- (unless (equal new font-lock-syntactic-keywords)
- (setq font-lock-syntactic-keywords
- (fortran-font-lock-syntactic-keywords))
- (if font-lock-mode (font-lock-mode 1))))))
+affects all Fortran buffers, and also the default.
+If a numeric prefix argument is specified, it will be used as NCHARS,
+otherwise is a non-numeric prefix arg is specified, the length will be
+provided via the minibuffer, and otherwise the current column is used."
+ (interactive
+ (list (cond
+ ((numberp current-prefix-arg) current-prefix-arg)
+ (current-prefix-arg
+ (read-number "Line length: " (default-value 'fortran-line-length)))
+ (t (current-column)))))
+ (dolist (buff (if global
+ (buffer-list)
+ (list (current-buffer))))
+ (with-current-buffer buff
+ (when (derived-mode-p 'fortran-mode)
+ (unless (eq fortran-line-length nchars)
+ (setq fortran-line-length nchars
+ fill-column fortran-line-length
+ syntax-propertize-function
+ (fortran-make-syntax-propertize-function nchars))
+ (syntax-ppss-flush-cache (point-min))
+ (if font-lock-mode (font-lock-mode 1))))))