Subject: Re: bug#22982: 25.0.92; Forms Mode seems to fail to open data file

From: Eli Zaretskii <[email-masked]>
Date: Fri, 11 Mar 2016 12:33:39 +0200

> From: John Mastro <[email-masked]>
> Date: Thu, 10 Mar 2016 16:14:32 -0800
> Cc: "N. Jackson" <[email-masked]>
> 
> This seems to be caused by the call ‘(set-visited-file-name nil)’ in
> ‘forms-mode’. Before that call, ‘forms-file’ is "/etc/passwd";
> afterward, it is nil.

Sorry, I don't see how this is related.  According to the backtrace,
find-file-noselect is called with an argument of nil, and I don't
understand how this could happen, since the call I see:

  ;; find the data file
  (setq forms--file-buffer (find-file-noselect forms-file))

invokes find-file-noselect with an argument that cannot be nil, and
has no relation to the visited-file's name.

There's another call to find-file-noselect, in
forms--intuit-from-file, but that one also uses forms-file, after
verifying that it exists (which is not the case in point):

      ;; Need a file to do this.
      (if (not (file-exists-p forms-file))
	  (error "Need existing file or explicit `forms-number-of-fields'")

	;; Visit the file and extract the first record.
	(setq forms--file-buffer (find-file-noselect forms-file))

So I don't see how the problem could happen, and I definitely don't
understand how it is related to the set-visited-file-name call.

Does the problem happen to you in "emacs -Q"?

Thanks.