Function: fortran-line-length

fortran-line-length is an interactive and byte-compiled function defined in fortran.el.gz.

Signature

(fortran-line-length NCHARS &optional GLOBAL)

Documentation

Set the length of fixed-form Fortran lines to NCHARS.

By default this only affects the current buffer, which must be in Fortran mode. If the optional argument GLOBAL is non-nil, it affects all Fortran buffers, and also the default. The default value of NCHARS is the current column. A numeric prefix argument specifies a value to use instead of the current column. A non-numeric prefix argument prompts for the value to use.

View in manual

Probably introduced at or before Emacs version 23.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/fortran.el.gz
(defun fortran-line-length (nchars &optional global)
  "Set the length of fixed-form Fortran lines to NCHARS.
By default this only affects the current buffer, which must be in
Fortran mode.  If the optional argument GLOBAL is non-nil, it affects
all Fortran buffers, and also the default.  The default value of NCHARS
is the current column.  A numeric prefix argument specifies a value to
use instead of the current column.  A non-numeric prefix argument prompts
for the value to use."
  (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))))))
          (if global
      (setq-default fortran-line-length nchars)))