Bug 98091 - M-q on certain javadoc comments destroys buffer contents
M-q on certain javadoc comments destroys buffer contents
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: emacs (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-06-26 10:59 EDT by Need Real Name
Modified: 2007-04-18 12:55 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-01-13 21:25:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2003-06-26 10:59:15 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
While editing a 1500 line .java file in JDE mode (http://jdee.sunsite.dk/),
putting the point on the first line of:

     *   <li> Create user session with another call to
{@link DriverManager#getConnection(String, String,
     *        String)} with user's oracle name and password.  Throws
     *        <code>AppException</code> if an error occurs.

and selecting M-q to reformat it destroys the buffer contents by deleting all
but the javadoc snippet above.  Undo (C-x u) is unavailable and buffer is
disassociated from file (M-x revert-file doesn't work).  A Lisp error backtrace
buffer shows:

Debugger entered--Lisp error: (args-out-of-range 9952 10069)
  put-text-property(9952 10069 fontified nil)
  jit-lock-after-change(10069 10069 14)
  fill-region-as-paragraph(10014 10263 nil)
  fill-paragraph(nil)
  c-fill-paragraph(nil)
  call-interactively(c-fill-paragraph)

JDE version is 2.3.2.


Version-Release number of selected component (if applicable):
emacs-21.2-18

How reproducible:
Always

Steps to Reproduce:
1. Load a Java source file with a Javadoc comment with lines greater than 78
characters and (maybe) includes a {@link} tag that spans two lines.
2. Put point on first line of javadoc comment described in (1).
3. Do a M-q
    

Actual Results:  See summary.

Expected Results:  The javadoc snippet should be reformatted to be no more than
78 characters per line.

Additional info:

~/.emacs contents:

;; Red Hat Linux default .emacs initialization file

;; Are we running XEmacs or Emacs?
(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))

;; Set up the keyboard so the delete key on both the regular keyboard
;; and the keypad delete the character under the cursor and to the right
;; under X, instead of the default, backspace behavior.
(global-set-key [delete] 'delete-char)
(global-set-key [kp-delete] 'delete-char)

;; Turn on font-lock mode for Emacs
(cond ((not running-xemacs)
       (global-font-lock-mode t)
))

;; Visual feedback on selections
(setq-default transient-mark-mode t)

;; Always end a file with a newline
(setq require-final-newline t)

;; Stop at the end of the file, not just add lines
(setq next-line-add-newlines nil)

;; Enable wheelmouse support by default
(cond (window-system
       (mwheel-install)
))

;; This .emacs file illustrates the minimul setup
;; required to run the JDE.

;; Set the debug option to enable a backtrace when a
;; problem occurs.
(setq debug-on-error t)

;; Update the Emacs load-path to include the path to
;; the JDE and its require packages. This code assumes
;; that you have installed the packages in the emacs/site
;; subdirectory of your home directory.
(add-to-list 'load-path (expand-file-name "/usr/local/src/jde/lisp"))
(add-to-list 'load-path (expand-file-name "/usr/local/src/semantic"))
(add-to-list 'load-path (expand-file-name "/usr/local/src/speedbar"))
(add-to-list 'load-path (expand-file-name "/usr/local/src/eieio"))
(add-to-list 'load-path (expand-file-name "/usr/local/src/elib"))


;; If you want Emacs to defer loading the JDE until you open a 
;; Java file, edit the following line
(setq defer-loading-jde nil)
;; to read:
;;
;;  (setq defer-loading-jde t)
;;

(if defer-loading-jde
    (progn
      (autoload 'jde-mode "jde" "JDE mode." t)
      (setq auto-mode-alist
	    (append
	     '(("\\.java\\'" . jde-mode))
	     auto-mode-alist)))
  (require 'jde))


;; Sets the basic indentation for Java source files
;; to two spaces.
(defun my-jde-mode-hook ()
  (setq c-basic-offset 4))

(add-hook 'jde-mode-hook 'my-jde-mode-hook)

;; Include the following only if you want to run
;; bash as your shell.

;; Setup Emacs to run bash as its primary shell.
(setq shell-file-name "bash")
(setq shell-command-switch "-c")
(setq explicit-shell-file-name shell-file-name)
(setenv "SHELL" shell-file-name)
(setq explicit-sh-args '("-login" "-i"))
(if (boundp 'w32-quote-process-args)
  (setq w32-quote-process-args ?\")) ;; Include only for MS Windows.

(setq indent-tabs-mode nil)
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "English")
 '(global-font-lock-mode t nil (font-lock))
 '(transient-mark-mode t)
 '(indent-tabs-mode nil))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )
Comment 1 Jens Petersen 2004-01-13 02:52:07 EST
Does this still happen with Emacs 21.3?
Comment 2 Need Real Name 2004-01-13 13:33:08 EST
No.  The problem appears to be fixed.
Comment 3 Jens Petersen 2004-01-13 21:25:59 EST
Thanks. :)

Note You need to log in before you can comment on or make changes to this bug.