Re: [O] Generate and fill PDF-forms by org-mode?!

2024-07-18 Thread Ihor Radchenko
Balaji Bikshandi  writes:

> I use a transparent terminal over the PDF and then screenshot it!
>
> This is, as you would expect, an ultralight and ultrafast solution. 
>
> In fact, I use mupdf to open the PDF, then open the venerable SC spreadsheet 
> calculator in a transparent terminal over it. Once ‘filled’, I just take a 
> screenshot! Then use Imagemagick to convert it.

Interesting.
May you expand a bit on how exactly you do it?

In particular, how does Org mode enter the picture? I imagine that you
need to align the text layout in the Org file to fit the underlying PDF,
but I am not sure if Org is the most suitable program to achieve such
alignment. Something like M-x artist-mode might probably be more flexible.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Pending contents in org documents

2024-07-18 Thread Bruno Barbier


Hi Ihor,

Ihor Radchenko  writes:

> Bruno Barbier  writes:
>
>> I added a function 'org-pending-unlock-NOW!' which unlock the region
>> immediately.  The uppercase "NOW!" emphasizes that it's not the
>> "safe" way to unlock a region.
>
> I expect to see this function called by some kind of button in the
> details buffer, so that users can actually call it.

This function should not be used, not even in code, except to work
around bugs.  I would prefer not to provide a button for it.


> Also, a few more small comments on the commentary section:
>
>> ;; The library makes locks visible to the user using text properties
>> ;; and/or overlays.  It diplays and updates the status while the
> * displays

Thanks.


>> ;; If the user kills a buffer, or, kills Emacs, some locks may have to
>> ;; be destroyed.  The library will ask the user to confirm if an
>> ;; operation requires to destroy some locks.  See the field
>> ;; `before-destroy-function' of REGLOCK object, if you need to do
>> ;; something before a lock is destroyed.
>
> We should provide a user option to suppress the query. Something like
> what `confirm-kill-processes' does. Maybe even support something akin
> `process-query-on-exit-flag', but for reglocks.

IMHO, it's the package that uses org-pending that should provide such a
feature: I may not care about loosing data by ignoring on-going code
block executions, but, I'll probably care if Emacs aborts some money
transfers.


>
>> ... feel free to look at the docstrings of the
>> ;; cl-defstruct `org-pending-reglock' for the full documentation.
>
> Maybe better refer to M-x cl-describe-type org-pending-reglock. It will
> look nicer.

Thanks. I didn't know how to display that documentation actually :)

As this library is for developpers, I've used the syntax:
 (cl-describe-type 'org-pending-reglock)
so that the documentation is only one click away.


>> (cl-defun org-pending (region
>> ...
>> On receiving the outcome (a :success or :failure message, sent with
>> `org-pending-send-update'), remove the region protection.  Call
>> ON-OUTCOME with the reglock and the outcome, from the position from
>> where the REGLOCK was created.  If ON-OUTCOME returns a region (a
>> pair (start position . end position)), use it to report the
>> success/failure using visual hints on that region.  If ON-OUTCOME
>> returns nothing, don't display outcome marks.
>
> Please describe what the default value of ON-OUTCOME (when ON-OUTCOME is
> not explicitly provided) does right in the docstring.

Done.



>> You may set/update the following fields of your reglock to customize its
>> behavior:
>>- Emacs may have to destroy your locks; see the field
>>  `before-destroy-function' if you wish to do something before your
>>  lock is destroyed.
>>- The user may ask Emacs to cancel your lock; see the field
>>  `user-cancel-function' to override the default cancel function.
>>- The user may request a description of the lock; see the the field
>>  `insert-details-function' to add custom information when your
>>  lock is displayed to the user.
>> 
>> You may add/update your own properties to your reglock using the field
>> `properties', which is an association list.
>
> Here, we may also refer to cl-describe-type for more details about the fields.

Done.



>>   ( user-cancel-function nil
>> :documentation
>> "Function called when the user wish to cancel this REGLOCK,
>> with the REGLOCK as argument.  This function must return immediately; it
>> may, asynchronously, stop some processing and release resources; and,
>> once this is done, it should send the outcome to the REGLOCK (using
>> `org-pending-send-update', so that the region is unlocked and the
>> REGLOCK destroyed). The default value is
>> `org-pending--user-cancel-default'" )
>
> How come the default value is `org-pending--user-cancel-default' when it
> is nil?

The only way to build a lock is to use the function 'org-pending'; and
that function was setting it to that value.  I've moved the setting
to the defstruct definition.


>> (cl-defstruct (org-pending-reglock
>> ...
>
> It would be nice to define slot types for each slot.

I added that to my todo list: I'll have to learn how to write types in
elisp (or common lisp?) to be able to do that (... the very bottom of my
list :)
)


>>  insert-details-function nil
>> When non-nil, function called to insert custom details at the end of
>> ‘org-pending-describe-reglock’.  The function is called with a REGLOCK,
>> a START position and an END position, it must insert details at
>> point. Assuming B is a (virtual) buffer containing all detailed human
>> readable information, insert at point details from START to END.  Handle
>> cases where START, END are nil or out of bounds without raising an
>> error.  The function may use text properties, overlays, etc.  See
>> ‘org-pending-describe-reglock’
>
> From this description, my understanding is tha

Re: [BUG] Org parser error: invalid search bound (wrong side of point) [9.7.7 (9.7.7-1ee080 @ /home/talmage/.emacs.d/elpa/org-9.7.7/)]

2024-07-18 Thread David Talmage
On Thursday, July 18, 2024 1:57:50 AM CDT Ihor Radchenko wrote:
> David Talmage  writes:
> > What I did: I visited Planning.org, a big Org Mode file I use to plan an
> > extended motorcycle trip.
> > 
> > What I expected: Emacs would load Planning.org, handing it off to Org
> > Mode to Do The Right Thing, as it usually does.
> > 
> > What occurred: Emacs complained of a parsing error.
> 
> Thanks for reporting!
> Are you seeing this problem frequently?

Yesterday, I saw it every time I loaded Planning.org.  Today, I loaded the file 
and Emacs didn't complain.  I'll send more info when I have it.  At the 
moment, I'm inclined to believe that this is one of my Linux Surface Pro 
tablet's many quirks.








Re: Experimental public branch for inline special blocks

2024-07-18 Thread Juan Manuel Macías
Ihor Radchenko writes:

> Juan Manuel Macías  writes:
>
>> Well, next week I will continue commenting. I will try to stay up to
>> date with everything that is being discussed here. By the way, if
>> someone wants to collaborate on the branch, I can add them as a
>> contributor (I'm afraid it is necessary to have a GitLab account, if
>> I'm not mistaken).
>
> It has been quite a while since the last activity in this thread.
> Juan, may I know if you had a chance to work on the branch?

Hi, Ihor,

Thanks for your reminder. I'm sorry for all this long time that I've
been inactive and unresponsive, but the last few months I have had a lot
of work, in addition to other personal circumstances that have kept me
busy. I haven't had time to follow the list or deal with the branch. I
had planned to respond to your comments now in the summer (and I will
probably do so in the next few days), but I am afraid that until
September I will not be able to participate actively or continuously on
the list.

Of course, if someone wants to actively collaborate in the development
of this branch, I have no problem. If necessary, I also have no
objection to moving the repository to another more ‘open’ place (in Gitlab
it is necessary to have an account to collaborate).

Best regards,

Juan Manuel 

-- 
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
editorial y ortotipografía