]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix some useless condition-case forms
authorMattias Engdegård <mattiase@acm.org>
Tue, 28 Feb 2023 16:07:06 +0000 (17:07 +0100)
committerMattias Engdegård <mattiase@acm.org>
Tue, 28 Feb 2023 16:12:54 +0000 (17:12 +0100)
* lisp/progmodes/cperl-mode.el (cperl-calculate-indent):
* lisp/progmodes/verilog-mode.el (verilog--suppressed-warnings):
Add error handler, seemingly the intention here.
* lisp/url/url-gw.el (url-open-stream): Remove condition-case;
it was neutered in 2006.

lisp/progmodes/cperl-mode.el
lisp/progmodes/verilog-mode.el
lisp/url/url-gw.el

index 412283f34885b8093aef1528cd3cc1499ec081f0..b6f0e9bca41e9f6a394bba18d6b61fe2f64d746e 100644 (file)
@@ -2918,8 +2918,9 @@ and closing parentheses and brackets."
         ;;
         ((eq 'REx-part2 (elt i 0)) ;; [self start] start of /REP in s//REP/x
          (goto-char (elt i 1))
-         (condition-case nil   ; Use indentation of the 1st part
-             (forward-sexp -1))
+          (condition-case nil
+             (forward-sexp -1)         ; Use indentation of the 1st part
+            (error nil))
          (current-column))
         ((eq 'indentable (elt i 0))    ; Indenter for REGEXP qw() etc
          (cond                ;;; [indentable terminator start-pos is-block]
index 2989d7ddb616a09b926b732b5139ab5ee1cb8d7f..ac6fd382a46daf60a4beb3e1706238317cb137af 100644 (file)
@@ -370,7 +370,8 @@ wherever possible, since it is slow."
       (unless (fboundp 'ignore-errors)
         (defmacro ignore-errors (&rest body)
           (declare (debug t) (indent 0))
-          `(condition-case nil (progn ,@body) (error nil)))))
+          `(condition-case nil (progn ,@body) (error nil))))
+    (error nil))
   ;; Added in Emacs 24.1
   (condition-case nil
       (unless (fboundp 'prog-mode)
index b20e5073f7465bb2907d44c08dbb847bac9bbe07..f16be98094546a9fc05506401ebc5880119caba3 100644 (file)
@@ -239,35 +239,34 @@ overriding the value of `url-gateway-method'."
       (if url-gateway-broken-resolution
          (setq host (url-gateway-nslookup-host host)))
 
-      (condition-case nil
-         ;; This is a clean way to ensure the new process inherits the
-         ;; right coding systems in both Emacs and XEmacs.
-         (let ((coding-system-for-read 'binary)
-               (coding-system-for-write 'binary))
-           (setq conn (pcase gw-method
-                        ((or 'tls 'ssl 'native)
-                         (if (eq gw-method 'native)
-                             (setq gw-method 'plain))
-                         (open-network-stream
-                          name buffer host service
-                          :type gw-method
-                          ;; Use non-blocking socket if we can.
-                          :nowait (and (featurep 'make-network-process)
-                                        (url-asynchronous url-current-object)
-                                        '(:nowait t))))
-                         ('socks
-                         (socks-open-network-stream name buffer host service))
-                        ('telnet
-                         (url-open-telnet name buffer host service))
-                        ('rlogin
-                          (unless url-gw-rlogin-obsolete-warned-once
-                            (lwarn 'url :error "Setting `url-gateway-method' to `rlogin' is obsolete")
-                            (setq url-gw-rlogin-obsolete-warned-once t))
-                          (with-suppressed-warnings ((obsolete url-open-rlogin))
-                            (url-open-rlogin name buffer host service)))
-                        (_
-                         (error "Bad setting of url-gateway-method: %s"
-                                url-gateway-method))))))
+      ;; This is a clean way to ensure the new process inherits the
+      ;; right coding systems in both Emacs and XEmacs.
+      (let ((coding-system-for-read 'binary)
+           (coding-system-for-write 'binary))
+       (setq conn (pcase gw-method
+                    ((or 'tls 'ssl 'native)
+                     (if (eq gw-method 'native)
+                         (setq gw-method 'plain))
+                     (open-network-stream
+                      name buffer host service
+                      :type gw-method
+                      ;; Use non-blocking socket if we can.
+                      :nowait (and (featurep 'make-network-process)
+                                    (url-asynchronous url-current-object)
+                                    '(:nowait t))))
+                     ('socks
+                     (socks-open-network-stream name buffer host service))
+                    ('telnet
+                     (url-open-telnet name buffer host service))
+                    ('rlogin
+                      (unless url-gw-rlogin-obsolete-warned-once
+                        (lwarn 'url :error "Setting `url-gateway-method' to `rlogin' is obsolete")
+                        (setq url-gw-rlogin-obsolete-warned-once t))
+                      (with-suppressed-warnings ((obsolete url-open-rlogin))
+                        (url-open-rlogin name buffer host service)))
+                    (_
+                     (error "Bad setting of url-gateway-method: %s"
+                            url-gateway-method)))))
       conn)))
 
 (provide 'url-gw)