From: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: Bugfix and improved error handling
Date: Thu, 23 Nov 2006 22:48:09 +0100 [thread overview]
Message-ID: <87k61lq1gm.fsf@gmx.de> (raw)
In-Reply-To: <456351DB.8010805@soem.dk> (Lars Hansen's message of "Tue, 21 Nov 2006 20:22:03 +0100")
Lars Hansen <lists@soem.dk> writes:
Hi Lars,
> The attached patch has improved error handling for out-of-band copying
> and some bug fixes.
> The changes are:
>
> 1. Give error message "permission denied"/"not a regular file"/"no such
> file or directory" rather than the misleading "login failed" when
> appropriate.
> 2. Also kill the copy program buffer when an error occurs (bugfix).
> 3. Use pscp as default method under windows.
>
> Objections?
In general the patch looks OK to me.
> --- 1327,1354 ----
> Whenever a pattern matches, the corresponding action is performed.
> Each item looks like (PATTERN ACTION).
>
> ! The PATTERN should be a form. This form must evaluate to a
> ! regular expression to search for. Note that the regexp must match
> ! at the end of the buffer except for trailing blanks. When PATTERN
> ! is evaluated, the symbols `method', `user' and `host' are bound.
>
> ! The ACTION should be a symbol, a function. When the corresponding
> ! PATTERN matches, the ACTION function is called."
> :group 'tramp
> ! :type '(repeat (list form function)))
>
> (defcustom tramp-actions-copy-out-of-band
> '((tramp-password-prompt-regexp tramp-action-password)
> (tramp-wrong-passwd-regexp tramp-action-permission-denied)
> + ("\\(.+: Permission denied\\)" tramp-action-copy-failed)
> + ("\\(.+: \\(not a regular file\\|is a directory\\)\\)" tramp-action-copy-failed)
> + ("\\(.+: No such file or directory\\)" tramp-action-copy-failed)
Why didn't you introduce a new variable tramp-copy-failed-regexp? This
would make the code more readable, and it would avoid several changes.
> --- 5472,5482 ----
> (while todo
> (goto-char (point-min))
> (setq item (pop todo))
> ! (setq pattern (eval (nth 0 item)))
> (setq action (nth 1 item))
> (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
> pattern)
> ! (when (re-search-forward (concat pattern "[ \t\n]*\\'") nil t)
> (setq found (funcall action p multi-method method user host)))))
> found)))
I don't know whether it is possible to cut trailing newlines in
general. Some existing regexps claim "The regexp should match at end
of buffer." Likely you are right in your change, but then you could
remove trailing "\\s-*" from several regexps. It would be more
consistent.
Best regards, Michael.
next prev parent reply other threads:[~2006-11-23 21:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-21 19:22 Bugfix and improved error handling Lars Hansen
2006-11-23 21:48 ` Michael Albinus [this message]
2006-11-24 16:28 ` Lars Hansen
2006-11-24 17:35 ` Michael Albinus
2006-11-24 19:17 ` Lars Hansen
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=87k61lq1gm.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).