Simon Wright <[email protected]> writes:

> On 13 Jan 2016, at 14:13, Georg Bauhaus <[email protected]> wrote:
>> 
>> 
>>> Am 13.01.2016 um 14:17 schrieb Piotr Trojanek <[email protected]>:
>>> 
>>> Sorry, I attached a wrong file. With the current one the problem
>>> should be more evident.
>>> 
>>> On Wed, Jan 13, 2016 at 1:02 PM, Piotr Trojanek
>>> <[email protected]> wrote:
>>>> Hi,
>>>> 
>>>> I am using latest ada-mode from monotone repo. On the attached code if
>>>> I go to COMMA within association_list and press TAB then
>>>> wisi-indent-line raises an exception.
>> 
>> Would the advice given recently for handling protected,
>> extending types apply here, too? I am guessing (only) that
>> cl-ecase is missing list-break, in ada-wisi—before-cache.
>
> Yes; I'm pretty sure it's the first cl-ecase in that function. Having
> said M-x toggle-debug-on-error, I get
>
> cl-ecase failed: list-break, (block-start block-end block-middle
> close-paren keyword name name-paren open-paren return-with-params
> return-without-params statement-end statement-other statement-start)
>
> It's a bug, it needs fixing, but not at the highest priority I think
> (but give me a justification for putting the list-breaking COMMA on a
> line of its own!)
>
> Where should it be indented to?

I agree the actual indentation is not important, but you might get to
this point while editing, so this should not throw an error.

The simplest patch is:

============================================================
--- ada-wisi.el 4b95fa8700ef3ba9a354d967eddfb96a7e608972
+++ ada-wisi.el 3872c7aa807bbb56b3a9a38d92b21b5e53c6df33
@@ -306,6 +306,17 @@ point must be on CACHE. PREV-TOKEN is th
         ;; defer to after-cache)
         nil)
 
+       (list-break
+       ;; test/ada_mode-parens.adb
+        ;; Foo (X
+        ;;        ,    --  used to get an error here; don't care about the 
actual indentation
+        ;; indenting ','
+        ;;
+        ;; We don't actually care what the indentation is, since this
+        ;; should only occur while editing; defer to after-cache
+        ;; avoids an error and does something reasonable.
+        nil)
+
        (name
         (cond
          ((let ((temp (save-excursion (wisi-goto-containing cache))))
 

That gives:

   procedure P2 is
   begin
      Foo (X
             ,
           Y);
   end;

which is good enough.

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to