GNU bug report logs - #13892
24.3.50; Provide for customizing default regexp in hi-lock commands

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Wed, 6 Mar 2013 17:57:01 UTC

Severity: wishlist

Found in version 24.3.50

Done: Jambunathan K <kjambunathan <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jambunathan K <kjambunathan <at> gmail.com>
Subject: bug#13892: closed (Re: bug#13892: 24.3.50; Provide for
 customizing default regexp in hi-lock commands)
Date: Fri, 08 Mar 2013 04:31:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#13892: 24.3.50; Provide for customizing default regexp in hi-lock commands

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 13892 <at> debbugs.gnu.org.

-- 
13892: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13892
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jambunathan K <kjambunathan <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 13892-done <at> debbugs.gnu.org
Subject: Re: bug#13892: 24.3.50;
	Provide for customizing default regexp in hi-lock commands
Date: Fri, 08 Mar 2013 09:59:42 +0530
Juri Linkov <juri <at> jurta.org> writes:

>> +(defvar hi-lock-read-regexp-defaults-function
>> +  'hi-lock-read-regexp-defaults
>> +  "Function that provides default regexp(s) for highlighting commands.
>> +This function should take one argument OP and return one of nil,
>> +a regexp or a list of regexps for use with highlighting command
>> +OP.  OP, a symbol, can be one of `phrase', `line' or `nil'
>> +signifying commands `hi-lock-face-phrase-buffer',
>> +`hi-lock-line-face-buffer' and `hi-lock-face-buffer'
>> +respectively.
>
> Requiring an additional argument `op' means that we wouldn't
> be able to customize `hi-lock-read-regexp-defaults-function'
> to just `find-tag-default' or `find-tag-default-as-regexp'.
> I think there is no need to distinguish between different
> hi-lock commands since one user would very likely prefer
> the one way to get the default for all hi-lock commands,
> so you could call `hi-lock-read-regexp-defaults-function'
> without arguments.

Committed as bzr revision 111971.

I have removed OP, updated the docstring.  I have also introduced
`find-tag-default-as-regexp' in subr.el.


[Message part 3 (message/rfc822, inline)]
From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Provide for customizing default regexp in hi-lock commands
Date: Wed, 06 Mar 2013 23:26:09 +0530
[Message part 4 (text/plain, inline)]
Provide for customizing default regexp in hi-lock commands

See bug#13687 & Co. disussion surrounding this feature-let.  

Let me know if the patch is OK, so that I can install it in trunk.

[Message part 5 (diff, attachment)]
[Message part 6 (text/plain, inline)]

I also need a ready-made function for retrieving the regexp for symbol
at point.

I can install this as a new defun in subr.el

    (defun find-tag-default-as-regexp ()
      (let* ((tagf (or find-tag-default-function
                       (get major-mode 'find-tag-default-function)
                       'find-tag-default))
             (tag (funcall tagf)))
        (cond ((not tag))
              ((eq tagf 'find-tag-default)
               (format "\\_<%s\\_>" (regexp-quote tag)))
              (t (regexp-quote tag)))))

or

Augment existing `find-tag-default' to take an optional argument like so


[Message part 7 (diff, attachment)]

This bug report was last modified 12 years and 77 days ago.

Previous Next


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