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

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

CC Mode 5.25 (Java); fill-paragraph confused by parentheses in comments


From: Francesco Potorti`
Subject: CC Mode 5.25 (Java); fill-paragraph confused by parentheses in comments
Date: Thu, 16 Nov 2000 23:30:04 +0100

Dear Barry and Martin,

Sometimes the M-q command works inside comment in java code, sometimes
it doesn't.

It works with this comment:

    /**
     * A delay with a repetition count.
     *
     * <p> This class is currently unused.  If it will be used, a
     * data member of <code>Event</code> should be of type
     * <code>Event.Time</code>, and
     * should replace both the <code>absolute_delay</code> and
     * <code>repeat</code> data members.
     **/

but it does not with this one:

    /**
     * A delay with a repetition count.
     *
     * <p> This class is currently unused.  If it will be used, a (private?)
     * data member of <code>Event</code> should be of type
     * <code>Event.Time</code>, and
     * should replace both the <code>absolute_delay</code> and
     * <code>repeat</code> data members.
     **/

I append the whole file below.  Thanks for reading this.

Emacs  : GNU Emacs 20.7.3 (i686-pc-linux-gnu, X toolkit)
 of Fri Oct 13 2000 on pot
Package: CC Mode 5.25 (Java)
Buffer Style: java


c-emacs-features: (1-bit)

current state:
==============
(setq
 c-basic-offset 4
 c-offsets-alist '((string . c-lineup-dont-change)
                   (c . c-lineup-C-comments)
                   (defun-open . 0)
                   (defun-close . 0)
                   (defun-block-intro . +)
                   (class-open . 0)
                   (class-close . 0)
                   (inline-open . 0)
                   (inline-close . 0)
                   (func-decl-cont . c-lineup-java-throws)
                   (knr-argdecl-intro . 5)
                   (knr-argdecl . 0)
                   (topmost-intro . 0)
                   (topmost-intro-cont . +)
                   (member-init-intro . +)
                   (member-init-cont . 0)
                   (inher-intro . +)
                   (inher-cont . c-lineup-java-inher)
                   (block-open . 0)
                   (block-close . 0)
                   (brace-list-open . 0)
                   (brace-list-close . 0)
                   (brace-list-intro . +)
                   (brace-list-entry . 0)
                   (brace-entry-open . 0)
                   (statement . 0)
                   (statement-cont . +)
                   (statement-block-intro . +)
                   (statement-case-intro . +)
                   (statement-case-open . +)
                   (substatement . +)
                   (substatement-open . +)
                   (case-label . 0)
                   (access-label . 0)
                   (label . 0)
                   (do-while-closure . 0)
                   (else-clause . 0)
                   (catch-clause . 0)
                   (comment-intro . c-lineup-comment)
                   (arglist-intro . c-lineup-arglist-intro-after-paren)
                   (arglist-cont . 0)
                   (arglist-cont-nonempty . c-lineup-arglist)
                   (arglist-close . c-lineup-arglist)
                   (stream-op . c-lineup-streamop)
                   (inclass . +)
                   (cpp-macro . -1000)
                   (cpp-macro-cont . c-lineup-dont-change)
                   (friend . 0)
                   (objc-method-intro . -1000)
                   (objc-method-args-cont . c-lineup-ObjC-method-args)
                   (objc-method-call-cont . c-lineup-ObjC-method-call)
                   (extern-lang-open . 0)
                   (extern-lang-close . 0)
                   (inextern-lang . +)
                   (namespace-open . 0)
                   (namespace-close . 0)
                   (innamespace . +)
                   (template-args-cont . +)
                   (inlambda . c-lineup-inexpr-block)
                   (lambda-intro-cont . +)
                   (inexpr-statement . 0)
                   (inexpr-class . +)
                   )
 c-cleanup-list '(scope-operator)
 c-comment-only-line-offset '(0 . 0)
 c-backslash-column 48
 c-delete-function 'delete-char
 c-electric-pound-behavior nil
 c-hanging-braces-alist '((brace-list-open) (brace-entry-open)
                          (substatement-open after)
                          (block-close . c-snug-do-while)
                          (extern-lang-open after)
                          (inexpr-class-open after) (inexpr-class-close before))
 c-hanging-colons-alist nil
 c-hanging-comment-starter-p nil
 c-hanging-comment-ender-p nil
 c-indent-comments-syntactically-p nil
 c-tab-always-indent t
 c-comment-continuation-stars "* "
 c-label-minimum-indentation 1
 defun-prompt-regexp "\\(class\\|/\\*\\*\\)[^{]*"
 tab-width 8
 comment-column 32
 )

===File ~/galileo/Engine/Event.java=========================
/*
 * This is part of the GaliLEO package.
 * Copyright (C) 2000 Laurent Franck and Francesco Potortì
 * See file COPYING for copying conditions.
 */

// Last revision is $Id: Event.java,v 1.5 2000/11/16 13:00:52 pot Exp $
// made on $Date: 2000/11/16 13:00:52 $ by $Author: pot $

//


package GaliLEO.Engine;

import GaliLEO.Tools.*;

/**
   An event is something which is scheduled to happen in the
   simulation.  Events are stored in a delta list or in a calendar
   queue and are corresponding to the scheduled triggering of a given
   selector.

   @see DeltaList
   @see Calendar
*/
public class Event implements Linkable
{
    /**
     * A delay with a repetition count.
     *
     * <p> This class is currently unused.  If it will be used, a (private?)
     * data member of <code>Event</code> should be of type
     * <code>Event.Time</code>, and
     * should replace both the <code>absolute_delay</code> and
     * <code>repeat</code> data members.
     **/
    public static class Time
    {
        private double delay;
        private double count;

        /**
         * Contructor for events that will never be scheduled.  Use like this:
         * <code> new Time(null) </code>.
         */
        public Time(Object o)
        {
            delay = 0; count = 0;
        }

        /**
         * Contructor for one-shot events to be scheduled after a delay.
         *
         * @param a non-negative double representing the delay
         */
        public Time(double d)
        {
            Debug.assert(d >= 0, "delay is negative");
            delay = d; count = 1;
        }

        /**
         * Contructor for repetitive events to be scheduled periodically.
         *
         * @param a non-negative double representing the period length.  The
         * first event is scheduled after this delay.
         * @param an integer greater than <code>1</code> representing the
         * number of times the event will be scheduled, or <code>0</code>
         * meaning forever.
         */
        public Time(double d, int c)
        {
            Debug.assert(d >= 0, "delay is negative");
            Debug.assert(c > 1 || c == 0,
                         "count is not zero nor greater than one");
            delay = d; count = c;
        }

        /**
         * Get next expire time for this event and decrement the count.  If
         * the returned value is negative, this event should be deleted.  This
         * call modifies the state of this object, and should be called
         * exactly once for each time the event is scheduled.
         *
         * @return a double representing the delay after wich the event should
         * be triggered.  If it is negative, the event should be deleted.
         */
        public double nextDelay()
        {
            if (--count < 0)
                return -1;
            else
                return delay;
        }
    }

    public Entity target_entity;
    public Selector selector;
    public Selector.Params params;
    public double absolute_delay;
    public double deadline;
    public int repeat;

    private Linkable next;

    /**
     * Basic constructor
     * @param target_entity the entity the selector is applied to
     * @param selector the selector invoked by this event
     * @param params parameters used with the selector
     * @param absolute_delay the delay to wait before triggering the
     * selector
     * @param repeart number of iteration
     */
    public Event(Entity target_entity, Selector selector,
                 Selector.Params params, double absolute_delay, int repeat)
    {
        this.target_entity=target_entity;
        this.selector=selector;
        this.params=params;
        this.absolute_delay=absolute_delay;
        this.repeat=repeat;
    }


    /********************************************************************/


    /**
     * Check if this event has the same target as another event
     * This event is equal to the template in <code>event</code> if
     * 1) They use the same selector and the same entity
     *    -> <code>event</code> provides entity and selector
     * 2) They use the same selector
     *    -> <code>event</code> shows a <code>null</code> target entity
     *       meaning all entities supporting this selector.
     * 3) They use the same entity
     *    -> <code>event</code> shows a <code>null</code> selector, the target 
entity
     *       denotes the entity that is concerned.
     *
     * @param the event udes as template
     *
     * @return a boolean telling whether the two events are identical
     */
    public boolean sameTargetAs(Event event)
    {

        // Rule 1
        if(target_entity==event.target_entity &&
           selector==event.selector)
            {
                return(true);
            }

        // Rule 2
        if(event.target_entity==null &&
           event.selector!=null)
            {
                if(selector.selector_id.
                   equals(event.selector.selector_id) &&
                   selector.entity_type.
                   equals(event.selector.entity_type))
                    {
                        return(true);
                    }
            }

        // Rule 3
        if(event.selector==null &&
           event.target_entity!=null &&
           event.target_entity==target_entity)
            {
                return(true);
            }

        return(false);
    }


    /********************************************************************/


    /**
     * Utility function to convert an event to a String
     *
     * @return a string representing the event
     */
    public String toString()
    {
        return("At " +
               absolute_delay +
               " (" + deadline +") -> " +
               selector + "  on " + target_entity);
    }


    /**
     * Attach an event to this event
     *
     * @param object The event to attach
     */
    public void attach(Linkable object)
    {
        next=object;
    }


    /**
     * Get the attached object
     *
     * @return the Linkable object to this one
     */
    public Linkable nextOf()
    {
        return(next);
    }
}


/****
Local variables:
compile-command: "make -C .. -k"
tags-file-name: "../TAGS"
change-log-default-name: "../ChangeLog"
End:
****/
============================================================



reply via email to

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