Subject: bug#5303: 23.1.91; Cannot load .emacs-history from savehist.el

From: Michael Albinus <[email-masked]>
Date: Wed, 20 Jan 2010 10:45:55 +0100

Michael Albinus <[email-masked]> writes:

> Tramp inhibits the file name handler of `load'. `openp' checks for a
> file name handler of `file-exists-p', which is not inhibited.

The following patch could solve the problem (untested, and I don't know
whether it is TRTTD)

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs/src/lread.c.~1.422.~	2009-12-08 13:25:31.000000000 +0100
--- /home/albinus/src/emacs/src/lread.c	2010-01-20 10:34:23.000000000 +0100
***************
*** 1487,1493 ****
  	     It's not clear why that was the case and it breaks things like
  	     (load "/bar.el") where the file is actually "/bar.el.gz".  */
  	  string = build_string (fn);
! 	  handler = Ffind_file_name_handler (string, Qfile_exists_p);
  	  if ((!NILP (handler) || !NILP (predicate)) && !NATNUMP (predicate))
              {
  	      if (NILP (predicate))
--- 1487,1496 ----
  	     It's not clear why that was the case and it breaks things like
  	     (load "/bar.el") where the file is actually "/bar.el.gz".  */
  	  string = build_string (fn);
! 	  handler = Ffind_file_name_handler (string,
! 					     NILP (Vinhibit_file_name_operation)
! 					     ? Qfile_exists_p
! 					     : Vinhibit_file_name_operation);
  	  if ((!NILP (handler) || !NILP (predicate)) && !NATNUMP (predicate))
              {
  	      if (NILP (predicate))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.