Next: , Previous: , Up: トップレベルの定義、またはdefun   [Contents][Index]


28.2.3 Moving by Sentences

These commands move point or set up the region based on units of code, also called sentences. Even though sentences are usually considered when writing human languages, Emacs can use the same commands to move over certain constructs in programming languages (see センテンス, see defunの移動). In a programming language a sentence is usually a complete language construct smaller than defuns, but larger than sexps (see List Motion in The Emacs Lisp Reference Manual). What exactly is a sentence in this case depends on the programming language, but usually it is a complete statement, such as a variable definition and initialization, or a conditional statement. An example of a sentence in the C language could be

int x = 5;

or in the JavaScript language it could look like

const thing = () => console.log("Hi");
const foo = [1] == '1'
  ? "No way"
  : "...";

M-a

Move to beginning of current or preceding sentence (backward-sentence).

M-e

Move to end of current or following sentence (forward-sentence).

The commands to move to the beginning and end of the current sentence are M-a (backward-sentence) and M-e (forward-sentence). If you repeat one of these commands, or use a positive numeric argument, each repetition moves to the next sentence in the direction of motion.

M-a with a negative argument -n moves forward n times to the next end of a sentence. Likewise, M-e with a negative argument moves back to the start of a sentence.


Next: Imenuとは, Previous: defunの移動, Up: トップレベルの定義、またはdefun   [Contents][Index]

This page has generated for branch:work/master_4078d0fd3ee9e55c3da219aa6e7788ac6130697b, commit:c7db2a384198d0c98b496ec88317efbf77a2fb57 to check Japanese translation.