Git Product home page Git Product logo

corfu-doc's People

Contributors

ashton314 avatar fredericgiquel avatar galeo avatar manateelazycat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

corfu-doc's Issues

Not an issue :)

Thanks for the great package. Can you please tell what the theme is in the screenshot? :)

Doc frame extends outside of view on monitor

I sometimes see completions like this, where the documentation frame is way to the left and cut off at the edge of my monitor:

I've only seen this with cider, and mostly in the cider REPL as I recall.

I'm using Emacs 29 recent master on a MacOS M1 machine.

I tried with corfu-doc-display-within-parent-frame set to both nil and t; same result.

Integration with LSP mode

Hey there!

I know this is pretty alpha-stuff, so please don't feel pressure from my asking about features. :) I really, really don't want to encroach on your time.

That said, does this work with lsp-mode? When I've tried it it doesn't seem to work. I can get some documentation from inside of corfu with M-h. It would be really snazzy if that documentation popped up in this window. Is there just something that I need to configure?

I just started the school semester; I doubt I'll personally have much time to tinker with this, but if there is something I might be able to help with, please let me know and I'll see what I can do.

Thank you for publishing this! I love that you just kind of said "fine, I'll do it myself" ala Thanos when @minad said this kind of thing wasn't a priority. πŸ˜„

Reccommended key bindings are backwards?

