Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 31 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jambunathan K  
View profile  
 More options Oct 10 2012, 4:20 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Thu, 11 Oct 2012 01:51:08 +0530
Local: Wed, Oct 10 2012 4:21 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

I am attaching a patch that addresses Part-I/Item-1 below.  

The patch adds no functionality.  It merely removes "color" from
appearing verbatim in the face variables.  

I am using `hi-lock-' as prefix.  Let me know if `highlight-' will be
more appropriate (considering that there is a standard highlight face).

  bug11095-part1.patch
5K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?" by Jambunathan K
Jambunathan K  
View profile  
 More options Oct 10 2012, 6:08 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Thu, 11 Oct 2012 03:38:51 +0530
Local: Wed, Oct 10 2012 6:08 pm
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Here is a patch for Part-1/Item-2.  This patch applies ON TOP OF
bug11095-part1.patch attached with
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11095#8)

--

  bug11095-part2.patch
2K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Oct 11 2012, 4:23 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Fri, 12 Oct 2012 01:54:30 +0530
Local: Thurs, Oct 11 2012 4:24 pm
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

The attached patch, applies on top of earlier two patches. See
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11095#11

The patch allows highlighting of tag at point.  (Note that for all
practical purposes, tag at point is the symbol at point.) See
Part_I/Item-2 below for a usecase.

--

  bug11095-part3.patch
3K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Oct 11 2012, 4:32 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Fri, 12 Oct 2012 02:03:11 +0530
Local: Thurs, Oct 11 2012 4:33 pm
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Jambunathan K <kjambunat...@gmail.com> writes:
> The attached patch, applies on top of earlier two patches. See
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11095#11

> The patch allows highlighting of tag at point.  (Note that for all
> practical purposes, tag at point is the symbol at point.) See
> Part_I/Item-2 below for a usecase.
> [2. bug11095-part3.patch --- text/x-diff; bug11095-part3.patch]...

Here is the Changelog entry for bug11095-part3.patch.  (Sorry for the
confusion, if any)

--

  bug11095-part3-changelog.patch
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Juri Linkov  
View profile  
 More options Oct 11 2012, 6:44 pm
