Subject: Re: bug#17134: 24.3.50; Dired error

From: Michael Heerdegen <[email-masked]>
Date: Sat, 29 Mar 2014 18:53:06 +0100

Hi Fabrice,

> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p [...])
>   save-place-dired-hook()
>   run-hooks(dired-initial-point-hook)
>   dired-initial-position("d:/Users/fni/src/stage-latex-dunkerque-2012/")
>   dired-internal-noselect("d:/Users/fni/src/stage-latex-dunkerque-2012/" nil)
>   dired-noselect("~/src/stage-latex-dunkerque-2012")
>   run-hook-with-args-until-success(dired-noselect "~/src/stage-latex-dunkerque-2012")
>   find-file-noselect("D:/Users/fni/src/stage-latex-dunkerque-2012" nil nil nil)
> [...]

Thanks for your report.  I think this has already been fixed 3 months
ago (revision 843879d in git).  `save-place-dired-hook' looks in the
emacs-24 branch like this:

--8<---------------cut here---------------start------------->8---
(defun save-place-dired-hook ()
  "Position the point in a Dired buffer."
  (or save-place-loaded (load-save-place-alist-from-file))
  (let ((cell (assoc (and (derived-mode-p 'dired-mode)
			  dired-directory
			  (expand-file-name (if (consp dired-directory)
						(car dired-directory)
					      dired-directory)))
		     save-place-alist)))
    (if cell
        (progn
          (or revert-buffer-in-progress-p
              (if (integerp (cdr cell))
		  (goto-char (cdr cell))
		(and (assq 'dired-filename (cdr cell))
		     (dired-goto-file (cdr (assq 'dired-filename (cdr cell)))))))
          ;; and make sure it will be saved again for later
          (setq save-place t)))))
--8<---------------cut here---------------end--------------->8---

Evaluating the new defun should fix the problem for you, I think.

Regards,

Michael.