GNU bug report logs -
#19436
24.4; dired-insert-subdir with saveplace
Previous Next
Reported by: Tak Kunihiro <tak.kunihiro <at> gmail.com>
Date: Wed, 24 Dec 2014 17:19:01 UTC
Severity: normal
Found in version 24.4
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19436 in the body.
You can then email your comments to 19436 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19436
; Package
emacs
.
(Wed, 24 Dec 2014 17:19:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tak Kunihiro <tak.kunihiro <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 24 Dec 2014 17:19:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
On `dired-insert-subdir' with saveplace on, point goes to random place.
0. emacs -Q
1. (require 'saveplace)
2. (setq-default save-place t)
3. M-x dired
4. M-x dired-insert-subdir
5. I expect point goes to top of the new inserted directory.
However, it goes to random place.
6. It seems that it has something to do with dired-initial-position-hook
in dired-initial-position.
In GNU Emacs 24.4.1 (i686-pc-mingw32)
of 2014-10-25 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --prefix=/c/usr'
Important settings:
value of $LANG: ENU
locale-coding-system: cp932
Major mode: Emacs-Lisp
Minor modes in effect:
tooltip-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
M-x b u g <tab> <tab> <M-backspace> r e p o r t <tab>
<tab> <backspace> <M-backspace> <M-backspace> r e p
o r <tab> <return> s a v e p l a c e SPC + SPC <down-mouse-1>
<mouse-1> <double-down-mouse-1> <double-mouse-1> C-g
<down-mouse-1> <mouse-1> C-g <down-mouse-1> <mouse-1>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
C-g <help-echo> <down-mouse-1> <mouse-1> C-g <help-echo>
<down-mouse-1> <mouse-1> C-x d C-g C-; C-; C-g M-x
C-g C-h C-g C-x C-f C-g C-h f d i r e d C-a p o s i
<tab> <backspace> <backspace> <backspace> <backspace>
C-e - i n i <tab> <return> C-x o C-e C-b C-b C-b <return>
C-n C-n C-p C-p C-f C-f C-f C-f C-f C-f C-f C-M-SPC
M-w C-x 5 2 <switch-frame> <help-echo> <help-echo>
M-x r e p o r <tab> <return>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Quit [5 times]
C-; is undefined [2 times]
Quit [2 times]
C-h C-g is undefined
Quit
Making completion list...
Type C-x 1 to delete the help window.
Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr find-func dired emacsbug message
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils help-mode easymenu
time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
w32notify w32 multi-tty emacs)
Memory information:
((conses 8 81635 14902)
(symbols 32 17881 0)
(miscs 32 61 231)
(strings 16 13041 4284)
(string-bytes 1 322092)
(vectors 8 10161)
(vector-slots 4 401031 5646)
(floats 8 67 243)
(intervals 28 462 0)
(buffers 508 15))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19436
; Package
emacs
.
(Thu, 25 Dec 2014 19:34:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 19436 <at> debbugs.gnu.org (full text, mbox):
> On `dired-insert-subdir' with saveplace on, point goes to random place.
>
> 0. emacs -Q
> 1. (require 'saveplace)
> 2. (setq-default save-place t)
> 3. M-x dired
> 4. M-x dired-insert-subdir
> 5. I expect point goes to top of the new inserted directory.
> However, it goes to random place.
> 6. It seems that it has something to do with dired-initial-position-hook
> in dired-initial-position.
Thanks for the report. Subdir saving was not supported by
dired-initial-position until now. It's implemented by this patch:
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index a25dba2..a081794 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -153,7 +153,7 @@ (defun toggle-save-place (&optional parg)
\(setq-default save-place t)"
(interactive "P")
(if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
- dired-directory)))
+ (dired-current-directory))))
(message "Buffer `%s' not visiting a file or directory" (buffer-name))
(setq save-place (if parg
(> (prefix-numeric-value parg) 0)
@@ -172,12 +172,13 @@ (defun save-place-to-alist ()
;; file. If not, do so, then feel free to modify the alist. It
;; 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 (derived-mode-p 'dired-mode)
- dired-directory
- (expand-file-name (if (consp dired-directory)
- (car dired-directory)
- dired-directory))))))
+ (let* ((directory (and (derived-mode-p 'dired-mode)
+ (dired-current-directory)))
+ (item (or buffer-file-name
+ (and directory
+ (expand-file-name (if (consp directory)
+ (car directory)
+ directory))))))
(when (and item
(or (not save-place-ignore-files-regexp)
(not (string-match save-place-ignore-files-regexp
@@ -186,8 +187,7 @@ (defun save-place-to-alist ()
(position (cond ((eq major-mode 'hexl-mode)
(with-no-warnings
(1+ (hexl-current-address))))
- ((and (derived-mode-p 'dired-mode)
- dired-directory)
+ ((and (derived-mode-p 'dired-mode) directory)
(let ((filename (dired-get-filename nil t)))
(if filename
`((dired-filename . ,filename))
@@ -305,7 +305,7 @@ (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)
- dired-directory))
+ (dired-current-directory)))
(save-place-to-alist))
(setq buf-list (cdr buf-list))))))
@@ -325,12 +325,13 @@ (declare-function dired-goto-file "dired" (file))
(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)))
+ (let* ((directory (and (derived-mode-p 'dired-mode)
+ (dired-current-directory)))
+ (cell (assoc (and directory
+ (expand-file-name (if (consp directory)
+ (car directory)
+ directory)))
+ save-place-alist)))
(if cell
(progn
(or revert-buffer-in-progress-p
Reply sent
to
Juri Linkov <juri <at> linkov.net>
:
You have taken responsibility.
(Sat, 27 Dec 2014 00:42:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tak Kunihiro <tak.kunihiro <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 27 Dec 2014 00:42:03 GMT)
Full text and
rfc822 format available.
Message #13 received at 19436-done <at> debbugs.gnu.org (full text, mbox):
> Thanks for the report. Subdir saving was not supported by
> dired-initial-position until now. It's implemented by this patch:
This is implemented now cumulatively with
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02101.html
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 24 Jan 2015 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 10 years and 97 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.