changeset 1064:e699ce19609f

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Mon, 31 Aug 1992 21:42:28 +0000
parents 25b929c06f83
children f7477db25e8c
files lisp/loadup.el lisp/mouse.el lisp/progmodes/c-mode.el
diffstat 3 files changed, 53 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/loadup.el	Mon Aug 31 20:22:03 1992 +0000
+++ b/lisp/loadup.el	Mon Aug 31 21:42:28 1992 +0000
@@ -116,6 +116,7 @@
 	(setq name (concat (downcase (substring name 0 (match-beginning 0)))
 			   "-"
 			   (substring name (match-end 0)))))
+      (delete-file (concat (expand-file-name "../etc/DOC-") name))
       (copy-file (expand-file-name "../etc/DOC")
 		 (concat (expand-file-name "../etc/DOC-") name)
 		 t)
--- a/lisp/mouse.el	Mon Aug 31 20:22:03 1992 +0000
+++ b/lisp/mouse.el	Mon Aug 31 21:42:28 1992 +0000
@@ -473,17 +473,17 @@
 (defvar help-admin-map '(keymap "Administrivia"))
 
 (define-key help-menu-map [apropos]
-  (cons "Is there a command that..." help-apropos-map))
+  (cons "@Is there a command that..." help-apropos-map))
 (define-key help-menu-map [keys]
-  (cons "Key Commands <==> Functions" help-keys-map))
+  (cons "@Key Commands <==> Functions" help-keys-map))
 (define-key help-menu-map [manuals]
-  (cons "Manual and tutorial" help-manual-map))
+  (cons "@Manual and tutorial" help-manual-map))
 (define-key help-menu-map [misc]
-  (cons "Odds and ends" help-misc-map))
+  (cons "@Odds and ends" help-misc-map))
 (define-key help-menu-map [modes]
-  (cons "Modes" help-modes-map))
+  (cons "@Modes" help-modes-map))
 (define-key help-menu-map [admin]
-  (cons "Administrivia" help-admin-map))
+  (cons "@Administrivia" help-admin-map))
 
 (define-key help-apropos-map "c" '("Command Apropos" . command-apropos))
 (define-key help-apropos-map "a" '("Apropos" . apropos))
--- a/lisp/progmodes/c-mode.el	Mon Aug 31 20:22:03 1992 +0000
+++ b/lisp/progmodes/c-mode.el	Mon Aug 31 21:42:28 1992 +0000
@@ -240,12 +240,17 @@
 is filled, preserving the comment indentation or line-starting decorations."
   (interactive "P")
   (let ((first-line
+	 ;; Check for obvious entry to comment.
 	 (save-excursion
 	   (beginning-of-line)
 	   (skip-chars-forward " \t")
 	   (looking-at comment-start-skip))))
     (if (or first-line
-	    (eq (calculate-c-indent) t))
+	    ;; t if we enter a comment between start of function and this line.
+	    (eq (calculate-c-indent) t)
+	    ;; See if we enter a comment between beg-of-line and here.
+	    (nth 4 (parse-partial-sexp (save-excursion (beginning-of-line) (point))
+				       (point) 0)))
 	;; Inside a comment: fill one comment paragraph.
 	(let ((fill-prefix
 	       ;; The prefix for each line of this paragraph
@@ -272,8 +277,12 @@
 	       (concat paragraph-separate
 		       "\\|^[ \t]*/\\*[ \t]*$\\|^[ \t]*\\*/[ \t]*$\\|^[^ \t/*]")))
 	  (save-restriction
+  (recursive-edit)
 	    ;; Don't fill the comment together with the code following it.
-	    (narrow-to-region (point-min)
+	    (narrow-to-region (save-excursion
+				(search-backward "/*")
+				(beginning-of-line)
+				(point))
 			      (save-excursion
 				(search-forward "*/" nil 'move)
 				(forward-line 1)
@@ -515,26 +524,41 @@
 		      (save-excursion
 			(re-search-backward "^[^ \^L\t\n#]" nil 'move)
 			(let (comment lim)
-			  (if (and (looking-at "\\sw\\|\\s_")
-				   (looking-at "[^\"\n=]*(")
-				   (progn
-				     (goto-char (1- (match-end 0)))
-				     (setq lim (point))
-				     (forward-sexp 1)
-				     (skip-chars-forward " \t\f")
-				     (and (< (point) indent-point)
-					  (not (memq (following-char)
-						     '(?\, ?\;)))))
-				   ;; Make sure the "function decl" we found
-				   ;; is not inside a comment.
-				   (progn
-				     (beginning-of-line)
-				     (while (and (not comment)
-						 (search-forward "/*" lim t))
-				       (setq comment
-					     (not (search-forward "*/" lim t))))
-				     (not comment)))
-			      c-argdecl-indent 0)))))
+			  ;; Recognize the DEFUN macro in Emacs.
+			  (if (save-excursion
+				;; Move down to the (putative) argnames line.
+				(while (not (looking-at " *("))
+				  (forward-line 1))
+				;; Go back to the DEFUN, if it is one.
+				(condition-case nil
+				    (backward-sexp 1)
+				  (error))
+				(beginning-of-line)
+				(setq tem (point))
+				(looking-at "DEFUN\\b"))
+			      c-argdecl-indent
+			    (if (and (looking-at "\\sw\\|\\s_")
+				     (looking-at "[^\"\n=]*(")
+				     (progn
+				       (goto-char (1- (match-end 0)))
+				       (setq lim (point))
+				       (condition-case nil
+					   (forward-sexp 1)
+					 (error))
+				       (skip-chars-forward " \t\f")
+				       (and (< (point) indent-point)
+					    (not (memq (following-char)
+						       '(?\, ?\;)))))
+				     ;; Make sure the "function decl" we found
+				     ;; is not inside a comment.
+				     (progn
+				       (beginning-of-line)
+				       (while (and (not comment)
+						   (search-forward "/*" lim t))
+					 (setq comment
+					       (not (search-forward "*/" lim t))))
+				       (not comment)))
+				c-argdecl-indent 0))))))
 		 basic-indent)))
 
 ;; 		 ;; Now add a little if this is a continuation line.