From: jai-bholeki@gmx.com
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 46193@debbugs.gnu.org, Philipp Stephani <p.stephani2@gmail.com>
Subject: bug#46193: Enabling Auto Fill mode
Date: Mon, 1 Feb 2021 12:59:25 +0100 [thread overview]
Message-ID: <trinity-0f3e4cc7-a63e-4a4f-8764-4e4e5fa86f00-1612180765322@3c-app-mailcom-bs14> (raw)
In-Reply-To: <87tuqwp2k0.fsf@gnus.org>
I have now made the following function. Would I better make the
functionality to be buffer-local?
(defvar dfv-break-long-lines-state nil)
(defun cycle-break-long-lines-din ()
"Breaks long lines using auto-fill tool."
(interactive)
;;
(pcase dfv-break-long-lines-state
;;
(1 (setq fill-column 72)
(setq comment-auto-fill-only-comments t)
(auto-fill-mode)
(message "%s" "Enable: Break only comments")
(setq dfv-break-long-lines-state 2))
;;
(2 (setq comment-auto-fill-only-comments nil)
(message "%s" "Enable: Break all long lines")
(setq dfv-break-long-lines-state 1))
;;
(_ (setq comment-auto-fill-only-comments nil)
(auto-fill-mode 0)
(message "%s" "Disable: Break long lines")
(setq dfv-break-long-lines-state 0)) ))
(defun break-long-lines-din ()
"Breaks long lines using auto-fill."
(setq dfv-break-long-lines-state 1)
(cycle-break-long-lines-din))
> Sent: Monday, February 01, 2021 at 9:20 PM
> From: "Lars Ingebrigtsen" <larsi@gnus.org>
> To: jai-bholeki@gmx.com
> Cc: "Philipp Stephani" <p.stephani2@gmail.com>, 46193@debbugs.gnu.org
> Subject: Re: bug#46193: Enabling Auto Fill mode
>
> jai-bholeki@gmx.com writes:
>
> > I have noticed that enabling a minor-mode using texinfo-mode-hook fails after
> > setting auto-fill comments using a hook.
> >
> > (add-hook 'texinfo-mode-hook
> > (lambda () ((set (make-local-variable
> > 'comment-auto-fill-only-comments) t)))
> > (auto-fill-mode)
> >
> > ;; crucible-mode not enabled after setting comment-auto-fill-only-comments
> > (add-hook 'texinfo-mode-hook 'crucible-mode)
>
> (add-hook 'texinfo-mode-hook
> (lambda () ((set (make-local-variable 'comment-auto-fill-only-comments) t)))
>
> That's not valid syntax -- you have one extra pair of () around the
> `set' function call.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
>
next prev parent reply other threads:[~2021-02-01 11:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-30 14:41 bug#46193: Enabling Auto Fill mode jai-bholeki
2021-01-30 18:31 ` Philipp Stephani
2021-01-30 19:55 ` jai-bholeki
2021-02-01 9:20 ` Lars Ingebrigtsen
2021-02-01 11:59 ` jai-bholeki [this message]
2021-02-01 9:19 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-0f3e4cc7-a63e-4a4f-8764-4e4e5fa86f00-1612180765322@3c-app-mailcom-bs14 \
--to=jai-bholeki@gmx.com \
--cc=46193@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=p.stephani2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.