unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: trapping process filter error in a thread
Date: Tue, 22 Mar 2022 20:28:12 +0100	[thread overview]
Message-ID: <87zglhkcs3.fsf@zoho.eu> (raw)
In-Reply-To: 87pmmegk7a.fsf@gnuvola.org

Thien-Thi Nguyen wrote:

> I'm in the process of writing a dead-link checker

Good idea ...

> and would like to use Emacs' threads and ‘url-http’ funcs.
> I've run into a problem w/ GNU Emacs 27.1 (Debian), however:
> When there is a TLS problem, i am unable to trap the process
> filter error. It seems ‘condition-case’ is not the right
> tool for the job.
>
> (defun func ()
>   (let ((noninteractive t))
>     (condition-case nil
>         (if (url-http-file-exists-p url)
>             "ok"
>           "dead")
>       (t "error"))))

Isn't the syntax/usage rather as in e.g.

(defun erc-element-next (&optional prev)
  (interactive "P")
  (when (erc-at-prompt-p)
    (goto-char (point-min)) )
  (condition-case nil
      (if prev
          (erc-button-previous)
        (erc-button-next) )
    (error (progn
             (goto-char (point-max))
             (when prev
               (erc-bol) )))))

> (a) Can anyone else reproduce this on their Emacs?
>     (Obviously your Emacs has to be built w/
>     thread support.)

What are threads in this context and how do you build Emacs
for that

> (c) Is there a recommended way to trap process filter errors
>     for a noninteractive (perhaps batch) session?

What's a process filter?

> Thank-you for any insight into this corner of Emacs Lisp!

You don't say ;)

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2022-03-22 19:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 14:01 trapping process filter error in a thread Thien-Thi Nguyen
2022-03-22 19:28 ` Emanuel Berg via Users list for the GNU Emacs text editor [this message]
2022-04-02 23:54   ` Thien-Thi Nguyen
2022-04-03  0:50     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-24  2:33 ` Felix Dietrich
2022-04-03  0:07   ` Thien-Thi Nguyen
2022-04-10  8:58     ` Felix Dietrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zglhkcs3.fsf@zoho.eu \
    --to=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).