bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19851: 25.0.50; package-install-{file,from-buffer} broken


From: Mark Oteiza
Subject: bug#19851: 25.0.50; package-install-{file,from-buffer} broken
Date: Sat, 19 Dec 2015 14:21:20 -0500
User-agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30)

On 15/06/15 at 11:56pm, Juri Linkov wrote:
> > Found it.  It is from using package-install-file on a directory while
> > saveplace is enabled.  Saveplace gets stuck.  From emacs -Q:
> >
> > 1. mkdir /some/new/dir
> > 2. Evaluate:
> >
> >   (setq-default save-place t)
> >   (require 'saveplace)
> >   (package-initialize)
> >
> > 3. M-x package-install-file RET /some/new/dir RET
> >
> >   "dired-current-directory: No subdir-alist in  *temp*"
> >
> > In order to quit emacs, one has to hack around kill-emacs-hook.
> 
> Does this patch fix it for you?
> 
> diff --git a/lisp/saveplace.el b/lisp/saveplace.el
> index fe54743..5bbcd79 100644
> --- a/lisp/saveplace.el
> +++ b/lisp/saveplace.el
> @@ -158,6 +158,8 @@ (defun toggle-save-place (&optional parg) ;FIXME: 
> save-place-local-mode!
>  \(setq-default save-place t)"
>    (interactive "P")
>    (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
> +                                     (boundp 'dired-subdir-alist)
> +                                  dired-subdir-alist
>                                    (dired-current-directory))))
>        (message "Buffer `%s' not visiting a file or directory" (buffer-name))
>      (setq save-place (if parg
> @@ -178,6 +180,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* ((directory (and (derived-mode-p 'dired-mode)
> +                         (boundp 'dired-subdir-alist)
> +                      dired-subdir-alist
>                        (dired-current-directory)))
>        (item (or buffer-file-name
>                  (and directory
> @@ -310,6 +314,8 @@ (defun save-places-to-alist ()
>       ;; save-place checks buffer-file-name too, but we can avoid
>       ;; overhead of function call by checking here too.
>       (and (or buffer-file-name (and (derived-mode-p 'dired-mode)
> +                                       (boundp 'dired-subdir-alist)
> +                                    dired-subdir-alist
>                                      (dired-current-directory)))
>            (save-place-to-alist))
>       (setq buf-list (cdr buf-list))))))
> @@ -331,6 +337,8 @@ (defun save-place-dired-hook ()
>    "Position the point in a Dired buffer."
>    (or save-place-loaded (load-save-place-alist-from-file))
>    (let* ((directory (and (derived-mode-p 'dired-mode)
> +                         (boundp 'dired-subdir-alist)
> +                      dired-subdir-alist
>                        (dired-current-directory)))
>        (cell (assoc (and directory
>                          (expand-file-name (if (consp directory)

Could this patch be applied? I have been running with it for so long
that getting this bug again reminded me I forgot to apply it this last
time.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]