unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15287: Diary format is Fuzzily defined.
@ 2013-09-06 10:04 Jambunathan K
  2013-11-15  4:56 ` Jambunathan K
  0 siblings, 1 reply; 2+ messages in thread
From: Jambunathan K @ 2013-09-06 10:04 UTC (permalink / raw)
  To: 15287

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


Executive summary:


Diary helps you to intermix personal journal/notes with appointments
right in the *same* entry.  This nuance - which I can put to good use -
is not clarified in the Info manual.  (What a pity!)

It is difficult to explain over email.  So I will give an example and
ask some questions.  I will appreciate some insights from long-time
Diary users.

----------------------------------------------------------------
Claimer:


Consider this a request for a bug fix, an articulation of a use-case, an
adjunct to the manual or even ramblings of a deluded man.

----------------------------------------------------------------
Diary format is Fuzzy?


Diary format is Fuzzily defined.  By fuzzily, I mean there are some
loose edges.

I have consulted the documentation below:

  1. C-h v diary-file 
  2. (info "(emacs) Format of Diary File")

       Lines that do not begin with valid dates and do not continue a
       preceding entry are ignored.

It is difficult to explain over mail.  Here I give 

  - A statement of the problem

  - An example file and followup questions to clarify the purpose of
    this report.

  - Some possibilities that it opens up.

----------------------------------------------------------------
Problems articulated:


Broadly, I see two problems.

1. The term "entry" is fuzzily defined.  For example, what is the scope
   of an entry. i.e., where does it begin where does it end.

2. Diary docstrings suggests that format is "line-oriented".  In fact,
   it looks like it is not line-oriented, but is separated in to active
   and inactive portions.  An active part (the one that is shown in
   Fancy diary display) and an inactive part which is skipped over.

(2) above can be put to good use.  

For example, by introducing an empty-line in-and-of itself and thereby
"breaking" an active region, I should be able to keep a personal journal
or technical notes right in the diary file and have it never contribute
to the agenda.

----------------------------------------------------------------

jambu.diary: An example diary file. 

Put the above file in whitespace-mode so that you can visualize the
newlines and spaces.  Pay particular attention to lines that "look"
empty but actually has SPCs in them.  This is IMPORTANT.

Q: How many entries that  the diary has?
A: 3, as I see it.  The canonical diary format doesn't make it clear how
   many entries in fact there are.

Q: To what entries items (c) and (d) belong.  Likewise for (f), (g) and
   (h).
A: Common sense says they "stick" to the immediate preceding paragraph
   introduced by a date.  They are inactive fragments - meaning they
   don't contribute to agenda.

IMHO, the diary format doesn't help to answer these questions.  I
believe it will be helpful to explicitly clarify the philosophical
motivation for the diary format (and for use-cases that it serves)

----------------------------------------------------------------
Possibilities:

1. The TODO mode builds upon the base diary format in 3 levels.  

   It introducea categories (which are sub-diaries or sections) and
   todo/done states (which are but sections within a sub-diary i.e.,
   sub-sections.)

2. Defining what an entry is clarifying and differentiating or not
   differentiating between active and inactive portions can help with
   primitive operations like:

   - Marking an entry.
   - Marking an active portion.
   - Moving up or down of an entry
   - Copying an entry to another file (either for re-filing, archiving
     etc.)

For example, here is a screenshot which highlights the "active part" of
an entry using `hl-line-mode' and a custom `hl-line-range-function'.  I
will not post a snippet because it was explicitly insisted by the list
maintainers.


[-- Attachment #2: intermix-diary-and-journal.png --]
[-- Type: image/png, Size: 149081 bytes --]

[-- Attachment #3: Type: text/plain, Size: 82 bytes --]


----------------------------------------------------------------

Attachments:



[-- Attachment #4: jambu.diary --]
[-- Type: application/octet-stream, Size: 845 bytes --]

;;; -*- mode: diary; -*-
Sep 6, 2013 Testing
    
    a) This paragraph starts on column 4.  This paragraph is preceded
    by an empty line with just 4 SPCs.
    
    b) This paragraph starts on column 4.  This paragraph is also
    preceded by an empty line just 4 SPCs.

    c) This paragraph starts on column 4.  This is preceded by just an
    empty line.
    
    d) This is the forth text paragraph.  This is preceded by an empty
    line with just 4 SPCs.
    
Sep 7, 2013 Another diary entry
    
    e) This paragraph starts on column 4.  This paragraph is preceded
    by an empty line with just 4 SPCs.
    
f) This paragraph starts on column 0.  This paragraph is preceded
by an empty line with just 4 SPCS.
    
    g) This paragraph starts on column 4.
    
    h) This paragraph starts on column 4.
Sep 9, 2013 Another date entry

[-- Attachment #5: Type: text/plain, Size: 742 bytes --]


Here is the fancy diary display for the above file.

--8<---------------cut here---------------start------------->8---
Friday, September 6, 2013
=========================
Testing
    
    a) This paragraph starts on column 4.  This paragraph is preceded
    by an empty line with just 4 SPCs.
    
    b) This paragraph starts on column 4.  This paragraph is also
    preceded by an empty line just 4 SPCs.

Saturday, September 7, 2013
===========================
Another diary entry
    
    e) This paragraph starts on column 4.  This paragraph is preceded
    by an empty line with just 4 SPCs.
    

Monday, September 9, 2013
=========================
Another date entry
--8<---------------cut here---------------end--------------->8---

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

* bug#15287: Diary format is Fuzzily defined.
  2013-09-06 10:04 bug#15287: Diary format is Fuzzily defined Jambunathan K
@ 2013-11-15  4:56 ` Jambunathan K
  0 siblings, 0 replies; 2+ messages in thread
From: Jambunathan K @ 2013-11-15  4:56 UTC (permalink / raw)
  To: 15287-done


OP here.  Closed.





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

end of thread, other threads:[~2013-11-15  4:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 10:04 bug#15287: Diary format is Fuzzily defined Jambunathan K
2013-11-15  4:56 ` Jambunathan K

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

	https://git.savannah.gnu.org/cgit/emacs.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).