emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug: Function org-heading-components is not resilient [9.4.3 (9.4.3-


From: Jean Louis
Subject: Re: Bug: Function org-heading-components is not resilient [9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/)]
Date: Sun, 18 Dec 2022 10:39:56 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Tim Cross <theophilusx@gmail.com> [2022-12-18 04:26]:
> > M-x org-id-get-create
> 
> I think this is an unrealistic expectation. We have sufficient
> challenges ensuring org functions work within org buffers without adding
> the additional burden of expectation they would work outside these
> buffers where there is no guarantee of syntax or formatting
> constraints.

I understand.

Org commands could get slowly or speedy adopted not to be shown in
other modes by using the recent development of the command
`interactive'

interactive is a special form in ‘C source code’.

(interactive &optional ARG-DESCRIPTOR &rest MODES)

If MODES is present, it should be a list of mode names (symbols) that
this command is applicable for.  The main effect of this is that
‘M-x TAB’ (by default) won’t list this command if the current buffer’s
mode doesn’t match the list.  That is, if either the major mode isn’t
derived from them, or (when it’s a minor mode) the mode isn’t in effect.

> If you find some org functions work outside of org buffers, that is just
> happenstance. There is no inconsistency here. Many other modes have
> functions which will also work to varying degrees outside the specific
> mode for which it was written. That does not mean you should use them
> outside the mode they were designed for. If you do use them, it is at
> your own risk.
> 
> An expectation that a function will work outside the mode it was
> designed for is a user error of expectation not a mode error. 

That may be said so, though I see that rather as neglect by design and
lack of checks. If we speak of functions that are not interactive,
your statement applies. 

If we speak of interactive functions, they are accessible to users,
they should not be if the function does not apply.

M-x org-agenda-Quit -- it is good example, why have a function that
quits and leave it to user to invoke it in any other mode?

> This error in understanding is likely due to the lack of real name space
> support in Emacs. If we had real name spaces, org functions would not be
> visible outside of org modes. Unfortunately, Emacs doesn't have such a
> concept, so it is down to users respecting the conventions. One of those
> conventions is not to use mode specific functions outside the mode they
> were designed for. 

As you can see the `interactive' function already has that
functionality.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]