From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12169 Path: main.gmane.org!not-for-mail From: Matt Simmons Newsgroups: gmane.emacs.gnus.general Subject: Re: Message without gnus Date: 19 Sep 1997 10:49:42 -0500 Message-ID: References: Reply-To: simmonmt@acm.org NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: multipart/mixed; boundary="Multipart_Fri_Sep_19_10:49:42_1997-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035151753 2281 80.91.224.250 (20 Oct 2002 22:09:13 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:09:13 +0000 (UTC) Cc: ding@ifi.uio.no Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id KAA03360 for ; Fri, 19 Sep 1997 10:09:58 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id MAA13715 for ; Fri, 19 Sep 1997 12:06:10 -0500 (CDT) Original-Received: from aurora.matt.cs.purdue.edu (simmonmt@chw-il5-13.ix.netcom.com [198.211.138.77]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Fri, 19 Sep 1997 17:50:12 +0200 Original-Received: (from simmonmt@localhost) by aurora.matt.cs.purdue.edu (8.8.7/8.8.7) id KAA01132; Fri, 19 Sep 1997 10:49:44 -0500 (CDT) Original-To: Mark Hovey In-Reply-To: Mark Hovey's message of "Fri, 19 Sep 1997 06:17:13 +0000" Original-Lines: 113 X-Mailer: Quassia Gnus v0.7/XEmacs 20.2 Xref: main.gmane.org gmane.emacs.gnus.general:12169 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12169 --Multipart_Fri_Sep_19_10:49:42_1997-1 Content-Type: text/plain; charset=US-ASCII Mark Hovey 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 --Multipart_Fri_Sep_19_10:49:42_1997-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="gnus.patch" Content-Transfer-Encoding: 7bit *** /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))) --- 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)))) *************** *** 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 --Multipart_Fri_Sep_19_10:49:42_1997-1--