Source

xemacs-base / annotations.el

Diff from to

annotations.el

 The function `annotation-glyph' returns the current glyph."
   (if (not (annotationp annotation))
       (error "%s is not an annotation" annotation)
-    (progn
-      (if (not layout)
-	  (setq layout (or (extent-begin-glyph-layout annotation)
-			   (extent-end-glyph-layout annotation))))
-      (if (or (eq side 'right)
-	      (and (not (eq side 'left))
-		   (eq (annotation-side annotation) 'right)))
-	  (set-extent-end-glyph annotation glyph layout)
-	(set-extent-begin-glyph annotation glyph layout))
-      (aset (extent-property annotation 'annotation) 3 glyph)
-      (if (eq side 'right)
-	  (aset (extent-property annotation 'annotation) 5 t))
-      (if (eq side 'left)
-	  (aset (extent-property annotation 'annotation) 5 nil))
-      (annotation-glyph annotation))))
+    ;; else
+    (or layout (setq layout (annotation-layout annotation)))
+    (or side   (setq side   (annotation-side   annotation)))
+    (cond ((eq side 'left)
+	   (set-extent-begin-glyph annotation glyph layout)
+	   (set-extent-end-glyph annotation nil)
+	   (aset (extent-property annotation 'annotation) 5 nil))
+	  ((eq side 'right)
+	   (set-extent-end-glyph annotation glyph layout)
+	   (set-extent-begin-glyph annotation nil)
+	   (aset (extent-property annotation 'annotation) 5 nil)))
+    (aset (extent-property annotation 'annotation) 3 glyph)
+    (annotation-glyph annotation)))
 
 (defun annotation-down-glyph (annotation)
   "If ANNOTATION is of type `string' return the down string.  Otherwise,