[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DWIM region
From: |
Emanuel Berg |
Subject: |
Re: DWIM region |
Date: |
Sun, 07 Jan 2018 04:25:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
OK, I spoke to soon! There were *two* cases
I didn't change. Here is the second one.
The reason I didn't change this is the use of
the prefix argument.
If there is no interactive string, does that
mean one has to check manually in the
interactive form for a/the prefix argument?
PS. Pretty cool code, ey? :)
(defun fill-down (&optional justify)
"Fill the current paragraph from the current line down.\n
With mark active, act upon the region instead.\n
With \\[universal-argument] before invocation, JUSTIFY fully.
With \\[universal-argument] twice, remove full justification. (Or just fill it!)
With \\[universal-argument] thrice, center."
(interactive "P")
(let*((area (if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (save-excursion
(forward-paragraph)
(point) ))))
(start (car area))
(end (cadr area)) )
;; C-u C-u -> unjustify
(if (equal justify '(16))
(canonically-space-region start end)
(fill-region start end
;; can't use cl-case here as compares with `elq' - bummer!
(cond ((equal justify '(0)) nil) ; fill
((equal justify '(4)) 'full) ; C-u -> justify
((equal justify '(64)) 'center)) ; C-u C-u C-u -> center
))))
--
underground experts united
http://user.it.uu.se/~embe8573
- Re: DWIM region, (continued)
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/05
- Re: DWIM region, Stefan Monnier, 2018/01/05
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/05
- Re: DWIM region, Stefan Monnier, 2018/01/06
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/06
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/06
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/06
- Re: DWIM region, Emanuel Berg, 2018/01/06
- Re: DWIM region,
Emanuel Berg <=
- Re: DWIM region, Stefan Monnier, 2018/01/08
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/08
- Re: DWIM region, Stefan Monnier, 2018/01/08
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/08
- Re: DWIM region, Stefan Monnier, 2018/01/09
- Re: DWIM region, Stefan Monnier, 2018/01/08
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/08
- Re: DWIM region, Stefan Monnier, 2018/01/08
- Message not available
- Re: DWIM region, Emanuel Berg, 2018/01/04
- Re: DWIM region (was: Re: count regexp hits), Marcin Borkowski, 2018/01/07