Newsgroups: gnu.emacs.bug
From: Juri Linkov <j...@jurta.org>
Date: Fri, 12 Oct 2012 01:41:04 +0300
Local: Thurs, Oct 11 2012 6:41 pm
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Would you agree that a better way to implement your proposal is to add a new
command to hi-lock.el with a name like `highlight-symbol'?  I mean there are
already such hi-lock commands as:

1. highlight-lines-matching-regexp (that corresponds to occur)
2. highlight-regexp (that corresponds to isearch-forward-regexp)
3. highlight-phrase (that corresponds to isearch-forward-word)

what is currently missing is this command:

4. highlight-symbol (that corresponds to isearch-forward-symbol)

Then both highlight-phrase and highlight-symbol could use internally
isearch functions that turn words and symbols into regexps
and that will do the right thing using search-upper-case and
search-whitespace-regexp.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Oct 12 2012, 12:29 am
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Fri, 12 Oct 2012 10:00:07 +0530
Local: Fri, Oct 12 2012 12:30 am
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Have you tried the patches?

With my current patches, M-s h r will highlight symbol at point (more
precisely tag at point).  It may not be the best thing, but achieves the
task at hand.

Let me emphasize that the patches are mostly concerned with easy and
hands-off highlighting and un-highlighting (i.e., the highlighting
process itself - the "how" - rather than "what (regexp)" is highlighted
and how those regexes are composed.)  So the patches are valid
candidates for consideration, irrespective of your observations above.
As for handling of regexes themselves, I will rather leave it to more
experienced hands.

ps: I have one more patch to circulate - wrt unhighlighting - before I
leave the table open for further discussion.  Once I get some initial
comments, I can rework the changes and provide a (revised) consolidated
patch.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Oct 12 2012, 12:17 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Fri, 12 Oct 2012 21:47:47 +0530
Local: Fri, Oct 12 2012 12:17 pm
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

I am attaching a patch that addresses Part-II/Item-1 below.

This patch is 4-th in the series and applies on top of the third patch
seen here at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11095#14.

--

  bug11095-part4.patch
3K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Oct 12 2012, 2:18 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Fri, 12 Oct 2012 23:48:55 +0530
Local: Fri, Oct 12 2012 2:18 pm
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

I am attaching a patch that is 5-th and last in the series for my
proposal.  This patch applies on top of the 4-th patch visible here:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11095#26.

The patch adds an ability to un-highlight all highlighted text in the
buffer via a prefix arg.  See Part-II/Item-2 below.

ps: I am following up this mail with a consolidated patch, just in case
someone needs to try stuff out.

--

  bug11095-part5.patch
3K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "bug#11095: [FINAL] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?" by Jambunathan K
Jambunathan K  
View profile  
 More options Oct 12 2012, 3:31 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Sat, 13 Oct 2012 01:02:24 +0530
Local: Fri, Oct 12 2012 3:32 pm
Subject: bug#11095: [FINAL] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Here goes the final set for this bug.  The revnos. reflect the (local)
bzr revision.

0. bug11095-final-r110525.diff :: Consolidated final patch.

1. bug11095-r110501.diff :: Introduce hi-lock-* faces.
2. bug11095-r110502.diff :: Let each highlight command choose a new face
3. bug11095-r110503.diff :: By default, highlight symbol at point
4. bug11095-r110504.diff :: Un-highlight text at point
5. bug11095-r110505.diff :: Un-highlight all highlighted text

  bug11095-final-r110525.diff
14K Download

  bug11095-r110501.diff
4K Download

  bug11095-r110502.diff
3K Download

  bug11095-r110503.diff
4K Download

  bug11095-r110504.diff
3K Download

  bug11095-r110505.diff
3K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?" by Juri Linkov
Juri Linkov  
View profile  
 More options Oct 13 2012, 12:13 pm
Newsgroups: gnu.emacs.bug
From: Juri Linkov <j...@jurta.org>
Date: Sat, 13 Oct 2012 19:10:00 +0300
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

> Have you tried the patches?

I'm trying your patches now, thanks.  My initial reaction was to using
a symbol regexp "\\_<%s\\_>" in `read-regexp' to match a symbol at point.
I think such symbol specific defaults could be specified by callers of
`read-regexp' in its argument `DEFAULTS'.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Oct 13 2012, 1:28 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Sat, 13 Oct 2012 22:58:58 +0530
Local: Sat, Oct 13 2012 1:28 pm
Subject: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Juri Linkov <j...@jurta.org> writes:
>> Have you tried the patches?

> I'm trying your patches now, thanks.  My initial reaction was to using
> a symbol regexp "\\_<%s\\_>" in `read-regexp' to match a symbol at point.
> I think such symbol specific defaults could be specified by callers of
> `read-regexp' in its argument `DEFAULTS'.

(This is not a response to your post, but only to record my observations
for further consideration by the reviewer)

1. Highlighting (M-shr) can happen via isearch or through hi-lock mode
   (C-xwh).  

   I don't use isearch much.  So the patch merely formalizes what I had
   in my .emacs and it is done with my hi-lock mode glasses.

2. In `read-regexp' there is a `find-tag-default-function' but no
   `find-tag-regexp-function'.  i.e., `find-tag-default' returns a
   symbol at point.  But using `regexp-quote' on the result is a poor
   choice when in should actually be returning a symbol regexp. (When I
   am renaming symbols, I highlight them and then re-name.  In that
   case, the looser regexp is unreliable and annoying.  As you may very
   well agree, it is not uncommon to have variables share a common
   prefix.)

3. `read-regexp' will use tag at point as the default regexp.  If a
    caller - say a `highlight-symbol' function or a symbol yank from
    isearch context - then it is the responsibility of the caller to
    provide the right regexp.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?" by Stefan Monnier
Stefan Monnier  
View profile  
 More options Dec 4 2012, 4:14 pm
Newsgroups: gnu.emacs.bug
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Tue, 04 Dec 2012 16:14:41 -0500
Local: Tues, Dec 4 2012 4:14 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

> -(defface hi-yellow
> +(defface hi-lock-1

I'm not sure it's an improvement.  When choosing a face in
hi-lock-face-buffer, "hi-lock-1" doesn't speak much to me contrary to
"hi-yellow".

So, could you expand on your motivations for this change, so we can find
another solution that satisfies your use case and mine?

I've installed your second patch (the hi-lock-auto-select-face, tho
using `pop' to simplify the code), but when hi-lock-auto-select-face is
t the user can't specify a face any more, which I think is too drastic,
which should provide a C-u override or something.

