unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally
@ 2024-07-02 17:07 Aaron Zeng
  2024-07-02 18:27 ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Zeng @ 2024-07-02 17:07 UTC (permalink / raw)
  To: 71905; +Cc: app-emacs-dev


When dired-omit-mode is set non-nil globally, recover-session fails to
show any auto-save files because they continue to be omitted.

For example, running this command:

    emacs -Q -l dired-x --eval "(setopt dired-omit-mode t)" -f recover-session

I see no files listed in the dired buffer, but toggling
dired-omit-mode shows them.

I see that recover-session has this bit of code:

    (let ((ls-lisp-support-shell-wildcards t)
           ;; Ensure that we don't omit the session files as the user may
           ;; have (as suggested by the manual) `dired-omit-mode' in the
           ;; hook.
           (dired-mode-hook (delete 'dired-omit-mode dired-mode-hook)))

This seems incorrect as well, since it would destructively modify the
user's preferred dired-mode-hook.  It seems that changing delete to
remove should be fine, and then binding dired-omit-mode to nil, should
do the trick, regardless of how the user enables dired-omit-mode.

Note that dired-omit-mode's docstring suggests the following code,
however, which recover-session would not be able to handle:

    (add-hook 'dired-mode-hook (lambda () (dired-omit-mode)))

Perhaps that docstring should be changed to remove the lambda.


In GNU Emacs 29.2.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2024-06-26 built on
 igm-qws-u22796a
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Rocky Linux 8.9 (Green Obsidian)

Configured using:
 'configure --config-cache --with-x-toolkit=lucid --without-gpm
 --without-gconf --without-selinux --without-imagemagick
 --with-modules --with-gif=no --with-cairo --with-rsvg
 --without-compress-install --with-tree-sitter
 --prefix=/j/office/app/emacs/builds/29-20240626-134246'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE
XIM XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Shell-script

Minor modes in effect:
  Info-breadcrumbs-in-mode-line-mode: t
  shfmt-on-save-mode: t
  global-flycheck-eglot-mode: t
  pupo-mode: t
  purpose-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  recentf-mode: t
  eval-sexp-fu-flash-mode: t
  goto-address-prog-mode: t
  highlight-numbers-mode: t
  highlight-parentheses-mode: t
  rainbow-delimiters-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  smartparens-strict-mode: t
  smartparens-mode: t
  indent-guide-global-mode: t
  indent-guide-mode: t
  global-vi-tilde-fringe-mode: t
  vi-tilde-fringe-mode: t
  global-corfu-mode: t
  corfu-mode: t
  winner-mode: t
  global-spacemacs-whitespace-cleanup-mode: t
  spacemacs-whitespace-cleanup-mode: t
  winum-mode: t
  volatile-highlights-mode: t
  unkillable-scratch: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-term-cursor-mode: t
  term-cursor-mode: t
  save-place-mode: t
  savehist-mode: t
  persistent-scratch-autosave-mode: t
  mode-line-bell-mode: t
  global-ligature-mode: t
  ligature-mode: t
  flycheck-pos-tip-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  global-hl-todo-mode: t
  hl-todo-mode: t
  bug-reference-prog-mode: t
  global-fasd-mode: t
  global-evil-quickscope-always-mode: t
  evil-quickscope-always-mode: t
  global-anzu-mode: t
  anzu-mode: t
  envrc-global-mode: t
  counsel-mode: t
  ivy-mode: t
  global-column-enforce-mode: t
  column-enforce-mode: t
  clean-aindent-mode: t
  projectile-mode: t
  global-git-commit-mode: t
  hybrid-mode: t
  which-key-mode: t
  flyspell-mode: t
  evil-mode: t
  evil-local-mode: t
  windmove-mode: t
  spacemacs-leader-override-mode: t
  global-spacemacs-leader-override-mode: t
  global-hl-line-mode: t
  xterm-mouse-mode: t
  global-auto-revert-mode: t
  which-function-mode: t
  minibuffer-depth-indicate-mode: t
  midnight-mode: t
  display-time-mode: t
  override-global-mode: t
  ido-vertical-mode: t
  global-page-break-lines-mode: t
  jane-fe-minor-mode: t
  dired-omit-mode: t
  editorconfig-mode: t
  whitespace-mode: t
  server-mode: t
  shell-file-mode: t
  shell-dirtrack-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t
  hs-minor-mode: t

Features:
(sort emacsbug calc-arith calc-bin calc-comb uuidgen calc-misc
calc-ext shadow link-hint wdired evil-matchit-ocaml
evil-matchit-simple evil-matchit-prog pcre2el rxt re-builder info+
edebug mail-extr dired-quick-sort ls-lisp shortdoc
evil-collection-ediff ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util dabbrev cl-print
flycheck-bashate shfmt reformatter two-column mule-util
evil-iedit-state merlin-iedit iedit iedit-lib
mc-hide-unmatched-lines-mode mc-mark-more mc-cycle-cursors
multiple-cursors-core auto-highlight-symbol ht utop utop-minor-mode
wgrep jane-fe-read-feature sh-script flycheck-eglot eglot
external-completion jsonrpc timezone orgit-forge misearch
multi-isearch tramp tramp-loaddefs trampver tramp-integration
tramp-compat ffap org-duration diary-lib diary-loaddefs cal-iso
org-eldoc evil-org ob-C smartparens-c cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob-js
ob-perl ob-python smartparens-python python treesit ob-sql org-appear
org-download org-superstar toc-org org-indent oc-basic magit-imenu
face-remap executable nix-format tabify smex spacemacs-purpose-popwin
window-purpose-x ibuf-macs imenu-list window-purpose
window-purpose-fixes window-purpose-prefix-overload
window-purpose-switch window-purpose-layout window-purpose-core
display-line-numbers evil-surround recentf tree-widget overseer
pkg-info epl auto-compile packed elisp-slime-nav flycheck-elsa
flycheck-package package-lint finder eval-sexp-fu goto-addr vc-git
vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc-fe vc-hg vc
vc-dispatcher evil-lisp-state flycheck-rust highlight-numbers
parent-mode highlight-parentheses hideshow rainbow-delimiters
smartparens-config smartparens-ml smartparens-org smartparens-markdown
smartparens-text smartparens indent-guide fancy-battery battery dbus
vi-tilde-fringe dired-async dired-aux cus-start corfu jane-profile
profiler winner async window-purpose-configuration
window-purpose-utils org-clock evil-matchit evil-matchit-sdk
semantic/lex semantic/fw mode-local xterm-color
spacemacs-whitespace-cleanup ws-butler winum etags fileloop
volatile-highlights unkillable-scratch unicode-fonts undo-tree
term-cursor symbol-overlay string-inflection diminish saveplace
savehist restart-emacs desktop frameset popwin persistent-scratch
org-rich-yank org-projectile org-project-capture
org-project-capture-backend org-category-capture multi-line
multi-line-find multi-line-enter multi-line-decorator
multi-line-respace multi-line-shared shut-up multi-line-cycle
multi-line-candidate mode-line-bell git-rebase ligature keycast
jane-async-merlin jane-merlin merlin-imenu flycheck-ocaml
flycheck-pos-tip pos-tip flycheck merlin-xref merlin-cap merlin
caml-types jane-elpa-snapshot jane-completion jane-common evil-escape
ivy-hydra ivy-avy hl-todo forge-list forge-commands forge-semi
forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab
glab forge-github ghub-graphql treepy gsexp ghub let-alist
forge-notify forge-revnote forge-pullreq forge-issue forge-topic yaml
parse-time bug-reference forge-post markdown-mode forge-repo forge
forge-core forge-db closql emacsql-sqlite emacsql-sqlite-common
emacsql emacsql-compiler fasd evil-unimpaired f evil-textobj-line
evil-quickscope evil-easymotion avy evil-collection-dired
evil-collection-magit evil-collection-info evil-collection-buff-menu
evil-collection annalist evil-anzu anzu eshell-z em-dirs em-term term
disp-table ehelp em-smart esh-var envrc inheritenv emr popup s
drag-stuff counsel xref swiper ivy flx delsel ivy-faces ivy-overlay
colir color column-enforce-mode clean-aindent-mode clang-format xml
bcc32-org bcc32-org-lint org-lint ox-texinfo ox-org ox-latex
ox-icalendar ox-gfm ox-md ox-html table ox-ascii ox-publish ox
org-attach projectile grep ibuf-ext ibuffer ibuffer-loaddefs
org-capture zenburn-theme-autoloads yapfify-autoloads
yaml-mode-autoloads xterm-color-autoloads ws-butler-autoloads
writeroom-mode-autoloads visual-fill-column-autoloads winum-autoloads
wgrep-autoloads web-mode-autoloads web-beautify-autoloads
vterm-autoloads volatile-highlights-autoloads
vi-tilde-fringe-autoloads vertico-autoloads uuidgen-autoloads
utop-autoloads caml-autoloads unkillable-scratch-autoloads
unicode-fonts-autoloads ucs-utils-autoloads font-utils-autoloads
undo-tree-autoloads toml-mode-autoloads toc-org-autoloads
tide-autoloads typescript-mode-autoloads terminal-here-autoloads
tao-theme-autoloads tagedit-autoloads symon-autoloads
symbol-overlay-autoloads string-inflection-autoloads
sql-indent-autoloads spotify-autoloads sphinx-doc-autoloads
spaceline-all-the-icons-autoloads memoize-autoloads
spaceline-autoloads powerline-autoloads solarized-theme-autoloads
smex-autoloads smeargle-autoloads slim-mode-autoloads shfmt-autoloads
reformatter-autoloads shell-pop-autoloads scss-mode-autoloads
sass-mode-autoloads rust-mode-autoloads ron-mode-autoloads
reveal-in-osx-finder-autoloads restart-emacs-autoloads
rainbow-delimiters-autoloads quickrun-autoloads pytest-autoloads
pyenv-mode-autoloads pydoc-autoloads py-isort-autoloads
pug-mode-autoloads prettier-js-autoloads popwin-autoloads
poetry-autoloads pocket-reader-autoloads org-web-tools-autoloads
esxml-autoloads rainbow-identifiers-autoloads ov-autoloads
pocket-lib-autoloads kv-autoloads pippel-autoloads pipenv-autoloads
pyvenv-autoloads pip-requirements-autoloads persistent-soft-autoloads
pcache-autoloads persistent-scratch-autoloads pdf-tools-autoloads
tablist-autoloads password-generator-autoloads paradox-autoloads
spinner-autoloads ox-gfm-autoloads overseer-autoloads
osx-trash-autoloads osx-clipboard-autoloads orgit-forge-autoloads
orgit-autoloads orgit magit-bookmark magit-submodule magit-obsolete
magit-blame magit-stash magit-reflog magit-bisect magit-push
magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode
diff diff-mode git-commit log-edit pcvs-util add-log magit-core
magit-autorevert magit-margin magit-transient magit-process magit-mode
transient magit-git magit-section benchmark magit-utils crm dash
org-superstar-autoloads org-rich-yank-autoloads
org-projectile-autoloads org-category-capture-autoloads
org-present-autoloads org-pomodoro-autoloads alert-autoloads
log4e-autoloads gntp-autoloads org-mime-autoloads
org-download-autoloads org-contrib-autoloads org-cliplink-autoloads
org-appear-autoloads open-junk-file-autoloads npm-mode-autoloads
nose-autoloads nodejs-repl-autoloads nixos-options-autoloads
nix-mode-autoloads nano-agenda-autoloads nameless-autoloads
multi-term-autoloads shut-up-autoloads mode-line-bell-autoloads
mmm-mode-autoloads markdown-toc-autoloads macrostep-autoloads
lorem-ipsum-autoloads livid-mode-autoloads skewer-mode-autoloads
live-py-mode-autoloads link-hint-autoloads ligature-autoloads
launchctl-autoloads keycast-autoloads json-navigator-autoloads
hierarchy-autoloads json-mode-autoloads json-snatcher-autoloads
json-reformat-autoloads js2-refactor-autoloads
multiple-cursors-autoloads js2-mode-autoloads js-doc-autoloads
ivy-xref-autoloads ivy-rtags-autoloads ivy-purpose-autoloads
window-purpose-autoloads imenu-list-autoloads ivy-hydra-autoloads
ivy-avy-autoloads inspector-autoloads insert-shebang-autoloads
info+-autoloads indent-guide-autoloads importmagic-autoloads
epc-autoloads ctable-autoloads concurrent-autoloads
impatient-mode-autoloads simple-httpd-autoloads
ibuffer-projectile-autoloads hungry-delete-autoloads hl-todo-autoloads
highlight-parentheses-autoloads highlight-numbers-autoloads
parent-mode-autoloads highlight-indentation-autoloads
helm-make-autoloads haml-mode-autoloads google-translate-autoloads
google-c-style-autoloads golden-ratio-autoloads gnuplot-autoloads
gitignore-templates-autoloads git-timemachine-autoloads
git-modes-autoloads git-messenger-autoloads git-link-autoloads
gh-md-autoloads gendoxy-autoloads geiser-guile-autoloads
geiser-chicken-autoloads geiser-impl geiser-custom geiser-base
geiser-autoloads forge-autoloads yaml-autoloads magit-autoloads
magit-section-autoloads git-commit-autoloads with-editor-autoloads
transient-autoloads ghub-autoloads treepy-autoloads closql-autoloads
emacsql-sqlite-autoloads emacsql-autoloads
flyspell-correct-ivy-autoloads flyspell-correct-autoloads
flycheck-ycmd-autoloads ycmd-autoloads request-deferred-autoloads
deferred-autoloads flycheck-rust-autoloads flycheck-rtags-autoloads
rtags-autoloads flycheck-pos-tip-autoloads pos-tip-autoloads
flycheck-package-autoloads package-lint-autoloads
flycheck-ocaml-autoloads flycheck-elsa-autoloads
flycheck-bashate-autoloads flycheck-autoloads pkg-info-autoloads
epl-autoloads flx-ido-autoloads flx-autoloads fish-mode-autoloads
fasd-autoloads fancy-battery-autoloads explain-pause-mode-autoloads
expand-region-autoloads evil-visualstar-autoloads
evil-visual-mark-mode-autoloads evil-unimpaired-autoloads
evil-tutor-autoloads evil-textobj-line-autoloads
evil-surround-autoloads evil-quickscope-autoloads evil-org-autoloads
evil-numbers-autoloads evil-nerd-commenter-autoloads
evil-matchit-autoloads evil-lisp-state-autoloads evil-lion-autoloads
evil-indent-plus-autoloads evil-iedit-state-autoloads
evil-goggles-autoloads evil-exchange-autoloads evil-escape-autoloads
evil-easymotion-autoloads evil-collection-autoloads annalist-autoloads
evil-cleverparens-autoloads smartparens-autoloads evil-args-autoloads
evil-anzu-autoloads anzu-autoloads eval-sexp-fu-autoloads
eshell-z-autoloads eshell-prompt-extras-autoloads esh-help-autoloads
envrc-autoloads inheritenv-autoloads emr-autoloads iedit-autoloads
projectile-autoloads paredit-autoloads list-utils-autoloads cl
emmet-mode-autoloads elisp-slime-nav-autoloads elisp-def-autoloads
dumb-jump-autoloads popup-autoloads drag-stuff-autoloads
disaster-autoloads dired-quick-sort-autoloads devdocs-autoloads
define-word-autoloads debbugs-autoloads cython-mode-autoloads
csv-mode-autoloads cpp-auto-include-autoloads
counsel-spotify-autoloads counsel-css-autoloads counsel-autoloads
ivy-autoloads corfu-autoloads compat-autoloads
command-log-mode-autoloads column-enforce-mode-autoloads
code-cells-autoloads clean-aindent-mode-autoloads
clang-format-autoloads centered-cursor-mode-autoloads cargo-autoloads
markdown-mode-autoloads browse-at-remote-autoloads blacken-autoloads
auto-highlight-symbol-autoloads ht-autoloads auto-dictionary-autoloads
auto-compile-autoloads packed-autoloads anaconda-mode-autoloads
pythonic-autoloads f-autoloads dash-autoloads s-autoloads
all-the-icons-autoloads ahk-mode-autoloads aggressive-indent-autoloads
advent-of-code-autoloads request-autoloads ace-window-autoloads
ace-link-autoloads avy-autoloads hybrid-mode evil-evilified-state
pcre2el-autoloads hybrid-mode-autoloads font-lock+-autoloads
dotenv-mode-autoloads which-key hydra lv evil evil-integration
evil-maps evil-commands reveal flyspell ispell evil-jumps
evil-command-window evil-search evil-ex evil-types evil-macros
evil-repeat evil-states evil-core evil-common windmove calc
calc-loaddefs calc-macs rect evil-digraphs evil-vars bind-map
hydra-autoloads lv-autoloads evil-autoloads goto-chg-autoloads
diminish-autoloads bind-map-autoloads async-autoloads mm-archive
message sendmail yank-media rfc822 mml mml-sec epa gnus-util
mailabbrev gmm-utils mailheader mail-utils gnutls network-stream
url-http url-gw nsm puny url-cache url-auth quelpa mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr lisp-mnt help-fns radix-tree hl-line xt-mouse autorevert
thunk linum base16-material-theme base16-theme base16-theme-autoloads
finder-inf jane-elpa-pin ol-man org-checklist ol-eshell esh-mode
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util files-x org-tempo tempo ol-info org-habit
org-agenda org-element org-persist xdg org-id avl-tree generator
org-refile ol-docview doc-view jka-compr image-mode exif ol-bibtex
bibtex iso8601 which-func mb-depth midnight time use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core ido-vertical-mode ido
core-spacemacs core-use-package-ext core-spacebind
core-transient-state core-micro-state core-toggle core-keybindings
core-fonts-support core-themes-support core-display-init core-jump
core-release-management core-custom-settings core-configuration-layer
core-progress-bar core-spacemacs-buffer core-funcs spacemacs-ht inline
epg rfc6068 epg-config core-command-line core-debug core-hooks
page-break-lines core-env load-env-vars core-dotspacemacs
core-customization validate core-emacs-backports core-compilation
core-dumper spinner core-load-paths core-versions site-start
jane-customization jane-diagnose jane-comint with-editor compat
org-protocol org org-macro org-pcomplete org-list org-footnote
org-faces org-entities time-date noutline outline ob-dot ob-shell ob
ob-tangle org-src ob-ref ob-lob ob-table ob-exp ob-comint
ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold
org-fold-core org-keys oc org-loaddefs cal-menu calendar cal-loaddefs
org-compat org-version org-macs format-spec jane-fe-project
jane-fe-feature-table imenu jane-fe-menu ecaml_plugin view edmacro
kmacro gopcaml bookmark dired-x image+ advice image-file
image-converter editorconfig editorconfig-core
editorconfig-core-handle editorconfig-fnmatch whitespace help-at-pt
jane jane-yasnippet jane-micro-features ert ewoc debug backtrace
find-func server jane-diff unified-test-mode shell-file dired
dired-loaddefs easy-mmode core core-buffer jane-sexp jane-python
jane-ocaml cl-extra help-mode jane-tuareg-theme jane-aide tuareg
tuareg-compat tuareg-opam skeleton flymake-proc flymake project
warnings thingatpt smie find-file compile text-property-search jane-cr
jane-align shell pcomplete comint ansi-osc ansi-color ring jane-smerge
gnu-elpa-keyring-update jane-telemetry jane-ocp-indent ocp-indent
jane-eglot yasnippet-autoloads vba-mode-autoloads tuareg-autoloads rx
term-cursor-autoloads swiper-autoloads org-project-capture-autoloads
multi-line-autoloads htmlize-autoloads haskell-mode-autoloads
eglot-autoloads editorconfig-conf-mode derived conf-mode
editorconfig-autoloads contrib-autoloads jane-autoloads jane-util
pcase filenotify package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars info cus-edit pp cus-load icons
wid-edit cl-loaddefs cl-lib core-early-funcs rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win
x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray
oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face
macroexp files window text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget keymap hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo x-toolkit xinput2 x multi-tty
make-network-process emacs)

Memory information:
((conses 16 4541528 1870118)
 (symbols 48 113289 78)
 (strings 32 536650 168259)
 (string-bytes 1 17758772)
 (vectors 16 213658)
 (vector-slots 8 4263194 3211890)
 (floats 8 1278 4013)
 (intervals 56 302851 63323)
 (buffers 984 240))





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

* bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally
  2024-07-02 17:07 bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally Aaron Zeng
@ 2024-07-02 18:27 ` Juri Linkov
  2024-07-04  6:49   ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2024-07-02 18:27 UTC (permalink / raw)
  To: Aaron Zeng; +Cc: app-emacs-dev, 71905

> When dired-omit-mode is set non-nil globally, recover-session fails to
> show any auto-save files because they continue to be omitted.
>
> For example, running this command:
>
>     emacs -Q -l dired-x --eval "(setopt dired-omit-mode t)" -f recover-session
>
> I see no files listed in the dired buffer, but toggling
> dired-omit-mode shows them.
>
> I see that recover-session has this bit of code:
>
>     (let ((ls-lisp-support-shell-wildcards t)
>            ;; Ensure that we don't omit the session files as the user may
>            ;; have (as suggested by the manual) `dired-omit-mode' in the
>            ;; hook.
>            (dired-mode-hook (delete 'dired-omit-mode dired-mode-hook)))
>
> This seems incorrect as well, since it would destructively modify the
> user's preferred dired-mode-hook.  It seems that changing delete to
> remove should be fine, and then binding dired-omit-mode to nil, should
> do the trick, regardless of how the user enables dired-omit-mode.

Indeed, handling of dired-omit-mode in recover-session is wrong.
For example, I'm using a lambda and it fails.  Therefore needed
to rely on such patch:

diff --git a/lisp/files.el b/lisp/files.el
index 042b8e2d515..7c291b3f54c 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -7263,7 +7263,7 @@ recover-file
 	   (after-find-file nil nil t))
 	  (t (user-error "Recover-file canceled")))))
 
-(defvar dired-mode-hook)
+(declare-function dired-omit-mode "dired-x" (&optional arg))
 
 (defun recover-session ()
   "Recover auto save files from a previous Emacs session.
@@ -7284,14 +7284,11 @@ recover-session
                                (concat "\\`" (regexp-quote nd)))
 			     t)
       (error "No previous sessions to recover")))
-  (require 'dired)
-  (let ((ls-lisp-support-shell-wildcards t)
-        ;; Ensure that we don't omit the session files as the user may
-        ;; have (as suggested by the manual) `dired-omit-mode' in the
-        ;; hook.
-        (dired-mode-hook (delete 'dired-omit-mode dired-mode-hook)))
+  (let ((ls-lisp-support-shell-wildcards t))
     (dired (concat auto-save-list-file-prefix "*")
-	   (concat (connection-local-value dired-listing-switches) " -t")))
+	   (concat (connection-local-value dired-listing-switches) " -t"))
+    (when (bound-and-true-p dired-omit-mode)
+      (dired-omit-mode -1)))
   (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
   (define-key (current-local-map) "\C-c\C-c" 'recover-session-finish)
   (save-excursion





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

* bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally
  2024-07-02 18:27 ` Juri Linkov
@ 2024-07-04  6:49   ` Juri Linkov
  2024-07-04  7:43     ` Eli Zaretskii
  2024-07-06 10:06     ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Juri Linkov @ 2024-07-04  6:49 UTC (permalink / raw)
  To: Aaron Zeng; +Cc: Eli Zaretskii, app-emacs-dev, 71905

>> When dired-omit-mode is set non-nil globally, recover-session fails to
>> show any auto-save files because they continue to be omitted.
>
> Indeed, handling of dired-omit-mode in recover-session is wrong.
> For example, I'm using a lambda and it fails.  Therefore needed
> to rely on such patch:

Eli, please decide this should be fixed in master or emacs-30?





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

* bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally
  2024-07-04  6:49   ` Juri Linkov
@ 2024-07-04  7:43     ` Eli Zaretskii
  2024-07-06 10:06     ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2024-07-04  7:43 UTC (permalink / raw)
  To: Juri Linkov; +Cc: app-emacs-dev, azeng, 71905

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  app-emacs-dev@janestreet.com,
>   71905@debbugs.gnu.org
> Date: Thu, 04 Jul 2024 09:49:23 +0300
> 
> >> When dired-omit-mode is set non-nil globally, recover-session fails to
> >> show any auto-save files because they continue to be omitted.
> >
> > Indeed, handling of dired-omit-mode in recover-session is wrong.
> > For example, I'm using a lambda and it fails.  Therefore needed
> > to rely on such patch:
> 
> Eli, please decide this should be fixed in master or emacs-30?

It's on my todo.  The patch was posted only 2 days ago...





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

* bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally
  2024-07-04  6:49   ` Juri Linkov
  2024-07-04  7:43     ` Eli Zaretskii
@ 2024-07-06 10:06     ` Eli Zaretskii
  2024-07-07  6:52       ` Juri Linkov
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2024-07-06 10:06 UTC (permalink / raw)
  To: Juri Linkov; +Cc: app-emacs-dev, azeng, 71905

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  app-emacs-dev@janestreet.com,
>   71905@debbugs.gnu.org
> Date: Thu, 04 Jul 2024 09:49:23 +0300
> 
> >> When dired-omit-mode is set non-nil globally, recover-session fails to
> >> show any auto-save files because they continue to be omitted.
> >
> > Indeed, handling of dired-omit-mode in recover-session is wrong.
> > For example, I'm using a lambda and it fails.  Therefore needed
> > to rely on such patch:
> 
> Eli, please decide this should be fixed in master or emacs-30?

Please install on emacs-30, and thanks.





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

* bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally
  2024-07-06 10:06     ` Eli Zaretskii
@ 2024-07-07  6:52       ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2024-07-07  6:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: app-emacs-dev, azeng, 71905

close 71905 30.0.60
thanks

>> >> When dired-omit-mode is set non-nil globally, recover-session fails to
>> >> show any auto-save files because they continue to be omitted.
>> >
>> > Indeed, handling of dired-omit-mode in recover-session is wrong.
>> > For example, I'm using a lambda and it fails.  Therefore needed
>> > to rely on such patch:
>>
>> Eli, please decide this should be fixed in master or emacs-30?
>
> Please install on emacs-30, and thanks.

Now installed on emacs-30.  The patch uses

  +    (when (bound-and-true-p dired-omit-mode)
  +      (dired-omit-mode -1)))

that is the same as in 'dired-jump', but with one difference that
'dired-jump' uses (dired-omit-mode) that never disabled 'dired-omit-mode',
so I fixed the bug in 'dired-omit-mode' as well to use -1.





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

end of thread, other threads:[~2024-07-07  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 17:07 bug#71905: 29.2.50; recover-session fails to disable dired-omit-mode if the latter is set globally Aaron Zeng
2024-07-02 18:27 ` Juri Linkov
2024-07-04  6:49   ` Juri Linkov
2024-07-04  7:43     ` Eli Zaretskii
2024-07-06 10:06     ` Eli Zaretskii
2024-07-07  6:52       ` Juri Linkov

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).