Re: [O] WISH: SQL on org-mode tables

2013-08-20 Thread SAKURAI Masashi
Hi,

I wrote a full DB browser in Emacs, EDBI https://github.com/kiwanami/emacs-edbi.

This program provides DB Query API (like Perl's DBI) and table layout framework.
One can query any SQL and layout the results into a rigid table format.
There is no document for API, please see the demo code.
https://github.com/kiwanami/emacs-edbi/blob/master/edbi-demo.el

I don't have a time to integrate it into org-mode,
if someone would write the code, I think I can help a little.


Regards
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net


At Sun, 18 Aug 2013 16:06:43 +0200,
Johan W. Kl$(D+d(Bwer wrote:
 
 [1  text/plain; ISO-8859-1 (7bit)]
 
 [2  text/html; ISO-8859-1 (quoted-printable)]
 I wish it were possible to execute SQL on tables in org-mode buffers. 
 Filtering rows and columns,
 joining values across named tables, and so forth could be done with SQL in 
 the org-table SEND
 clauses.
 
 There's a script called csvsql that allows for executing SQL on comma- or 
 tab-separated files from
 the command-line (using the H2 database engine): 
 https://github.com/jdurbin/durbinlib/wiki/csvsql.
 I'm thinking csvsql or similar could provide the query capability, and 
 org-mode would take care of
 sending it org tables in tab separated format.
 
 That's my wish.
 
 Cheers
 
 Johan
 
 



Re: [O] Add agenda entries into diary to export weelky calendar

2013-02-28 Thread SAKURAI Masashi
Hi Torsten,

 I gave calfw a new try yesterday. It works well now and I really like it!
 I tried to do, as you suggested, a export via htmlfontify-buffer. 
 It seems like it has problems with the cell alignment for those cells which 
 contain an
 appointment.
 Please see the attached picture (I can send you the html file in a private 
 mail if you are
 interested to see the html code).
 Could be the trouble of a non-monospace font, As far as I know Japanese fonts 
 are monospace?

Calfw assumes that the calfw buffer uses the monospace font.
If you usually use proportional fonts in emacs, you can change the buffer font
with cfw:calendar-mode-hook.

Ref: Re: [O] Calendar-like view of the org-agenda
http://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg00882.html


 The generic htmlfontify-buffer might be a bit to simple. E.g. as you can see 
 in the image, I use a
 dark colour scheme in emacs. This is also used in the export, making it 
 difficult to print. 
 How about a real export function in calfw? Similar to what the calendar/diary 
 offers.
 I could help to work on a LaTeX template using graphical elements e.g. by 
 using TikZ [1]. 
 There are SVG-based generators and solutions written in python as well.
 However, I have no idea how move the data of calfw into a template or into 
 such a script.
 My elisp knowledge is almost non existing.

Calfw has extension point for the many view styles, however I think it
is not easy to implement. Anyway, I will consider the function
cfw:export-view-to-org which is mentioned by the another message.


Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Add agenda entries into diary to export weelky calendar

2013-02-25 Thread SAKURAI Masashi
Hi,

 Alternatives:
 I read about calfw and org2hpda. However, I did not found a way to generate a 
 printable version of
 calfw (and I had trouble to set it up). For org2hpda I still struggle with 
 the installation and it
 seems to be broken at the moment. Not sure.

I'm an author of calfw. I would help you about calfw.

After displaying your calfw buffer, you can get a HTML buffer 
with M-x htmlfontify-buffer.


Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Cal-fw info file?

2012-10-31 Thread SAKURAI Masashi
Hi Johnny,

Thank you for your contribution!
There is no info document for calfw now.
I also think that the info document is easy to access from Emacs.

 However, I really enjoy having an info file around as a reference and
 would rather not refer to other loose files on the system. So I was
 wondering if there is a texinfo file already for cal-fw, or there is a
 plan/interest in developing one?
 
 Nonetheless, it's time to learn som texinfo, so I plunged ahead and
 created a skeleton from the available information. 

I can merge your commits on the github.
How can I help you?


thank you,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] calfw, get rid of file names

2012-06-12 Thread SAKURAI Masashi
Hi,

I'm sorry for my late response.

At Tue, 12 Jun 2012 12:14:29 -0700,
Kyle Machulis wrote:
 :
 But yeah, that is definitely a way to change the output, but on
 further inspection it doesn't look like the right one. If you check
 out calfw-org.el, there's a useful defvar,
 cfw:org-schedule-summary-transformer. This allows you to write your
 own summary line transformer without even needing to advise, so you
 could just copy cfw:org-summary-format, chop it up to your hearts
 content, then set the variable without modifying the package at all.
 I'll probably do this myself.

Yes. That is my intent for customization.

However, I think calfw-org should be improved for better integration
between org-mode and calfw.

Because I'm not an user of the org-mode scheduling (I'm using howm
mainly), I have little idea for better summarizing the items and
calfw-org customization.

If you give me some idea or patches, I would include them.
(I may have to involve org-mode users for integration...)


Thank you,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net




Re: [O] Simple reference card browser by Anything.el

2011-12-12 Thread SAKURAI Masashi
Hi Tassilo,

Thank you for your advice!
I'm going to discuss this topic at emacs-anything ML.

 
Thanks,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Simple reference card browser by Anything.el

2011-12-11 Thread SAKURAI Masashi
Hi Bastien,

Thank you for your comment.
If I can contribute this program, I'll be glad.

How should I do, Tassilo?

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net


At Sun, 11 Dec 2011 13:23:20 +0100,
Bastien wrote:
 
 Hi Masashi,
 
 SAKURAI Masashi m.saku...@kiwanami.net writes:
 
  I made simple reference browser.
  Just browsing, not executing commands.
 
  https://gist.github.com/1345100
 
 Great -- I think this could be added to the contrib/ directory
 of anything.  Tassilo (Anything's maintainer) is reading this list,
 I think the main repo for anything-config is on repo.or.cz:
 
 http://repo.or.cz/w/anything-config.git
 
 Best,
 
 -- 
  Bastien
 



[O] Simple reference card browser by Anything.el

2011-12-10 Thread SAKURAI Masashi
Hi,

I made simple reference browser.
Just browsing, not executing commands.

https://gist.github.com/1345100

Sample setting:
(eval-after-load org
  '(progn
 (require 'anything-orgcard)
 (define-key org-mode-map (kbd M-4) 'aoc:anything-orgcard)
   ))

Here is a screenshot.
https://cacoo.com/diagrams/pU53GOElYyHbXtpa-0D3F5.png

This program retrieves the reference card for text version.
http://orgmode.org/orgcard.txt
Then, parses simply and just makes it enumerate for anything.


--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] [calfw] Better use of space

2011-09-07 Thread SAKURAI Masashi
Thanks for your comment!

At Wed, 07 Sep 2011 10:32:48 +0200,
Rasmus wrote:
 :
 
 Emacs has several built-in word wrapping mechanisms.  See
Options → Line Wrapping in this buffer 
 for an overview.  My preferred method is Word Wrap.  Whether this can
easily be utilized by calfw I don't know.

Yes. I seem this word wrapping algorithm is a simple one (it may be
the same as 'fill-region'), which is shown at the Wikipedia. To fill
out the narrow space efficiently, I think hyphenation is needed.
I will continue to search the better algorithm.


  If you have a time, will you check it out?
  I would like to hear feeling from the not East Asians users,
  using line breaking without no smart word-wrapping and hyphenation.
 
 It works okay.  The problem is not so much the line breaking as the lack
 of appropriately segregating entries.  
 
 The following view is decent, and word wrap certainly improves
 the ease of obtaining information:
http://ompldr.org/vYThpOQ
 
 On the other hand information is not easily obtained from a week with
 lots of scheduled class from a single file: 
http://ompldr.org/vYThpYQ
 
  - An easy solution might be do add a `\n' but this might not always be
desirable.
  - Events could also be separated by lines.
  - Different shades might also be a possibility. Here is a screenshot of
my Gnus group buffer which is striped. 
   http://ompldr.org/vYThpZQ

I think the current look needs to improve in the case of many
schedules too.

Many schedule items, like Japanese TV programs guides...
https://twitter.com/#!/kiwanami/status/110721726375145472/photo/1/large

I'm going to try some improvement, such as inserting a horizontal
line, applying different face on the first lines and shading like gnus
group buffer.

I will inform here again.
Thank you,

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net




Re: [O] [calfw] Better use of space

2011-09-05 Thread SAKURAI Masashi
Hi Rasmus,

I implemented simple multi line breaking.
Here is a screenshot.
http://twitpic.com/6gpgz7/full

I pushed the multiline branch on the github.
https://github.com/kiwanami/emacs-calfw/tree/multiline
(including some minor updating)

I have studied some line breaking algorithms.

- Word wrap - Wikipedia, the free encyclopedia
  - http://en.wikipedia.org/wiki/Word_wrap
- Other implementations
  - Python implementation
  - Perl Text::Reflow 
- The Knuth/Plass line-breaking Algorithm
  - http://defoe.sourceforge.net/folio/knuth-plass.html
- Some command line programs
  - fmt, groff

Then, I found that the complicated algorithms, such as 'Knuth/Plass
line-breaking Algorithm', are difficult to implement on the Emacs Lisp
efficiently, because the line breaking function is called many time
during rendering the view.  (I hope that Emacs support native
line-breaking function.)

So, I introduced a pluggable design for the line breaking algorithm
and I just implement simple line breaking code.  I will use this code
for a while and evaluate use-feeling.

If you have a time, will you check it out?
I would like to hear feeling from the not East Asians users,
using line breaking without no smart word-wrapping and hyphenation.


Thank you,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] [calfw] Better use of space

2011-07-24 Thread SAKURAI Masashi
Hi Rasmus,

At Fri, 22 Jul 2011 11:12:46 +0200,
Rasmus wrote:
 :
  * Display multiple-lines items (the source splits an item multiple lines.)
 
  This is not so difficult. In this mechanism, the source objects can
  propose some formats, for example, 15:00 appointment and (15:00-15:30 
  appointment). Then, calfw chooses the suitable format and displays 
  in the current layout algorithm.
 
 It could be a string similar to how BBDB, Gnus and other Emacs mode does
 it. See for example (describe-variable 'gnus-summary-line-format).
 
 User could specify calfw:timeview-format %Starttime-%Endtime: %Event
 or whatever. 

Thanks for references.
I will check them.

  * Word-wrapping and folding lines (calfw splits lines within a column.)
 
  This is little difficult. I think word-wrapping, folding lines and
  truncating strings can not be achieved in the narrow columns
  straightforwardly. I need a time to study this issue.
 
 Hmm, 
 I guess the width of column is calculated when generating the view. 
 I'll use pseudo-code as my Emacs Lisp isn't great.  
 #+begin_src emacs-lisp
   (if ( (calfw:timeview-entry-length) (calfw:column-length))
(#split-entry after column-length, preferbly after word
 # and retur
)
 #+end_src
 I hope it makes sense. . . 

Yes. The code is the start point. I would discuss how to split a line.
I show two simple code as following:
(Note: These codes include Japanese characters.)

* Simple counting and splitting

This code splits words mechanically. I think it is bad for the Western
languages. However, for the Eastern Asian languages, this result is
not bad.

#+begin_src emacs-lisp
(let ((str The quick brown fox jumped over the lazy dog. The 
internationalization and Localization are long words. 日本語を含むときの場合。)
  (fill-column 10))
  (loop with ret = nil
with curcol = 0 with lastpos = 0
with endpos = (1- (length str))
for i from 0 upto endpos
for c = (aref str i)
for w = (char-width c)
if (or (= endpos i) (= fill-column (+ curcol w))) do
(push (substring str lastpos (1+ i)) ret)
(setq lastpos (1+ i) curcol 0)
else do
(incf curcol w)
finally return (mapconcat 'identity (nreverse ret) \n)))
; = 
The quick 
brown fox 
jumped ove
r the lazy
 dog. The 
internatio
nalization
 and Local
ization ar
e long wor
ds. 日本語
を含むとき
の場合。
#+end_src

* Word-wrapping by fill function of Emacs

This splitting is smarter, but not perfect.
Long words are still need truncation or hyphenation.

#+begin_src emacs-lisp
(let ((str The quick brown fox jumped over the lazy dog. The 
internationalization and Localization are long words. 日本語を含むときの場合。)
  (fill-column 10))
  (with-temp-buffer
(insert str)
(fill-region (point-min) (point-max))
(buffer-string)))
; = 
The quick
brown fox
jumped
over the
lazy
dog. The
internationalization
and
Localization
are long
words. 日本
語を含むと
きの場合。
#+end_src


So, I think I should study the word-wrapping algorithm.
If someone knows better algorithm or implementations, please let me
know.

Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net




Re: [O] [calfw] Better use of space

2011-07-22 Thread SAKURAI Masashi
Hi Rasmus,

At Thu, 21 Jul 2011 10:57:45 +0200,
Rasmus wrote:
 :
 I have a feature request for Calfw.
 
 Masashi, would you prefer these to be posted here or on your github
 page?

I like here because I can get more comments than do in other channels.
I'm sorry that other members does not feel noisy.

I can catch both track and I will manage incoming issues and my
progress. Then, I will announce calfw updates here.


 Anyhow, the month view is just superb!
 
 However, when using especially the two week view (and this is probably
 also true for the week view) I would like calfw to utilize vertical
 space better. By 'better' I basically mean that I would like calfw to be
 greedy.
 
 Refer to the following screenshot:
 
http://ompldr.org/vOWtjdA
 
 Compare (the second week) to Google Cal: 
 
http://ompldr.org/vOWtjdg
 
 Seeing there is a lot of space left in each of Calfw's day-column it
 would be nice if it could be used to enhance the overview. This could
 for example be archived mapping events against time on the vertical axis
 as the Google calendar does (and also Mozilla Lightning but it no longer
 work on my system). This might also allow for printing more text from
 the even entry (using multiple lines).

Thanks for your request and good images.
I think this request involves 3 functions.

* Time table layout

I think this function is very difficult, because it needs many study
for me to implement, including following functions.
Of course, I consider the time table view is one of the goal of calfw.

* Display multiple-lines items (the source splits an item multiple lines.)

This is not so difficult. In this mechanism, the source objects can
propose some formats, for example, 15:00 appointment and (15:00-15:30 
appointment). Then, calfw chooses the suitable format and displays 
in the current layout algorithm.

I will design the interface between cfw:source and calfw, and
implement it.

* Word-wrapping and folding lines (calfw splits lines within a column.)

This is little difficult. I think word-wrapping, folding lines and
truncating strings can not be achieved in the narrow columns
straightforwardly. I need a time to study this issue.

 On the other hand we probably also want to make sure that it is still
 works on a 800x600 display. Thus, it might be best to introduce a
 governing variable.

Yes. It is good idea.

Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] New backend for org-agenda: (Was Calendar-like view of the org-agenda)

2011-07-22 Thread SAKURAI Masashi
Hi Bastien,

At Thu, 21 Jul 2011 11:52:44 +0200,
Bastien wrote:
 :
  I'm also think about cache in the calfw side, such as an alist:
  (date . [a list of contents]). Then, uses can refresh the cache
  explicitly. It is easy to implement.
 
  Is the plan(1) the same idea?
 
 Yes, It's the same idea, but on Org's side.

I see. It sounds great.


 I'm focusing on bugfixes for the next release and cannot work 
 through the details of the implementation, but I keep thinking
 about it.

Ok. I also need a time to do other things.
Indeed, I have to write the document of calfw.

Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] New backend for org-agenda: (Was Calendar-like view of the org-agenda)

2011-07-20 Thread SAKURAI Masashi
Hi Bastien,

At Tue, 19 Jul 2011 01:06:14 +0200,
Bastien wrote:
 :
  I'm sure that the caching mechanism is useful, but I'm not sure that
  we should do it with paying the large cost of rewrite whole codes.
 
 FWIW, this is a two separate steps process: 1) write a usable cache, 
 then 2) re-implement (parts of) the agenda by using it.
 
 I think (1) could be interesting /per-se/ and if it helps calfw, then
 it's even more interesting.

What does '/per-se/' mean ?
Excuse me for asking a trivial word.

I'm also think about cache in the calfw side, such as an alist:
(date . [a list of contents]). Then, uses can refresh the cache
explicitly. It is easy to implement.

Is the plan(1) the same idea?


Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] New backend for org-agenda: (Was Calendar-like view of the org-agenda)

2011-07-20 Thread SAKURAI Masashi
Hi Rasmus and Giovanni,

At Wed, 20 Jul 2011 15:31:04 +0200,
Giovanni Ridolfi wrote:
 :
  What does '/per-se/' mean ?
 
 :-)
 it is Latin, an ancient  *European* language
 it means:
 - 'In itself' 
 - Also by itself 
 or:
 - Without referring to anything else, intrinsically, 
   taken without qualifications, 


Thanks for your commentary.
I could understand the meaning and that '/' means italic.

Thank you,

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net





Re: [O] Calendar-like view of the org-agenda

2011-07-19 Thread SAKURAI Masashi
Hi Rasmus,

Thanks for your setting sample.

At Sun, 17 Jul 2011 20:59:19 +0200,
Rasmus wrote:
 :
  Is is somehow possible to change the font family used in Calfw windows
  only?
 
 Hardly perfect, the following let me change the font used in Calfw
 sessions. It seems rather fragile, though as it only seems to work with
 `:height 90'. Obviously there is a more fundamental problem that I ought
 to address. 

Yes. Some Japanese users use the function `buffer-face-set' too.
They also worry about the difference between the value of `char-width' for
the charactors and the real width of the font glyphs.

Indeed, the font setting in Emacs has been very difficult.

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-17 Thread SAKURAI Masashi
At Wed, 13 Jul 2011 21:55:09 +0200,
Tassilo Horn wrote:
 :
 Sebastien Vauban
 wxhgmqzgw...@spammotel.com writes:
 :
  - I was hoping `r' to redraw the grid, after I've changed Emacs frame size. 
  It
does not seem to be the case. Could that be foreseen?  I've seen you 
  already
all the available space, when drawing the grid for the first time.
 
 I've implemented that in my fork.
 
  http://github.com/tsdh/emacs-calfw
 
 Masashi, feel free to pull if you think it's ok.

Thank you so much for many advice and patches. I pulled and merged it.

My master branch of calfw [https://github.com/kiwanami/emacs-calfw]
has been added following improvements from v1.0:

- Improved navigation keymaps.
- Remove display text properties because images screw the table layout.
- Add defcustoms for line drawing chars.
- Added cfw:org-agenda-schedule-args variable to limit the schedule items. 
- Schedule items in a day are sorted by time.
- SPC key is bound to org-agenda with day view.
- Range items are displayed by a band.

I will continue to improve calfw and org integration.
Please check it and let me know any ideas.

Thank you,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-16 Thread SAKURAI Masashi
Hi Manuel,

Thank you for your example.
I have to study a lot of customize variables of org-agenda.
The org-mode is very deep world!

At Mon, 11 Jul 2011 21:02:48 +0200,
Manuel Hermenegildo wrote:
 :
 Currently, both tasks will appear in the calfw view. 
 
 In the normal org agenda views the necessary filtering is done via the
 org-agenda-custom-commands variable, defining a custom agenda
 command with a filter (this is the recommended way of creating
 different agendas and todo lists in org). For example, to get an
 agenda view with only my tasks, which I identfy with the tag MH I
 use (this is my normal agenda view):
 
 (setq org-agenda-custom-commands
   (list
   (list 
a Agenda with (only) my tasks (those that have my tag and a date)
'((agenda 
   
   ((org-agenda-skip-function '(my-skip-by-tags MH))
(org-agenda-overriding-header 
 Agenda -- with (only) my tasks (those that have my tag and a 
 date))
))
 :
 The particular filter that I use (my-skip-by-tags) is a function that
 checks for inherited tags. I am not sure this can be done with
 org-agenda-get-day-entries.  This is why I was suggesting perhaps
 using a modified version of org-agenda (a back-end) that would feed
 the data computed to calfw (the same could be used for all the other
 agenda exports). Or perhaps org-agenda-get-day-entries can be made to
 call a filter function like the one above?

I think org-agenda-get-day-entries uses the customize function
org-agenda-skip-function via org-agenda-get-xxx functions.
So, I can display schedules filtered by the my-skip-by-tags, 
like following ad-hoc code.

==

(defun cfw:org-collect-schedules-period (begin end)
  [internal] Return org schedule items between BEGIN and END.
  (let ((org-agenda-prefix-format )
(span 'day)
(org-agenda-skip-function '(my-skip-by-tags MH))) ;; Added here!!
(org-compile-prefix-format nil)
(loop for date in (cfw:enumerate-days begin end) append
  (loop for file in (org-agenda-files nil 'ifmode) append
(progn
  (org-check-agenda-file file)
  (apply 'org-agenda-get-day-entries 
 file date 
 cfw:org-agenda-schedule-args))

==

I will think about the customization of such filters.
If someone has a good idea or patch, please let me know.

Thank you,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-16 Thread SAKURAI Masashi
Hi Bastien,

At Tue, 12 Jul 2011 09:24:25 +0200,
Bastien wrote:
 :
  One question, is it fixed variable for an user?  I mean, one often
  changes the argument parameter to change the filtering in a single
  Emacs session. 
 
 It would actually be nice to be able to change this parameters on the
 fly -- even for org agendas.  That's not currently possible but I will
 consider implementing this for Org.

I see.

  If one frequently changes it, should I design the UI to change it and
  re-draw the calendar?
 
 I think you can already do this independantly from Org's implementation.

Ok. I will try to design the customization.  I think it should be done
together with the filter function discussed at another thread.

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] New backend for org-agenda: (Was Calendar-like view of the org-agenda)

2011-07-16 Thread SAKURAI Masashi
Hi Bastien,

At Tue, 12 Jul 2011 09:37:21 +0200,
Bastien wrote:
 :
 The question is: would an API for the whole agenda mechanism (and not
 just scheduled items) be useful?
 
 I've never been a big fan of caching Org files information, because Org
 files are often modified in impredictible ways.  But if we can update
 the cache quickly, then it will certainly be useful.

I'm sure that the caching mechanism is useful, but I'm not sure that
we should do it with paying the large cost of rewrite whole codes.

Because the orgmode is the center of information for the many Emacs
users, I think it is very interesting for not only elisp codes but
also the other applications to access the information of the orgmode
via emacsclient or D-Bus messaging.

If the interface for the mode of orgmode items and modification hooks
is defined, one would send todo items to one's mobile terminal
immediately, or share the items on the SNS.

Of course, it is just a trivial idea, not my request.

 I will let you know about progress about this.
 
 Thanks again for raising this idea!

I'm glad to be able to share my idea.
It was difficult for me to discuss the abstract topic quickly in English.

Thank you
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-14 Thread SAKURAI Masashi
Hi Tassilo,

At Wed, 13 Jul 2011 21:55:09 +0200,
Tassilo Horn wrote:
 :
  - I was hoping `r' to redraw the grid, after I've changed Emacs frame size. 
  It
does not seem to be the case. Could that be foreseen?  I've seen you 
  already
all the available space, when drawing the grid for the first time.
 
 I've implemented that in my fork.
 
  http://github.com/tsdh/emacs-calfw
 
 Masashi, feel free to pull if you think it's ok.

Thank you!
I will check and merge it.

Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-11 Thread SAKURAI Masashi
Hi,

At Mon, 11 Jul 2011 17:50:27 +0200,
Sebastien Vauban wrote:
 :
 Tassilo Horn wrote:
  I've also made the characters used for table rendering customizable, so
  that you can use nice unicode glyphs.
 
http://dl.dropbox.com/u/30611246/img/calfw-unicode.png
 
 Now that this has been made configurable, could you share your customization
 for getting such a (very) nice view?  Which characters are you using?

Here is a sample code.

https://gist.github.com/1074205
==
;; Default setting
(setq cfw:fchar-junction ?+
  cfw:fchar-vertical-line ?|
  cfw:fchar-horizontal-line ?-
  cfw:fchar-left-junction ?+
  cfw:fchar-right-junction ?+
  cfw:fchar-top-junction ?+
  cfw:fchar-top-left-corner ?+
  cfw:fchar-top-right-corner ?+ )

;; Nice view (Unicode characters)
(setq cfw:fchar-junction ?╋
  cfw:fchar-vertical-line ?┃
  cfw:fchar-horizontal-line ?━
  cfw:fchar-left-junction ?┣
  cfw:fchar-right-junction ?┫
  cfw:fchar-top-junction ?┯
  cfw:fchar-top-left-corner ?┏
  cfw:fchar-top-right-corner ?┓)
==

Regards,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-10 Thread SAKURAI Masashi
Hi Bastien

At Thu, 07 Jul 2011 17:32:44 +0200,
Bastien wrote:
 :
 SAKURAI Masashi m.saku...@kiwanami.net writes:
 
  Then, I use the function org-agenda-get-day-entries to get schedule
  items of the org-agenda-files. The function can receive some arguments
  to limit the tasks, but I didn't understand exactly.  
 
 See the attached patch -- org-agenda-get-day-entries can take more
 arguments like :scheduled :deadline to help reduce the size of listed
 entries.  See the docstring of org-diary, which understands the same
 list of arguments.

Thank you for your advice and patch. I will merge it.

One question, is it fixed variable for an user?  I mean, one often
changes the argument parameter to change the filtering in a single
Emacs session. If one frequently changes it, should I design the UI to
change it and re-draw the calendar?


--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-10 Thread SAKURAI Masashi
Hi Tassilo and Bastien

  +(defvar cfw:org-agenda-schedule-args '(:scheduled)
  +  Default arguments for collecting agenda entries.)
 
  I'd go with a default value of `nil' meaning put every org entry with a
  timestamp into the calfw view.  Only getting SCHEDULED org tasks there
  is a somewhat peculiar default.
 
 Agreed -- I used :scheduled in this example just to make sure to
 illustrate the filtering.

Thank you for your advice.
I merged and pushed it to master branch.

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



[O] New backend for org-agenda: (Was Calendar-like view of the org-agenda)

2011-07-10 Thread SAKURAI Masashi
Hi Bastien,

At Fri, 08 Jul 2011 10:53:08 +0200,
Bastien wrote:
 :
  the re-design of the whole org-agenda-list algorithm
  seems to be needed, because the key function
  org-agenda-get-day-entries requires only one date and the subsequent
  dependent functions also are designed by the API.
 
 FWIW, I'm all ears -- if you have ideas on how to make org-agenda-list
 more effective please let us know, I could try to implement them.

How about caching of schedule items?
My idea is as follows.

When one query schedule items for the first time, the backend parses
the org buffer and stores all schedule items with a buffer local
variable.  From the next time of the query, the backend can use the
cache data without parsing the buffer text.

Then, because The backend has a model of schedule items, in addition
to org-agenda-get-day-entries, we can define some useful API for
schedule items, such as org-agenda-get-entries-by-range(begin end).

I illustrated this idea:
[Diagram for caching schedule items]
https://cacoo.com/diagrams/RcNaxILLHDGZlr1L#4B823

Org schedule seems to consist of two types, simple items and repeat
items. So, I think that the backend should execute two type queries.

[Query and Data Structure]
https://cacoo.com/diagrams/RcNaxILLHDGZlr1L#C071E

Of course, because I have used orgmode not so long time, this idea is
not useful or too simple to handle the org schedules. 


Here are other implementations:

The Howm schedule API (howm-reminder-search) enumerates all schedule
items. The API user can filter them easily. However, the enumeration
employs full-text searching using grep command, so it takes a long
time to be done the query.  calfw-howm.el has a cache data and the
user can refresh it explicitly.

Another schedule API is CalDAV. This is a specification for the
schedule server, such as Apple iCal server and Google Calendar.

[Calendaring Extensions to WebDAV (CalDAV) RFC 4791]
http://www.webdav.org/specs/rfc4791.html
http://en.wikipedia.org/wiki/CalDAV

This specification has many API for query. It is very heavy spec, but
I think it may be a hint for designing query API for orgmode schedule
items.


Regards
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-09 Thread SAKURAI Masashi
At Wed, 06 Jul 2011 11:23:00 +0100,
Eric S Fraga wrote:
 :
 what I would like, however, is that the detailed view that is accessible
 from hitting the space bar in the cfw view put me into an agenda view
 for that day.  that would then give me full access to org!  this should
 be quite simple: replace the detail view with a simple invocation of the
 default org-agenda view (what you get from C-c a a, say) for that
 particular date?

I will try this idea. It may be easy to implement.

 Footnotes: 
 [1]  I often use Google's calendar for this, having uploaded all my
 org details but I don't expect to use Google to update my org files.

One can display an org schedule and a google calendar one in the same
buffer. Here is a sample code.

==
(require 'calfw-org)
(require 'calfw-ical)

(defun my-open-calendar ()
  (interactive)
  (cfw:open-calendar-buffer
   :view 'month
   :contents-sources
   (list 
(cfw:org-create-source Seagreen4) ; color
(cfw:ical-create-source ical 
https://www.google.com/calendar/ical/../basic.ics; #2952a3
;; title, URL, color
==

The commands `cfw:open-org-calendar' and `cfw:open-ical-calendar' are
simple API for quick use. Giving schedule source (cfw:source) objects
via the argument `:contents-sources', one can mix some calendar
schedules in one buffer.

I will write the document about calfw customization soon.



Re: [O] Calendar-like view of the org-agenda

2011-07-09 Thread SAKURAI Masashi
At Wed, 6 Jul 2011 12:41:06 +0200,
Manuel Hermenegildo wrote:
 :
   I particularly like having a graphical view of my commitments,
   especially for a month, without worrying about detail.  Org's
   agenda view becomes cumbersome (for me) when going beyond a week's
   view (or even a day sometimes...)  [1].
 
 Me too, but the problem with the current approach is that, at least
 for me, this view is full of tasks that are not mine, are in a
 different order (not by priorities), etc., which then does not help.

Sorry for my less experience of orgmode.
Can I get a sample task file which contains such complex schedules?



Re: [O] Calendar-like view of the org-agenda

2011-07-09 Thread SAKURAI Masashi
At Wed, 6 Jul 2011 11:30:02 + (UTC),
Memnon Anon wrote:
 
 Bastien b...@altern.org writes:
 
  Thanks for this -- I guess you'll find a lot of dedicated testers here.
 [...]
  Also explore the Agenda views (M-x org-agenda -- see the manual), your
  package might give us new ideas on how to display agenda information.
 
 might? I'm almost certain it will!
 This is *beautiful*. 
 
 Just when I thought it couldn't get any better, *pow*, there comes a new
 project along.

Thank you for your comment!

 ,[ calfw-org.el ]
 | ;; Display org-agenda items in the calfw buffer.
 | ;; (Because I don't use the org-agenda mainly,
 | ;; I hope someone continue integration with the org.)
 `
 
 With so many orgers around, I have no doubt that org integration will
 improve. 

In this week, I hardly have had a time for calfw and org ML.
I will continue better integration with orgmode.

Thank you



Re: [O] Calendar-like view of the org-agenda

2011-07-09 Thread SAKURAI Masashi
Hi, Tassilo

At Thu, 07 Jul 2011 09:24:33 +0200,
Tassilo Horn wrote:
 
 SAKURAI Masashi m.saku...@kiwanami.net writes:
 
 Hi!
 :
  I implemented calfw-org with consultation of the code of
  org-agenda-list. I think it is difficult to make the speed faster with
  a simple way, the re-design of the whole org-agenda-list algorithm
  seems to be needed, because the key function
  org-agenda-get-day-entries requires only one date and the subsequent
  dependent functions also are designed by the API.
 
 I think it's pretty fast, so I'd vote for keeping the good and simple
 design of the org schedule import in contrast to reimplement the wheel
 for a slight speedup.

Thanks for your advice.
I think the importing speed depends on the size of org files.
I would discuss this topic on another thead.


  It is not so difficult to add a customize of the sort criteria.  And
  you can try your custom summary format, modifying
  cfw:org-summary-format.  In the function, you can get the time value
  from the text property.
 
 Right.  Maybe a good idea was allowing a custom sort function that sorts
 the `contents' for one day in `cfw:org-schedule-period-to-calendar'.
 There, you still have the 'time text property that you can use for
 sorting.

I will implement a simple custom sort function.
After then, I would like to discuss time management on calfw.

Thank you,

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-09 Thread SAKURAI Masashi
At Fri, 8 Jul 2011 15:00:05 + (UTC),
Memnon Anon wrote:
 
 Russell Adams rlad...@adamsinfoserv.com writes:
 
  Two minor FRs (I hope you continue to monitor the list):
 
 https://github.com/kiwanami/emacs-calfw/issues ?
 
   - 'q' key to close the calendar buffer, like org-agenda does
 
 ,[ https://github.com/kiwanami/emacs-calfw/pull/4 ]
 TSDH:  aee24d8 Bind q to bury-buffer in calendar buffer
 | [...]
 KIWA: I'm going to check them and would merge them.
 `

I merged them and tagged v1.1.

- Bug fixed: an error of cfw:open-calendar-buffer
- Improved: Customize grid characters
- Improved: Modified keymap

They are small changes.
However, I would continue improve calfw and org integration.


Thank you,

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-06 Thread SAKURAI Masashi
Hi, all

Thank you for many comments.
I'm so glad to know many people are interesting in calfw.

I'm working on my job in daytime, so I will reply later.



Re: [O] Calendar-like view of the org-agenda

2011-07-06 Thread SAKURAI Masashi

At Tue, 05 Jul 2011 13:49:15 +0200,
Niels Giesen wrote:
 :
  I have not used orgmode so far, so I'm not good at the schedule management 
  in 
  the orgmode. Comments and patches are welcome.
 
 Ok. Here you go:
 :
 2. For people using org-google-weather and using icons to spicen up
 their agenda views for the weather, there is a problem with the grid as
 the icons do not fit well inside a grid.
 
 The simplest way to get around this I guess is advising
 `cfw:org-collect-schedules-period' (I use a similar strategy for
 `org-mobile-push' where one would otherwise only see the text icon).
 
 #+begin_src emacs-lisp
   (defadvice cfw:org-collect-schedules-period (around no-icon activate)
 (let (org-google-weather-display-icon-p)
   ad-do-it))
 #+end_src

I received the similar issue on github,
https://github.com/kiwanami/emacs-calfw/issues/1

In the current implementation, invalidating images and deleting the
`display' property are simple solution.

But I would try to display images in calfw.


 3. I'd like to select items with my keyboard, but the normal emacs
 navigation bindings are not available. Maybe tabbing to items in
 `cfw:details-mode' (but preferably also in cfw:calendar-mode) would do
 it for me, where it would be nice if the mouse echo was also shown when
 entering an item by way of keyboard navigation.

I also think key binding should be improved.
I would try to implement TAB key navigation you mentioned.

The problem of navigation is discussed on the github issue too.
https://github.com/kiwanami/emacs-calfw/issues/2


 4. I do not know whether it is possible due to the dynamic construction
 of mode maps in calfw.el, but it would be nice if you could take
 advantage of the self-documenting nature of Emacs by including a
 reference to the keymap in the docstring for the various modes. For
 cfw:calendar-mode this would be st. like:
  :

I will do this. Thank you for your helpful code.


 5. (perhaps slightly OT) From your screenshots I see you have no problem
 with putting multibyte (japanese) characters inside a grid, something
 with which I always have problems (e.g. in org tables but also in your
 calendar). Do you do anything special to make that work?

Instead of `length', the function `string-width' of mule.el should be
used to calculate display width of the string. This function treats
not only East Asian characters but also complex Unicode ones. Some
functions, such as `cfw:render-truncate', use it.

However, it is not so easy for Japanese users to fit a grid, because
of the font and rendering problems of Emacs. One can find many
Japanese blog articles about beautiful font setting on Emacs.


Thank you for your many comments.



Re: [O] Calendar-like view of the org-agenda

2011-07-06 Thread SAKURAI Masashi
At Tue, 05 Jul 2011 15:33:53 +0100,
Eric S Fraga wrote:
 
 SAKURAI Masashi m.saku...@kiwanami.net writes:
 
 [...]
 
   https://github.com/kiwanami/emacs-calfw
 
 [...]
 
 
  Just yesterday in JST, I released calfw v1.0.
 
 This is brilliant!  Many thanks for this.  Very useful for quick diary
 planning!  I particularly like the different views and, for once, the
 default colour scheme ;-)  Also, as a long time vi user (sorry), I like
 the vi movement commands.

I'm very encouraged. Thank you.
I choose the color scheme of calfw carefully.
Some Japanese users create other color scheme.
http://sheephead.homelinux.org/2011/01/19/6571/
http://valvallow.blogspot.com/2011/01/emacs-face.html
(Note: These settings are written for v0.1, little bit changed.)

 so I tried M-x cfw:open-calendar-buffer which proceeded to give me the
 error:
 
 let: Symbol's function definition is void: cfw:create-calendar-buffer

This is a bug. I fixed and pushed it to master branch.
I'm sorry that many people met this trouble.


 One feature request: in the display of individual calendar items, it
 would be nice to have tags and the originating file name highlighted (in
 different ways, of course), but this is a minor request.

Is this the same issue which is discussed at another thread?


--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-06 Thread SAKURAI Masashi
At Tue, 05 Jul 2011 12:13:09 -0500,
Christopher Allan Webber wrote:
 
 Also, cfw:open-org-calendar works, but things seem really slow... it
 looks like you're recalculating the entire orgmode agenda for every day.
 I wonder if things could be sped up if the orgmode agenda was calculated
 for the entire period all at once and then broke that up into days?

I read the implementation of `org-agenda-list' to get schedule items.
Then, I found it may be slow in this implementation. I want to know
better way to get the schedule items.


Well, it is midnight in JST, so I will reply to subsequent discussions 
tomorrow. Sorry that I could not catch up your discussion speed...

Thank you,
--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-06 Thread SAKURAI Masashi
At Wed, 06 Jul 2011 09:16:32 +0200,
Tassilo Horn wrote:
 :
 Christopher Allan Webber cweb...@dustycloud.org writes:
 
 Hi Christopher,
 
  Also, cfw:open-org-calendar works, but things seem really slow... it
  looks like you're recalculating the entire orgmode agenda for every
  day.  I wonder if things could be sped up if the orgmode agenda was
  calculated for the entire period all at once and then broke that up
  into days?
 
 For me, creating a custom org agenda with the next 21 days takes not
 much less than building an calfw calendar buffer with 42 days.  It's
 about one second for the former and 2 seconds for the latter, so it
 seems calfw does the right thing.

Thank you for your confirming.

I implemented calfw-org with consultation of the code of
org-agenda-list. I think it is difficult to make the speed faster with
a simple way, the re-design of the whole org-agenda-list algorithm
seems to be needed, because the key function
org-agenda-get-day-entries requires only one date and the subsequent
dependent functions also are designed by the API.


 One thing which I'm currently missing is that the calfw entries gathered
 from org are missing the times (if that's specified using the 'time text
 property) and are sorted in an order I can't understand.  For example,
  :

Yes. The current implementation, calfw sorts the items by alphabet,
i.e. string-less, in one date cell. This is intent to sort the items which 
has time header like 10:00 meeting 13:00 go to airport 16:00 meeting.

It is not so difficult to add a customize of the sort criteria.
And you can try your custom summary format, modifying cfw:org-summary-format.
In the function, you can get the time value from the text property.




Re: [O] Calendar-like view of the org-agenda

2011-07-06 Thread SAKURAI Masashi
At Wed, 6 Jul 2011 11:39:47 +0200,
Manuel Hermenegildo wrote:
 
 First, thanks very much to Sakurai for a wonderful tool and having
 integrated it so well with org!

Thank you for your comment. I'm very encouraged!


   For me, creating a custom org agenda with the next 21 days takes
   not much less than building an calfw calendar buffer with 42 days.
 :
 Seems like calfw is ignoring the org priorities and order.  In my case
 the problem is that calfw is gathering all the tasks ignoring my per
 tag filters. I explain: in my case I only want to see in my agenda
 entries that have a certain tag (my tag): I share org files with other
 people and we assign tasks by marking E.g., I am MH and my tasks are
 like:
 
 * TODO Thank Sakurai for a great tool 2011-07-05 Tue  :MH:
 
 which should appear in my agenda and there are other tasks like:
 
 * TODO Write paper  2011-07-05 Tue :JF:
 
 which should only appear in JF's agenda. This is done using a custom
 agenda command that filters by tag.
 
 It seems to me too complicated to try to reproduce all the nuances and
 capabilities of org agenda generation (priorities, filtering, custom
 views, etc.) and do it all again in calfw --it would always be very
 hard to keep them in sync.

I read the code of org-agenda-list and subsequent callee functions.
Indeed it was very hard way and I didn't understand all codes because
I was not a orgmode user.

Then, I use the function org-agenda-get-day-entries to get schedule
items of the org-agenda-files. The function can receive some arguments
to limit the tasks, but I didn't understand exactly.  Do you use this
function? If so, it may be easy to implement a simple filter.


 I have not had time to look at the code, but perhaps calfw, instead of
 reading directly the org files could instead use the org code that
 generates the agenda and then present the agenda in its very nice and
 graphical way. I.e., an idea would be to add a back end to the code
 that generates the org agenda which, instead of rendering the agenda
 creates the calfw objects.
 
 Or, perhaps even simpler, calfw could simply read the org-agenda
 buffer (colors and all) instead of reading the org files.  
 
 This would have the enormous advantage that it would always generate
 the tasks with the same order, priorities, filters, customizations,
 etc. as the org agenda.

The face property and other text properties which are put by
org-agenda-get-day-entries, are remained in calfw buffer.

Customization of summary texts of org items is the variable
cfw:org-schedule-summary-transformer or the function
cfw:org-summary-format. Because I have used orgmode not so heavily,
the current integration is very simple.

I think calfw can display the items in any way how you want.
I would implement simple ideas as soon as possible.


Thank you.

--
SAKURAI, Masashi (family, given)
m.saku...@kiwanami.net



Re: [O] Calendar-like view of the org-agenda

2011-07-05 Thread SAKURAI Masashi
Michael Markert markert.michael at googlemail.com writes:
 
 On 4 Jul 2011, Kan-Ru Chen wrote:
 
  Michael Markert markert.michael at googlemail.com writes:
  :
  I just find this emacs-calfw project today.
 
  https://github.com/kiwanami/emacs-calfw
 
  It looks very interesting and supports org!
 
 Indeed. Not quite what I was looking for but interesting nonetheless.
 
 What I miss:
 - It lacks some org support (e.g. org-contacts anniversaries -- they
   look horrible)
 - a week view
 - a time grid

Just yesterday in JST, I released calfw v1.0.
I will write and append the documents.

In the latest version (v1.0), this program can display
the 1, 2 week view and daily view. Key bindings are following:
- M Monthly view
- W 1 week view
- T 2 week view
- D Daily view
And, pushing SPC key, a daily view is displayed, like the Quicklook in Mac.

The handling of the time grid is a new task.
Because the calfw is designed with focusing on the replacement of the 
calendar.el, I should consider the extending schedule data.

I have not used orgmode so far, so I'm not good at the schedule management in 
the orgmode. Comments and patches are welcome.

--
SAKURAI Masashi