emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [feature request] org-at-timestamp-p should accept multiple parameters
@ 2020-08-02 10:54 Adam Faryna
  2020-09-05  8:31 ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Faryna @ 2020-08-02 10:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

Hi,

recently I was doing some customization and I needed to check if timestamp
at a point is active or inactive. That timestamp also contains an agenda
like information about reoccurring.

So I tried to use org-at-timestamp-p function for this purpose.

The problem is I needed to check if the timestamp is agenda like and
inactive or ignore the context at the same time. But org-at-timestamp-p
takes only one parameter, and I needed to give it multiple parameters,
which is not possible in the current version.

Can you amend the implementation of org-at-timestamp-p to make it accept a
list of parameters or named parameters instead of just one parameter?

Thanks,
Adam

[-- Attachment #2: Type: text/html, Size: 728 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] org-at-timestamp-p should accept multiple parameters
  2020-08-02 10:54 [feature request] org-at-timestamp-p should accept multiple parameters Adam Faryna
@ 2020-09-05  8:31 ` Bastien
       [not found]   ` <CABEF3YFSNh8avFYjTSQ-Eww2qRAxt7+6OWHzjy25Ncd1MTgXkA@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2020-09-05  8:31 UTC (permalink / raw)
  To: Adam Faryna; +Cc: emacs-orgmode

Hi Adam,

Adam Faryna <adamfaryna@gmail.com> writes:

> The problem is I needed to check if the timestamp is agenda like and
> inactive or ignore the context at the same time. But
> org-at-timestamp-p takes only one parameter, and I needed to give it
> multiple parameters, which is not possible in the current version.

Can you show the first of org-at-timestamp-p you would need for your
purpose? 

Does it solve a general problem?

> Can you amend the implementation of org-at-timestamp-p to make it
> accept a list of parameters or named parameters instead of just one
> parameter?

We cannot amend the implementation of org-at-timestamp-p just for
flexibility's sake, because there would be no good reason not to 
change other functions as well.

If you have a generic change to propose to org-at-timestamp-p please
go ahead.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] org-at-timestamp-p should accept multiple parameters
       [not found]     ` <87v9gse5ve.fsf@bzg.fr>
@ 2020-09-08 13:28       ` Adam Faryna
  2020-09-08 14:26         ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Faryna @ 2020-09-08 13:28 UTC (permalink / raw)
  To: Bastien, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

I think the problem is general. If you work with any timestamp that is
agenda like, you can't check using this function if it's active or
inactive. The one solution would be to remove parameter "agenda" and
consider every timestamp as a agenda like (the "timestamp" in "
org-at-timestamp-p" suggest that there is time information in it anyway) by
default, or keep it as it is but extend parameter list with support of
named parameters where agenda-like can be activated with :agenda t,
inactive timestamp with :inactive t, with default values nil.

Thanks,
Adam

On Sat, 5 Sep 2020 at 13:59, Bastien <bzg@gnu.org> wrote:

> Hi Adam,
>
> you forgot to copy the emacs-orgmode list - can you repost your email
> there?
>
> Thanks,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1158 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] org-at-timestamp-p should accept multiple parameters
  2020-09-08 13:28       ` Adam Faryna
@ 2020-09-08 14:26         ` Bastien
  2020-09-08 15:57           ` Adam Faryna
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2020-09-08 14:26 UTC (permalink / raw)
  To: Adam Faryna; +Cc: emacs-orgmode

Hi Adam,

thanks, but I still need to understand the exact change you suggest
and what general fix/improvement it will provide.  Probably a patch 
will be easier to understand for this.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] org-at-timestamp-p should accept multiple parameters
  2020-09-08 14:26         ` Bastien
@ 2020-09-08 15:57           ` Adam Faryna
  2020-09-09  8:13             ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Faryna @ 2020-09-08 15:57 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

Ok, maybe I misunderstood the purpose of this function. I wanted to use it
to check if the timestamp is active or inactive and I tried to get it by
using (org-at-timestamp-p 'inactive) while pointing at the timestamp. But
actually when I call it on any timestamp like [2020-09-04 Fri], <2020-09-04
Fri> I always get nil. So either it's a bug, or I miss something.

Thanks,

Adam

On Tue, 8 Sep 2020 at 15:26, Bastien <bzg@gnu.org> wrote:

> Hi Adam,
>
> thanks, but I still need to understand the exact change you suggest
> and what general fix/improvement it will provide.  Probably a patch
> will be easier to understand for this.
>
> Thanks,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1048 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] org-at-timestamp-p should accept multiple parameters
  2020-09-08 15:57           ` Adam Faryna
@ 2020-09-09  8:13             ` Bastien
  2020-09-09 11:04               ` Adam Faryna
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2020-09-09  8:13 UTC (permalink / raw)
  To: Adam Faryna; +Cc: emacs-orgmode

Hi Adam,

Adam Faryna <adamfaryna@gmail.com> writes:

> Ok, maybe I misunderstood the purpose of this function. I wanted to
> use it to check if the timestamp is active or inactive and I tried to
> get it by using (org-at-timestamp-p 'inactive) while pointing at the
> timestamp. But actually when I call it on any timestamp like
> [2020-09-04 Fri], <2020-09-04 Fri> I always get nil. So either it's a
> bug, or I miss something.

(org-at-timestamp-p) returns t on an active timestamp.

(org-at-timestamp-p 'inactive) returns t on any timestamp, including
inactive ones.

If you think the docstring could be enhanced, can you share a patch?

See https://orgmode.org/worg/org-contribute.html on how to contribute.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [feature request] org-at-timestamp-p should accept multiple parameters
  2020-09-09  8:13             ` Bastien
@ 2020-09-09 11:04               ` Adam Faryna
  0 siblings, 0 replies; 7+ messages in thread
From: Adam Faryna @ 2020-09-09 11:04 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

Thanks. I understand now.

I think to generate a patch in this case it's too much hustle, for a minor
benefit.

--
Adam

On Wed, 9 Sep 2020 at 09:13, Bastien <bzg@gnu.org> wrote:

> Hi Adam,
>
> Adam Faryna <adamfaryna@gmail.com> writes:
>
> > Ok, maybe I misunderstood the purpose of this function. I wanted to
> > use it to check if the timestamp is active or inactive and I tried to
> > get it by using (org-at-timestamp-p 'inactive) while pointing at the
> > timestamp. But actually when I call it on any timestamp like
> > [2020-09-04 Fri], <2020-09-04 Fri> I always get nil. So either it's a
> > bug, or I miss something.
>
> (org-at-timestamp-p) returns t on an active timestamp.
>
> (org-at-timestamp-p 'inactive) returns t on any timestamp, including
> inactive ones.
>
> If you think the docstring could be enhanced, can you share a patch?
>
> See https://orgmode.org/worg/org-contribute.html on how to contribute.
>
> Thanks,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1577 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-09 11:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-02 10:54 [feature request] org-at-timestamp-p should accept multiple parameters Adam Faryna
2020-09-05  8:31 ` Bastien
     [not found]   ` <CABEF3YFSNh8avFYjTSQ-Eww2qRAxt7+6OWHzjy25Ncd1MTgXkA@mail.gmail.com>
     [not found]     ` <87v9gse5ve.fsf@bzg.fr>
2020-09-08 13:28       ` Adam Faryna
2020-09-08 14:26         ` Bastien
2020-09-08 15:57           ` Adam Faryna
2020-09-09  8:13             ` Bastien
2020-09-09 11:04               ` Adam Faryna

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).