emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] New package: Peek


From: Meow King
Subject: Re: [ELPA] New package: Peek
Date: Wed, 19 Jul 2023 22:55:27 +0800
User-agent: mu4e 1.10.5; emacs 29.0.92

Thanks for your comment. It is valuable!

The detailed changes can be viewed here:
https://git.sr.ht/~meow_king/peek/commit/67992ac65d7b97574004bf97d8b5936ac28404b5

However, some changes need be noted:

> (defvar-local peek-live-update-associated-overlays nil
>   "Associated overlays for this buffer.
> @ -288,6 +278,9 @@ WDW: window body width"
>   (let* ((window-body-width (if wdw
>                                 wdw
>                               (window-body-width)))
>         ;; This approach seems to not work if the frame is resized.
>         ;; Perhaps you could take a similar approach like what
>         ;; `make-separator-line' does?
>          (total-column-number (if (display-graphic-p)
>                                   window-body-width
>                                 ;; terminal Emacs will pad '\' at the
>   line end

I test the `window-body-width` function when I resizing my Emacs frame(system
window) manually or using `set-frame-width` function. In both cases,
`window-body-width` function seems to work well. (ps: my emacs version
is `GNU Emacs 29.0.92 Development version f063f79a4933 on makepkg branch;
build date 2023-07-19. `). However, I have added a fallback method for
those users who is not satisfied with the current border formatting,
which can be achieved though setting `peek-overlay-border-character` to
nil to make border looks just like `make-separator-line` do.

> +(declare-function peek-display-eldoc "peek" (docs interactive))
> +
>  ;;;###autoload
>  (when (>= emacs-major-version 28)
> +  ;; Are you sure you want to autoload the `when' expression?  Unless
> +  ;; I am mistaken, that means that this entire expression will be
> +  ;; copied into the autoload file, which can cause warnings due to
> +  ;; `eldoc--format-doc-buffer' or `peek-get-or-create-window-overlay'
> +  ;; not being defined.
>    (defun peek-display-eldoc (docs interactive)
>      "Related function: `eldoc-display-functions'.
>  DOCS: docs passed by eldoc.

I have put the `when` expression into the `defun` expression and remove
the `declare-function` expression. I guess this makes things better,
hopefully xD.

> I tried it out briefly, but did not figure out how to disable the
> "peek".  Perhaps you should rebind keyboard-quit to hide it?

You can use `peek-overlay-dwim` command again to hide the peek view as
is mentioned in the README. Rebinding `keyboard-quit` seems to be a more
authentic way to do such stuffs in Emacs. However, since Peek is a
global mode(`global-peek-mode`), and the keybindings in its keymap is
always active when not overlapped, rebinding `keyboard-quit` may
override `keyboard-quit` keybinding in other modes keymap. And also, I
don't think activating/deactivating `peek-mode-keymap` when peek view is
shown/hide is a good idea, because users may bind other keys in
`peek-mode-keymap`.

Again, thanks for your comment, from which I really learned a lot!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]