Simon Wright <[email protected]> writes:

> My recollection of partial case exceptions in 4.01 is that when you
> created one it selected the underscore-delimited text around point.
> So, if you had point in the LED of BSP_LED_Init then you’d get *LED in
> the case exceptions file. Instead, 5.1.7 inserts *BSP_LED_Init.

That depends on whether you modified the syntax class of '_' in 4.01.

The standard code in 4.01 uses word syntax for '_' while defining a case
exception, which would select BSB_LED_Init.

But if you changed the syntax class for '_' in
ada-mode-symbol-syntax-table to symbol, then it would select LED.

In 5.01, I don't mess with the syntax tables as much; there is only one,
and _ has symbol, not word, syntax.

(Except that I always change that to make _ have word syntax, so moving
by word jumps entire identifiers. Which makes testing this stuff
confusing :).

ada-case-create-exception explicitly includes both w and _ syntax, so _
is always included in the default word.

> I suppose the current MO - select the text you want to be a partial
> exception - allows more flexibility (though I’m not sure 4.01 didn’t
> support this as well?)

4.01 supported the active region, yes. That's the way I always use it,
since I always change _ to have word syntax.

It is simple to drop _ from the search syntax when defining a partial
case exception, which gives the behavior you describe:

ada-mode.el:1024

  (unless word
    (if (use-region-p)
        (setq word (buffer-substring-no-properties (region-beginning) 
(region-end)))
      (save-excursion
        (let ((syntax (if partial "w" "w_")))
          (skip-syntax-backward syntax)
          (setq word
                (buffer-substring-no-properties
                 (point)
                 (progn (skip-syntax-forward syntax) (point))
                 ))))))


-- 
-- Stephe

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

Reply via email to