[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replacing a function with another one

From: lee
Subject: Re: replacing a function with another one
Date: Wed, 12 Mar 2014 16:22:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Michael Heerdegen <address@hidden> writes:

> lee <address@hidden> writes:
>> Why shouldn´t I switch buffers?  They are switched back anyway.
> But what the code that's being run in the meantime, between your
> advices?  Then, the wrong buffer is current.  That can't work.

Hm, that would depend on what is being run.  I see what you mean: Since
everything can be modified, there is no way to know if something runs in
between and what that might be.

>> One thing I haven´t been able to figure out is how hi-lock.el decides
>> what the lines it writes to the buffer are prepended with.  In one
>> buffer, it puts "// Hi-lock ...", in another one, it´s "# Hi-lock ...".
>> Then it searches patterns with '"\\<" hi-lock-file-patterns-prefix ":"',
>> and apparently it will not find patterns prepended with "//" when it
>> figures that they should be prepended with "#".
> When writing the specification to he buffer, it calls `comment-region',
> which DTRT in any mode.
> `hi-lock-find-patterns' indeed doesn't seem to search only inside
> comments, it just searches the whole buffer for the regexp
>    (concat "\\<" hi-lock-file-patterns-prefix ":")

Yes, that´s what I thought.  I usually search for what I have written
when doing things like that.

Anyway, all the documentation I found says that "\s<" in a regex is
supposed to match a comment starter.  That doesn´t seem to work at all,
and I ended up with

(concat "^" comment-start lsl-hi-lock-patterns-end-marker).


(concat "^\\s<" lsl-hi-lock-patterns-end-marker)

supposedly works but doesn´t.  Is that a bug?

Knowledge is volatile and fluid.  Software is power.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]