help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange behaviour of auto-fill


From: michael-franzese
Subject: Strange behaviour of auto-fill
Date: Fri, 23 Apr 2021 23:42:49 +0200

I am trying to set "auto-fill", with some tools to change "on-off" behaviour.

Things get very confusing.  When I comment out "(setq-default 
auto-fill-function 'do-auto-fill)", "auto-fill-mode" will still break comments 
even though "break-line" is "0"
and one sets "(auto-fill-mode 0)".



(setq-default auto-fill-function 'do-auto-fill)
(defvar break-line 0)

(defun break-line-ddd ()
  "Breaks long lines using auto-fill tool."
  (interactive)

  (pcase break-line
    ((or 'nil 0)
       (setq comment-auto-fill-only-comments nil)
       (auto-fill-mode 0)
       (message "%s %s"
                "Disable: Break line;  " break-line)
       (setq break-line 1))
    (1
       (setq fill-column 72)
       (setq comment-auto-fill-only-comments t)
       (auto-fill-mode 1)
       (message "%s" "Enable: Break only comments")
       (setq break-line 2))
    (_
       (setq comment-auto-fill-only-comments nil)
       (auto-fill-mode 1)
       (message "%s" "Enable: Break all long lines")
       (setq break-line 0)) ))

(defun break-line-set ()
  "Breaks long lines using auto-fill."
  (break-line-ddd)
  (global-set-key (kbd "H-b") #'break-line-ddd) )

(break-line-set)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]