unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Maske <maske1foro@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to modify a function of a package
Date: Thu, 12 Oct 2023 22:02:00 +0000	[thread overview]
Message-ID: <87h6mvzehz.fsf@posteo.net> (raw)
In-Reply-To: <ug9iaq$shs$1@ciao.gmane.io> (Maske's message of "Thu, 12 Oct 2023 21:39:39 +0200")

Maske <maske1foro@gmail.com> writes:

> Hi
>
> I have installed a package and I want to modify a function of it, but
> not in the package itself, because if there is an update it would stop
> working, so I have added the function modified in my init file. But,
> it doesn't work. The package behavior is not altered.

If you know that it will only affect you and you can reasonably assume
that the feature will be stable in future versions, you can take a look
at `(elisp) Advising Functions'.  Specifically the function
`define-advice' could be of use, here is an example that pulses the
region evaluated using C-M-x:

(define-advice eval-region (:after (start end &rest _))
  (pulse-momentary-highlight-region start end))

The other option is always to share your contribution with the author
and all other users.  This might require some discussions and
generalising whatever you changed, and even if nothing is accepted you
probably stand learning something new, so it is always worth the try.
You can use package-vc-install to fetch the package sources (which btw.
doesn't loose local modifications on updating, but therefore might
require resolving a merge-conflict), and package-vc-submit-patch to send
the change to the maintainer.

> What would be the correct way?
>
> Best regards



  reply	other threads:[~2023-10-12 22:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 19:39 How to modify a function of a package Maske
2023-10-12 22:02 ` Philip Kaludercic [this message]
2023-10-13  4:24   ` tomas
2023-10-12 23:54 ` Emanuel Berg
2023-10-28 13:18 ` Nikolay Kudryavtsev
2023-10-28 23:55   ` Maske

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6mvzehz.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=help-gnu-emacs@gnu.org \
    --cc=maske1foro@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).