Hi, I have a feature request for Calfw. Masashi, would you prefer these to be posted here or on your github page? 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). 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. Unfortunately, my own Emacs Lisp skills are not sufficient to implement such a thing at the moment. Thanks a bunch for Calfw. It a great supplement to Org-Agenda. Cheers, Rasmus -- Sent from my Emacs
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.sakurai@kiwanami.net
Hi Masashi, > I like here We're trilled that you're here! > Thanks for your request and good images. > I think this request involves 3 functions. You are probably right. > * 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. Oh, right; it could be done as a seperate view or layout. > * 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. > * 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. . . –Rasmus -- Sent from my Emacs
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.sakurai@kiwanami.net
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.sakurai@kiwanami.net
SAKURAI Masashi <m.sakurai@kiwanami.net> writes: > I pushed the multiline branch on the github. > https://github.com/kiwanami/emacs-calfw/tree/multiline(including some minor updating) Thanks! > > 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.) 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. > 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 Cheers, Rasmus -- Sent from my Emacs
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.sakurai@kiwanami.net