(define-key corfu-map (kbd "M-p") #'corfu-doc-scroll-down) ;; corfu-next
(define-key corfu-map (kbd "M-n") #'corfu-doc-scroll-up)  ;; corfu-previous

Hi! I guess this might be a matter of perspective, but these binds feel backwards to me; corfu-next advances down to the next selection, which does correspond to corfu-doc-scroll-down, but would conventionally be bound to M-n (n for next), not M-p (and vice versa).

emacs-daemon won't start after the latest update

Hello, I use emacs-daemon + emacsclient on Arch Linux. I usually run emacs using systemctl --user start emacs.service. After the latest update of corfu-doc I'm getting the error in logs:

Jun 06 10:52:36 rudakov-xps emacs[4841]: Warning (initialization): An error occurred while loading β€˜/home/rrudakov/.emacs.d/init.el’:
Jun 06 10:52:36 rudakov-xps emacs[4841]: error: Corfu-doc requires child frames to display documentation
Jun 06 10:52:36 rudakov-xps emacs[4841]: To ensure normal operation, you should investigate and remove the
Jun 06 10:52:36 rudakov-xps emacs[4841]: cause of the error in your initialization file.  Start Emacs with
Jun 06 10:52:36 rudakov-xps emacs[4841]: the β€˜--debug-init’ option to view a complete error backtrace. Disable showing Disable logging
Jun 06 10:52:36 rudakov-xps emacs[4841]: Package rfc2368 is deprecated
Jun 06 10:52:36 rudakov-xps emacs[4841]: Package cl is deprecated

Starting emacs without systemctl works fine.

`corfu`, `corfu-doc` and `corfu-terminal`

Hi,

I'm the author of corfu-terminal. corfu-terminal allows to use Corfu on terminal. I'm trying to make corfu-doc working in terminal, but I can't find any sane way to do this, because corfu-doc depends heavily on the window of child frame. For Corfu, it was easy because though it uses child frame, it is line oriented.

Can you help to corfu-doc usable on terminal? One solution would be to use corfu--popup-show and corfu--popup-hide but that might be too specialized for Corfu to use. Another solution would be to not depend on the window of child frame, instead be line oriented like Corfu and rewrite the doc buffer (the buffer visible in the child frame) for every change (e.g. scroll, candidate change) using a function to show the popup and another to hide it. Then I can write a package like corfu-doc-terminal and override those functions that show and hide the popup. If you don't do anything, then another package must be developed from scratch for doing the same work but with terminal support, which is indeed undesirable.

Enabling corfu-doc-mode in init.el errors when running emacs as daemon

After updating the package today, the (corfu-doc-mode) line in my init.el works when emacs is started normally, but errors when emacs is started as a daemon. This is likely because when running as daemon, no frame is available while running init.el.

The exact error I get is as follows:

Warning (initialization): An error occurred while loading β€˜/home/archit/.config/emacs/init.el’:

error: Corfu-doc requires child frames to display documentation

Emacs continues after the error but does not load the rest of init.el and shows the above error in the messages buffer.

I am using emacs 29 on Linux.

Relocate cache directory

Very fantastic work! I love the package.

I noticed that the package creates a .cache directory in the emacs-directory which stores SVG files. Though I'm not sure if this is directly from a setting this package set or a setting in another package this relies on, would it be possible to have a variable which chooses which directory is the cache?

Feedback

Hey @galeo,

in preparation of minad/corfu#178 I tested your package more thoroughly. Overall, this is great work! I observed a few issues which should be resolved first before merging this into Corfu itself:

  • When scrolling over candidates the doc frame flickers heavily. It always redisplays once without content and then with content. Is there a chance to improve this such that the content is displayed immediately?

  • There are multiple missing docstrings and other warnings which should be sorted out. Check out package-lint.

  • The option corfu-doc-display-within-parent-frame is set to nil by default. This option does not work on most platforms, in particular not on the free ones. I suggest we remove the option entirely and always display the frame inside the parent frame. This should also simplify the position computation slightly.

  • You define a variable space=1 in corfu-doc--calculate-doc-frame-position such that the frames have a distance of 1. Did you consider instead to move the frames very close to each other space=-1, such that they share the border. This looks better in my opinion. (EDIT: Fixed, but we should also handled border width /= 1.)

  • Sometimes the child frame size fluctuates slightly when scrolling. This is probably related to the redisplay issue when scrolling.

  • You use advices to hook into Corfu. Would it be possible to instead register a post-command-hook and then perform the required updates there, depending on if the corfu--frame is alive, the selected candidate etc? This seems a little bit cleaner.

Child frame not positioned correctly with external monitor

Hey there! I love this package!

I'm getting an issue with the child frame when Emacs is on my external monitor. Here's what it looks like:

Screen Shot 2022-01-03 at 16 51 13 (2)

Is there anything else that I can contribute to help figure this out? I wouldn't call myself an elisp wizard or anything, but I can follow whatever instructions you give me. I'm sorry if this isn't too helpful. πŸ™

Mouse wheel to scroll documentation

Have you had any luck trying to bind the mouse wheel (button 4 and 5) to scroll documentation?

I tried but it didn't work. I'll try to reconstruct the command and paste it here.

Strange behavior when trying to complete after using corfu-quit

I noticed a behavior I cannot explain, which I will try to demonstrate below:

In the *scratch* buffer, I type y-[completion-at-point]:

image

Now, I will quit this completion with corfu-quit, and then try to complete at point (invoke completion-at-point) again, but now there is no corfu popup:

image

Repeating this process (of completing and quitting) would yield the above results, alternating between the two.

I do not have any special configuration (only the add-hook form from the README).

Why does this happen?

The reason I post this question here is because it happens only when corfu-doc-mode is enabled.

Inconsistent behavior in corfu-doc-toggle

Thanks for writing corfu-doc!

I noticed that the behavior of corfu-doc-toggle is inconsistent, in that it doesn't restore state correctly when you exit the Corfu completion. To reproduce this,

  1. Make sure corfu-doc-mode is off.
  2. Start a completion and call corfu-doc-toggle.
  3. Cancel the completion session with keyboard-quit.
  4. Start another completion. This time corfu-doc--frame pops up automatically because corfu-doc-mode was not turned off.

I modified this command to clean up after itself as follows:

(defun corfu-doc--cleanup ()
  (advice-remove 'corfu--popup-hide #'corfu-doc--cleanup)
  (advice-remove 'corfu--popup-show #'corfu-doc--set-timer)
  (corfu-doc--hide))

(defun corfu-doc-toggle ()
  (interactive)
  (advice-add 'corfu--popup-hide :after #'corfu-doc--cleanup)
  (if (and corfu-doc--frame (frame-visible-p corfu-doc--frame))
      (progn (corfu-doc--hide)
             (advice-remove 'corfu--popup-show #'corfu-doc--set-timer))
    (corfu-doc--show)
    (advice-add 'corfu--popup-show :after #'corfu-doc--set-timer)))

If you want to reuse corfu-doc-mode in corfu-doc-toggle, perhaps you could add an unwind-protect clause to this command instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.