From unknown Fri Sep 05 20:56:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#19436 <19436@debbugs.gnu.org> To: bug#19436 <19436@debbugs.gnu.org> Subject: Status: 24.4; dired-insert-subdir with saveplace Reply-To: bug#19436 <19436@debbugs.gnu.org> Date: Sat, 06 Sep 2025 03:56:03 +0000 retitle 19436 24.4; dired-insert-subdir with saveplace reassign 19436 emacs submitter 19436 Tak Kunihiro severity 19436 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 24 12:18:16 2014 Received: (at submit) by debbugs.gnu.org; 24 Dec 2014 17:18:16 +0000 Received: from localhost ([127.0.0.1]:56719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3pZf-0005Gu-SL for submit@debbugs.gnu.org; Wed, 24 Dec 2014 12:18:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59605) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3mrD-0000rP-1y for submit@debbugs.gnu.org; Wed, 24 Dec 2014 09:24:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3mrB-0006W0-TS for submit@debbugs.gnu.org; Wed, 24 Dec 2014 09:24:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3mrB-0006Vw-QI for submit@debbugs.gnu.org; Wed, 24 Dec 2014 09:24:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3mrA-0002A7-MT for bug-gnu-emacs@gnu.org; Wed, 24 Dec 2014 09:24:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3mr6-0006Va-MF for bug-gnu-emacs@gnu.org; Wed, 24 Dec 2014 09:24:08 -0500 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]:57214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3mr6-0006VO-Di for bug-gnu-emacs@gnu.org; Wed, 24 Dec 2014 09:24:04 -0500 Received: by mail-pa0-f42.google.com with SMTP id et14so10190449pad.29 for ; Wed, 24 Dec 2014 06:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:to:cc:subject:from:mime-version:content-type :content-transfer-encoding; bh=W/r7cY8mlSKlB7skBQv4LNyzEwOjm2SzOlRk0ptk1vY=; b=UQYILpi4cvqX3FqtfAgsg7yRhxCRrZGv9i/n18lN7snoeFpKBZsnV4Qr8lGxN+LLHH 1JM9sKS9NSrA261RYl1epkXx8whNUbN7GXtpnVb4A7HznVC1ypR/7V9CYC7/1E9exbZ8 9X04SinzDf6maS43Rn4oRSAUo6NEDm8u7urMW1nZApymzNidf/D/x/4rZMMWqcG/Avg+ TcLmUmEjHGYKUHoRr5Kfrbe9J23CvCtyRNLbCF9VzMXpuwxsf/jDuiavE91u/kzI73Dy VTIR0oeY5iVJXr3EU+H/G+umN5//SJPM9mSHk9pGxEw6QRwent4XEb58E1RGKAENwVxl vFGg== X-Received: by 10.70.103.197 with SMTP id fy5mr53947581pdb.131.1419431043456; Wed, 24 Dec 2014 06:24:03 -0800 (PST) Received: from localhost (p3229-ipbfp403tottori.tottori.ocn.ne.jp. [118.13.81.229]) by mx.google.com with ESMTPSA id gx1sm22994049pbd.57.2014.12.24.06.24.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Dec 2014 06:24:02 -0800 (PST) Date: Wed, 24 Dec 2014 23:24:01 +0900 (JST) Message-Id: <20141224.232401.279982387.tak.kunihiro@gmail.com> To: bug-gnu-emacs@gnu.org Subject: 24.4; dired-insert-subdir with saveplace From: Tak Kunihiro X-Mailer: Mew version 6.6 on Emacs 24.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 24 Dec 2014 12:18:15 -0500 Cc: tak.kunihiro@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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 r e p o r t r e p o r s a v e p l a c e SPC + SPC C-g C-g C-g C-g 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 C-e - i n i C-x o C-e C-b C-b C-b 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 M-x r e p o r 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)) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 25 14:33:20 2014 Received: (at 19436) by debbugs.gnu.org; 25 Dec 2014 19:33:20 +0000 Received: from localhost ([127.0.0.1]:57520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4E9v-0006r7-Ty for submit@debbugs.gnu.org; Thu, 25 Dec 2014 14:33:20 -0500 Received: from ps18281.dreamhost.com ([69.163.222.226]:55422 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4E9t-0006qz-Tv for 19436@debbugs.gnu.org; Thu, 25 Dec 2014 14:33:18 -0500 Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D16B4300D191C5; Thu, 25 Dec 2014 11:33:13 -0800 (PST) From: Juri Linkov To: Tak Kunihiro Subject: Re: bug#19436: 24.4; dired-insert-subdir with saveplace Organization: LINKOV.NET References: <20141224.232401.279982387.tak.kunihiro@gmail.com> Date: Thu, 25 Dec 2014 21:31:28 +0200 In-Reply-To: <20141224.232401.279982387.tak.kunihiro@gmail.com> (Tak Kunihiro's message of "Wed, 24 Dec 2014 23:24:01 +0900 (JST)") Message-ID: <87mw6bh7uf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19436 Cc: 19436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 26 19:41:12 2014 Received: (at 19436-done) by debbugs.gnu.org; 27 Dec 2014 00:41:12 +0000 Received: from localhost ([127.0.0.1]:58481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4fRP-0004KK-Qk for submit@debbugs.gnu.org; Fri, 26 Dec 2014 19:41:11 -0500 Received: from ps18281.dreamhost.com ([69.163.222.226]:47156 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4fRN-0004KA-LY for 19436-done@debbugs.gnu.org; Fri, 26 Dec 2014 19:41:10 -0500 Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id AE6E5304D049AF; Fri, 26 Dec 2014 16:41:07 -0800 (PST) From: Juri Linkov To: Tak Kunihiro Subject: Re: bug#19436: 24.4; dired-insert-subdir with saveplace Organization: LINKOV.NET References: <20141224.232401.279982387.tak.kunihiro@gmail.com> <87mw6bh7uf.fsf@mail.linkov.net> Date: Sat, 27 Dec 2014 02:40:33 +0200 In-Reply-To: <87mw6bh7uf.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 25 Dec 2014 21:31:28 +0200") Message-ID: <87fvc1kjr2.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19436-done Cc: 19436-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > 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 From unknown Fri Sep 05 20:56:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 24 Jan 2015 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator