From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: very mysterious behaviour from rmail-output-to-rmail-file Date: Tue, 04 Jan 2005 16:00:38 -0700 Message-ID: <340lgqF44rhsnU1@individual.net> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1104879850 24374 80.91.229.6 (4 Jan 2005 23:04:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Jan 2005 23:04:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 05 00:03:49 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ClxiP-0001gj-00 for ; Wed, 05 Jan 2005 00:03:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Clxtc-0005hM-TO for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jan 2005 18:15:24 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 77 Original-X-Trace: individual.net v/agUq4oqSEF2GMDUdA8JQsslDG32tKWd5BVwDe4vH+/BpZvk= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:127682 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23149 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23149 Florian von Savigny wrote: > I'm trying to debug a function I have written which is meant to be > called in rmail buffers and basically should sort a message > somewhere. The directory of that somewhere should be returned by > another function which works well on its own: > > (defun rmail-output-to-afile () > (interactive) > (rmail-output-to-rmail-file (concat > (nth 1 (current-contract)) > "/putmail"))) ... > But if the function definition is left as above, it will only go as > far as asking whether it should create the file (if it isn't already > there). Then, it will emit the error "Wrong type argument: stringp, > nil", and stop. > > The backtrace says: > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > rmail-output-to-rmail-file("/home/uebersetzer/auftraege/20040203.hau45147ess/putmail") > rmail-output-to-afile() > * call-interactively(rmail-output-to-afile) > execute-extended-command(nil) > call-interactively(execute-extended-command) > > > This is either a no-brainer, or a deep mystery. To me, it's the > latter. Can anybody help me? ,----[ C-h f rmail-output-to-rmail-file RET ] | rmail-output-to-rmail-file is an interactive autoloaded Lisp function in `rmailout'. | [Arg list not available until function definition is loaded.] | | Append the current message to an Rmail file named FILE-NAME. | If the file does not exist, ask if it should be created. | If file is being visited, the message is appended to the Emacs | buffer visiting that file. | If the file exists and is not an Rmail file, the message is | appended in inbox format, the same way `rmail-output' does it. | | The default file name comes from `rmail-default-rmail-file', | which is updated to the name you use in this command. Hmmm, perhaps that variable isn't set... | A prefix argument N says to output N consecutive messages | starting with the current one. Deleted messages are skipped and don't count. | | If optional argument STAY is non-nil, then leave the last filed | mesasge up instead of moving forward to the next non-deleted message. `---- Then if you look at the source for rmail-output-to-rmail-file, it's preceded by this comment: ;;; There are functions elsewhere in Emacs that use this function; ;;; look at them before you change the calling method. I would try binding that variable, which is set by all the Emacs commands that call rmail-output-to-rmail-file (via rmail-output-read-rmail-file-name, C-h v): (defun rmail-output-to-afile () "Append the current message to the \"putfile\" Rmail file in the `current-contract' directory. See `rmail-output-to-file'." (interactive) (let ((rmail-default-rmail-file (expand-file-name "putmail" (nth 1 (current-contract))))) (rmail-output-to-rmail-file rmail-default-rmail-file))) -- Kevin Rodgers