Loading ...
Sorry, an error occurred while loading the content.

Formatting Java Doc comments in Java - bug fix.

Expand Messages
  • Jon Green
    Formatting Java comments (where Java Doc comments are inserted) behave badly with the current comment formatting as the /** leader is interpreted as a box
    Message 1 of 1 , Apr 20 3:41 AM
    View Source
    • 0 Attachment
      Formatting Java comments (where Java Doc comments are
      inserted) behave badly with the current comment formatting
      as the /** leader is interpreted as a box which is not
      required. The following modifications to cbox.emf
      fix the problem.

      /**
      * This is a Java Doc comment
      */

      To create a box with the following modifications
      then use 3 stars i.e.

      /***
      my comment
      */

      with an M-o transformation we get

      /**************************************************************************
      * my comment *
      **************************************************************************/

      as expected.

      Regards
      Jon.

      cd C:/Program Files/JASSPA/MicroEmacs/macros/
      diff --context --minimal --ignore-space-change --report-identical-files --recursive "c:/microemacs/000414/macros/cbox.emf-1" "c:/microemacs/000414/macros/cbox.emf"

      *** c:/microemacs/000414/macros/cbox.emf-1 Sun Nov 28 17:04:18 1999
      --- c:/microemacs/000414/macros/cbox.emf Thu Apr 20 10:52:08 2000
      ***************
      *** 12,18 ****
      ;
      ; Creation Date: 13/05/92
      ;
      ! ; Modification date: <991128.1704>
      ;
      ; Current rev: 20.1
      ;
      --- 12,18 ----
      ;
      ; Creation Date: 13/05/92
      ;
      ! ; Modification date: <000420.1052>
      ;
      ; Current rev: 20.1
      ;
      ***************
      *** 80,85 ****
      --- 80,99 ----
      replace-string "\n" " *\n"
      !emacro
      ;
      + ;--- Mode 0: Java Doc mode.
      + ;
      + 0 define-macro c-box-method-j
      + ;--- Set up the current column settings.
      + set-variable $fill-col &sub $fill-col 4
      + c-box-remove
      + beginning-of-buffer
      + replace-string "^" " * "
      + beginning-of-buffer
      + insert-string "/**\n"
      + end-of-buffer
      + insert-string " */"
      + !emacro
      + ;
      ; Single line comment
      ;
      ; e.g. /* sdgksdhsdkfg */
      ***************
      *** 168,174 ****
      set-variable #l5 $window-wcol
      ; if the comment starts with /** then assume its a box type else auto
      2 forward-char
      ! set-variable #l6 &cond &seq @wc "*" "b" "a"
      ;
      ;--- Search for the end of the comment.
      ;
      --- 182,195 ----
      set-variable #l5 $window-wcol
      ; if the comment starts with /** then assume its a box type else auto
      2 forward-char
      ! !if &seq @wc "*"
      ! 1 forward-char
      ! ; Java Doc or bounding box.
      ! set-variable #l6 &cond &seq @wc "*" "b" "j"
      ! 1 backward-char
      ! !else
      ! set-variable #l6 "a"
      ! !endif
      ;
      ;--- Search for the end of the comment.
      ;
      ***************
      *** 188,194 ****
      !if ¬ $status
      c-box-failed
      !endif
      ! !force set-variable #l6 @mc1 "Comment style [abs012]? " "abs012"
      !if ¬ $status
      c-box-failed
      !endif
      --- 209,215 ----
      !if ¬ $status
      c-box-failed
      !endif
      ! !force set-variable #l6 @mc1 "Comment style [abjs012]? " "abjs012"
      !if ¬ $status
      c-box-failed
      !endif
      ***************
      *** 229,234 ****
      --- 250,257 ----
      ;
      !if &seq #l6 "b"
      c-box-method-b
      + !elif &seq #l6 "j"
      + c-box-method-j
      !else
      end-of-buffer
      !if &or &seq #l6 "s" &and &seq #l6 "a" &equ $window-line 2
      [EXIT]
    Your message has been successfully submitted and would be delivered to recipients shortly.