[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA] Add 'pulsar' package
From: |
Protesilaos Stavrou |
Subject: |
Re: [ELPA] Add 'pulsar' package |
Date: |
Tue, 22 Mar 2022 12:37:14 +0200 |
User-agent: |
Notmuch/0.35 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
On 2022-03-20, 11:29 +0000, Philip Kaludercic <philipk@posteo.net> wrote:
>> As I wrote before, I do not know how best to do this in core. This is
>> not me faking ignorance to support a different opinion: I genuinely do
>> not know how to do this with a single option. Please do it if you
>> can---it will also help me learn something new.
>
> This is a quick sketch:
>
> diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
> index f7af10887c..97803d08c1 100644
> --- a/lisp/cedet/pulse.el
> +++ b/lisp/cedet/pulse.el
> @@ -102,6 +102,22 @@ pulse-delay
> :group 'pulse
> :type 'number)
>
> +;;;###autoload
> +(defcustom pulse-after-commands '()
> + "List of commands to pulse the current line after invocation."
> + :set (lambda (sym val)
> + (funcall (if val #'add-hook #'remove-hook)
> + 'post-command-hook
> + #'pulse--after-command)
> + (set-default sym val))
> + :group 'pulse
> + :type '(repeat symbol))
> +
> +(defun pulse--after-command ()
> + "Pulse if the current command is in `pulse-after-commands'."
> + (when (memq this-command pulse-after-commands)
> + (pulse-momentary-highlight-one-line)))
> +
> ;;; Convenience Functions
> ;;
> (defvar pulse-momentary-overlay nil
>
> This can be extended by allowing regular expressions to match sets of
> commands, or cons-cells to configure additional details (color,
> duration, multiple pulses, ...) for specific case.
That's neat. Thanks for sharing! In the original version of my code I
was using an advice, but changed it to post-command-hook following
feedback from Daniel Mendler.
Will you include a variant of this in pulse.el? Then I can reference it
in pulsar's manual and tell people to use it if they want.
>> At any rate, this is not what this thread is about. I think pulsar
>> belongs in the archive. I post on emacs-devel to give others a chance
>> to point out any obvious flaws with the package. If there are none, the
>> patch must be installed in elpa.git (I have write access and can do that
>> myself, if needed).
>>
>> There are people who are already using pulsar and I believe there is no
>> technical reason why it should not be in GNU ELPA.
>
> In any case, I don't want to object, especially if others find the
> package useful. I just wanted to be sure that the alternative was
> mentioned.
You did the right thing in that regard.
> Unless anyone objects, there shouldn't be any problem if you push your
> patch to elpa.git.
I think we have given this sufficient time. I am pushing the change
now.
I want to do the same for lin, which is another small package I maintain
and which I recently refined: <https://protesilaos.com/emacs/lin>.
>> To your point though about patching the core, I repeat what I already
>> stated in unequivocal terms: I will deprecate pulsar when the Emacs
>> version that includes its functionality becomes the stable version of
>> Emacs. Until then, the package has a good reason to exist and be
>> readily available.
>
> I don't even think this is necessary. IMO there is nothing wrong with
> having a package on ELPA that extends or improves on a core feature.
Okay. I stand by my commitment and will adapt to what core Emacs is
doing.
--
Protesilaos Stavrou
https://protesilaos.com
- [ELPA] Add 'pulsar' package, Protesilaos Stavrou, 2022/03/14
- Re: [ELPA] Add 'pulsar' package, Philip Kaludercic, 2022/03/14
- Re: [ELPA] Add 'pulsar' package, Protesilaos Stavrou, 2022/03/14
- Re: [ELPA] Add 'pulsar' package, Philip Kaludercic, 2022/03/14
- Re: [ELPA] Add 'pulsar' package, Protesilaos Stavrou, 2022/03/16
- Re: [ELPA] Add 'pulsar' package, Philip Kaludercic, 2022/03/16
- Re: [ELPA] Add 'pulsar' package, Protesilaos Stavrou, 2022/03/20
- Re: [ELPA] Add 'pulsar' package, Philip Kaludercic, 2022/03/20
- Re: [ELPA] Add 'pulsar' package,
Protesilaos Stavrou <=
- Re: [ELPA] Add 'pulsar' package, Philip Kaludercic, 2022/03/23