help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Plsql mode indenting broken on windows


From: Tim X
Subject: Re: Plsql mode indenting broken on windows
Date: Fri, 27 Oct 2006 11:42:55 +1000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"kcrews02460" <kcrews02460@gmail.com> writes:

> In my previous post I failed to get the start of the 2nd error message.
>  It begins:
>
>  Search failed: "[
> ()]\\(a\\(?:ccess\\|dd\\|l\\(?:l\\|ter\\)\\
>
> kcrews02...@gmail.com wrote:
>> I'm running gnu emacs 21.3.1 on windows xp.  I downloaded plsql.el
>> (version Version: 0.8.0) yesterday and it does not work properly.
>> Specifically, if I try to indent code I one of 2 errors:
>>
>> Invalid search bound (wrong side of point)
>>
>> or
>>
>> \\|dd\\|l\\(?:l\\|ter\\)\\|n\\(?:alyse\\|[dy]\\)\\|sc?\\|
>> udit\\|vg\\)\\|b\\(?:etween\\|y\\)\\|c\\(?:heck\\|luster\\|o\\(?:lumn\\|
>> m\\(?:m\\(?:\\(?:en\\|i\\)t\\)\\|press\\)\\|n\\(?:nect\\|tinue\\)\\)\\|
>> reate\\|urrent\\)\\|d\\(?:e\\(?:clare\\|lete\\|sc\\)\\|istinct\\|
>> rop\\)\\|e\\(?:scape\\|x\\(?:ec\\|ists\\|plain\\)\\)\\|f\\(?:loat\\|
>> o\\(?:r\\(?:\\(?:eig\\|tra\\)n\\)\\|und\\)\\|rom\\)\\|g\\(?:o\\|r\\(?:ant\\|
>> oup\\)\\)\\|having\\|i\\(?:dentified\\|mmediate\\|n\\(?:crement\\|dex\\|itial\\|sert\\|
>> t\\(?:eger\\|o\\)\\)?\\)\\|key\\|l\\(?:evel\\|ike\\|o\\(?:ck\\|ng\\)\\)\\|
>> m\\(?:ax\\|in\\(?:us\\)?\\|od\\(?:e\\|ify\\|ule\\)\\)\\|
>> n\\(?:o\\(?:\\(?:\\(?:aud\\|wa\\)i\\)?t\\)\\|u\\(?:ll\\|
>> meric\\)\\)\\|o\\(?:ffline\\|nline\\|ption\\|rder\\|[fnr]\\)\\|
>> p\\(?:ctfree\\|li\\|ri\\(?:mary\\|or\\)\\|ublic\\)\\|
>> r\\(?:e\\(?:\\(?:nam\\|sourc\\|vok\\(?:\\)?\\)e\\)\\|o\\(?:llback\\|
>> w\\(?:id\\|num\\|s\\)?\\)\\)\\|s\\(?:chema\\|e\\(?:ction\\|lect\\|ssion\\|
>> t\\)\\|hare\\|ize\\|ome\\|ql\\(?:code\\|error\\)\\|tart\\|y\\(?:nonym\\|
>> sdate\\)\\)\\|t\\(?:able\\|o\\|r\\(?:igger\\|uncate\\)\\)\\|u\\(?:id\\|
>> ni\\(?:on\\|que\\)\\|pdate\\|ser\\)\\|v\\(?:al\\(?:idate\\|ues\\)\\|iew\\)\\|
>> w\\(?:he\\(?:never\\|re\\)\\|ith\\|ork\\)\\)[
>>
>> ()]" Quit
>>
>> (Note - the 2nd error is really one long line - I added newlines for
>> readibility.  Also, it looks kind of odd because the first characters
>> of the keywords are missing "etween" instead of "between", "able"
>> instead of "table", etc.)
>>
>> The version of sql.el that comes with this version of emacs is Version:
>> 1.6.3.  I tried downloading the most recent version of sql.el (2.0.1
>> from
>> http://cvs.savannah.gnu.org/viewcvs/*checkout*/emacs/emacs/lisp/progmodes/sql.el)
>> but that did not help.  (plsql mode depends on sql.el)  Apparently it
>> was tested with emacs 22.1 and might not work with earlier versions of
>> emacs.  I have not found any more recent version of emacs for windows
>> than the one I am running, even though it was built in 2004.
>>
>> Does anyone know of either
>>
>> 1) a fix for the indenting problems
>>
>> 2) versions of gnu emacs, sql.el and plsql.el that work together on
>> windows?
>>
>> The code below shows the problem.  If you select the entire buffer and
>> indent it (C-\), you get the Invalid search bound error.  If you put
>> the cursor at the beginning of the line starting FUNCTION, and press
>> tab, you get the other error.
>>
>> CREATE OR REPLACE PACKAGE BODY Indent_prob AS
>>
>>    FUNCTION get_da_value(i_attr_name IN
>> gt_product_profile.attribute%TYPE,
>>                      i_def_value     IN gt_product_profile.char_value%TYPE 
>> DEFAULT NULL)
>>    RETURN VARCHAR2
>>    AS
>>    v_value             gt_product_profile.char_value%TYPE := i_def_value;
>>    BEGIN
>>       SELECT char_value
>>         INTO v_value
>>         FROM gt_product_profile pp
>>        WHERE ATTRIBUTE = i_attr_name
>>           and UPPER(pp.userid) = 'PUBLIC';
>>
>>         RETURN v_value;
>>    EXCEPTION WHEN NO_DATA_FOUND THEN
>>              IF v_value IS NULL THEN
>>                 RAISE;
>>              END IF;
>>              RETURN v_value;
>>    END;
>> END Sce_Notification_Util;
>> /
>

I believe this is a long standing bug in plsql-mode. I submitted a
patch to fix this to the author about 4+ years ago, but have never
seen it implemented/updated. Essentially, I don't think there is any
currently maintained plsql-mode. 

I would give you my patch, but I stopped working with Oracle not long
after that and don't seem to have it in my archives. However, I do
remember it was relatively easy to fix. 

Enable debug on error in emacs and you should be able to track down
the problem quite easily. From memory (which could be completely
wrong), there was an error in one of the regular expressions.

Note that there are a few different plsql  modes out there - I think
initially, I tracked down more than four. However, none of them were
being actively maintained and all of them had problems. The one I was
using I found on the emacs wiki site.

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

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