emacs-android icon indicating copy to clipboard operation
emacs-android copied to clipboard

can't list files on samsung galaxy tab 10.1

Open coloquio opened this issue 12 years ago • 9 comments

how am I supposed to understand this message when I ask to open home directory: "listing directory failed but 'access file' worked. btw which I assume the home directory corresponds to /data/data/com.zielm.emacs but it's nowhere to be found in my device.

coloquio avatar Sep 05 '12 17:09 coloquio

HOME=/sdcard/emacs Check if it exists and if it is readable by group sdcard. You will be able to access /data/data/com.zielm.emacs only if you are root. If it doesn't exist there is something wrong with your system.

zielmicha avatar Sep 05 '12 17:09 zielmicha

thanks. Indeed I can write to sdcard/emacs, although the default prompt to C-x C-f is directory /data/data/com.zielm.emacs which can only be accessed as root.

Is there any option in emacs to initiate the session as a root user (su)

Should I write a .emacs configuration file to the root or will it work from sdcard?

coloquio avatar Sep 05 '12 18:09 coloquio

It will work from sdcard, but you should be able to access /data/data/com.zielm.emacs from normal session. If you can't, reinstall.

It is possible to run emacs as root. Run emacs, type C-x C-c su RET emacs RET

zielmicha avatar Sep 05 '12 18:09 zielmicha

I see this problem trying to list files in any directory, not just home (also Galaxy Note 10.1).

I tried to run emacs as root but su is not found.

Happy to help you debug, but I'll need a little guidance.

SorraTheOrc avatar Sep 09 '12 09:09 SorraTheOrc

Not only on Samsung. On HTC, I also get the error:

Listing directory failed but `access file' worked

when trying to list files in any directory, for example using C-x C-f to visit a directory with Dired.

To debug this, I added the following to my /sdcard/emacs/.emacs init file:

(setq debug-on-error t)

It seems Dired is using "ls -la", but on Android that doesn't work, and it probably should be "ls -l", so I tried:

(setq dired-listing-switches "-l")

This changed -la to -l, which should work, but I'm still getting that error.

There is probably some other problem with Dired on Android.

On the other hand, "M-x eshell" seems to be working well, like in the Emacs app screenshot on Google Play.

juan-g avatar Dec 10 '12 23:12 juan-g

Until someone figures out a correct configuration for Dired on Android, although we can't use C-x C-f to visit directories by invoking Dired, at least C-x C-f works to visit files and for tab completion.

An additional possibility is an Org-mode file such as Files.org, as a place to collect links to frequently used files. We can use link abbreviations for absolute paths with something like the following example for the /sdcard/emacs/.emacs init file:

;; Link abbreviations
(setq org-link-abbrev-alist
'(("org" . "file:/sdcard/Org/%s.org")
("doc" . "file+sys:/sdcard/My Documents/%s")))

In this way, we can write -in Files.org, or any Org documents- links to files like Work.org, anyfile.pdf, etc.:

[[org:Work][Work]]
[[doc:anyfile.pdf]]

To quickly open the list of file links, we can assign for example the F8 key to Files.org, in the .emacs file:

(global-set-key [(f8)]
  '(lambda ()
    (interactive)
    (find-file "/sdcard/Org/Files.org"))) 

juan-g avatar Dec 11 '12 22:12 juan-g

quite clever, thanks. another point in favor of org-mode.  Also, I had implemented a menu option to display recently used files to access from "file" in the menu line.  

vicco


From: juan-g [email protected] To: zielmicha/emacs-android [email protected] Cc: vicco [email protected] Sent: Tuesday, December 11, 2012 7:48 PM Subject: Re: [emacs-android] can't list files on samsung galaxy tab 10.1 (#6)

Until someone figures out a correct configuration for Dired on Android, although we can't use C-x C-f to visit directories by invoking Dired, at least C-x C-f works to visit files and for tab completion. An additional possibility is an Org-mode file such as Files.org, as a place to collect links to frequently used files. We can use link abbreviations for absolute paths with something like the following example for the /sdcard/emacs/.emacs init file: ;; Link abbreviations (setq org-link-abbrev-alist '(("org" . "file:/sdcard/Org/%s.org") ("doc" . "file+sys:/sdcard/My Documents/%s"))) In this way, we can write -in Files.org, or any Org documents- links to files like Work.org, anyfile.pdf, etc.: [[org:Work][Work]] [[doc:anyfile.pdf]] To quickly open the list of file links, we can assign for example the F8 key to Files.org, in the .emacs file: (global-set-key [(f8)] '(lambda () (interactive) (find-file "/sdcard/Org/Files.org"))) — Reply to this email directly or view it on GitHub.

coloquio avatar Dec 16 '12 16:12 coloquio

There is a fix for this issue that worked for me on my Galaxy S3: http://stackoverflow.com/questions/4076360/error-in-dired-sorting-on-os-x (require 'ls-lisp) (setq ls-lisp-use-insert-directory-program nil)

By the way, I think it is the `--dired' flag that is causing the android "ls" to choke ...

Why isn't the android linux just plain-old-linux ... grumble ... grumble ...

For this emacs ... which totally rules by the way ... I'd like to see the full install including emacsclient, which obviously would require a working server. Currently, when I try to start in --daemon mode I get an error: mylo@android:/ # emacs --daemon emacs: Could not open file: /dev/tty Error: server did not start correctly

M-x start-server seems to work, but still I don't know how you could then allow emacs to keep running when your session disconnects. I am currently rooted, and logging in over ssh (via adb forward tcp:2222 tcp:22)

mylostone avatar May 30 '13 23:05 mylostone

Switching to lisp ls worked for me on a galaxy note 10.1. Thanks.

(require 'ls-lisp) (setq ls-lisp-use-insert-directory-program nil)

dppdppd avatar Jul 14 '13 23:07 dppdppd