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

Fluid-width windows by default [Enhancement] #179

Open
ghost opened this issue Jun 17, 2015 · 19 comments
Open

Fluid-width windows by default [Enhancement] #179

ghost opened this issue Jun 17, 2015 · 19 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jun 17, 2015

After using circe for a little while, I am finding it hard to imagine a use-case where someone wouldn't want Fluid-Width Windows by default. Is there a possibility of this being included by default or has the consensus been against this?

@jorgenschaefer jorgenschaefer added this to the v2.0 milestone Jun 18, 2015
@jorgenschaefer
Copy link
Collaborator

Good question!

How do fluid-width windows work in a terminal?

@ghost
Copy link
Author

ghost commented Jun 18, 2015

It works rather well from my experience with or without X11, and I haven't seen any display issues. I'll retest with a clean config and share my results for clarity.

@ghost
Copy link
Author

ghost commented Jun 18, 2015

The right-margin appears to be 2 columns off-screen in my testing (see images below), though I had no other issues in either gnome-terminal or tty. This should be a minor issue that can be fixed by adding a right-margin of 2, but I'll confirm that this is the case and submit a pull request when suitable.

I'm using Emacs v24.5.1 && Circe v1.6 with no other configuration

Fluid-Width Enabled

circe-fluid2

Fluid-Width Disabled

circe-nonfluid2

@jorgenschaefer
Copy link
Collaborator

Thank you for testing this! This looks rather good to me.

Any other opinions? @wasamasa ?

@wasamasa
Copy link
Collaborator

I've been using fluid-width windows exclusively ever after Circe's scrolling became less wonky with the recent changes (before that usage of ido managed pushing the cursor away from the input line and resulted in scrolling backwards with incoming server output...) and am pretty happy with it. Currently I only have tuning the movement behaviour in the input line on my todo (C-a moves to the beginning of the visual line, not the logical line, though it would be even better if the input line weren't wrapped at all in the first place).

So, the only thing I'm worrying about is how to make sure people can customize it in case they aren't happy with it at all or want to tweak minor stuff. The latter should be doable with the existing hooks, the former requires a customizable that needs to be set before loading up Circe.

@ghost
Copy link
Author

ghost commented Jun 18, 2015

Looks like a right-margin-width of 8 is spot-on, though I agree with @wasamasa about ensuring this is readily available to adjust in case someone finds it annoying.

(setq
 lui-time-stamp-position 'right-margin
 lui-fill-type nil)

(add-hook 'lui-mode-hook 'my-lui-setup)
(defun my-lui-setup ()
  (setq
   fringes-outside-margins t
   right-margin-width 8
   word-wrap t
   wrap-prefix "    "))
(setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)

circe-fluid-fixed

Edit: Updated

@jorgenschaefer
Copy link
Collaborator

We can easily add a new value for lui-fill-type that configures this for users.

Some observations:

  1. I actually do not see time stamps anymore after the above configuration.
  2. Continuation lines in the input line are quite annoying
  3. C-a/C-e behavior is wonky. This is particularly iffy as they should have different behavior in the input line and the main buffer.

Of those, (2) is somewhat of a dealbreaker for me. I guess wrapping behavior can not be configured differently depending on the parts of the buffer you are in? :-)

@wasamasa
Copy link
Collaborator

I've disabled continuation lines in my setup, but have done the line wrapping a bit differently (I'm using visual-fill-column in combination with visual-line-mode to have wrapping going on at a specified width or less than that because I'm a special snowflake). The crucial part of it is (setf (cdr (assoc 'continuation fringe-indicator-alist)) nil).

edit: That is part of the linked wiki entry, so nevermind.

@jorgenschaefer
Copy link
Collaborator

Added one more annoyance with (2): Typing a longer line creates a new displayed line, which causes the window to scroll, which makes lui not keep the line flushed to the bottom for some reason. (I hate the hacky nature of that feature, and that Emacs has no way of doing this correctly.)

@ghost
Copy link
Author

ghost commented Jun 18, 2015

@jorgenschaefer Good catch!

  1. I'm not sure what is causing your issue with timestamps. My values appear to be respected, and in my main configuration I have left-aligned timestamps that have yet to cause an issue.
    2a) Sorry I forgot to add the last snippit from the Fluid-Width section of the wiki as pointed out by @wasamasa, it has since been updated
    2b) lui not remaining flush to the bottom is my biggest annoyance, and I'm not sure how to handle long links from wrapping to a newline. This is probably the biggest issue imo.
  2. C-a/C-e seem to work as intended, unable to reproduce.

I'll continue testing this and report back sometime tomorrow when I have more brain cells firing.

@jorgenschaefer
Copy link
Collaborator

The snippet from the wiki is for GUI versions. I'm on a terminal. I probably did not clarify enough what I find annoying: If I type a long line, it gets broken into multiple lines and continuation lines receive the wrap-prefix, which is highly confusing (and annoying) for input. Ideally, wrap-prefix for the input line should be "".

C-a/C-e are confusing in the channel buffer, as they do not follow visual lines, as wasamasa notes.

@ghost
Copy link
Author

ghost commented Jun 18, 2015

Ah I apologize for misunderstanding that point. Even with an empty wrap-prefix the lines are still behaving strangely, but it does not seem to impact usability when in a tty as the text is still visible (though this is rather annoying).

Also, I believe I found what may be preventing your timestamps from displaying. For a right-aligned timestamp I use the following modified from the wiki:

;; Fluid-width Windows
(setq
 lui-time-stamp-position 'left-margin
 lui-fill-type nil)

(add-hook 'lui-mode-hook 'my-lui-setup)
(defun my-lui-setup ()
  (setq
   fringes-outside-margins t
   right-margin-width 6
   word-wrap t
   wrap-prefix "   "))
(setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)

;; Timestamps in Margins
(setq
 lui-time-stamp-position 'right-margin
 lui-time-stamp-format "%H:%M")

(add-hook 'lui-mode-hook 'my-circe-set-margin)
(defun my-circe-set-margin ()
  (setq right-margin-width 6))

@jorgenschaefer
Copy link
Collaborator

it does not seem to impact usability […] though this is rather annoying

We seem to have different ideas about what "usability" means :-D

Thanks for the snippet. What exactly did you change there? All I noticed was that you removed the brackets around time stamps and made the margin smaller?

@jorgenschaefer
Copy link
Collaborator

Noticed another strange thing, links seem to get broken up in a really weird way

link breakage

@ghost
Copy link
Author

ghost commented Jun 18, 2015

There are too many minor issues for this to be pleasant for new users. For now I'll recommend that we close this issue and plan for this to land beyond the v2.0 release (or until the expected behavior is improved).

@jorgenschaefer
Copy link
Collaborator

We could add a convenience function, or a setting for lui-fill-type, to configure this for users who want it.

@ghost ghost closed this as completed Jun 26, 2015
@jorgenschaefer jorgenschaefer modified the milestones: v2.1, v2.0 Jun 26, 2015
@jorgenschaefer
Copy link
Collaborator

Hm. I like the idea of making lui-fill-type configurable to have this option, even if it's not enabled by default. So reopening this. :-)

@ghost
Copy link
Author

ghost commented Jun 26, 2015

I need to stop using github while drinking, it's very hazardous!

@jorgenschaefer
Copy link
Collaborator

Nothing that's undoable is hazardous! :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants