You can trim objects to their nearest intersection with other objects. When you select the objects to trim, AutoCAD automatically chooses the nearest selected objects as cutting edges. In the following example, the walls are trimmed so that they intersect smoothly.

nearest-intersection