Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun 11f-end-line-or-para (&optional arg)
- "Move cursor end of current line, or end of current paragraph,
- respecting `paragraph-start' and `paragraph-separate' by use of
- `forward-paragraph'.
- When pressed repeatedly, moves down the 'outside' of paragraphs.
- This is slightly different to `xah-fly-keys's
- `xah-end-of-line-or-block', but such behaviour can be simulated by
- giving the optional argument, or using the prefix-command.
- Improvements over xah-fly-keys:
- - More common to add text to end of paragraph rather than start when moving forwards.
- - Allows less-common paragraphing styles, such as with *roff commands in `nroff-mode'.
- - Skips whitespace at end of lines (may be unnecessary).
- "
- (interactive)
- (if (or (equal (point) (line-end-position))
- (eq last-command this-command))
- (if (or current-prefix-arg arg)
- (progn
- (forward-paragraph)
- (skip-chars-forward "\t\n "))
- (progn
- (forward-line)
- (forward-paragraph)
- (skip-chars-backward "\t\n ")))
- (end-of-line)
- (skip-chars-backward "\t ")))
- (defun 11f-start-line-or-para (&optional arg)
- "Move cursor beginning of current line, or end of current paragraph,
- respecting `paragraph-start' and `paragraph-separate' by use of
- `forward-paragraph'.
- When pressed repeatedly, moves up the 'inside' of the paragraphs.
- This is slightly different to `xah-fly-keys's
- `xah-beginning-of-line-or-block', but such behaviour can be simulated
- by giving the optional argument, or using the prefix-command.
- Improvements over xah-fly-keys:
- - Allows less-common paragraphing styles, such as with *roff commands in `nroff-mode'.
- - Skips whitespace and indentation.
- - Allows easier access to first line of paragraph.
- "
- (interactive)
- (if (or (equal (point) (line-beginning-position))
- (eq last-command this-command))
- (if (or current-prefix-arg arg)
- (progn
- (backward-paragraph)
- (skip-chars-backward "\t\n "))
- (progn
- (forward-line -1)
- (backward-paragraph)
- (skip-chars-forward "\t\n ")))
- ;; (beginning-of-line)
- ;; (skip-chars-forward "\t "))
- (beginning-of-line-text)))
- (global-set-key (quote [f5]) '11f-start-line-or-para)
- (global-set-key (quote [f6]) '11f-end-line-or-para)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement