unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67028: 29.1; WDired should restore the previous `mode-name' when returning to Dired mode
@ 2023-11-09 20:00 Drew Adams
  2023-11-10  8:09 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2023-11-09 20:00 UTC (permalink / raw)
  To: 67028

Dunno how simple and sure this would be to do, but I think that when you
quit WDired the mode-line should show the same `mode-name' it showed
before you entered WDired.  E.g., if the `mode-name' was "Dired by name"
then it should be restored to that.

Instead, when you quit WDired the `mode-name' is always set to just
"Dired".  You lose the info that the sorting is by name or by date.

Seems like `wdired-change-to-dired-mode' could just save the `mode-name'
before it changes mode.  And then `wdired-change-to-dired-mode' to
restore that saved `mode-name' value.

In GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-08-02 built on
 AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.3570)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation=aot
 --without-compress-install --with-tree-sitter CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

(NATIVE_COMP present but libgccjit not available)






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#67028: 29.1; WDired should restore the previous `mode-name' when returning to Dired mode
  2023-11-09 20:00 bug#67028: 29.1; WDired should restore the previous `mode-name' when returning to Dired mode Drew Adams
@ 2023-11-10  8:09 ` Eli Zaretskii
  2023-11-10 17:21   ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-11-10  8:09 UTC (permalink / raw)
  To: Drew Adams; +Cc: 67028

> From: Drew Adams <drew.adams@oracle.com>
> Date: Thu, 9 Nov 2023 20:00:25 +0000
> 
> Dunno how simple and sure this would be to do, but I think that when you
> quit WDired the mode-line should show the same `mode-name' it showed
> before you entered WDired.  E.g., if the `mode-name' was "Dired by name"
> then it should be restored to that.
> 
> Instead, when you quit WDired the `mode-name' is always set to just
> "Dired".  You lose the info that the sorting is by name or by date.

Thanks.  Does the patch below give good results?

diff --git a/lisp/wdired.el b/lisp/wdired.el
index 7b9c75d..079d93d 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -453,7 +453,7 @@ wdired-change-to-dired-mode
   (force-mode-line-update)
   (setq buffer-read-only t)
   (setq major-mode 'dired-mode)
-  (setq mode-name "Dired")
+  (dired-sort-set-mode-line)
   (dired-advertise)
   (dired-hide-details-update-invisibility-spec)
   (remove-hook 'kill-buffer-hook #'wdired-check-kill-buffer t)





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#67028: 29.1; WDired should restore the previous `mode-name' when returning to Dired mode
  2023-11-10  8:09 ` Eli Zaretskii
@ 2023-11-10 17:21   ` Drew Adams
  2023-11-10 19:55     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2023-11-10 17:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67028@debbugs.gnu.org

> Thanks.  Does the patch below give good results?

LGTM - thx.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#67028: 29.1; WDired should restore the previous `mode-name' when returning to Dired mode
  2023-11-10 17:21   ` Drew Adams
@ 2023-11-10 19:55     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-11-10 19:55 UTC (permalink / raw)
  To: Drew Adams; +Cc: 67028-done

> From: Drew Adams <drew.adams@oracle.com>
> CC: "67028@debbugs.gnu.org" <67028@debbugs.gnu.org>
> Date: Fri, 10 Nov 2023 17:21:29 +0000
> 
> > Thanks.  Does the patch below give good results?
> 
> LGTM - thx.

Thanks, installed on master, and closing the bug.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-10 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 20:00 bug#67028: 29.1; WDired should restore the previous `mode-name' when returning to Dired mode Drew Adams
2023-11-10  8:09 ` Eli Zaretskii
2023-11-10 17:21   ` Drew Adams
2023-11-10 19:55     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).