Skip to content

Commit

Permalink
Use <kbd> tags in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
emarsden committed Oct 3, 2024
1 parent 49a5f56 commit 0a99015
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
7 changes: 4 additions & 3 deletions doc/src/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ It allows you to:

- browse the contents of a table, row by row, in paginated mode for large tables

- edit the value of a column (type `RET` on the value you want to modify)
- edit the value of a column (type <kbd>RET</kbd> on the value you want to modify)

- delete a row (type `DEL` on the row you wish to delete)
- delete a row (type <kbd>DEL</kbd> on the row you wish to delete)

- copy/paste rows of a database table (type `k` to copy, `y` to paste in a table display buffer)
- copy/paste rows of a database table (type <kbd>k</kbd> to copy, <kbd>y</kbd> to paste in a table
display buffer)

- export the contents of a table to CSV or TSV format

Expand Down
38 changes: 19 additions & 19 deletions doc/src/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ database table.
## Editing a column value

If your table has a primary key, you can edit the contents of the table. To modify a value, move the
cursor to the relevant column value and type `RET`. This will prompt you for the new value, and
cursor to the relevant column value and type <kbd>RET</kbd>. This will prompt you for the new value, and
immediately update the cell to the value you specified (it sends PostgreSQL an SQL command similar
to `UPDATE table_name SET column_name to X WHERE pk_col1 = value1 AND pk_col2 = value2`, where
`pk_col1` and `pk_col2` are the names of the columns that comprise the primary key constraint).
Expand All @@ -30,22 +30,22 @@ If you wish to abort editing, simply kill this editing buffer.

## Inserting, copying and deleting rows

To insert a new row into a table, press `+` in the row-list buffer. You will be prompted for the values
of each column for which a default value is not specified (in the minibuffer), then the new row will
be inserted. You can also insert a new row by entering new values in a widget-based buffer by
pressing `i` (this may be more convenient if the table contains many rows, or the values to enter
are very long).
To insert a new row into a table, press <kbd>+</kbd> in the row-list buffer. You will be prompted
for the values of each column for which a default value is not specified (in the minibuffer), then
the new row will be inserted. You can also insert a new row by entering new values in a widget-based
buffer by pressing <kbd>i</kbd> (this may be more convenient if the table contains many rows, or the
values to enter are very long).

To delete the row at point, press `<delete>` or `<backspace>` in a table buffer and confirm. Please
note that this deletes the current row in the PostgreSQL database, as well as in the Emacs buffer.
Deleting rows is only possible on tables that include a primary key constraint (this can be a single
column specified as `PRIMARY KEY`, or a constraint across a group of columns).
To delete the row at point, press <kbd>Del</kbd> or <kbd>Backspace</kbd> in a table buffer and
confirm. Please note that this deletes the current row in the PostgreSQL database, as well as in the
Emacs buffer. Deleting rows is only possible on tables that include a primary key constraint (this
can be a single column specified as `PRIMARY KEY`, or a constraint across a group of columns).

To copy/paste rows, press `k` to copy the row to the PGmacs kill buffer (this only copies, without
deleting the row), then `y` to insert a new row with the same values. Any columns that have a
default value specified (for example, primary key rows that pull a value from an integer sequence,
or are specified as `SERIAL`, or timestamp values that default to `now`) will be inserted with a new
generated value, rather than the value in the copied row.
To copy/paste rows, press <kbd>k</kbd> to copy the row to the PGmacs kill buffer (this only copies,
without deleting the row), then <kbd>y</kbd> to insert a new row with the same values. Any columns
that have a default value specified (for example, primary key rows that pull a value from an integer
sequence, or are specified as `SERIAL`, or timestamp values that default to `now`) will be inserted
with a new generated value, rather than the value in the copied row.

All updates, insertions and deletions are immediately synced with the PostgreSQL server by sending it
the appropriate SQL `UPDATE TABLE`, `DELETE FROM` or `INSERT INTO` commands.
Expand All @@ -54,10 +54,10 @@ the appropriate SQL `UPDATE TABLE`, `DELETE FROM` or `INSERT INTO` commands.

## Running a shell command on a cell value

Typing `!` in a row-list buffer runs a shell-command on the current cell value, and displays the
output in the echo area. The cell value is sent as standard input to the shell command, as for the
Emacs function `shell-command-on-region`. If called with a prefix argument, the current cell value
is replaced by the output of the cell command, and the PostgreSQL database is updated.
Typing <kbd>!</kbd> in a row-list buffer runs a shell-command on the current cell value, and
displays the output in the echo area. The cell value is sent as standard input to the shell command,
as for the Emacs function `shell-command-on-region`. If called with a prefix argument, the current
cell value is replaced by the output of the cell command, and the PostgreSQL database is updated.

For example, to count the length in characters of the current cell value (or of its displayed
representation, when it is not a text field), type
Expand Down

0 comments on commit 0a99015

Please sign in to comment.