Giter VIP home page Giter VIP logo

eaf-file-manager's Introduction

EAF File Manager

File manager application for the Emacs Application Framework.

Load application

Install EAF first, then add below code in your emacs config:

(add-to-list 'load-path "~/.emacs.d/site-lisp/emacs-application-framework/")
(require 'eaf)
(require 'eaf-file-manager)

The keybinding of EAF File Manager.

Key Event
<f12> open_devtools
h js_up_directory
j js_select_next_file
C-n js_select_next_file
k js_select_prev_file
C-p js_select_prev_file
l open_select_files
J js_select_last_file
K js_select_first_file
r js_rename_file
e batch_rename
y change_path
Y open_path
<left> js_up_directory
<down> js_select_next_file
<up> js_select_prev_file
<right> open_select_files
f open_select_files
C-m open_select_files
F open_link
T open_current_file_in_new_tab
H open_file_with_external_app
SPC js_scroll_up_select_file
b js_scroll_down_select_file
<return> open_select_files
w js_copy_file_name
W js_copy_file_path
/ copy_file_path
? copy_dir_path
n new_file
N new_directory
R move_current_or_mark_file
C copy_current_or_mark_file
^ js_up_directory
' js_up_directory
m js_mark_file
u js_unmark_file
t js_toggle_mark_file
U js_unmark_all_files
x delete_selected_files
X delete_current_file
o toggle_hidden_file
O toggle_preview
a filter_file_with_regex
q bury-buffer
Q close_buffer
g refresh_dir
G find_files
* mark_file_by_extension
; convert_cr2_files
& narrow_file
v js_preview_toggle
, js_preview_scroll_up_line
. js_preview_scroll_down_line
< js_preview_scroll_up
> js_preview_scroll_down
1 sort_by_name
2 sort_by_type
3 sort_by_size
4 sort_by_modified_time
5 sort_by_created_time
6 sort_by_access_time
! eaf-file-manager-run-command-for-mark-files
B eaf-file-manager-byte-compile-file
z compressed_file
Z decompressed_file
C-s search_file

eaf-file-manager's People

Contributors

c1-g avatar dependabot[bot] avatar manateelazycat avatar matthewzmd avatar mumu-lhl avatar tumashu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eaf-file-manager's Issues

Unable to view directories with broken simlinks

Traceback (most recent call last):
  File "/home/nbfields/.emacs.d/site-lisp/emacs-application-framework/app/file-manager/buffer.py", line 936, in run
    file_infos = self.get_files_callback(self.file)
  File "/home/nbfields/.emacs.d/site-lisp/emacs-application-framework/app/file-manager/buffer.py", line 243, in get_file_infos
    file_infos.append(self.get_file_info(str(p.absolute())))
  File "/home/nbfields/.emacs.d/site-lisp/emacs-application-framework/app/file-manager/buffer.py", line 234, in get_file_info
    "mtime": os.path.getmtime(file_path)
  File "/usr/lib/python3.8/genericpath.py", line 55, in getmtime
    return os.stat(filename).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/home/nbfields/test_directory/also_no_real'
Traceback (most recent call last):
  File "/home/nbfields/.emacs.d/site-lisp/emacs-application-framework/app/file-manager/buffer.py", line 936, in run
    file_infos = self.get_files_callback(self.file)
  File "/home/nbfields/.emacs.d/site-lisp/emacs-application-framework/app/file-manager/buffer.py", line 243, in get_file_infos
    file_infos.append(self.get_file_info(str(p.absolute())))
  File "/home/nbfields/.emacs.d/site-lisp/emacs-application-framework/app/file-manager/buffer.py", line 234, in get_file_info
    "mtime": os.path.getmtime(file_path)
  File "/usr/lib/python3.8/genericpath.py", line 55, in getmtime
    return os.stat(filename).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/home/nbfields/test_directory/also_no_real'

Describe the bug

When using the EAF file manager, directories that contain broken simlinks cannot be displayed. They simply show a blank screen, and attempting to show or hide hidden files results in an error: [EAF/file-manager] Cannot execute function: toggle_hidden_file (f81b-41d0-c654-9a74-f27c-39d4-8a9f)

To Reproduce

1: Create a directory called test_directory
2: Create a file called test_file in that directory
3: Create a simlink that does not exist, ie ln -s not_real also_not_real
4: Open the EAF file manager and attempt to open that directory
5: Switch to the EAF terminal and remove the broken simlink (or do something else to remove it)
6: Return to the file manager (possibly killing the buffer and reopening it) to see the directory is now usable

Expected behavior
The EAF file manager would display all files as expected, perhaps highlighting the broken simlink in red or some such to indicate that it is not usable.

Versions (please complete the following info):

  • Distro and DE/WM: Ubuntu 20.04.3 LTS - Window Manager AwesomeWM
  • Versions of Dependencies: Unknown
  • M-x emacs-version: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2021-11-04

Additional context

There is the obvious solution of simply not having any broken simlinks, but the program Steam creates one in the home directory every time it opens! This is for some backwards compatibility with an older version of the Steam Development Kit or something to that effect, where the link must exist but is unused, so it is created and then broken intentionally. I can delete it each time, but I am pretty sure this is not desired behavior regardless.

排序功能增加正反序

现状

目前的文件排序,只支持正序排列(不论按哪个字段来排序)。

Describe the solution you'd like
希望增加一个toggle 功能,即 支持按同样排序按键时, 触发该字段反序排列

比如, 按 4 , 默认是最早修改在最上面,最新修改在最下面; 再按4, 则触发反序, 最新修改在最上面,最早修改在最下面。

提升目录打开速度

当光标停一端时间后,可以预加载光标处目录的信息,加快打开下一层目录的时间。

Dark Mode On or Off based on Emacs Daemon Mode

Describe the bug

My .emacs contains the following code:

(load-theme 'tango-dark)

; some other settings

(require 'eaf)
(require 'eaf-browser)
(require 'eaf-pdf-viewer)
(require 'eaf-terminal)
(require 'eaf-video-player)
(require 'eaf-file-manager)
(require 'eaf-demo)
(require 'eaf-evil)

; some other settings

(setq eaf-terminal-dark-mode "nil")
(setq eaf-pdf-dark-mode "nil")
(setq eaf-file-manager-dark-mode "nil")

The intention of this code is to disable dark mode on PDFs, the terminal, and the file manager. The linked screenshot in the screenshot section shows the appearance of the file manager in a "regular" emacs instance, versus one that is created via "emacs --daemon". As may be seen, the appearence is not the same. The regular emacs instance has a blueish background, which is the default appearance of my terminal and what I would like to see. The daemonized version is all black and it is hard to see the files in the file manager. The colors are likewise in the terminal and PDFs - not shown, but I can provide more screenshots if desired.

To Reproduce
Ensure you're on the latest master branch, then note the steps to reproduce the behavior.
0: Set up a .emacs file with the above code for eaf
1: Run emacs --daemon, and launch a window in GUI
2: Run emacs (without --daemon) in GUI
3: Open the file manager with M-x eaf-open-in-file-manager in both emacs clients

Expected behavior

Expected behavior is that the emacs clients would both look the same. I am actually not sure what the "expected" appearance is as far as the desired behavior from the development perspective. My preference is that the file manager etc inherit the same color scheme as my regular work, ie tango-dark, but I do not know which, if any, settings are intended to look like this.

Versions (please complete the following info):

  • Distro and DE/WM:
    Operating System: Ubuntu 20.04.3 LTS
    Kernel: Linux 5.11.0-38-generic
    Architecture: x86-64

  • Versions of Dependencies: Uncertain how to find/check

  • M-x emacs-version: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2021-06-04

Screenshots
Daemon vs standard

Additional context
As noted, I am actually not entirely certain which of these is "expected" behavior, just that them being different is probably not intended!

File manager gets stuck on opening directory

qt.dbus.integration: Could not connect "org.freedesktop.IBus" to globalEngineChanged(QString)
[JavaScript console]: Uncaught ReferenceError: updateGitLog is not defined
[JavaScript console]: Uncaught TypeError: Cannot read properties of undefined (reading 'install')
[JavaScript console]: Uncaught ReferenceError: init is not defined
[JavaScript console]: Uncaught ReferenceError: changePath is not defined
[JavaScript console]: Uncaught ReferenceError: updateGitLog is not defined
[JavaScript console]: Uncaught ReferenceError: setPreview is not defined
[JavaScript console]: Uncaught ReferenceError: setPreviewOption is not defined
[JavaScript console]: Uncaught ReferenceError: setPreviewOption is not defined

Describe the bug
EAF file manager gets stuck on opening any directory.

To Reproduce
Open up emacs and <M-x>eaf-open-file-manager<RET>.

Expected behavior
EAF file manager opens correctly.

Versions (please complete the following info):

  • Distro and DE/WM: Ubuntu 22.04
  • Versions of Dependencies:
  • M-x emacs-version: 27.1

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

文件管理器删除文件报错

文件管理器有一个问题,假如a目录有a1和 a2两个文件,如果当前文件是a1, 如果我从其它途径把a1删除,在文件管理器中按 g就会导致崩溃,如果当前选择的是a2, 就没有类似问题.

How can I customize the font used in eaf-file-manager?

Is your feature request related to a problem? Please describe.
I'd like to keep using my main font (PragmataPro) in eaf-file-manager, but I don't know how to customize it.

Describe the solution you'd like
Is there a variable to choose the font, or should I hardcode the font family somewhere in the code?

Describe alternatives you've considered
With eaf-pyqterminal, I can use something like (Doom Emacs user here):

(after! eaf-pyqterminal
  (setq eaf-pyqterminal-font-family "PragmataPro Mono Liga")
  (setq eaf-pyqterminal-font-size 14)
  )

Additional context
$ uname -a
Linux optimus 6.6.7-2-cachyos #1 SMP PREEMPT_DYNAMIC Sat, 16 Dec 2023 09:07:35 +0000 x86_64 GNU/Linux

narrow filter 更改为大小写无关的过滤

现状

新增的 narrow filter 功能, 是大小写相关的。 在实际使用过程中, 在一个文件夹下, 大小写同名的文件(夹)大概率不会出现。

建议
更改为大小写无关的过滤方式。使用起来更为便捷。

文件管理器打开报错

  • If EAF was working correctly until a recent git pull, please refer to Mandatory Procedures to Keep Your EAF Up-to-Date first.
  • Please check the *eaf* buffer, if there is any error shown in the *eaf* buffer, paste it here.
    Traceback (most recent call last):
    File "/home/dn/MyEmacs/site-lisp/packages/emacs-application-framework/core/utils.py", line 60, in on_signal_received
    self._func(obj, *args, **kwargs)
    File "/usr/share/emacs/MyEmacs/site-lisp/packages/emacs-application-framework/eaf.py", line 170, in new_buffer
    self.create_buffer(buffer_id, url, module_path, arguments)
    File "/usr/share/emacs/MyEmacs/site-lisp/packages/emacs-application-framework/eaf.py", line 187, in create_buffer
    app_buffer = module.AppBuffer(buffer_id, url, arguments)
    File "/usr/share/emacs/MyEmacs/site-lisp/packages/emacs-application-framework/app/file-manager/buffer.py", line 47, in init
    self.load_index_html(file)
    File "/home/dn/MyEmacs/site-lisp/packages/emacs-application-framework/core/webengine.py", line 1334, in load_index_html
    with open(self.index_file, "r") as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/emacs/MyEmacs/site-lisp/packages/emacs-application-framework/app/file-manager/dist/index.html'

Process eaf aborted (core dumped)
Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Ensure you're on the latest master branch, then note the steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Versions (please complete the following info):

  • Distro and DE/WM:
  • Versions of Dependencies:
  • M-x emacs-version:

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

void variable doom-modeline-mode

Debugger entered--Lisp error: (void-variable doom-modeline-mode)
  (and doom-modeline-mode doom-modeline-icon doom-modeline-major-mode-icon)
  (if (and doom-modeline-mode doom-modeline-icon doom-modeline-major-mode-icon) (progn (set (make-local-variable 'doom-modeline--buffer-file-icon) (eaf-all-the-icons-icon mode-name))))
  eaf-all-the-icons-update-icon()
  (progn nil (eaf-all-the-icons-update-icon))
  (if (and (condition-case nil (progn (require 'all-the-icons) (featurep 'eaf-all-the-icons)) (error nil))) (progn nil (eaf-all-the-icons-update-icon)))
  eaf--update-modeline-icon()
  (save-current-buffer (set-buffer buffer) (eaf-call-async "new_buffer" eaf--buffer-id (if (eaf--called-from-wsl-on-windows-p) (eaf--translate-wsl-url-to-windows url) url) (eaf--get-app-module-path app-name) args) (eaf--update-modeline-icon))
  (let* ((buffer (eaf--create-buffer url app-name args))) (save-current-buffer (set-buffer buffer) (eaf-call-async "new_buffer" eaf--buffer-id (if (eaf--called-from-wsl-on-windows-p) (eaf--translate-wsl-url-to-windows url) url) (eaf--get-app-module-path app-name) args) (eaf--update-modeline-icon)) (eaf--preview-display-buffer app-name buffer))
  eaf--open-internal("~" "file-manager" "")
  (if (and exists-eaf-buffer (not always-new)) (progn (eaf--preview-display-buffer app-name exists-eaf-buffer) (message (concat "[EAF/" app-name "] " "Switch to %s") url)) (eaf--open-internal url app-name args) (message (concat "[EAF/" app-name "] " "Opening %s") url))
  (let (exists-eaf-buffer) (catch 'found-eaf (let ((--dolist-tail-- (eaf--get-eaf-buffers))) (while --dolist-tail-- (let ((buffer (car --dolist-tail--))) (save-current-buffer (set-buffer buffer) (if (and ... ...) (progn ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (if (and exists-eaf-buffer (not always-new)) (progn (eaf--preview-display-buffer app-name exists-eaf-buffer) (message (concat "[EAF/" app-name "] " "Switch to %s") url)) (eaf--open-internal url app-name args) (message (concat "[EAF/" app-name "] " "Opening %s") url)))
  (if (eaf-epc-live-p eaf-epc-process) (let (exists-eaf-buffer) (catch 'found-eaf (let ((--dolist-tail-- (eaf--get-eaf-buffers))) (while --dolist-tail-- (let ((buffer ...)) (save-current-buffer (set-buffer buffer) (if ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (if (and exists-eaf-buffer (not always-new)) (progn (eaf--preview-display-buffer app-name exists-eaf-buffer) (message (concat "[EAF/" app-name "] " "Switch to %s") url)) (eaf--open-internal url app-name args) (message (concat "[EAF/" app-name "] " "Opening %s") url))) (if eaf--first-start-app-buffers nil (setq eaf--first-start-app-buffers (cons (list url app-name args) eaf--first-start-app-buffers))) (eaf-start-process) (message (concat "[EAF/" app-name "] " "Opening %s") url))
  eaf-open("~" "file-manager")
  eaf-open-file-manager()
  funcall-interactively(eaf-open-file-manager)
  call-interactively(eaf-open-file-manager)

Describe the bug
A clear and concise description of what the bug is.
M-x eaf-open-file-manage. The error appeared, voild variable doom-modeline-mode.
If I try again eaf-open-file-manage, file-manage can be opened without the voild variable error.
If I press C-x k kill this buffer, and try again eaf-open-file-manage, the error appeared again.

If a require doom-modeline in my configuration, everything is ok.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.