Gnus development mailing list
 help / color / mirror / Atom feed
* Re: Message without gnus
       [not found] <yl90wt7rpy.fsf@cchan1.math.wesleyan.edu>
@ 1997-09-19 15:49 ` Matt Simmons
  0 siblings, 0 replies; only message in thread
From: Matt Simmons @ 1997-09-19 15:49 UTC (permalink / raw)
  Cc: ding

[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]

Mark Hovey <mhovey@wesleyan.edu> writes:
> I like message-mode so much I have C-x m redefined to 'message-mail.  In
> qgnus-0.6, this works fine as long as I have previously loaded gnus, but
> gives the following error if I have not:
> 
> Symbol's function definition is void: nndraft-request-associate-buffer
> 
> I can live with this problem myself, or fix it, but I think it is a
> bug.  

Here's a patch that fixes message-set-auto-save-file-name and
message-disassociate-draft (the two functions in message.el that call
nndraft functions).  It's basically a lift of the old code from 5.4.66 
(for message-set-auto-save-file-name - the other function didn't exist 
in 5.4.66) if'd in based on a fboundp of the nndraft functions.

I also copied message-replace-chars-in-string (nee nnheader-repla...)
from nnheader.el.

Matt

-- 
     Matt Simmons  -  simmonmt@acm.org  -  http://www.netcom.com/~simmonmt
     When a fellow says it ain't the money but the principle of the thing,
                        it's the money.  --Kin Hubbard

[-- Attachment #2: gnus.patch --]
[-- Type: application/octet-stream, Size: 2551 bytes --]

*** /tmp/T0a000GL	Fri Sep 19 10:31:19 1997
--- gnus/lisp/message.el	Fri Sep 19 10:30:10 1997
***************
*** 3036,3049 ****
  (defun message-set-auto-save-file-name ()
    "Associate the message buffer with a file in the drafts directory."
    (when message-autosave-directory
!     (setq message-draft-article (nndraft-request-associate-buffer "drafts"))
!     (clear-visited-file-modtime)))
  
  (defun message-disassociate-draft ()
    "Disassociate the message buffer from the drafts directory."
    (when message-draft-article
!     (nndraft-request-expire-articles
!      (list message-draft-article) "drafts" nil t)))
  
  \f
  
--- 3036,3071 ----
  (defun message-set-auto-save-file-name ()
    "Associate the message buffer with a file in the drafts directory."
    (when message-autosave-directory
!     (cond
!      ((fboundp 'nndraft-request-associate-buffer)
!      (setq message-draft-article (nndraft-request-associate-buffer "drafts"))
!       (clear-visited-file-modtime))
!      (t (unless (file-exists-p message-autosave-directory)
! 	(make-directory message-autosave-directory t))
!       (let ((name (make-temp-name
! 		   (expand-file-name
! 		    (concat (file-name-as-directory message-autosave-directory)
! 			    "msg."
! 			    (message-replace-chars-in-string
! 			     (message-replace-chars-in-string
! 			      (buffer-name) ?* ?.)
! 			     ?/ ?-))))))
! 	(setq buffer-auto-save-file-name
! 	      (save-excursion
! 		(prog1
! 		    (progn
! 		      (set-buffer (get-buffer-create " *draft tmp*"))
! 		      (setq buffer-file-name name)
! 		      (make-auto-save-file-name))
! 		  (kill-buffer (current-buffer)))))
! 	(clear-visited-file-modtime))))))
  
  (defun message-disassociate-draft ()
    "Disassociate the message buffer from the drafts directory."
    (when message-draft-article
!     (if (fboundp 'nndraft-request-expire-articles)
! 	(nndraft-request-expire-articles
! 	  (list message-draft-article) "drafts" nil t))))
  
  \f
  
***************
*** 3728,3731 ****
--- 3750,3768 ----
  
  (provide 'message)
  
+ ;;; Miscellaneous functions
+ 
+ ;; stolen (and renamed) from nnheader.el
+ (defun message-replace-chars-in-string (string from to)
+   "Replace characters in STRING from FROM to TO."
+   (let ((string (substring string 0))	;Copy string.
+ 	(len (length string))
+ 	(idx 0))
+     ;; Replace all occurrences of FROM with TO.
+     (while (< idx len)
+       (when (= (aref string idx) from)
+ 	(aset string idx to))
+       (setq idx (1+ idx)))
+     string))
+ 
  ;;; message.el ends here

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

only message in thread, other threads:[~1997-09-19 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <yl90wt7rpy.fsf@cchan1.math.wesleyan.edu>
1997-09-19 15:49 ` Message without gnus Matt Simmons

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 NNTP newsgroup(s).