emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 114/287: condition-case->ignore-errors ergoemacs-translate.el


From: Matthew Fidler
Subject: [elpa] 114/287: condition-case->ignore-errors ergoemacs-translate.el
Date: Wed, 02 Jul 2014 14:45:09 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 58f731f6f5a138fbdb30d79da2c337dcb67d5640
Author: Matthew L. Fidler <address@hidden>
Date:   Tue Jun 17 11:01:36 2014 -0500

    condition-case->ignore-errors ergoemacs-translate.el
---
 ergoemacs-translate.el |   86 ++++++++++++++++++++++++-----------------------
 1 files changed, 44 insertions(+), 42 deletions(-)

diff --git a/ergoemacs-translate.el b/ergoemacs-translate.el
index f619e1d..832e484 100644
--- a/ergoemacs-translate.el
+++ b/ergoemacs-translate.el
@@ -50,8 +50,12 @@
 ;; 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+(eval-when-compile (require 'ergoemacs-macros (expand-file-name 
"ergoemacs-macros" default-directory)))
+
 ;;; ergoemacs pretty keys
 
+
 (defvar ergoemacs-display-char-list nil
   "List of characters and fonts and if they display or not.")
 
@@ -60,28 +64,27 @@
 
 (defun ergoemacs-display-char-p (char)
   "Determines if CHAR can be displayed."
-  (condition-case err
-      (let* (ret
-             (buf (current-buffer))
-             (face (font-xlfd-name (face-attribute 'default :font)))
-             (found (assoc (list face char window-system) 
ergoemacs-display-char-list)))
-        (if found
-            (nth 0 (cdr found))
-          (switch-to-buffer (get-buffer-create " *ergoemacs-display-char-p*") 
t)
-          (delete-region (point-min) (point-max))
-          (insert char)
-          (let ((display (describe-char-display (point-min) (char-after 
(point-min)))))
-            (if (display-graphic-p (selected-frame))
-                (if display
-                    (setq ret t))
+  (ignore-errors
+    (let* (ret
+           (buf (current-buffer))
+           (face (font-xlfd-name (face-attribute 'default :font)))
+           (found (assoc (list face char window-system) 
ergoemacs-display-char-list)))
+      (if found
+          (nth 0 (cdr found))
+        (switch-to-buffer (get-buffer-create " *ergoemacs-display-char-p*") t)
+        (delete-region (point-min) (point-max))
+        (insert char)
+        (let ((display (describe-char-display (point-min) (char-after 
(point-min)))))
+          (if (display-graphic-p (selected-frame))
               (if display
-                  (setq ret t))))
-          (switch-to-buffer buf)
-          ;; Save it so the user doesn't see the buffer popup very much
-          ;; (if at all).
-          (add-to-list 'ergoemacs-display-char-list (list (list face char 
window-system) ret))
-          ret))
-    (error nil)))
+                  (setq ret t))
+            (if display
+                (setq ret t))))
+        (switch-to-buffer buf)
+        ;; Save it so the user doesn't see the buffer popup very much
+        ;; (if at all).
+        (add-to-list 'ergoemacs-display-char-list (list (list face char 
window-system) ret))
+        ret))))
 
 (defvar ergoemacs-use-unicode-char t
   "Use unicode characters when available.")
@@ -245,28 +248,27 @@ This assumes `ergoemacs-use-unicode-char' is non-nil.  
When
 
 (defun ergoemacs-display-char-p (char)
   "Determines if CHAR can be displayed."
-  (condition-case err
-      (let* (ret
-             (buf (current-buffer))
-             (face (font-xlfd-name (face-attribute 'default :font)))
-             (found (assoc (list face char window-system) 
ergoemacs-display-char-list)))
-        (if found
-            (nth 0 (cdr found))
-          (switch-to-buffer (get-buffer-create " *ergoemacs-display-char-p*") 
t)
-          (delete-region (point-min) (point-max))
-          (insert char)
-          (let ((display (describe-char-display (point-min) (char-after 
(point-min)))))
-            (if (display-graphic-p (selected-frame))
-                (if display
-                    (setq ret t))
+  (ignore-errors
+    (let* (ret
+           (buf (current-buffer))
+           (face (font-xlfd-name (face-attribute 'default :font)))
+           (found (assoc (list face char window-system) 
ergoemacs-display-char-list)))
+      (if found
+          (nth 0 (cdr found))
+        (switch-to-buffer (get-buffer-create " *ergoemacs-display-char-p*") t)
+        (delete-region (point-min) (point-max))
+        (insert char)
+        (let ((display (describe-char-display (point-min) (char-after 
(point-min)))))
+          (if (display-graphic-p (selected-frame))
               (if display
-                  (setq ret t))))
-          (switch-to-buffer buf)
-          ;; Save it so the user doesn't see the buffer popup very much
-          ;; (if at all).
-          (add-to-list 'ergoemacs-display-char-list (list (list face char 
window-system) ret))
-          ret))
-    (error nil)))
+                  (setq ret t))
+            (if display
+                (setq ret t))))
+        (switch-to-buffer buf)
+        ;; Save it so the user doesn't see the buffer popup very much
+        ;; (if at all).
+        (add-to-list 'ergoemacs-display-char-list (list (list face char 
window-system) ret))
+        ret))))
 
 ;;; Actual Translations
 (defvar ergoemacs-dir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]