chiark / gitweb /
Update choose screen when a rescan completes (and drive initial fill
[disorder] / disobedience / choose.c
1 /*
2  * This file is part of DisOrder
3  * Copyright (C) 2008 Richard Kettlewell
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  */
20 /** @file disobedience/choose.c
21  * @brief Hierarchical track selection and search
22  *
23  * We now use an ordinary GtkTreeStore/GtkTreeView.
24  *
25  * We don't want to pull the entire tree in memory, but we want directories to
26  * show up as having children.  Therefore we give directories a placeholder
27  * child and replace their children when they are opened.  Placeholders have
28  * TRACK_COLUMN="" and ISFILE_COLUMN=FALSE (so that they don't get check boxes,
29  * lengths, etc).
30  *
31  * TODO We do a period sweep which kills contracted nodes, putting back
32  * placeholders, and updating expanded nodes to keep up with server-side
33  * changes.  (We could trigger the latter off rescan complete notifications?)
34  * 
35  * TODO:
36  * - sweep up contracted nodes
37  * - update when content may have changed (e.g. after a rescan)
38  */
39
40 #include "disobedience.h"
41 #include "choose.h"
42
43 /** @brief The current selection tree */
44 GtkTreeStore *choose_store;
45
46 /** @brief The view onto the selection tree */
47 GtkWidget *choose_view;
48
49 /** @brief The selection tree's selection */
50 GtkTreeSelection *choose_selection;
51
52 /** @brief Count of file listing operations in flight */
53 static int choose_list_in_flight;
54
55 /** @brief If nonzero autocollapse column won't be set */
56 static int choose_suppress_set_autocollapse;
57
58 static char *choose_get_string(GtkTreeIter *iter, int column) {
59   gchar *gs;
60   gtk_tree_model_get(GTK_TREE_MODEL(choose_store), iter,
61                      column, &gs,
62                      -1);
63   char *s = xstrdup(gs);
64   g_free(gs);
65   return s;
66 }
67
68 char *choose_get_track(GtkTreeIter *iter) {
69   char *s = choose_get_string(iter, TRACK_COLUMN);
70   return *s ? s : 0;                    /* Placeholder -> NULL */
71 }
72
73 char *choose_get_sort(GtkTreeIter *iter) {
74   return choose_get_string(iter, SORT_COLUMN);
75 }
76
77 char *choose_get_display(GtkTreeIter *iter) {
78   return choose_get_string(iter, NAME_COLUMN);
79 }
80
81 int choose_is_file(GtkTreeIter *iter) {
82   gboolean isfile;
83   gtk_tree_model_get(GTK_TREE_MODEL(choose_store), iter,
84                      ISFILE_COLUMN, &isfile,
85                      -1);
86   return isfile;
87 }
88
89 int choose_is_dir(GtkTreeIter *iter) {
90   gboolean isfile;
91   gtk_tree_model_get(GTK_TREE_MODEL(choose_store), iter,
92                      ISFILE_COLUMN, &isfile,
93                      -1);
94   if(isfile)
95     return FALSE;
96   return !choose_is_placeholder(iter);
97 }
98
99 int choose_is_placeholder(GtkTreeIter *iter) {
100   return choose_get_string(iter, TRACK_COLUMN)[0] == 0;
101 }
102
103 int choose_can_autocollapse(GtkTreeIter *iter) {
104   gboolean autocollapse;
105   gtk_tree_model_get(GTK_TREE_MODEL(choose_store), iter,
106                      AUTOCOLLAPSE_COLUMN, &autocollapse,
107                      -1);
108   return autocollapse;
109 }
110
111 /** @brief Remove node @p it and all its children
112  * @param Iterator, updated to point to next
113  * @return True if iterator remains valid
114  *
115  * TODO is this necessary?  gtk_tree_store_remove() does not document what
116  * happens to children.
117  */
118 static gboolean choose_remove_node(GtkTreeIter *it) {
119   GtkTreeIter child[1];
120   gboolean childv = gtk_tree_model_iter_children(GTK_TREE_MODEL(choose_store),
121                                                  child,
122                                                  it);
123   while(childv)
124     childv = choose_remove_node(child);
125   return gtk_tree_store_remove(choose_store, it);
126 }
127
128 /** @brief Update length and state fields */
129 static gboolean choose_set_state_callback(GtkTreeModel attribute((unused)) *model,
130                                           GtkTreePath attribute((unused)) *path,
131                                           GtkTreeIter *it,
132                                           gpointer attribute((unused)) data) {
133   if(choose_is_file(it)) {
134     const char *track = choose_get_track(it);
135     const long l = namepart_length(track);
136     char length[64];
137     if(l > 0)
138       byte_snprintf(length, sizeof length, "%ld:%02ld", l / 60, l % 60);
139     else
140       length[0] = 0;
141     gtk_tree_store_set(choose_store, it,
142                        LENGTH_COLUMN, length,
143                        STATE_COLUMN, queued(track),
144                        -1);
145     if(choose_is_search_result(track))
146       gtk_tree_store_set(choose_store, it,
147                          BG_COLUMN, SEARCH_RESULT_BG,
148                          FG_COLUMN, SEARCH_RESULT_FG,
149                          -1);
150     else
151       gtk_tree_store_set(choose_store, it,
152                          BG_COLUMN, (char *)0,
153                          FG_COLUMN, (char *)0,
154                          -1);
155   }
156   return FALSE;                         /* continue walking */
157 }
158
159 /** @brief Called when the queue or playing track change */
160 static void choose_set_state(const char attribute((unused)) *event,
161                              void attribute((unused)) *eventdata,
162                              void attribute((unused)) *callbackdata) {
163   gtk_tree_model_foreach(GTK_TREE_MODEL(choose_store),
164                          choose_set_state_callback,
165                          NULL);
166 }
167
168 /** @brief (Re-)populate a node
169  * @param parent_ref Node to populate or NULL to fill root
170  * @param nvec Number of children to add
171  * @param vec Children
172  * @param files 1 if children are files, 0 if directories
173  *
174  * Adjusts the set of files (or directories) below @p parent_ref to match those
175  * listed in @p nvec and @p vec.
176  *
177  * @parent_ref will be destroyed.
178  */
179 static void choose_populate(GtkTreeRowReference *parent_ref,
180                             int nvec, char **vec,
181                             int isfile) {
182   const char *type = isfile ? "track" : "dir";
183   //fprintf(stderr, "%d new children of type %s\n", nvec, type);
184   if(!nvec)
185     goto skip;
186   /* Compute parent_* */
187   GtkTreeIter pit[1], *parent_it;
188   GtkTreePath *parent_path;
189   if(parent_ref) {
190     parent_path = gtk_tree_row_reference_get_path(parent_ref);
191     parent_it = pit;
192     gboolean pitv = gtk_tree_model_get_iter(GTK_TREE_MODEL(choose_store),
193                                             pit, parent_path);
194     assert(pitv);
195     /*fprintf(stderr, "choose_populate %s: parent path is [%s]\n",
196             type,
197             gtk_tree_path_to_string(parent_path));*/
198   } else {
199     parent_path = 0;
200     parent_it = 0;
201     /*fprintf(stderr, "choose_populate %s: populating the root\n",
202             type);*/
203   }
204   /* Both td[] and the current node set are sorted so we can do a single linear
205    * pass to insert new nodes and remove unwanted ones.  The total performance
206    * may be worse than linear depending on the performance of GTK+'s insert and
207    * delete operations. */
208   //fprintf(stderr, "sorting tracks\n");
209   struct tracksort_data *td = tracksort_init(nvec, vec, type);
210   GtkTreeIter it[1];
211   gboolean itv = gtk_tree_model_iter_children(GTK_TREE_MODEL(choose_store),
212                                               it,
213                                               parent_it);
214   int inserted = 0, deleted_placeholder = 0;
215   //fprintf(stderr, "inserting tracks type=%s\n", type);
216   while(nvec > 0 || itv) {
217     /*fprintf(stderr, "td[] = %s, it=%s [%s]\n",
218             nvec > 0 ? td->track : "(none)",
219             itv ? choose_get_track(it) : "(!itv)",
220             itv ? (choose_is_file(it) ? "file" : "dir") : "");*/
221     enum { INSERT, DELETE, SKIP_TREE, SKIP_BOTH } action;
222     const char *track = itv ? choose_get_track(it) : 0;
223     if(itv && !track) {
224       //fprintf(stderr, " placeholder\n");
225       action = DELETE;
226       ++deleted_placeholder;
227     } else if(nvec > 0 && itv) {
228       /* There's both a tree row and a td[] entry */
229       const int cmp = compare_tracks(td->sort, choose_get_sort(it),
230                                      td->display, choose_get_display(it),
231                                      td->track, track);
232       //fprintf(stderr, " cmp=%d\n", cmp);
233       if(cmp < 0)
234         /* td < it, so we insert td before it */
235         action = INSERT;
236       else if(cmp > 0) {
237         /* td > it, so we must either delete it (if the same type) or skip it */
238         if(choose_is_file(it) == isfile)
239           action = DELETE;
240         else
241           action = SKIP_TREE;
242       } else
243         /* td = it, so we step past both */
244         action = SKIP_BOTH;
245     } else if(nvec > 0) {
246       /* We've reached the end of the tree rows, but new have tracks left in
247        * td[] */
248       //fprintf(stderr, " inserting\n");
249       action = INSERT;
250     } else {
251       /* We've reached the end of the new tracks from td[], but there are
252        * further tracks in the tree */
253       //fprintf(stderr, " deleting\n");
254       if(choose_is_file(it) == isfile)
255         action = DELETE;
256       else
257         action = SKIP_TREE;
258     }
259     
260     switch(action) {
261     case INSERT: {
262       //fprintf(stderr, " INSERT %s\n", td->track);
263       /* Insert a new row from td[] before it, or at the end if it is no longer
264        * valid */
265       GtkTreeIter child[1];
266       gtk_tree_store_insert_before(choose_store,
267                                    child, /* new row */
268                                    parent_it, /* parent */
269                                    itv ? it : NULL); /* successor */
270       gtk_tree_store_set(choose_store, child,
271                          NAME_COLUMN, td->display,
272                          ISFILE_COLUMN, isfile,
273                          TRACK_COLUMN, td->track,
274                          SORT_COLUMN, td->sort,
275                          AUTOCOLLAPSE_COLUMN, FALSE,
276                          -1);
277       /* Update length and state; we expect this to kick off length lookups
278        * rather than necessarily get the right value the first time round. */
279       choose_set_state_callback(0, 0, child, 0);
280       /* If we inserted a directory, insert a placeholder too, so it appears to
281        * have children; it will be deleted when we expand the directory. */
282       if(!isfile) {
283         //fprintf(stderr, "  inserting a placeholder\n");
284         GtkTreeIter placeholder[1];
285
286         gtk_tree_store_append(choose_store, placeholder, child);
287         gtk_tree_store_set(choose_store, placeholder,
288                            NAME_COLUMN, "Waddling...",
289                            TRACK_COLUMN, "",
290                            ISFILE_COLUMN, FALSE,
291                            -1);
292       }
293       ++inserted;
294       ++td;
295       --nvec;
296       break;
297     }
298     case SKIP_BOTH:
299       //fprintf(stderr, " SKIP_BOTH\n");
300       ++td;
301       --nvec;
302       /* fall thru */
303     case SKIP_TREE:
304       //fprintf(stderr, " SKIP_TREE\n");
305       itv = gtk_tree_model_iter_next(GTK_TREE_MODEL(choose_store), it);
306       break;
307     case DELETE:
308       //fprintf(stderr, " DELETE\n");
309       itv = choose_remove_node(it);
310       break;
311     }
312   }
313   /*fprintf(stderr, "inserted=%d deleted_placeholder=%d\n\n",
314           inserted, deleted_placeholder);*/
315   if(parent_ref) {
316     /* If we deleted a placeholder then we must re-expand the row */
317     if(deleted_placeholder) {
318       ++choose_suppress_set_autocollapse;
319       gtk_tree_view_expand_row(GTK_TREE_VIEW(choose_view), parent_path, FALSE);
320       --choose_suppress_set_autocollapse;
321     }
322     gtk_tree_row_reference_free(parent_ref);
323     gtk_tree_path_free(parent_path);
324   }
325 skip:
326   /* We only notify others that we've inserted tracks when there are no more
327    * insertions pending, so that they don't have to keep track of how many
328    * requests they've made.  */
329   if(--choose_list_in_flight == 0) {
330     /* Notify interested parties that we inserted some tracks, AFTER making
331      * sure that the row is properly expanded */
332     //fprintf(stderr, "raising choose-more-tracks\n");
333     event_raise("choose-more-tracks", 0);
334   }
335   //fprintf(stderr, "choose_list_in_flight -> %d-\n", choose_list_in_flight);
336 }
337
338 static void choose_dirs_completed(void *v,
339                                   const char *error,
340                                   int nvec, char **vec) {
341   if(error) {
342     popup_protocol_error(0, error);
343     return;
344   }
345   choose_populate(v, nvec, vec, 0/*!isfile*/);
346 }
347
348 static void choose_files_completed(void *v,
349                                    const char *error,
350                                    int nvec, char **vec) {
351   if(error) {
352     popup_protocol_error(0, error);
353     return;
354   }
355   choose_populate(v, nvec, vec, 1/*isfile*/);
356 }
357
358 void choose_play_completed(void attribute((unused)) *v,
359                            const char *error) {
360   if(error)
361     popup_protocol_error(0, error);
362 }
363
364 static void choose_state_toggled
365     (GtkCellRendererToggle attribute((unused)) *cell_renderer,
366      gchar *path_str,
367      gpointer attribute((unused)) user_data) {
368   GtkTreeIter it[1];
369   /* Identify the track */
370   gboolean itv =
371     gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(choose_store),
372                                         it,
373                                         path_str);
374   if(!itv)
375     return;
376   if(!choose_is_file(it))
377     return;
378   const char *track = choose_get_track(it);
379   if(queued(track))
380     return;
381   disorder_eclient_play(client, track, choose_play_completed, 0);
382   
383 }
384
385 /** @brief (Re-)get the children of @p path
386  * @param path Path to target row
387  * @param iter Iterator pointing at target row
388  *
389  * Called from choose_row_expanded() to make sure that the contents are present
390  * and from choose_refill_callback() to (re-)synchronize.
391  */
392 static void choose_refill_row(GtkTreePath *path,
393                               GtkTreeIter *iter) {
394   const char *track = choose_get_track(iter);
395   disorder_eclient_files(client, choose_files_completed,
396                          track,
397                          NULL,
398                          gtk_tree_row_reference_new(GTK_TREE_MODEL(choose_store),
399                                                     path));
400   disorder_eclient_dirs(client, choose_dirs_completed,
401                         track,
402                         NULL,
403                         gtk_tree_row_reference_new(GTK_TREE_MODEL(choose_store),
404                                                    path));
405   /* The row references are destroyed in the _completed handlers. */
406   choose_list_in_flight += 2;
407 }
408
409 static void choose_row_expanded(GtkTreeView attribute((unused)) *treeview,
410                                 GtkTreeIter *iter,
411                                 GtkTreePath *path,
412                                 gpointer attribute((unused)) user_data) {
413   /*fprintf(stderr, "row-expanded path=[%s]\n\n",
414           gtk_tree_path_to_string(path));*/
415   /* We update a node's contents whenever it is expanded, even if it was
416    * already populated; the effect is that contracting and expanding a node
417    * suffices to update it to the latest state on the server. */
418   choose_refill_row(path, iter);
419   if(!choose_suppress_set_autocollapse) {
420     if(choose_auto_expanding) {
421       /* This was an automatic expansion; mark it the row for auto-collapse. */
422       gtk_tree_store_set(choose_store, iter,
423                          AUTOCOLLAPSE_COLUMN, TRUE,
424                          -1);
425       /*fprintf(stderr, "enable auto-collapse for %s\n",
426               gtk_tree_path_to_string(path));*/
427     } else {
428       /* This was a manual expansion.  Inhibit automatic collapse on this row
429        * and all its ancestors.  */
430       gboolean itv;
431       do {
432         gtk_tree_store_set(choose_store, iter,
433                            AUTOCOLLAPSE_COLUMN, FALSE,
434                            -1);
435         /*fprintf(stderr, "suppress auto-collapse for %s\n",
436                 gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(choose_store),
437                                                     iter));*/
438         GtkTreeIter child = *iter;
439         itv = gtk_tree_model_iter_parent(GTK_TREE_MODEL(choose_store),
440                                          iter,
441                                          &child);
442       } while(itv);
443       /* The effect of this is that if you expand a row that's actually a
444        * sibling of the real target of the auto-expansion, it stays expanded
445        * when you clear a search.  That's find and good, but it _still_ stays
446        * expanded if you expand it and then collapse it.
447        *
448        * An alternative policy would be to only auto-collapse rows that don't
449        * have any expanded children (apart from ones also subject to
450        * auto-collapse).  I'm not sure what the most usable policy is.
451        */
452     }
453   }
454 }
455
456 static void choose_auto_collapse_callback(GtkTreeView *tree_view,
457                                           GtkTreePath *path,
458                                           gpointer attribute((unused)) user_data) {
459   GtkTreeIter it[1];
460
461   gtk_tree_model_get_iter(GTK_TREE_MODEL(choose_store), it, path);
462   if(choose_can_autocollapse(it)) {
463     /*fprintf(stderr, "collapse %s\n",
464             gtk_tree_path_to_string(path));*/
465     gtk_tree_store_set(choose_store, it,
466                        AUTOCOLLAPSE_COLUMN, FALSE,
467                        -1);
468     gtk_tree_view_collapse_row(tree_view, path);
469   }
470 }
471
472 /** @brief Perform automatic collapse after a search is cleared */
473 void choose_auto_collapse(void) {
474   gtk_tree_view_map_expanded_rows(GTK_TREE_VIEW(choose_view),
475                                   choose_auto_collapse_callback,
476                                   0);
477 }
478
479 /** @brief Called from choose_refill() with each expanded row */
480 static void choose_refill_callback(GtkTreeView attribute((unused)) *tree_view,
481                                    GtkTreePath *path,
482                                    gpointer attribute((unused)) user_data) {
483   GtkTreeIter it[1];
484
485   gtk_tree_model_get_iter(GTK_TREE_MODEL(choose_store), it, path);
486   choose_refill_row(path, it);
487 }
488
489 /** @brief Synchronize all visible data with the server
490  *
491  * Called at startup, when a rescan completes, and via periodic_slow().
492  */
493 static void choose_refill(const char attribute((unused)) *event,
494                           void attribute((unused)) *eventdata,
495                           void attribute((unused)) *callbackdata) {
496   //fprintf(stderr, "choose_refill\n");
497   /* Update the root */
498   disorder_eclient_files(client, choose_files_completed, "", NULL, NULL); 
499   disorder_eclient_dirs(client, choose_dirs_completed, "", NULL, NULL); 
500   choose_list_in_flight += 2;
501   /* Update all expanded rows */
502   gtk_tree_view_map_expanded_rows(GTK_TREE_VIEW(choose_view),
503                                   choose_refill_callback,
504                                   0);
505   //fprintf(stderr, "choose_list_in_flight -> %d+\n", choose_list_in_flight);
506 }
507
508 /** @brief Create the choose tab */
509 GtkWidget *choose_widget(void) {
510   /* Create the tree store. */
511   choose_store = gtk_tree_store_new(CHOOSE_COLUMNS,
512                                     G_TYPE_BOOLEAN,
513                                     G_TYPE_STRING,
514                                     G_TYPE_STRING,
515                                     G_TYPE_BOOLEAN,
516                                     G_TYPE_STRING,
517                                     G_TYPE_STRING,
518                                     G_TYPE_STRING,
519                                     G_TYPE_STRING,
520                                     G_TYPE_BOOLEAN);
521
522   /* Create the view */
523   choose_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(choose_store));
524   gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(choose_view), TRUE);
525   /* Suppress built-in typeahead find, we do our own search support.
526    * TODO: ^F still brings up the native search box
527    */
528   gtk_tree_view_set_enable_search(GTK_TREE_VIEW(choose_view), FALSE);
529
530   /* Create cell renderers and columns */
531   /* TODO use a table */
532   {
533     GtkCellRenderer *r = gtk_cell_renderer_toggle_new();
534     GtkTreeViewColumn *c = gtk_tree_view_column_new_with_attributes
535       ("Queued",
536        r,
537        "active", STATE_COLUMN,
538        "visible", ISFILE_COLUMN,
539        (char *)0);
540     gtk_tree_view_column_set_resizable(c, TRUE);
541     gtk_tree_view_column_set_reorderable(c, TRUE);
542     gtk_tree_view_append_column(GTK_TREE_VIEW(choose_view), c);
543     g_signal_connect(r, "toggled",
544                      G_CALLBACK(choose_state_toggled), 0);
545   }
546   {
547     GtkCellRenderer *r = gtk_cell_renderer_text_new();
548     GtkTreeViewColumn *c = gtk_tree_view_column_new_with_attributes
549       ("Length",
550        r,
551        "text", LENGTH_COLUMN,
552        (char *)0);
553     gtk_tree_view_column_set_resizable(c, TRUE);
554     gtk_tree_view_column_set_reorderable(c, TRUE);
555     g_object_set(r, "xalign", (gfloat)1.0, (char *)0);
556     gtk_tree_view_append_column(GTK_TREE_VIEW(choose_view), c);
557   }
558   {
559     GtkCellRenderer *r = gtk_cell_renderer_text_new();
560     GtkTreeViewColumn *c = gtk_tree_view_column_new_with_attributes
561       ("Track",
562        r,
563        "text", NAME_COLUMN,
564        "background", BG_COLUMN,
565        "foreground", FG_COLUMN,
566        (char *)0);
567     gtk_tree_view_column_set_resizable(c, TRUE);
568     gtk_tree_view_column_set_reorderable(c, TRUE);
569     g_object_set(c, "expand", TRUE, (char *)0);
570     gtk_tree_view_append_column(GTK_TREE_VIEW(choose_view), c);
571     gtk_tree_view_set_expander_column(GTK_TREE_VIEW(choose_view), c);
572   }
573   
574   /* The selection should support multiple things being selected */
575   choose_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(choose_view));
576   gtk_tree_selection_set_mode(choose_selection, GTK_SELECTION_MULTIPLE);
577
578   /* Catch button presses */
579   g_signal_connect(choose_view, "button-press-event",
580                    G_CALLBACK(choose_button_event), 0);
581   g_signal_connect(choose_view, "button-release-event",
582                    G_CALLBACK(choose_button_event), 0);
583   /* Catch row expansions so we can fill in placeholders */
584   g_signal_connect(choose_view, "row-expanded",
585                    G_CALLBACK(choose_row_expanded), 0);
586
587   event_register("queue-list-changed", choose_set_state, 0);
588   event_register("playing-track-changed", choose_set_state, 0);
589   event_register("search-results-changed", choose_set_state, 0);
590   event_register("lookups-completed", choose_set_state, 0);
591
592   /* After a rescan we update the choose tree.  We get a rescan-complete
593    * automatically at startup and upon connection too. */
594   event_register("rescan-complete", choose_refill, 0);
595
596   /* Make the widget scrollable */
597   GtkWidget *scrolled = scroll_widget(choose_view);
598
599   /* Pack vertically with the search widget */
600   GtkWidget *vbox = gtk_vbox_new(FALSE/*homogenous*/, 1/*spacing*/);
601   gtk_box_pack_start(GTK_BOX(vbox), scrolled,
602                      TRUE/*expand*/, TRUE/*fill*/, 0/*padding*/);
603   gtk_box_pack_end(GTK_BOX(vbox), choose_search_widget(),
604                    FALSE/*expand*/, FALSE/*fill*/, 0/*padding*/);
605   
606   g_object_set_data(G_OBJECT(vbox), "type", (void *)&choose_tabtype);
607   return vbox;
608 }
609
610 /*
611 Local Variables:
612 c-basic-offset:2
613 comment-column:40
614 fill-column:79
615 indent-tabs-mode:nil
616 End:
617 */