]> code.delx.au - gnu-emacs/commitdiff
Merge from trunk.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 24 Jul 2011 22:16:20 +0000 (15:16 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 24 Jul 2011 22:16:20 +0000 (15:16 -0700)
lisp/ChangeLog
lisp/net/tramp-sh.el
src/xml.c

index aac855804cbe05eb5b453b1dd8e6a9d72f18a43c..4f03b9b97d5227def9bc509474cfdbafe344f8c8 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-24  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-sh.el (tramp-barf-unless-okay): Return the value of
+       `tramp-send-command-and-check' if there is no error.
+       (tramp-send-command-and-read): Suppress *all* errors if NOERROR.
+
 2011-07-22  Alan Mackenzie  <acm@muc.de>
 
        Prevent cc-langs.elc being loaded at run time.
index 1c6f0844be0164e9c7a5b38efddfe1a41961127f..bcd235729089cdea00016ddc61532eed16b0bcdf 100644 (file)
@@ -4505,27 +4505,30 @@ DONT-SUPPRESS-ERR is non-nil, stderr won't be sent to /dev/null."
   "Run COMMAND, check exit status, throw error if exit status not okay.
 Similar to `tramp-send-command-and-check' but accepts two more arguments
 FMT and ARGS which are passed to `error'."
-  (unless (tramp-send-command-and-check vec command)
-    (apply 'tramp-error vec 'file-error fmt args)))
+  (or (tramp-send-command-and-check vec command)
+      (apply 'tramp-error vec 'file-error fmt args)))
 
 (defun tramp-send-command-and-read (vec command &optional noerror)
   "Run COMMAND and return the output, which must be a Lisp expression.
 In case there is no valid Lisp expression and NOERROR is nil, it
 raises an error."
-  (tramp-barf-unless-okay vec command "`%s' returns with error" command)
-  (with-current-buffer (tramp-get-connection-buffer vec)
-    ;; Read the expression.
-    (goto-char (point-min))
-    (condition-case nil
-       (prog1 (read (current-buffer))
-         ;; Error handling.
-         (when (re-search-forward "\\S-" (point-at-eol) t)
-           (error nil)))
-      (error (unless noerror
-              (tramp-error
-               vec 'file-error
-               "`%s' does not return a valid Lisp expression: `%s'"
-               command (buffer-string)))))))
+  (when (if noerror
+           (tramp-send-command-and-check vec command)
+         (tramp-barf-unless-okay
+          vec command "`%s' returns with error" command))
+    (with-current-buffer (tramp-get-connection-buffer vec)
+      ;; Read the expression.
+      (goto-char (point-min))
+      (condition-case nil
+         (prog1 (read (current-buffer))
+           ;; Error handling.
+           (when (re-search-forward "\\S-" (point-at-eol) t)
+             (error nil)))
+       (error (unless noerror
+                (tramp-error
+                 vec 'file-error
+                 "`%s' does not return a valid Lisp expression: `%s'"
+                 command (buffer-string))))))))
 
 (defun tramp-convert-file-attributes (vec attr)
   "Convert file-attributes ATTR generated by perl script, stat or ls.
index 600dcd11616803508f0675407b8bc057c9f4a74e..55352baae3a0ccceed9eed778670523a90fd95ca 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -128,13 +128,13 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html
       Lisp_Object r = Qnil;
 
       while (n) {
-       if (r != Qnil)
+       if (!NILP (r))
          result = Fcons (r, result);
        r = make_dom (n);
        n = n->next;
       }
 
-      if (result == Qnil)
+      if (NILP (result))
        result = r;
       else
        result = Fcons (intern ("top"),