Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect XDG for the inputrc config file #86

Merged
merged 2 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Next
----

* Load inputrc file from ~/.config/.lambda-term-inputrc as per XDG conventions (@copy)

2.0.3 (2019-12-31)
------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ You can then send the result to jeremie@dimino.org, including:
Key bindings
------------

Key bindings can be set in `~/.lambda-term-inputrc`. See
Key bindings can be set in `~/.config/.lambda-term-inputrc`. See
[lambda-term-inputrc](lambda-term-inputrc). Useful mappings:

```
Expand Down
2 changes: 1 addition & 1 deletion lambda-term-inputrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- conf-colon -*-

# Copy this file to your ~/.lambda-term-inputrc
# Copy this file to your ~/.config/.lambda-term-inputrc

[read-line]

Expand Down
2 changes: 1 addition & 1 deletion man/lambda-term-actions.1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lambda-term-actions \- Display lambda-term editing actions

.B lambda-term-actions
displays the list of actions that can be used in the
~/.lambda-term-inputrc file.
~/.config/.lambda-term-inputrc file.

.SH AUTHOR
Jérémie Dimino <jeremie@dimino.org>
Expand Down
6 changes: 3 additions & 3 deletions man/lambda-term-inputrc.5
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
lambda-term-inputrc \- Key bindings for lambda-term applications

.SH SYNOPSIS
.B ~/.lambda-term-inputrc
.B ~/.config/.lambda-term-inputrc

.SH DESCRIPTION

This manual page describes the format of the
.I ~/.lambda-term-inputrc
.I ~/.config/.lambda-term-inputrc
file. This file is a text file which associates editing actions to key
sequences. Comments start with a '#' character and empty lines are
ignored.
Expand Down Expand Up @@ -87,7 +87,7 @@ where
is the code of the character in hexadecimal.

.SH FILES
.I ~/.lambda-term-inputrc
.I ~/.config/.lambda-term-inputrc

.SH EXAMPLE
[edit]
Expand Down
5 changes: 3 additions & 2 deletions src/lTerm_inputrc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ exception Parse_error of string * int * string

val load : ?file : string -> unit -> unit Lwt.t
(** [load ?file ()] loads key bindings from [file], which defaults
to ~/.lambda-term-inputrc, if it exists. *)
to ~/.config/.lambda-term-inputrc, if it exists. *)

val default : string
(** The name of the default key bindings file,
i.e. ~/.lambda-term-inputrc. *)
i.e. ~/.config/.lambda-term-inputrc
or the legacy location ~/.lambda-term-inputrc, if it exists *)
5 changes: 4 additions & 1 deletion src/lTerm_inputrc.mll
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ and comma_actions seq l = parse

{
let default =
Filename.concat LTerm_resources.home ".lambda-term-inputrc"
LTerm_resources.xdgbd_file
~loc:LTerm_resources.Config
~allow_legacy_location:true
".lambda-term-inputrc"

let load ?(file = default) () =
Lwt.catch (fun () ->
Expand Down