emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* (error "Listing directory failed but ‘access-file’ worked")
@ 2024-04-12 17:36 Edgar Lux
  2024-04-13 12:50 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Edgar Lux @ 2024-04-12 17:36 UTC (permalink / raw)
  To: Emacs Orgmode

Hello.

I got this in an Org file:

#+begin_src org
[[file:Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg]]
[[file:Figures/Ti19-g(w, eta={0.1,}, R=1e-3).png]]
#+end_src

The files exist, and can be viewed in image-mode (tested with src_bash{emacs -q}).
With =C-c C-o= src_emacs-lisp{(org-open-at-point)}, the result is:

#+begin_example
Debugger entered--Lisp error: (error "Listing directory failed but ‘access-file’ worked")
  signal(error ("Listing directory failed but ‘access-file’ worked"))
  error("Listing directory failed but `access-file' worked")
  insert-directory("/tmp/Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" "--dired -alth --group-directories-first" t nil)
  dired-insert-directory("/tmp/Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" "-alth --group-directories-first" nil t t)
  dired-readin-insert()
  #f(compiled-function () #<bytecode -0x4d8e8bb5eb67701>)()
  combine-change-calls-1(1 1 #f(compiled-function () #<bytecode -0x4d8e8bb5eb67701>))
  dired-readin()
  dired-internal-noselect("/tmp/Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" nil)
  dired-noselect("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" nil)
  dired("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg")
  (if (string-match "[*?{]" (file-name-nondirectory file-name)) (dired file-name) (apply #'org-open-file file-name arg (cond ((not option) nil) ((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t (list nil option)))))
  (let* ((option (and (string-match "::\\(.*\\)\\'" path) (match-string 1 path))) (file-name (if (not option) path (substring path 0 (match-beginning 0))))) (if (string-match "[*?{]" (file-name-nondirectory file-name)) (dired file-name) (apply #'org-open-file file-name arg (cond ((not option) nil) ((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t (list nil option))))))
  org-link-open-as-file("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" nil)
  (let* ((option (org-element-property :search-option link)) (path (if option (concat path "::" option) path))) (org-link-open-as-file path (let* ((val (org-element-property :application link))) (cond (arg (let nil arg)) ((equal val '"emacs") (let nil 'emacs)) ((equal val '"sys") (let nil 'system))))))
  (let nil (let* ((option (org-element-property :search-option link)) (path (if option (concat path "::" option) path))) (org-link-open-as-file path (let* ((val (org-element-property :application link))) (cond (arg (let nil arg)) ((equal val '"emacs") (let nil 'emacs)) ((equal val '"sys") (let nil 'system)))))))
  (cond ((equal type '"file") (let nil (let* ((option (org-element-property :search-option link)) (path (if option (concat path "::" option) path))) (org-link-open-as-file path (let* ((val ...)) (cond (arg ...) (... ...) (... ...))))))) ((member type '("radio" "fuzzy" "custom-id" "coderef")) (let nil (if (run-hook-with-args-until-success 'org-open-link-functions path) nil (if (not arg) (org-mark-ring-push) (switch-to-buffer-other-window (org-link--buffer-for-internals))) (let ((destination (save-excursion ...))) (if (and (<= ... destination) (>= ... destination)) nil (widen)) (goto-char destination))))) (t (let nil (let ((f (org-link-get-parameter type :follow))) (if (functionp f) (progn (condition-case nil (funcall ... path arg) (wrong-number-of-arguments ...))))))))
  (let ((type (org-element-property :type link)) (path (org-element-property :path link))) (cond ((equal type '"file") (let nil (let* ((option (org-element-property :search-option link)) (path (if option ... path))) (org-link-open-as-file path (let* (...) (cond ... ... ...)))))) ((member type '("radio" "fuzzy" "custom-id" "coderef")) (let nil (if (run-hook-with-args-until-success 'org-open-link-functions path) nil (if (not arg) (org-mark-ring-push) (switch-to-buffer-other-window (org-link--buffer-for-internals))) (let ((destination ...)) (if (and ... ...) nil (widen)) (goto-char destination))))) (t (let nil (let ((f (org-link-get-parameter type :follow))) (if (functionp f) (progn (condition-case nil ... ...))))))))
  org-link-open((link (:type "file" :path "Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" :format bracket :raw-link "file:Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" :application nil :search-option nil :begin 1 :end 51 :contents-begin nil :contents-end nil :post-blank 0 :parent (paragraph (:begin 1 :end 103 :contents-begin 1 :contents-end 103 :post-blank 0 :post-affiliated 1 :mode top-comment :granularity element :cached t :parent (section (:begin 1 :end 103 :contents-begin 1 :contents-end 103 :robust-begin 1 :robust-end 101 :post-blank 0 :post-affiliated 1 :mode first-section :granularity element :cached t :parent (org-data ...))))))) nil)
  (cond ((not type) (user-error "No link found")) ((memq type '(comment comment-block node-property keyword)) (call-interactively #'org-open-at-point-global)) ((memq type '(headline inlinetask)) (org-match-line org-complex-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end 5))) (if (and tags-beg (>= (point) tags-beg) (< (point) tags-end)) (org-tags-view arg (save-excursion (let* (... ...) (buffer-substring ... ...)))) (let* ((val (org-offer-links-in-entry ... ... arg))) (if (consp val) (let* (...) (if ... ... ...))))))) ((or (eq type 'footnote-reference) (and (eq type 'footnote-definition) (save-excursion (skip-chars-forward " \11") (let ((begin ...)) (if begin (< ... begin) (= ... ...)))))) (org-footnote-action)) ((and (eq type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-timestamp-link)) ((and (eq type 'clock) value (>= (point) (org-element-property :begin value)) (<= (point) (org-element-property :end value))) (org-follow-timestamp-link)) ((eq type 'src-block) (org-babel-open-src-block-result)) ((>= (point) (save-excursion (goto-char (org-element-property :end context)) (skip-chars-backward " \11") (point))) (user-error "No link found")) ((eq type 'inline-src-block) (org-babel-open-src-block-result)) ((eq type 'timestamp) (org-follow-timestamp-link)) ((eq type 'link) (org-link-open context arg)) ((memq type '(citation citation-reference)) (org-cite-follow context arg)) (t (user-error "No link found")))
  (let* ((context (org-element-lineage (org-element-context) '(citation citation-reference clock comment comment-block footnote-definition footnote-reference headline inline-src-block inlinetask keyword link node-property planning src-block timestamp) t)) (type (org-element-type context)) (value (org-element-property :value context))) (cond ((not type) (user-error "No link found")) ((memq type '(comment comment-block node-property keyword)) (call-interactively #'org-open-at-point-global)) ((memq type '(headline inlinetask)) (org-match-line org-complex-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end 5))) (if (and tags-beg (>= (point) tags-beg) (< (point) tags-end)) (org-tags-view arg (save-excursion (let* ... ...))) (let* ((val ...)) (if (consp val) (let* ... ...)))))) ((or (eq type 'footnote-reference) (and (eq type 'footnote-definition) (save-excursion (skip-chars-forward " \11") (let (...) (if begin ... ...))))) (org-footnote-action)) ((and (eq type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-timestamp-link)) ((and (eq type 'clock) value (>= (point) (org-element-property :begin value)) (<= (point) (org-element-property :end value))) (org-follow-timestamp-link)) ((eq type 'src-block) (org-babel-open-src-block-result)) ((>= (point) (save-excursion (goto-char (org-element-property :end context)) (skip-chars-backward " \11") (point))) (user-error "No link found")) ((eq type 'inline-src-block) (org-babel-open-src-block-result)) ((eq type 'timestamp) (org-follow-timestamp-link)) ((eq type 'link) (org-link-open context arg)) ((memq type '(citation citation-reference)) (org-cite-follow context arg)) (t (user-error "No link found"))))
  (if (run-hook-with-args-until-success 'org-open-at-point-functions) nil (let* ((context (org-element-lineage (org-element-context) '(citation citation-reference clock comment comment-block footnote-definition footnote-reference headline inline-src-block inlinetask keyword link node-property planning src-block timestamp) t)) (type (org-element-type context)) (value (org-element-property :value context))) (cond ((not type) (user-error "No link found")) ((memq type '(comment comment-block node-property keyword)) (call-interactively #'org-open-at-point-global)) ((memq type '(headline inlinetask)) (org-match-line org-complex-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end 5))) (if (and tags-beg (>= ... tags-beg) (< ... tags-end)) (org-tags-view arg (save-excursion ...)) (let* (...) (if ... ...))))) ((or (eq type 'footnote-reference) (and (eq type 'footnote-definition) (save-excursion (skip-chars-forward " \11") (let ... ...)))) (org-footnote-action)) ((and (eq type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-timestamp-link)) ((and (eq type 'clock) value (>= (point) (org-element-property :begin value)) (<= (point) (org-element-property :end value))) (org-follow-timestamp-link)) ((eq type 'src-block) (org-babel-open-src-block-result)) ((>= (point) (save-excursion (goto-char (org-element-property :end context)) (skip-chars-backward " \11") (point))) (user-error "No link found")) ((eq type 'inline-src-block) (org-babel-open-src-block-result)) ((eq type 'timestamp) (org-follow-timestamp-link)) ((eq type 'link) (org-link-open context arg)) ((memq type '(citation citation-reference)) (org-cite-follow context arg)) (t (user-error "No link found")))))
  org-open-at-point(nil)
  funcall-interactively(org-open-at-point nil)
  call-interactively(org-open-at-point nil nil)
  command-execute(org-open-at-point)
#+end_example

-- 
Sent with https://mailfence.com  
Secure and private email


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

* Re: (error "Listing directory failed but ‘access-file’ worked")
  2024-04-12 17:36 (error "Listing directory failed but ‘access-file’ worked") Edgar Lux
@ 2024-04-13 12:50 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-04-13 12:50 UTC (permalink / raw)
  To: Edgar Lux; +Cc: Emacs Orgmode

Edgar Lux <edgarlux@mailfence.com> writes:

> I got this in an Org file:
>
> #+begin_src org
> [[file:Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg]]
> [[file:Figures/Ti19-g(w, eta={0.1,}, R=1e-3).png]]
> #+end_src
>
> The files exist, and can be viewed in image-mode (tested with src_bash{emacs -q}).
> With =C-c C-o= src_emacs-lisp{(org-open-at-point)}, the result is:
>
> #+begin_example
> Debugger entered--Lisp error: (error "Listing directory failed but ‘access-file’ worked")
> ...
>   dired("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg")
> ...
>   org-link-open-as-file("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" nil)

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6cb088972

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-04-13 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12 17:36 (error "Listing directory failed but ‘access-file’ worked") Edgar Lux
2024-04-13 12:50 ` Ihor Radchenko

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).