Ignore:
Timestamp:
Aug 17, 2021, 9:28:59 AM (4 years ago)
Author:
Andreas Schnellbacher
Message:
  • This is again a large extension. The Wrap and Reflow submenus complete now the new Format submenu. It also implements mode-dependant menu parts.
  • Reworked 'Wrap lines' submenu.
  • Extended Wrap cmd with more options.
  • Renamed Menu* cmds to *MenuCmd.
  • Reworked 'Reflow' submenu.
  • Added RefreshSubMenu and AddSubMenu.
  • Refresh Format submenu on selection of a different reflow mode.
  • Prepared 'Reflow' for beautify.
  • Selectable mode is currently: TEXT.
  • Changed Reflow cmd.
  • Moved 'Word processor' menu item to 'Reflow', mode 'TEXT'.
  • Changed Reflow config keys.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/netlabs/macros/reflowmail.e

    r3420 r4636  
    150150; Reflow previous paragraph.
    151151defproc Mail_ReflowMarkedLines( PrevParQuoteLevel, PrevPrevParQuoteLevel, PrevListIndent, PrevBullet, fEnableReflow, fIndentLists)
     152   KeyPath = '\NEPMD\User\Format\Reflow'
     153   NewListIndent   = QueryConfigKey( KeyPath'\ListIndent')
     154
    152155   QuoteChar = '>'
    153156   SpaceAmount = 1  -- Spaces after QuoteChar
     
    173176   endif
    174177
     178--   if not NewListIndent then
     179      NewListIndent = PrevListIndent
     180--   endif
    175181   if fIndentLists then
    176       lma = PrevListIndent + 1
    177       rma = RightMargin - PrevIndent - PrevListIndent
     182      lma = NewListIndent + 1
     183      rma = RightMargin - PrevIndent - NewListIndent
    178184      pma = lma
    179185   else
     
    182188      -- Indent the bullet line to the length of the bullet chars plus
    183189      -- following spaces. Also the original indent is kept.
    184       pma = PrevListIndent + 1
     190      pma = NewListIndent + 1
    185191   endif
    186192
     
    367373   PrevListIndent = 0
    368374
    369    KeyPath = '\NEPMD\User\Reflow\Mail\IndentedLines'
     375   KeyPath = '\NEPMD\User\Format\Reflow'
     376   fKeepIndent     = QueryConfigKey( KeyPath'\KeepIndent')
     377   fWrapIndent     = QueryConfigKey( KeyPath'\WrapIndent')
     378   fRecognizeLists = QueryConfigKey( KeyPath'\RecognizeLists')
     379   fReindentLists  = QueryConfigKey( KeyPath'\ReindentLists')
     380
    370381   -- Default is to not reflow indented lines
    371    fIndentedIsVerbatim = (QueryConfigKey( KeyPath) <> 1)
    372 
    373    KeyPath = '\NEPMD\User\Reflow\Mail\IndentLists'
     382   fIndentedIsVerbatim = (fKeepIndent)
    374383   -- Default is to indent lists
    375    fIndentLists = (QueryConfigKey( KeyPath) <> 0)
     384   fIndentLists = (fReindentLists)
    376385
    377386   .line = 1
     
    381390   -- Add a blank line after last to make reflow of the last par easy
    382391   insertline '', .last + 1
    383    i = 0
    384    --do forever
    385    do while i < 10000
    386       i = i + 1  -- Added only as emergency stop, for nothing else.
    387                  -- Maybe this will help to find the bug in it?
     392   do i = 1 to .last
    388393      fThisLineIsBlank    = 0
    389394      fThisLineIsVerbatim = 0
     
    524529
    525530      if fThisLineIsBlank = 0 then
    526          mark_line
     531         markline
    527532      endif
    528533
     
    547552      endif
    548553
    549    enddo  -- forever
     554   enddo  -- i
    550555
    551556   -- Remove last blank lines
Note: See TracChangeset for help on using the changeset viewer.