* Re: pabbrev
[not found] <CANsDbAYKM_3PSEkt+by5tBA1iza4spUOGLQgXCM9vyxh3TaGjg@mail.gmail.com>
@ 2024-02-14 22:23 ` Arthur Miller
2024-02-19 11:50 ` pabbrev Ihor Radchenko
0 siblings, 1 reply; 3+ messages in thread
From: Arthur Miller @ 2024-02-14 22:23 UTC (permalink / raw)
To: Terrence Yearwood; +Cc: phillip.lord, emacs-devel
Terrence Yearwood <send2tsy@gmail.com> writes:
Hi Terrence, thank you very much for the bug repport and fix.
> Hello, sorry about contacting you directly.
> I'm a hobbyist, don't have github account.
Github is not a problem. You can send me a patch; it works fine or me.
However, you need to sign FSF copyright if you would like to add any significant
contribution. However, this one seems like a very small so it is probably not a
problem. However, I have attached emacs-devel just to double check. I am a bit
new to maintaining a package myself.
> I've been using this essential package for ages!
I have just discovered it myself, but I think it is great. Thanks goes to
Phillip!
> I noticed an anomaly from the time I started using pabbrev.
> The following message would pop up when I updated my packages:
>
> Error running timer ‘pabbrev-idle-timer-function’: (error "Selecting
> deleted buffer")
>
> In October 2023, I decided to fix the problem.
> The following is the context for the error:
>
> (1) pabbrev enabled globally
> (2) execute command: package-list-packages
> or from the menu: Options -> Manage Emacs Packages
I have now tested, but I can't reproduce the bug you are describing. I did M-x
package-list-packages, followed by an U x to update packages, whereas about 15
packages got upgraded.
Pabbrev was not complaining and I do use global pabbrev mode. I uninstalled my
in-house I work on, and have installed one from the Melpa. It can be a different
versions of Emacs perhaps?
However, it sounds reasonable to me to check if a buffer is live; so I have no
problems installing your suggestion if it is OK from the copyright perspective.
> The following is the modified function:
>
> (defun pabbrev-idle-timer-function (&optional buffer)
> ;; so this only works on the current buffer. Might want to scavenge
> ;; over other buffers
> (let ((first-live-bufr (seq-find #'buffer-live-p (list buffer
> pabbrev-timer-buffer (current-buffer)) nil)))
> (when (or first-live-bufr)
> (with-current-buffer first-live-bufr
> (if (and pabbrev-mode (not pabbrev-disable-timers))
> (pabbrev-idle-timer-function-0)
> (pabbrev-debug-message "idle running in non pabbrev-mode"))))))
>
>
> Thx
Just a small stylistic remark:
(when (or first-live-bufr))
Or is not needed; I guess just a left over from some testing.
We can also combine `let' and `when' in one form, so I have rewritten the code
to:
(defun pabbrev-idle-timer-function (&optional buffer)
;; so this only works on the current buffer. Might want to scavenge
;; over other buffers
(when-let ((first-live-bufr
(seq-find
#'buffer-live-p
(list buffer pabbrev-timer-buffer (current-buffer)))))
(with-current-buffer first-live-bufr
(if (and pabbrev-mode (not pabbrev-disable-timers))
(pabbrev-idle-timer-function-0)
(pabbrev-debug-message "idle running in non pabbrev-mode")))))
If someone of emacs maintainers can confirm that 4 lines of code are not
requiring FSF copyright aissignement, I'll be happy to install the suggestion by
Terrence. For the eventual future info: how much is considered as
"insignificant" and how do I test if someone has signed FSF papers? It was about
sending email to some addresss?
Thank you very much for the help.
PS:
I have attached Phillip, I think he is happy to hear people are using his
package for years.
Best regards
/arthur
^ permalink raw reply [flat|nested] 3+ messages in thread