unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* FIX: auto-fill-mode concerted to proper minor-mode
@ 2005-03-15 17:22 Sascha Wilde
  0 siblings, 0 replies; only message in thread
From: Sascha Wilde @ 2005-03-15 17:22 UTC (permalink / raw)



[-- Attachment #1.1.1: Type: text/plain, Size: 462 bytes --]

Hi,

I enclosed a small patch to make auto-fill-mode a proper minor-mode.

Without this patch describe-mode won't work when auto-fill-mode is
used.

It's my first emacs patch, so I hope its not to worse...

cheers
sascha
-- 
Sascha Wilde 
"If you were young again, would you start writing TeX again or would
you use Microsoft Word, or another word processor?" - "I hope to die
before I *have* to use Microsoft Word."    --  Prof. Donald E. Knuth

[-- Attachment #1.1.2: simple.el.diff --]
[-- Type: text/plain, Size: 1935 bytes --]

*** simple.el	15 Mär 2005 11:03:13 +0100	1.698
--- simple.el	15 Mär 2005 18:12:05 +0100	
***************
*** 3933,3941 ****
    "The function to use for `auto-fill-function' if Auto Fill mode is turned on.
  Some major modes set this.")
  
! ;; FIXME: turn into a proper minor mode.
  ;; Add a global minor mode version of it.
! (defun auto-fill-mode (&optional arg)
    "Toggle Auto Fill mode.
  With arg, turn Auto Fill mode on if and only if arg is positive.
  In Auto Fill mode, inserting a space at a column beyond `current-fill-column'
--- 3933,3941 ----
    "The function to use for `auto-fill-function' if Auto Fill mode is turned on.
  Some major modes set this.")
  
! ;; FIXME:
  ;; Add a global minor mode version of it.
! (define-minor-mode auto-fill-mode
    "Toggle Auto Fill mode.
  With arg, turn Auto Fill mode on if and only if arg is positive.
  In Auto Fill mode, inserting a space at a column beyond `current-fill-column'
***************
*** 3943,3956 ****
  
  The value of `normal-auto-fill-function' specifies the function to use
  for `auto-fill-function' when turning Auto Fill mode on."
!   (interactive "P")
!   (prog1 (setq auto-fill-function
! 	       (if (if (null arg)
! 		       (not auto-fill-function)
! 		       (> (prefix-numeric-value arg) 0))
! 		   normal-auto-fill-function
! 		   nil))
!     (force-mode-line-update)))
  
  ;; This holds a document string used to document auto-fill-mode.
  (defun auto-fill-function ()
--- 3943,3954 ----
  
  The value of `normal-auto-fill-function' specifies the function to use
  for `auto-fill-function' when turning Auto Fill mode on."
!   nil " Fill" nil
!   :group 'editing-basics
!   (setq auto-fill-function
!         (if auto-fill-mode
!             normal-auto-fill-function
!           nil)))
  
  ;; This holds a document string used to document auto-fill-mode.
  (defun auto-fill-function ()

[-- Attachment #1.1.3: bindings.el.diff --]
[-- Type: text/plain, Size: 1197 bytes --]

*** bindings.el	11 Mär 2005 21:19:49 +0100	1.141
--- bindings.el	15 Mär 2005 17:26:22 +0100	
***************
*** 430,436 ****
  	      :button (:toggle . (bound-and-true-p auto-revert-mode))))
  (define-key mode-line-mode-menu [auto-fill-mode]
    `(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
! 	      :button (:toggle . auto-fill-function)))
  (define-key mode-line-mode-menu [abbrev-mode]
    `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
  	      :button (:toggle . abbrev-mode)))
--- 430,436 ----
  	      :button (:toggle . (bound-and-true-p auto-revert-mode))))
  (define-key mode-line-mode-menu [auto-fill-mode]
    `(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
! 	      :button (:toggle . auto-fill-mode)))
  (define-key mode-line-mode-menu [abbrev-mode]
    `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
  	      :button (:toggle . abbrev-mode)))
***************
*** 485,491 ****
        (list
         (list 'abbrev-mode " Abbrev")
         '(overwrite-mode overwrite-mode)
-        (list 'auto-fill-function " Fill")
         ;; not really a minor mode...
         '(defining-kbd-macro " Def")))
  
--- 485,490 ----

[-- Attachment #1.1.4: subr.el.diff --]
[-- Type: text/plain, Size: 781 bytes --]

*** subr.el	14 Mär 2005 21:32:57 +0100	1.437
--- subr.el	15 Mär 2005 17:24:38 +0100	
***************
*** 2424,2430 ****
  ;; add it here explicitly.
  ;; isearch-mode is deliberately excluded, since you should
  ;; not call it yourself.
! (defvar minor-mode-list '(auto-save-mode auto-fill-mode abbrev-mode
  					 overwrite-mode view-mode
                                           hs-minor-mode)
    "List of all minor mode functions.")
--- 2424,2430 ----
  ;; add it here explicitly.
  ;; isearch-mode is deliberately excluded, since you should
  ;; not call it yourself.
! (defvar minor-mode-list '(auto-save-mode abbrev-mode
  					 overwrite-mode view-mode
                                           hs-minor-mode)
    "List of all minor mode functions.")

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-15 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-15 17:22 FIX: auto-fill-mode concerted to proper minor-mode Sascha Wilde

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).