0

I try to view image under a point in external viewer by w3m-view-image, but when I call it I get in the *Messages*:

zsh:1: no matches found: accept_media=*/*

How can I make it working?

I use: macOS 10.15.7 Emacs 27.1.90


EDIT:

Following @lawlist guidence, I found out that the solution to the problem will probably be configuring ~/.mailcap.

Because the main reason to have it working was to display an image in external viewer, I decided to use external browser. I ended up creating copy of w3m-view-image function but which opens image in external browser. What's good about this is solution is, it doesn't download images into ~/.w3m, the content is managed by external browser (Firefox in my case) instead. I set the function below to override default binding I.

  (defun farynaio/w3m-view-image-generic-browser ()
    (interactive)
    (let ((url (w3m-url-valid (w3m-image))))
      (if url
        (browse-url-generic url)
        (w3m-message "No image at point"))))
Navidot
  • 732
  • 5
  • 12
  • Let's break this down to one of the three initial steps in debugging. The code is `(let ((url (w3m-url-valid (w3m-image)))) (if url (w3m-external-view url) (w3m-message "No image at point")))` **Step #1**: If you evaluate `(w3m-image)` at point, does that work? **Step #2**: If you evaluate `(w3m-url-valid (w3m-image))`, does that work? **Step #3**: If you evaluate `(w3m-external-view (w3m-url-valid (w3m-image)))`, is that the step that gives you the error message? If the error is in **Step 3**, then we look inside `w3m-external-view` and continue debugging .... – lawlist Feb 04 '21 at 00:16
  • The doc-string for `w3m-view-image` states (in part): "*The viewer is defined in `w3m-content-type-alist` for every type of an image.*" So, that begs the questions: what is the file-type (extension) at issue, and what is the value of `w3m-content-type-alist` and is it configured correctly for your particular setup? To describe the variable type `C-h v` aka `M-x describe-variable`. It may be helpful if you add those details to your question (by editing the question), along with the results of trouble-shooting performed in connection with the comment hereinabove. – lawlist Feb 04 '21 at 00:26
  • #1 yes (w3m-image) at point return url #2 (w3m-url-valid (w3m-image)) return url. #3 (w3m-external-view (w3m-url-valid (w3m-image))) return nil and in *Messages* "File(~/.w3m/file.png) downloading failed: zsh:1: no matches found: accept_media=*/*". The `w3m-content-type-alist` has plenty of default records. – Navidot Feb 04 '21 at 16:12
  • 1
    I would suggest experimenting with evaluating at point `(w3m-download (w3m-url-valid (w3m-image)) nil nil nil)` whereby you investigate the possibility that the URL at issue `(w3m-url-valid (w3m-image))` may contain one or more special characters that are not recognized, either because they need to be *escaped* or because the entire URL needs to be wrapped in something like `'URL'`. If you Google your error message, you will find a few hits that discuss potential issues. If the URL is the issue, then you may wish to try a different simple URL with nothing special in terms of characters. – lawlist Feb 04 '21 at 17:24

0 Answers0