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

Add function to apply fill-region in doc strings #173

Merged
merged 1 commit into from
Mar 17, 2015

Conversation

rranelli
Copy link
Contributor

@rranelli rranelli commented Mar 8, 2015

This commit adds a function that helps one to keep documentation strings
under fill-column columns.

For example, consider the following doc strings:

  @moduledoc """
  This is module documentation with a line that is waaaaayyy to long to be read. It's pretty bad when lines get wrapped in your editor or when you have to scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of the pain of keeping documentation columns straight??
  """

Github adds horizontal scrolling to the lines above, which I find a real pain.

  @doc """
  This is module documentation with a line that is waaaaayyy to long to be read. It's pretty bad when lines get wrapped in your editor or when you have to scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of the pain of keeping documentation columns straight??
  """

After calling elixir-mode-fill-doc-string the result would be:

  @moduledoc """
  This is module documentation with a line that is waaaaayyy to long to be read.
  It's pretty bad when lines get wrapped in your editor or when you have to
  scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of
  the pain of keeping documentation columns straight??
  """

  @doc """
  This is module documentation with a line that is waaaaayyy to long to be read.
  It's pretty bad when lines get wrapped in your editor or when you have to
  scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of
  the pain of keeping documentation columns straight??
  """

This commit adds a function that helps one to keep documentation strings
under `fill-column` columns.

For example, consider the following doc strings:

```elixir
  @moduledoc """
  This is module documentation with a line that is waaaaayyy to long to be read. It's pretty bad when lines get wrapped in your editor or when you have to scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of the pain of keeping documentation columns straight??
  """

  @doc """
  This is module documentation with a line that is waaaaayyy to long to be read. It's pretty bad when lines get wrapped in your editor or when you have to scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of the pain of keeping documentation columns straight??
  """
```

After calling `elixir-mode-fill-doc-string` the result would be:

```elixir
  @moduledoc """
  This is module documentation with a line that is waaaaayyy to long to be read.
  It's pretty bad when lines get wrapped in your editor or when you have to
  scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of
  the pain of keeping documentation columns straight??
  """

  @doc """
  This is module documentation with a line that is waaaaayyy to long to be read.
  It's pretty bad when lines get wrapped in your editor or when you have to
  scroll horizontally to be able to see it well. Gosh, can Emacs relieve me of
  the pain of keeping documentation columns straight??
  """
```
@whatyouhide
Copy link

👍 👍 👍 wonderful feature!

@rranelli
Copy link
Contributor Author

I did not understand why the CI build failed, the output of the failed job was quite clobbered.

I also could not reproduce it locally.

@mattdeboard
Copy link
Contributor

I will try to replicate this failure locally.

mattdeboard added a commit that referenced this pull request Mar 17, 2015
Add function to apply `fill-region` in doc strings
@mattdeboard mattdeboard merged commit 61fc785 into elixir-editors:master Mar 17, 2015
J3RN pushed a commit to J3RN/emacs-elixir that referenced this pull request Apr 24, 2021
…andle-partial-initiation

textDocument/documentSymbol should handle a non-fully initialized server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants