emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/progmodes/cc-cmds.el


From: Martin Stjernholm
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/cc-cmds.el
Date: Tue, 23 Apr 2002 20:48:53 -0400

Index: emacs/lisp/progmodes/cc-cmds.el
diff -c emacs/lisp/progmodes/cc-cmds.el:1.27 
emacs/lisp/progmodes/cc-cmds.el:1.28
*** emacs/lisp/progmodes/cc-cmds.el:1.27        Mon Apr 22 18:35:45 2002
--- emacs/lisp/progmodes/cc-cmds.el     Tue Apr 23 20:48:52 2002
***************
*** 2761,2767 ****
                  '("" . 0))))))
      ))
  
! (defun c-mask-comment (fill-include-ender apply-outside-literal fun &rest 
args)
    ;; Calls FUN with ARGS ar arguments.  If point is inside a comment,
    ;; the comment starter and ender are masked and the buffer is
    ;; narrowed to make it look like a normal paragraph during the call.
--- 2761,2767 ----
                  '("" . 0))))))
      ))
  
! (defun c-mask-comment (fill-mode apply-outside-literal fun &rest args)
    ;; Calls FUN with ARGS ar arguments.  If point is inside a comment,
    ;; the comment starter and ender are masked and the buffer is
    ;; narrowed to make it look like a normal paragraph during the call.
***************
*** 2790,2796 ****
        ;; Widen to catch comment limits correctly.
        (widen)
        (unless c-lit-limits
!       (setq c-lit-limits (c-literal-limits nil t)))
        (setq c-lit-limits (c-collect-line-comments c-lit-limits))
        (unless c-lit-type
        (setq c-lit-type (c-literal-type c-lit-limits))))
--- 2790,2796 ----
        ;; Widen to catch comment limits correctly.
        (widen)
        (unless c-lit-limits
!       (setq c-lit-limits (c-literal-limits nil fill-mode)))
        (setq c-lit-limits (c-collect-line-comments c-lit-limits))
        (unless c-lit-type
        (setq c-lit-type (c-literal-type c-lit-limits))))
***************
*** 2840,2847 ****
                                                 "\\)\\*/"))
                             (eq (cdr c-lit-limits) (match-end 0))
                             ;; Leave the comment ender on its own line.
!                            (set-marker end (point))))
!               (when fill-include-ender
                  ;; The comment ender should hang.  Replace all cruft
                  ;; between it and the last word with one or two 'x'
                  ;; and include it in the region.  We'll change them
--- 2840,2847 ----
                                                 "\\)\\*/"))
                             (eq (cdr c-lit-limits) (match-end 0))
                             ;; Leave the comment ender on its own line.
!                            (set-marker end (max (point) here))))
!               (when fill-mode
                  ;; The comment ender should hang.  Replace all cruft
                  ;; between it and the last word with one or two 'x'
                  ;; and include it in the region.  We'll change them
***************
*** 2900,2911 ****
              ;; The region includes the comment starter.
              (save-excursion
                (goto-char (car c-lit-limits))
!               (if (and (looking-at (concat "\\(" comment-start-skip "\\)$"))
!                        (> here (match-end 0)))
!                   ;; Begin with the next line.
!                   (setq beg (c-point 'bonl))
!                 ;; Fake the fill prefix in the first line.
!                 (setq tmp-pre t)))))
           ((eq c-lit-type 'string)     ; String.
            (save-excursion
              (when (>= end (cdr c-lit-limits))
--- 2900,2912 ----
              ;; The region includes the comment starter.
              (save-excursion
                (goto-char (car c-lit-limits))
!               (when (and (looking-at comment-start-skip)
!                          (> here (match-end 0)))
!                 (if (eq (match-end 0) (c-point 'eol))
!                     ;; Begin with the next line.
!                     (setq beg (c-point 'bonl))
!                   ;; Fake the fill prefix in the first line.
!                   (setq tmp-pre t))))))
           ((eq c-lit-type 'string)     ; String.
            (save-excursion
              (when (>= end (cdr c-lit-limits))
***************
*** 2951,2957 ****
                  (goto-char (match-end 0))
                (forward-char 2)
                (skip-chars-forward " \t"))
!             (while (< (current-column) (cdr fill)) (forward-char 1))
              (let ((col (current-column)))
                (setq beg (1+ (point))
                      tmp-pre (list (point)))
--- 2952,2960 ----
                  (goto-char (match-end 0))
                (forward-char 2)
                (skip-chars-forward " \t"))
!             (while (and (< (current-column) (cdr fill))
!                         (not (eolp)))
!               (forward-char 1))
              (let ((col (current-column)))
                (setq beg (1+ (point))
                      tmp-pre (list (point)))



reply via email to

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