GNU bug report logs - #62988
30.0.50; Add highlight line-or-region command to pulse.el

Previous Next

Package: emacs;

Reported by: Gabriel <gabriel376 <at> hotmail.com>

Date: Fri, 21 Apr 2023 06:11:02 UTC

Severity: wishlist

Found in version 30.0.50

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gabriel <gabriel376 <at> hotmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Add highlight line-or-region command to pulse.el
Date: Fri, 21 Apr 2023 03:04:49 -0300
[Message part 1 (text/plain, inline)]
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)

============================================================
[0001-Add-command-to-highlight-line-or-region-to-pulse.el.patch (text/x-diff, inline)]
From 30681b98fed3e90a653a741a644c94ee4f89a719 Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376 <at> 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

[Message part 3 (text/plain, inline)]
============================================================

---
Gabriel

This bug report was last modified 1 year and 287 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.