         @_sync()
 
     clear_all_outputs: =>
+        not_editable = 0
         @store.get('cells').forEach (cell, id) =>
             if cell.get('output')? or cell.get('exec_count')
                 if not @store.is_cell_editable(id)
-                    @show_edit_protection_error()
+                    not_editable += 1
                 else
                     @_set({type:'cell', id:id, output:null, exec_count:null}, false)
             return
         @_sync()
+        if not_editable > 0
+            @set_error("One or more cells are protected from editing.")
 
     # prop can be: 'collapsed', 'scrolled'
     toggle_output: (id, prop) =>

        return max
    return n

CellWriteProtectedException = {}
CellDeleteProtectedException = {}

class exports.JupyterActions extends Actions


    set_cell_slide: (id, value) =>
        if not value
            value = null  # delete
        return if @store.check_edit_protection(id, @)
        @_set
            type  : 'cell'
            id    : id