I also installed the 4th patch (the defaults for unhighlight), tho
I removed the docstring change (we usually don't document which default
is used in minibuffer arguments).  Also I moved your code to a separate
function, to clarify the code.  Furthermore I did not install your
change to the completion table so only the regexps that match at point
get completed.  Instead the list of regexps is passed as a list
of defaults.

BTW the hi-lock-auto-select-face should be fixed to just hash-cons (aka
uniquify) regexps, so you don't need your maphash loop to recover the
regexp from the unique "serialized" number.

I also installed the 5th patch (the "unhighlight all") tho I'm not
yet sure this is the right interface.  OT1H I think it would be nicer to
provide this "all" as one of the choices in the minibuffer, but OTOH
I can't think of any way to do that which is not hideously hackish.

As for the 3rd patch, I haven't installed it yet because I'm worried
that (format "\\_<%s\\_>" (regexp-quote tag)) may sometimes fail to
match `tag', so I think it needs some additional sanity check.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Adams  
View profile  
 More options Dec 4 2012, 4:39 pm
Newsgroups: gnu.emacs.bug
From: "Drew Adams" <drew.ad...@oracle.com>
Date: Tue, 4 Dec 2012 13:39:21 -0800
Local: Tues, Dec 4 2012 4:39 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

> > -(defface hi-yellow
> > +(defface hi-lock-1

> I'm not sure it's an improvement.  When choosing a face in
> hi-lock-face-buffer, "hi-lock-1" doesn't speak much to me contrary to
> "hi-yellow".

Not specifically related to this face, but it is a bad idea, in general (no
doubt there are exceptions), for a face name to advertize particular face
attributes, such as the color.

The color is presumably something that the user can customize, and is typically
not something that speaks to the use or meaning of the face.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Dec 4 2012, 4:57 pm
Newsgroups: gnu.emacs.bug
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Tue, 04 Dec 2012 16:57:04 -0500
Local: Tues, Dec 4 2012 4:57 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

>> > -(defface hi-yellow
>> > +(defface hi-lock-1
>> I'm not sure it's an improvement.  When choosing a face in
>> hi-lock-face-buffer, "hi-lock-1" doesn't speak much to me contrary to
>> "hi-yellow".
> Not specifically related to this face, but it is a bad idea, in general (no
> doubt there are exceptions), for a face name to advertize particular face
> attributes, such as the color.

Depends.  In the present case, the face has no particular purpose, so
saying that "its purpose to highlight in yellow" doesn't sound like such
a bad idea.  Not really worse than "its purpose is to be number 2".

> The color is presumably something that the user can customize, and is
> typically not something that speaks to the use or meaning of the face.

"2" doesn't "speak to the use or meaning of the face" very much either.

I think the real issue here is that hi-lock should have a customizable
set of faces rather than a set of customizable faces.
So if the user doesn't like hi-yellow (which should be called
hi-lock-yellow, BTW) because she never highlights in yellow, she can
replace it with her own face with the name she likes.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Adams  
View profile  
 More options Dec 4 2012, 5:43 pm
Newsgroups: gnu.emacs.bug
From: "Drew Adams" <drew.ad...@oracle.com>
Date: Tue, 4 Dec 2012 14:43:53 -0800
Local: Tues, Dec 4 2012 5:43 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

> >> > -(defface hi-yellow
> >> > +(defface hi-lock-1
> >> I'm not sure it's an improvement.  When choosing a face in
> >> hi-lock-face-buffer, "hi-lock-1" doesn't speak much to me
> >> contrary to "hi-yellow".

> > Not specifically related to this face, but it is a bad
> > idea, in general (no doubt there are exceptions), for a
> > face name to advertize particular face attributes, such
> > as the color.

> Depends.

I too suggested that it depends.  But it depends on what "depends" means ;-).
I.e., depends on what?  The dependence I see is that there could be exceptions
where the purpose/use/meaning of the face is in fact related to a particular
color.

> In the present case, the face has no particular purpose,

So in particular, it is NOT related to any particular color, including yellow.

> so saying that "its purpose to highlight in yellow" doesn't
> sound like such a bad idea.

That makes as much sense (to me) as to say that its name should be
`hi-lock-rumpelstiltskin".  Unless it is true that it really always should
"highlight in yellow", regardless of the face's current color.

