[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA] Add 'pulsar' package
From: |
Philip Kaludercic |
Subject: |
Re: [ELPA] Add 'pulsar' package |
Date: |
Wed, 23 Mar 2022 09:03:50 +0000 |
Protesilaos Stavrou <info@protesilaos.com> writes:
> 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.
I am currently short on time, and have other projects with higher
priorities, so finding the time to implement and discuss a feature I am
not personally interested in is a bit difficult right now.
>>> 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.
In that case the above patch should certainly be expanded, so that it is
even in a position to eventually deprecate pulsar.
--
Philip Kaludercic
- [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, 2022/03/22
- Re: [ELPA] Add 'pulsar' package,
Philip Kaludercic <=