unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gabriel <gabriel376@hotmail.com>
To: 62988@debbugs.gnu.org
Subject: bug#62988: 30.0.50; Add highlight line-or-region command to pulse.el
Date: Fri, 21 Apr 2023 03:04:49 -0300	[thread overview]
Message-ID: <PH8PR19MB7070793A676262112DC66AEA8B609@PH8PR19MB7070.namprd19.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

severity: wishlist

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.

Example: apply patch and bind the new command to F1 key

(keymap-set global-map
            "<f1>"
            #'pulse-momentary-highlight-line-or-region)

============================================================

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-command-to-highlight-line-or-region-to-pulse.el.patch --]
[-- Type: text/x-diff, Size: 1077 bytes --]

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)
-- 
2.34.1


[-- Attachment #3: Type: text/plain, Size: 74 bytes --]

============================================================

---
Gabriel

             reply	other threads:[~2023-04-21  6:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  6:04 Gabriel [this message]
2023-09-05 16:24 ` bug#62988: 30.0.50; Add highlight line-or-region command to pulse.el Stefan Kangas

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=PH8PR19MB7070793A676262112DC66AEA8B609@PH8PR19MB7070.namprd19.prod.outlook.com \
    --to=gabriel376@hotmail.com \
    --cc=62988@debbugs.gnu.org \
    /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).