If all we can say is that this face is about highlighting, then the only
operative word is "highlight".  If we can be more specific - e.g., highlighting
like a marker pen, then that's what is called for.

In `highlight.el', for instance, I have a command for highlighting text by
dragging the mouse over it, like using a marker pen, aka a highlighter.

That command is called `hlt-highlighter' (it can use any face, like all `hlt-*'
commands).  If `hl-lock-yellow' were intended for this kind of highlighting then
you might call it `hl-lock-highlighter' or some such.

I have no idea what `hl-lock-yellow' is really for.  You yourself have just said
that its use has nothing to do with "yellow", however.

> Not really worse than "its purpose is to be number 2".

Is its purpose really "to highlight in yellow"?  You seem to say no, above.  But
if so then you probably don't need to define a customizable face for that.  Just
highlight in yellow.

Or if the color must always be (or is always intended to be) yellow, but users
can customize other face attributes, then using "yellow" in the name would make
sense.  In that case, the doc string should say something about this
restriction/intention wrt the color being constant.

> > The color is presumably something that the user can
> > customize, and is typically not something that speaks
> > to the use or meaning of the face.

> "2" doesn't "speak to the use or meaning of the face" very
> much either.

You didn't hear me argue in favor of using `2' here.  Those are presumably not
the only two choices: 2 vs yellow.

On the other hand, if absolutely nothing can be said about this face other than
it is one of N hi-lock faces (none of which we can say anything else about),
then `2' is better than nothing.

It is certainly better than being overly specific and misleading, and doubly
certainly better than suggesting a specific face attribute such as a particular
color.

`hi-lock-2' does not suggest that any particular face attribute has the value
`2', unless it is something like a box line width of 2 pixels.  `hi-lock-yellow'
misleads immediately, suggesting that the face always has the color yellow.

> I think the real issue here is that hi-lock should have a customizable
> set of faces rather than a set of customizable faces.
> So if the user doesn't like hi-yellow (which should be called
> hi-lock-yellow, BTW) because she never highlights in yellow, she can
> replace it with her own face with the name she likes.

Ah, in that case you are really talking, I think, about having one or more user
options, which each has a face (or a set of faces) as value.

I don't see how that is related to the above, however.  If you call such an
option `*-yellow' then its name would still be misleading, no?  And if on the
other hand you feel that `hi-lock-2' is OK as an option name here, but not as a
face name, then I don't follow the logic.

Just why would you prefer a "customizable set of faces" over a "set of
customizable faces"?  And how does that relate to the names?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Dec 4 2012, 10:46 pm
Newsgroups: gnu.emacs.bug
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Tue, 04 Dec 2012 22:46:23 -0500
Local: Tues, Dec 4 2012 10:46 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

>> I think the real issue here is that hi-lock should have a customizable
>> set of faces rather than a set of customizable faces.
>> So if the user doesn't like hi-yellow (which should be called
>> hi-lock-yellow, BTW) because she never highlights in yellow, she can
>> replace it with her own face with the name she likes.
> Ah, in that case you are really talking, I think, about having one or
> more user options, which each has a face (or a set of faces) as value.

Just one option `hi-lock-faces'.

> Just why would you prefer a "customizable set of faces" over a "set of
> customizable faces"?  And how does that relate to the names?

Because the user can then choose the names that make sense to her.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Dec 5 2012, 5:15 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Thu, 06 Dec 2012 03:45:54 +0530
Local: Wed, Dec 5 2012 5:15 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Stefan Monnier <monn...@iro.umontreal.ca> writes:
>>> I think the real issue here is that hi-lock should have a customizable
>>> set of faces rather than a set of customizable faces.
>>> So if the user doesn't like hi-yellow (which should be called
>>> hi-lock-yellow, BTW) because she never highlights in yellow, she can
>>> replace it with her own face with the name she likes.
>> Ah, in that case you are really talking, I think, about having one or
>> more user options, which each has a face (or a set of faces) as value.

> Just one option `hi-lock-faces'.

1. I want the name to be opaque and semantic.

