|
From: | Yohann Pitrey |
Subject: | Re: paragraph fill and arguments |
Date: | Sat, 21 Apr 2007 13:03:10 +0200 |
User-agent: | Thunderbird 1.5.0.10 (Windows/20070221) |
Thanks for your answers, but i'm sorry, none of them seems to work. first, I tried to write : (defun justify () (command-execute 'mark-paragraph) (command-execute 'fill-region-as-paragraph) ) second, as it didn't work (same error message), i tried this one : (defun justify () (interactive) (mark-paragraph) (fill-region-as-paragraph (point) (mark)) ) and no more did it work. any idea? i admit i am completely lost! Stefan Monnier a écrit :
I a m trying to make my own fill paragraph command, which i want to be an equivalent of :'M-x mark-paragraph' and then 'M-x fill-region-as-paragraph'These are equivalent to (command-execute 'mark-paragraph) and (command-execute 'fill-region-as-paragraph) The `command-execute' function uses the `interactive' form inside the command to build a list of arguments and then calls the function with those arguments.(defun justify () (interactive) (mark-paragraph) (fill-region-as-paragraph))Here on the other hand, you directly call those commands as function, so if you want to use this form, you need to pass them arguments "manually". Stefan
>> how do I get the from an to points of the paragraph? >Try >(defun justify () > (interactive) > (mark-paragraph) > (fill-region-as-paragraph (point) (mark)))
[Prev in Thread] | Current Thread | [Next in Thread] |