[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6a12630 07/40: Add examples to README.md
From: |
Daiki Ueno |
Subject: |
[elpa] master 6a12630 07/40: Add examples to README.md |
Date: |
Fri, 22 Jan 2016 22:48:36 +0000 |
branch: master
commit 6a12630c9520b45c75b7942834cf4251f1ff7f6d
Author: Daiki Ueno <address@hidden>
Commit: Daiki Ueno <address@hidden>
Add examples to README.md
---
README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/README.md b/README.md
index ece29fa..24bfbb7 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ Usage
| Key | Command |
--------------|---------------------------------------------------|
-| C-c C-g g | Guess alignment columns from region |
+| C-c C-g g | Guess alignment columns from the current region |
| C-c C-g s | Set alignment column to point |
| C-c C-g a | Align argument list at point |
| C-c C-g r | Align function declarations in the current region |
@@ -35,3 +35,59 @@ Usage
| C-c C-g C | Insert ```MODULE_OBJECT``` |
| C-c C-g C-c | Insert ```ModuleObject``` |
| C-c C-g s | Insert custom snippet |
+
+Example
+------
+
+If you have the following code in a header file:
+```c
+GGpgCtx *g_gpg_ctx_new (GError **error);
+
+typedef void (*GGpgProgressCallback) (gpointer user_data,
+ const gchar *what,
+ gint type,
+ gint current,
+ gint total);
+
+void g_gpg_ctx_set_progress_callback (GGpgCtx *ctx,
+ GGpgProgressCallback callback,
+ gpointer user_data,
+ GDestroyNotify destroy_data);
+void g_gpg_ctx_add_signer (GGpgCtx *ctx, GGpgKey *key);
+guint g_gpg_ctx_get_n_signers (GGpgCtx *ctx);
+GGpgKey *g_gpg_ctx_get_signer (GGpgCtx *ctx, guint index);
+void g_gpg_ctx_clear_signers (GGpgCtx *ctx);
+```
+
+Mark the region, type ```C-c C-g g```, and you will see the optimum
+alignment columns:
+
+```
+identifier-start: 9, arglist-start: 41, arglist-identifier-start: 63
+```
+
+Then, mark the region again, type ```C-c C-g r```, and you will get
+the code aligned:
+
+```c
+GGpgCtx *g_gpg_ctx_new (GError **error);
+
+typedef void (*GGpgProgressCallback) (gpointer user_data,
+ const gchar *what,
+ gint type,
+ gint current,
+ gint total);
+
+void g_gpg_ctx_set_progress_callback (GGpgCtx *ctx,
+ GGpgProgressCallback callback,
+ gpointer user_data,
+ GDestroyNotify destroy_data);
+void g_gpg_ctx_add_signer (GGpgCtx *ctx,
+ GGpgKey *key);
+guint g_gpg_ctx_get_n_signers (GGpgCtx *ctx);
+GGpgKey *g_gpg_ctx_get_signer (GGpgCtx *ctx,
+ guint index);
+void g_gpg_ctx_clear_signers (GGpgCtx *ctx);
+```
+
+Note that ```typedef``` is skipped as it is not a function declaration.
- [elpa] master updated (7e40fdf -> eaa2c7a), Daiki Ueno, 2016/01/22
- [elpa] master f0f8217 02/40: Use table in README.md, Daiki Ueno, 2016/01/22
- [elpa] master 180cd98 04/40: align: Ignore some G_* symbols, Daiki Ueno, 2016/01/22
- [elpa] master 6c5bda5 05/40: align: Fix off-by-one when adding newline, Daiki Ueno, 2016/01/22
- [elpa] master a0fbb58 06/40: align: Fix off-by-one in positioning argument, Daiki Ueno, 2016/01/22
- [elpa] master 0d84312 08/40: Fix wording in README.md, Daiki Ueno, 2016/01/22
- [elpa] master 6a12630 07/40: Add examples to README.md,
Daiki Ueno <=
- [elpa] master 8579586 10/40: align: Minor refactoring, Daiki Ueno, 2016/01/22
- [elpa] master ea42394 09/40: Fix wording in README.md, Daiki Ueno, 2016/01/22
- [elpa] master dcb6a2e 03/40: align: Support guessing/setting alignment rules, Daiki Ueno, 2016/01/22
- [elpa] master 2f5707d 11/40: align: Fix previous commit, Daiki Ueno, 2016/01/22
- [elpa] master 870e78c 12/40: Add ERT tests, Daiki Ueno, 2016/01/22
- [elpa] master 7285abe 15/40: Reorder commands in README.md, Daiki Ueno, 2016/01/22
- [elpa] master 1ad58dc 01/40: Initial import, Daiki Ueno, 2016/01/22
- [elpa] master b4d4672 14/40: align: Support vfuncs, Daiki Ueno, 2016/01/22
- [elpa] master ae40679 18/40: Add symlink to README, Daiki Ueno, 2016/01/22
- [elpa] master 1e67806 19/40: snippet: Make options customizable, Daiki Ueno, 2016/01/22