2. I also want a pre-defined set of faces for highlighting apart from
   the one "core" highlight face.  I think there are 9 hi-* faces and
   these numbers are good enough.

   Think of them as extra colors in my palette.

   Having a set of highlighting faces will help in theming.  For
   example, consider finding file in ido-mode.  When I do C-x C-f, I see
   various faces - the minibuffer prompt, ido-first-match, ido-subdir,
   ido-indicator all occurring /next/ to each other.  If there are
   hi-lock-N faces, chosen by a theme designed, one can simply have ido
   faces inherit from these themed faces.  It is much cleaner.

   Remember choosing faces that can co-exist in buffer without much
   trouble to eyes is challenging task - one needs to balance harmony
   and contrast.  A theme designer is likely to work with a palette and
   can go with color-picking techniques like triad, tetrad schemes.  See

        http://colorschemedesigner.com/
        http://www.w3.org/wiki/Colour_theory
        http://packages.debian.org/squeeze/agave

   Triad and tetrads apparently are colors that are 120 and 90 degrees
   apart in the color wheel.  So if there are N highlighting faces, they
   can be spaced 360/N degree apart in a color wheeel.

   Drew's reasoning that it is the N-th highlighting face in a sequence.

3. Configuring an yellow face in red is a bit ugly.  It is declaring a
   variable name FALSE that is assigned a variable value true.

>> Just why would you prefer a "customizable set of faces" over a "set of
>> customizable faces"?  And how does that relate to the names?

> Because the user can then choose the names that make sense to her.

While reading a face name from minibuffer, if the face name itself is
highlighted in that face - think rainbow mode - then the name of the
face shouldn't matter.

What you are asking for is a constant face whose properties don't change
at all.  One can have an elpa packages which provides constant faces,
that are immediately useful.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Dec 5 2012, 8:14 pm
Newsgroups: gnu.emacs.bug
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Wed, 05 Dec 2012 20:14:20 -0500
Local: Wed, Dec 5 2012 8:14 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

