GNU bug report logs -
#13892
24.3.50; Provide for customizing default regexp in hi-lock commands
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13892 in the body.
You can then email your comments to 13892 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13892
; Package
emacs
.
(Wed, 06 Mar 2013 17:57:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Jambunathan K <kjambunathan <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 06 Mar 2013 17:57:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (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 2 (diff, attachment)]
[Message part 3 (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 4 (diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13892
; Package
emacs
.
(Thu, 07 Mar 2013 09:22:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 13892 <at> debbugs.gnu.org (full text, mbox):
> +(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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13892
; Package
emacs
.
(Thu, 07 Mar 2013 10:33:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 13892 <at> debbugs.gnu.org (full text, mbox):
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.
I had the same thought but ended up with having an OP.
If we want to remove OP but still want the ability to choose the regexp
based on the highlighting command, then may be `this-command' can take
the place of OP.
ps: Does EmacsLisp have notion of function pointers (as in C). Here the
function pointer is not declared and the function pointer could well be
set in a .emacs file. So there is no way the byte-compiler can complain
based on arity. Does runtime check for arity? (I don't think so). May
be (i.e., technically) it is OK to call a function that takes no
argument with a single argument? I don't know. Let's see what others
think.
Reply sent
to
Jambunathan K <kjambunathan <at> gmail.com>
:
You have taken responsibility.
(Fri, 08 Mar 2013 04:31:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Jambunathan K <kjambunathan <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 08 Mar 2013 04:31:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 13892-done <at> debbugs.gnu.org (full text, mbox):
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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13892
; Package
emacs
.
(Sun, 10 Mar 2013 18:33:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 13892 <at> debbugs.gnu.org (full text, mbox):
> Provide for customizing default regexp in hi-lock commands
Actually it's possible do the same for hi-lock commands that read faces.
I mean moving the following part of `hi-lock-read-face-name':
(defaults (append hi-lock--unused-faces
(cdr (member last-used-face hi-lock-face-defaults))
hi-lock-face-defaults))
to a new function with a name like `hi-lock-read-face-name-defaults'
where you could implement your wishes for hi-lock face auto-rotation
and auto-selection of the next default face value. In a separate
function the users would be able to modify its default behavior easily.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 08 Apr 2013 11:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 76 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.