GNU bug report logs -
#16477
24.3.50; [saveplace] symbol's function defn is void: dired-get-filename
Previous Next
Reported by: Mark Oteiza <mvoteiza <at> udel.edu>
Date: Fri, 17 Jan 2014 06:53:01 UTC
Severity: normal
Found in version 24.3.50
Done: Juri Linkov <juri <at> jurta.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 16477 <at> debbugs.gnu.org (full text, mbox):
> (setq-default save-place t)
> (require 'saveplace)
> (eshell)
> (kill-emacs)
> Debugger entered--Lisp error: (void-function dired-get-filename)
> dired-get-filename(nil t)
> save-place-to-alist()
> save-places-to-alist()
> save-place-kill-emacs-hook()
> kill-emacs()
> eval((kill-emacs) nil)
> eval-expression((kill-emacs) nil)
> call-interactively(eval-expression nil nil)
> command-execute(eval-expression)
Thanks for the report. `eshell' sets the variable `dired-directory',
so we have to check if we are in dired mode as well:
=== modified file 'lisp/saveplace.el'
--- lisp/saveplace.el 2014-01-01 07:43:34 +0000
+++ lisp/saveplace.el 2014-01-17 08:01:20 +0000
@@ -152,7 +152,8 @@ (defun toggle-save-place (&optional parg
\(setq-default save-place t\)"
(interactive "P")
- (if (not (or buffer-file-name dired-directory))
+ (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
+ dired-directory)))
(message "Buffer `%s' not visiting a file or directory" (buffer-name))
(if (and save-place (or (not parg) (<= parg 0)))
(progn
@@ -172,7 +173,8 @@ (defun save-place-to-alist ()
;; will be saved again when Emacs is killed.
(or save-place-loaded (load-save-place-alist-from-file))
(let ((item (or buffer-file-name
- (and dired-directory
+ (and (derived-mode-p 'dired-mode)
+ dired-directory
(if (consp dired-directory)
(expand-file-name (car dired-directory))
(expand-file-name dired-directory))))))
@@ -184,7 +186,8 @@ (defun save-place-to-alist ()
(position (cond ((eq major-mode 'hexl-mode)
(with-no-warnings
(1+ (hexl-current-address))))
- (dired-directory
+ ((and (derived-mode-p 'dired-mode)
+ dired-directory)
(let ((filename (dired-get-filename nil t)))
(if filename
`((dired-filename . ,filename))
@@ -301,7 +304,8 @@ (defun save-places-to-alist ()
(with-current-buffer (car buf-list)
;; save-place checks buffer-file-name too, but we can avoid
;; overhead of function call by checking here too.
- (and (or buffer-file-name dired-directory)
+ (and (or buffer-file-name (and (derived-mode-p 'dired-mode)
+ dired-directory))
(save-place-to-alist))
(setq buf-list (cdr buf-list))))))
@@ -321,9 +325,11 @@ (declare-function dired-goto-file "dired
(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 (if (consp dired-directory)
- (expand-file-name (car dired-directory))
- (expand-file-name dired-directory))
+ (let ((cell (assoc (and (derived-mode-p 'dired-mode)
+ dired-directory
+ (if (consp dired-directory)
+ (expand-file-name (car dired-directory))
+ (expand-file-name dired-directory)))
save-place-alist)))
(if cell
(progn
This bug report was last modified 11 years and 123 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.