>> Just one option `hi-lock-faces'.
> 1. I want the name to be opaque and semantic.

That's why I suggest hi-lock-faces, where you choose the face names you like.

> 2. I also want a pre-defined set of faces for highlighting apart from
>    the one "core" highlight face.

Sure, hi-lock-faces's default value would include a predefined set of
faces, to match the current behavior.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Dec 6 2012, 9:50 am
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Thu, 06 Dec 2012 20:20:16 +0530
Local: Thurs, Dec 6 2012 9:50 am
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Please review the attached patch.

The patch exposes exposes a bug in defcustom and defvar-local which I
will outline separately in a followup post (after another 2-3 hours).

ps: I only wish you had tested unhighlighting part.  It would have saved
some re-working for me.

  bug11095.patch
12K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Dec 6 2012, 2:16 pm
Newsgroups: gnu.emacs.bug
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Thu, 06 Dec 2012 14:16:57 -0500
Local: Thurs, Dec 6 2012 2:16 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

> (get-char-property (point) 'face)
>  : "hi-yellow"

I just fixed that a little while ago.

> Issue-2:  Various issues with unhighlighting
> ============================================
> Once you fix Issue-1 you will run in to other issues with
> un-highlighting.  Try highlighting and UN-highlighting in following 3
> ways
> 1. Buffer with font-lock-mode ON
> 2. Buffer with font-lock-mode OFF
> 3. Unhighlight from the menu

Seems to be working now (haven't tried before my recent changes, tho).

>     (defcustom hi-lock-face-defaults
>       '(hi-yellow hi-pink hi-green hi-blue hi-black-b
>                   hi-blue-b hi-red-b hi-green-b hi-black-hb)
>       "Default faces for hi-lock interactive functions."
>       :type '(repeat face)
>       :group 'hi-lock-faces)

I think it'd be important to make it possible/easy for the user to add
new faces of his own creation in there.  So we'd need a :setter that
creates those faces as needed.

BTW, I wouldn't spend too much time on hi-lock-auto-select-face since
setting it to t just saves you from typing RET RET instead of RET.
I'm not even sure we want to keep such configuration.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Adams  
View profile  
 More options Dec 6 2012, 2:36 pm
Newsgroups: gnu.emacs.bug
From: "Drew Adams" <drew.ad...@oracle.com>
Date: Thu, 6 Dec 2012 11:36:02 -0800
Local: Thurs, Dec 6 2012 2:36 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

> >     (defcustom hi-lock-face-defaults
> >       '(hi-yellow hi-pink hi-green hi-blue hi-black-b
> >                   hi-blue-b hi-red-b hi-green-b hi-black-hb)
> >       "Default faces for hi-lock interactive functions."
> >       :type '(repeat face)
> >       :group 'hi-lock-faces)

> I think it'd be important to make it possible/easy for the user to add
> new faces of his own creation in there.  So we'd need a :setter that
> creates those faces as needed.

The code still defines and uses faces named for colors.  Bad idea.  There is no
need for that, and nothing gained by it.

Look at the doc for each of those faces - it should give you a clue.

It says only that this is a face for hi-lock mode.  It says nothing about the
color that is in the name, and rightfully so.

The default color used to define the face is irrelevant to the
use/meaning/purpose of the face.  These faces should be renamed.

If you need a separate bug report for that I will be glad to file it.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Dec 6 2012, 4:26 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Fri, 07 Dec 2012 02:56:07 +0530
Local: Thurs, Dec 6 2012 4:26 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

>> (get-char-property (point) 'face)
>>  : "hi-yellow"

> I just fixed that a little while ago.

>> Issue-2:  Various issues with unhighlighting
>> ============================================
>> Once you fix Issue-1 you will run in to other issues with
>> un-highlighting.  Try highlighting and UN-highlighting in following 3
>> ways
>> 1. Buffer with font-lock-mode ON
>> 2. Buffer with font-lock-mode OFF
>> 3. Unhighlight from the menu

> Seems to be working now (haven't tried before my recent changes, tho).

By now, if you mean 111134, the unhighlighting is not working as
expected.

My patch has hints on where the brokenness comes from.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Dec 6 2012, 4:36 pm
Newsgroups: gnu.emacs.bug
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Thu, 06 Dec 2012 16:36:29 -0500
Local: Thurs, Dec 6 2012 4:36 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

>> Seems to be working now (haven't tried before my recent changes, tho).
> By now, if you mean 111134, the unhighlighting is not working as
> expected.

Can you give a recipe, because "it works for me",

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Dec 6 2012, 11:07 pm
Newsgroups: gnu.emacs.bug
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Thu, 06 Dec 2012 23:07:39 -0500
Local: Thurs, Dec 6 2012 11:07 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

>>>> Seems to be working now (haven't tried before my recent changes, tho).
>>> By now, if you mean 111134, the unhighlighting is not working as
>>> expected.
>> Can you give a recipe, because "it works for me",
> How about a screenshot?

That can work as well, tho since it's not a display problem,
explanations work at least as well, usually better.
I never use hi-lock, so don't assume I know how it's expected to behave.

> Recipe-1:
>     Couple of C-x w h, followed by C-x w r.  Note the cursor position
>     and the choice offered.

I don't see anything wrong with the cursor position.  Please explain.

>     See screenshot.  Why is there no default offered

Don't know, should there be one?

>     and why even absurd candidates are offered?

Which absurd candidates are you talking about?

> Recipe-2:
>     Turn off font-lock-mode.
>     Couple of C-x w h and then try C-x w r, C-u C-x w r, try from menu.

What am I supposed to see when I try that?

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Dec 6 2012, 11:46 pm
Newsgroups: gnu.emacs.bug
From: Jambunathan K <kjambunat...@gmail.com>
Date: Fri, 07 Dec 2012 10:16:56 +0530
Local: Thurs, Dec 6 2012 11:46 pm
Subject: bug#11095: [PATCH] Re: bug#11095: 24.0.94; hi-lock-face-buffer/unhighlight-regexp': Augment?

Stefan Monnier <monn...@iro.umontreal.ca> writes:
>>>>> Seems to be working now (haven't tried before my recent changes, tho).
>>>> By now, if you mean 111134, the unhighlighting is not working as
>>>> expected.
>>> Can you give a recipe, because "it works for me",
>> How about a screenshot?

> That can work as well, tho since it's not a display problem,
> explanations work at least as well, usually better.
> I never use hi-lock, so don't assume I know how it's expected to
> behave.

This is the behaviour I am expecting.  This is what I
circulated in etc/NEWS entry.

    *** Unhighlighting command (`hi-lock-unface-buffer') now un-highlights
    text at point.  When called interactively with C-u, removes all
    highlighting in current buffer.

We seem to be talking too much but not taking a moment to understand to
each other.  I will exchange no more mails with you in this thread,
sorry.  You reply, but with no effort on your part to understand what I
am saying or showing you.  I am happy with whatever you conceive to be
useful.

--

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 31   Newer >
« Back to Discussions « Newer topic     Older topic »