In the context of electroencephalogram (EEG)-based brain-computer interfaces (BCI), common spatial patterns (CSP) is widely used for spatially filtering multichannel EEG signals. CSP is a supervised learning technique depending on only labeled trials. Its generalization performance deteriorates due to overfitting occurred when the number of training trials is small. On the other hand, a large number of unlabeled trials are relatively easy to obtain. In this paper, we contribute a comprehensive learning scheme of CSP (cCSP) that learns on both labeled and unlabeled trials. cCSP regularizes the objective function of CSP by preserving the temporal relationship among samples of unlabeled trials in terms of linear representation. The intrinsically temporal structure is characterized by an graph. As a result, the temporal correlation information of unlabeled trials is incorporated into CSP, yielding enhanced generalization capacity. Interestingly, the regularizer of cCSP can be interpreted as minimizing a nontask related EEG component, which helps cCSP alleviate nonstationarities. Experiment results of single-trial EEG classification on publicly available EEG datasets confirm the effectiveness of the proposed method.