Gerald Wildgruber <wildgru...@tu-berlin.de> writes:

[...]

> Yet, I can't get any result: upon evaluating the "let" in the scratch
> buffer, I just get "nil" in the echo area, and nothing else has
> happened, none of the files in the directory is touched.
>
> @Nikolay: can you confirm that this worked for you?

I can confirm that it worked on my end.  But...

> Same thing with a single file:
>
> (let ((fill-column most-positive-fixnum))
>   (dolist (f (list "~/lorem.org"))
>     (with-current-buffer (find-file-noselect f)
>       (while (not (eobp))
>         (fill-paragraph)
>         (org-forward-paragraph))
>       (save-buffer))))

here are two ways I could make the above code fail:

  1) If the buffer for the file is already open and point is after the
     text.

     It seems your code should call `(goto-char (point-min))' and, if
     you care, restore it afterwards.

  2) Your code doesn't account for hidden text in the buffer.  You could
     call `(org-show-all)'.

I suspect #2 is why you're not seeing the results you expect.

-- 
Kyle

Reply via email to