CPSC170 Lecture 26

Linked Lists, Specialization

Links

In-Class Activities

Activity 1: Pre/Post Conditions
Activity 2: A Special Linked List

Emacs Commands

When you are copy and pasting large blocks of code, usually something is not right. Knowing how to copy and paste, for code re-factoring, is a useful skill to know. The following commands will speed up your copy/paste abilities.

  • Set mark: C-<SPC>
    Where <SPC> is the space bar. This sets a mark in the buffer. You can then move your cursor around the buffer, effectively "highlighting" everything from the mark, to the current cursor location.
  • Copy "highlighted" region: M-w
  • Kill (cut) "highlighted" region: C-w
  • Yank (paste): C-y
  • (Bonus Command) yank-pop: M-y
    If what you most recently killed was not what you wanted to paste, you can perform a yank-pop. This command only works after a yank. It allows you to cycle through previous kills at the location of the yank.
    Note: Bonus meaning for your knowledge. This command will not be on the quiz.