src: centralize the editor indentation rules

Instead of repeating an emacs footer in every source file, use config
files in the root of the repository. This fixes the bug that several
source files are missing the indent rules.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-02-10 15:02:28 +00:00
parent 396f31cb4b
commit 25092c2122
37 changed files with 42 additions and 268 deletions

20
.dir-locals.el Normal file
View File

@ -0,0 +1,20 @@
(
(c-mode . (
(c-file-style . "K&R")
(indent-tabs-mode . nil)
(c-indent-level . 4)
(c-basic-offset . 4)
))
(html-mode . (
(indent-tabs-mode . nil)
))
(sh-mode . (
(indent-tabs-mode . nil)
))
(nxml-mode . (
(indent-tabs-mode . nil)
))
(perl-mode . (
(indent-tabs-mode . nil)
))
)

21
.editorconfig Normal file
View File

@ -0,0 +1,21 @@
# EditorConfig is a file format and collection of text editor plugins
# for maintaining consistent coding styles between different editors
# and IDEs. Most popular editors support this either natively or via
# plugin.
#
# Check https://editorconfig.org for details.
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
[*.c]
indent_style = space
indent_size = 4
[*.{rng,xml}]
indent_style = space
indent_size = 2

View File

@ -2,7 +2,7 @@
# List version-controlled file names. # List version-controlled file names.
# Print a version string. # Print a version string.
scriptversion=2011-05-16.22; # UTC scriptversion=2021-02-10.15; # UTC
# Copyright (C) 2006-2011 Free Software Foundation, Inc. # Copyright (C) 2006-2011 Free Software Foundation, Inc.
@ -103,11 +103,3 @@ do
exit 1 exit 1
fi fi
done done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -70,10 +70,3 @@ GList *ovirt_foreign_menu_get_iso_names(OvirtForeignMenu *menu);
G_END_DECLS G_END_DECLS
#endif /* _OVIRT_FOREIGN_MENU_H */ #endif /* _OVIRT_FOREIGN_MENU_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -253,11 +253,3 @@ remote_viewer_connect_dialog(GtkWindow *main_window, gchar **uri)
return ci.response; return ci.response;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -26,11 +26,3 @@
gboolean remote_viewer_connect_dialog(GtkWindow *main_window, gchar **uri); gboolean remote_viewer_connect_dialog(GtkWindow *main_window, gchar **uri);
#endif /* REMOTE_VIEWER_CONNECT_H */ #endif /* REMOTE_VIEWER_CONNECT_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -43,11 +43,3 @@ main(int argc, char **argv)
g_object_unref(app); g_object_unref(app);
return ret; return ret;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -819,11 +819,3 @@ cleanup:
return ret; return ret;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -42,10 +42,3 @@ RemoteViewer *remote_viewer_new (void);
G_END_DECLS G_END_DECLS
#endif /* REMOTE_VIEWER_H */ #endif /* REMOTE_VIEWER_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -3167,11 +3167,3 @@ void virt_viewer_app_set_supports_share_clipboard(VirtViewerApp *self, gboolean
priv->supports_share_clipboard = enable; priv->supports_share_clipboard = enable;
g_object_notify(G_OBJECT(self), "supports-share-clipboard"); g_object_notify(G_OBJECT(self), "supports-share-clipboard");
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -110,10 +110,3 @@ void virt_viewer_app_set_supports_share_clipboard(VirtViewerApp *self, gboolean
G_END_DECLS G_END_DECLS
#endif /* VIRT_VIEWER_APP_H */ #endif /* VIRT_VIEWER_APP_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -115,11 +115,3 @@ virt_viewer_auth_collect_credentials(GtkWindow *window,
return response == GTK_RESPONSE_OK; return response == GTK_RESPONSE_OK;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -34,10 +34,3 @@ gboolean virt_viewer_auth_collect_credentials(GtkWindow *window,
char **password); char **password);
#endif #endif
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -390,11 +390,3 @@ virt_viewer_display_spice_set_desktop(VirtViewerDisplay *display,
g_signal_emit_by_name(display, "display-desktop-resize"); g_signal_emit_by_name(display, "display-desktop-resize");
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -48,10 +48,3 @@ void virt_viewer_display_spice_set_desktop(VirtViewerDisplay *display, guint x,
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_DISPLAY_SPICE_H */ #endif /* _VIRT_VIEWER_DISPLAY_SPICE_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -269,11 +269,3 @@ virt_viewer_display_vnc_close(VirtViewerDisplay *display)
*/ */
gtk_container_remove(GTK_CONTAINER(display), GTK_WIDGET(self->vnc)); gtk_container_remove(GTK_CONTAINER(display), GTK_WIDGET(self->vnc));
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -46,10 +46,3 @@ GtkWidget* virt_viewer_display_vnc_new(VirtViewerSessionVnc *session, VncDisplay
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_DISPLAY_VNC_H */ #endif /* _VIRT_VIEWER_DISPLAY_VNC_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -48,10 +48,3 @@ void virt_viewer_display_vte_zoom_out(VirtViewerDisplayVte *vte);
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_DISPLAY_VTE_H */ #endif /* _VIRT_VIEWER_DISPLAY_VTE_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -752,11 +752,3 @@ virt_viewer_display_get_nth(VirtViewerDisplay *self)
priv = virt_viewer_display_get_instance_private(self); priv = virt_viewer_display_get_instance_private(self);
return priv->nth_display; return priv->nth_display;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -115,10 +115,3 @@ gint virt_viewer_display_get_nth(VirtViewerDisplay *self);
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_DISPLAY_H */ #endif /* _VIRT_VIEWER_DISPLAY_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -43,11 +43,3 @@ int main(int argc, char **argv)
return ret; return ret;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -123,11 +123,3 @@ virt_viewer_notebook_new (void)
{ {
return g_object_new (VIRT_VIEWER_TYPE_NOTEBOOK, NULL); return g_object_new (VIRT_VIEWER_TYPE_NOTEBOOK, NULL);
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -46,10 +46,3 @@ void virt_viewer_notebook_show_display(VirtViewerNotebook *nb);
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_NOTEBOOK */ #endif /* _VIRT_VIEWER_NOTEBOOK */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -1505,11 +1505,3 @@ virt_viewer_session_spice_apply_monitor_geometry(VirtViewerSession *session, GHa
rect->y, rect->width, rect->height, TRUE); rect->y, rect->width, rect->height, TRUE);
} }
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -46,10 +46,3 @@ SpiceMainChannel* virt_viewer_session_spice_get_main_channel(VirtViewerSessionSp
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_SESSION_SPICE_H */ #endif /* _VIRT_VIEWER_SESSION_SPICE_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -449,11 +449,3 @@ virt_viewer_session_vnc_new(VirtViewerApp *app, GtkWindow *main_window)
return VIRT_VIEWER_SESSION(self); return VIRT_VIEWER_SESSION(self);
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -45,10 +45,3 @@ VirtViewerSession *virt_viewer_session_vnc_new(VirtViewerApp *app, GtkWindow *ma
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_SESSION_VNC_H */ #endif /* _VIRT_VIEWER_SESSION_VNC_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -740,10 +740,3 @@ void virt_viewer_session_vm_action(VirtViewerSession *self, gint action)
if (klass->vm_action) if (klass->vm_action)
klass->vm_action(self, action); klass->vm_action(self, action);
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -113,11 +113,3 @@ void virt_viewer_session_vm_action(VirtViewerSession *self, gint action);
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_SESSION_H */ #endif /* _VIRT_VIEWER_SESSION_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -732,11 +732,3 @@ configerror:
g_hash_table_unref(displaymap); g_hash_table_unref(displaymap);
return NULL; return NULL;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -66,11 +66,3 @@ GHashTable* virt_viewer_parse_monitor_mappings(gchar **mappings,
const gsize nmappings, const gsize nmappings,
const gint nmonitors); const gint nmonitors);
#endif #endif
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -102,11 +102,3 @@ virt_viewer_vm_connection_choose_name_dialog(GtkWindow *main_window,
return vm_name; return vm_name;
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -29,10 +29,3 @@ gchar* virt_viewer_vm_connection_choose_name_dialog(GtkWindow *main_window,
GError **error); GError **error);
#endif #endif
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -1798,11 +1798,3 @@ virt_viewer_window_get_minimal_zoom_level(VirtViewerWindow *self)
/* make sure that the returned zoom level is in the range from MIN_ZOOM_LEVEL to NORMAL_ZOOM_LEVEL */ /* make sure that the returned zoom level is in the range from MIN_ZOOM_LEVEL to NORMAL_ZOOM_LEVEL */
return CLAMP(zoom * ZOOM_STEP, MIN_ZOOM_LEVEL, NORMAL_ZOOM_LEVEL); return CLAMP(zoom * ZOOM_STEP, MIN_ZOOM_LEVEL, NORMAL_ZOOM_LEVEL);
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -66,11 +66,3 @@ void virt_viewer_window_set_kiosk(VirtViewerWindow *self, gboolean enabled);
G_END_DECLS G_END_DECLS
#endif /* _VIRT_VIEWER_WINDOW */ #endif /* _VIRT_VIEWER_WINDOW */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -1156,11 +1156,3 @@ virt_viewer_new(void)
"flags", G_APPLICATION_NON_UNIQUE, "flags", G_APPLICATION_NON_UNIQUE,
NULL); NULL);
} }
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

View File

@ -42,11 +42,3 @@ VirtViewer *virt_viewer_new (void);
G_END_DECLS G_END_DECLS
#endif /* VIRT_VIEWER_H */ #endif /* VIRT_VIEWER_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/