syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.7k stars 4.9k forks source link

Line wrap buggy in Elfeed on Mac Mojave in full screen mode #12108

Closed NatHarari closed 3 years ago

NatHarari commented 5 years ago

Description :octocat:

Issue with Elfeed in full screen on Mac Mojave

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: The opened buffer with the article, if running across the screen to wrap around, will not be wrapping properly. You have to turn off global-visual-line-mode and then turn it back on to get it to display correctly. This occurs when in full screen mode on the mac, and not when in any windowed mode.

Expected behaviour: :heart: :smile: The text should wrap normally under all circumstances.

System Info :computer:

- System configuration features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS

#### Backtrace :paw_prints:

I'm not sure what a backtrace is, but I shall endeavour to research it as soon as this is submitted.

duianto commented 5 years ago

It does not seem to be fullscreen related, I'm seeing the same thing both with and without fullscreen Emacs.

The issues seems to be that the lines are wrapped by character:

emacs_2019-04-12_01-28-27

global-visual-line-mode is set to nil by default.

After toggling it on M-x global-visual-line-mode, then the lines are wrapped by word:

emacs_2019-04-12_01-28-35

I'm seeing the same thing in Windows 10 version 1803 Emacs 26.1 and Ubuntu 18.04.2, Emacs 27.0.50

System Info :computer:

NatHarari commented 5 years ago

Try viewing another article after turning it on. Hit q to leave the viewing window and pull up another article. I have to reset the setting each time. It never sticks.

-- Nathaniel Harari Sent with Airmail

On April 12, 2019 at 01:35:51, duianto (notifications@github.com) wrote:

It does not seem to be fullscreen related, I'm seeing the same thing both with and without fullscreen Emacs.

The issues seems to be that the lines are wrapped by character:

[image: emacs_2019-04-12_01-28-27] https://user-images.githubusercontent.com/13420573/56002381-79e56b80-5cc2-11e9-8071-c98631722796.png

global-visual-line-mode is set to nil by default.

After toggling it on M-x global-visual-line-mode, then the lines are wrapped by word:

[image: emacs_2019-04-12_01-28-35] https://user-images.githubusercontent.com/13420573/56002445-af8a5480-5cc2-11e9-88e8-9b7b70f4d16f.png

I'm seeing the same thing in Windows 10 version 1803 Emacs 26.1 and Ubuntu 18.04.2, Emacs 27.0.50 System Info 💻

(c-c++ elfeed helm emacs-lisp git multiple-cursors treemacs version-control)

  • System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/syl20bnr/spacemacs/issues/12108#issuecomment-482373021, or mute the thread https://github.com/notifications/unsubscribe-auth/ASnft6SPokVfvudtg3j6zjqneI_4kCE6ks5vf8bXgaJpZM4cTlY2 .

duianto commented 5 years ago

doom-emacs has a function with this docstring:

"Enhances an elfeed entry's readability by wrapping it to a width of `fill-column' and centering it with `visual-fill-column-mode'."

https://github.com/hlissner/doom-emacs/blob/5dacbb7cb1c6ac246a9ccd15e6c4290def67757c/modules/app/rss/autoload.el#L18

Maybe something similar could be implemented in Spacemacs.

duianto commented 5 years ago

Here's another possible solution for adding word wrapping: https://github.com/skeeto/elfeed/issues/190#issuecomment-384346895

NatHarari commented 5 years ago

Here's another possible solution for adding word wrapping: skeeto/elfeed#190 (comment)

That fixed it. Thanks. I was able to change the font and size to my liking. It works pretty well now, except that it removes the left pane buffer with the news feeds when you click on an article. Closing the article returns to the search feed as normal. It's not a huge deal though. It would be nice to fix it eventually but so far, I can definitely live with this. :)

NatHarari commented 5 years ago

Fixed it. Apparently, elfeed uses shr-width to render html, so the Doom code worked. I customized it so it's more or less centered and the font is bigger for easy reading articles. I have my font set to monofur for powerline and the size is 21, but you can change it to anything you like.

Here is the code:

  (add-hook 'elfeed-show-mode-hook
            (lambda ()
              (let ((inhibit-read-only t)
                    (inhibit-modification-hooks t))
                (setq-local truncate-lines nil)
                (setq-local shr-width 85)
                (set-buffer-modified-p nil))
              (set-face-attribute 'variable-pitch (selected-frame) :font "monofur for Powerline-21")
              (setq-local left-margin-width 15)
              (setq-local right-margin-width 15)

              ))
syl20bnr commented 5 years ago

Is there a PR to incorporate these fixes in Spacemacs ?

NatHarari commented 5 years ago

Duianto fixed it in gitter chat with me today simply by making me remove the elfeed-goodies package thusly:

Change elfeed-goodies to:

(elfeed-goodies :toggle elfeed-want-goodies)

Then added: elfeed-want-goodies nil to the layer config:

 (elfeed :variables
         elfeed-want-goodies nil
         elfeed-feeds '(("http://nullprogram.com/feed/" blog emacs)
                        "http://www.50ply.com/atom.xml"  ; no autotagging
                        ("http://nedroid.com/feed/" webcomic)))

https://github.com/syl20bnr/spacemacs/blob/145f7e56cce82039ef565eb9432116f78de308a8/layers/%2Breaders/elfeed/packages.el#L14

This removes all "features" from the spacemacs implementation and reverts elfeed back to the default package, but with the spacemacs keybindings. It formats the text properly with wrapping and produces no errors (so far). It's made me incredibly happy as Elfeed is now working properly as it does in Emacs. 👍

syl20bnr commented 5 years ago

This is a work-around but it does not really fix the issue. You don't need to add a toggle to exclude a package completely from Spacemacs, you can just add the package to the variable dotspacemacs-excluded-packages and it is like it never existed for your Spacemacs.

syl20bnr commented 5 years ago

I would prefer we fix the actual problem with efleed-goodies and make the reading pane and wrapping to work correctly.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!