From: Stefan Kangas <stefankangas@gmail.com>
To: Gabriel <gabriel376@hotmail.com>
Cc: 62988@debbugs.gnu.org
Subject: bug#62988: 30.0.50; Add highlight line-or-region command to pulse.el
Date: Tue, 5 Sep 2023 09:24:18 -0700 [thread overview]
Message-ID: <CADwFkmm3OY7VT5GJCSVv9a=FmJsYcSaGyKok4w7VpmMHZRY92g@mail.gmail.com> (raw)
In-Reply-To: <PH8PR19MB7070793A676262112DC66AEA8B609@PH8PR19MB7070.namprd19.prod.outlook.com> (Gabriel's message of "Fri, 21 Apr 2023 03:04:49 -0300")
Gabriel <gabriel376@hotmail.com> writes:
> My suggestion is to add a new command (i.e. an interactive function) to
> pulse.el to highlight the current line or region. The basic functions
> already exist, but no command is provided. This command is useful, for
> example, in videos, demos or pair-programming sessions where the user
> wish to highlight the current line or region for the audience.
>
> Although pulse.el is part of CEDET, it provides general-purpose
> functions not coupled to CEDET.
Indeed. I guess this is only in the lisp/cedet for hysterical raisins.
> Example: apply patch and bind the new command to F1 key
>
> (keymap-set global-map
> "<f1>"
> #'pulse-momentary-highlight-line-or-region)
Your patch and the feature makes sense to me, and I guess some users
might want it. I think it should be called out in NEWS, and then it can
go in.
> ============================================================
>
>>From 30681b98fed3e90a653a741a644c94ee4f89a719 Mon Sep 17 00:00:00 2001
> From: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
> Date: Fri, 21 Apr 2023 02:51:47 -0300
> Subject: [PATCH 1/1] Add command to highlight line or region to pulse.el
>
> * lisp/cedet/pulse.el
> (pulse-momentary-highlight-line-or-region): New command.
> ---
> lisp/cedet/pulse.el | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
> index 37b41fbe8c3..c76668152f7 100644
> --- a/lisp/cedet/pulse.el
> +++ b/lisp/cedet/pulse.el
> @@ -215,6 +215,14 @@ pulse-momentary-highlight-region
> (overlay-put o 'pulse-delete t)
> (pulse-momentary-highlight-overlay o face)))
>
> +;;;###autoload
> +(defun pulse-momentary-highlight-line-or-region ()
> + "Highlight current region, when active, or current line, otherwise."
> + (interactive)
> + (if (use-region-p)
> + (pulse-momentary-highlight-region (region-beginning) (region-end))
> + (pulse-momentary-highlight-one-line)))
> +
> ;;; Random integration with other tools
>
> (defvar pulse-command-advice-flag nil)
prev parent reply other threads:[~2023-09-05 16:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 6:04 bug#62988: 30.0.50; Add highlight line-or-region command to pulse.el Gabriel
2023-09-05 16:24 ` Stefan Kangas [this message]
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='CADwFkmm3OY7VT5GJCSVv9a=FmJsYcSaGyKok4w7VpmMHZRY92g@mail.gmail.com' \
--to=stefankangas@gmail.com \
--cc=62988@debbugs.gnu.org \
--cc=gabriel376@hotmail.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).