--- cowsay/cowsay.el
+++ cowsay/cowsay.el
@@ -41,7 +41,7 @@
 Each entry is a list whose first element is the cow name (a
 string) and remaining elements are cow parts.  A cow part is
 either a string (which is inserted verbatim) or one of the
-symbols 'eyes, 'thoughts, 'tongue.")
+symbols \\='eyes, \\='thoughts, \\='tongue.")
 
 (defcustom cowsay-preferred-cows '("default")
   "List of your favorite cows.
@@ -61,7 +61,7 @@
   "History of which cows have been used to say things.")
 
 (defcustom cowsay-bubble-style 'say
-  "Either 'say or 'think."
+  "Either \\='say or \\='think."
   :group 'cowsay
   :type '(radio (say :tag "Speech bubble")
                 (think :tag "Thought bubble")))
@@ -216,13 +216,14 @@
       (fill-region (point-min) (point-max)))
     (goto-char (point-min))
     (while (not (eobp))
-      (setq longest (max longest (- (point-at-eol) (point-at-bol))))
-      (goto-char (min (point-max) (1+ (point-at-eol)))))
-    (goto-char (point-min))
-    (while (< (point-at-eol) (point-max))
-      (let* ((len     (- (point-at-eol) (point-at-bol)))
-             (top-p   (= (point-at-bol) (point-min)))
-             (bot-p   (= (point-at-eol) (1- (point-max))))
+      (setq longest (max longest (- (line-end-position)
+				    (line-beginning-position))))
+      (goto-char (min (point-max) (1+ (line-end-position)))))
+    (goto-char (point-min))
+    (while (< (line-end-position) (point-max))
+      (let* ((len     (- (line-end-position) (line-beginning-position)))
+             (top-p   (= (line-beginning-position) (point-min)))
+             (bot-p   (= (line-end-position) (1- (point-max))))
              (only-p  (and top-p bot-p))
              (padding (make-string (- longest len) ?\s)))
         (looking-at "^.*$")
@@ -233,7 +234,7 @@
                  (bot-p  (concat l-bot  text r-bot))
                  (t      (concat l-side text r-side)))
            t t))
-        (goto-char (1+ (point-at-eol)))))
+        (goto-char (1+ (line-end-position)))))
     (goto-char (point-min))
     (insert " " (make-string (+ 1 longest 1) ?\_) " \n")
     (goto-char (point-max))
