]> git.eshelyaron.com Git - emacs.git/commitdiff
Make argument optional in pulse-momentary-highlight-one-line
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 18 Sep 2021 14:12:56 +0000 (16:12 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 18 Sep 2021 16:18:13 +0000 (18:18 +0200)
* lisp/cedet/pulse.el (pulse-momentary-highlight-one-line): Make
POINT optional (bug#50642) so that the function can be used more
easily from some hook functions.

lisp/cedet/pulse.el

index 7928fa1bf420dd42ed03bd4b2abba62f321216e9..b02694402915fe8646835eb0cd9c576e919fd62e 100644 (file)
@@ -195,11 +195,13 @@ Optional argument FACE specifies the face to do the highlighting."
   (remove-hook 'pre-command-hook #'pulse-momentary-unhighlight))
 
 ;;;###autoload
-(defun pulse-momentary-highlight-one-line (point &optional face)
+(defun pulse-momentary-highlight-one-line (&optional point face)
   "Highlight the line around POINT, unhighlighting before next command.
+If POINT is nil or missing, the current point is used instead.
+
 Optional argument FACE specifies the face to do the highlighting."
   (save-excursion
-    (goto-char point)
+    (goto-char (or point (point)))
     (let ((start (point-at-bol))
           (end (save-excursion
                  (end-of-line)