summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-08-31 21:42:28 +0000
committerRichard M. Stallman <rms@gnu.org>1992-08-31 21:42:28 +0000
commit6ec3899e1629c6f954d12fc7773ddd5a8f1a76be (patch)
treeeb181b38fa44f07c67c70902a7c3073348d9edf7 /lisp
parent616ed245e9bc6cca7fb41575193ac6dcf5ea422e (diff)
downloademacs-6ec3899e1629c6f954d12fc7773ddd5a8f1a76be.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp')
-rw-r--r--lisp/loadup.el1
-rw-r--r--lisp/mouse.el12
-rw-r--r--lisp/progmodes/c-mode.el68
3 files changed, 53 insertions, 28 deletions
diff --git a/lisp/loadup.el b/lisp/loadup.el
index afca23d5e35..7710e47582f 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -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)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 351bab4c864..21dacf84348 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -473,17 +473,17 @@ This does not delete the region; it acts like \\[kill-ring-save]."
(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))
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el
index 3d135f83d81..fc4f4fa9da7 100644
--- a/lisp/progmodes/c-mode.el
+++ b/lisp/progmodes/c-mode.el
@@ -240,12 +240,17 @@ If point is inside a comment, the current paragraph of the comment
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 @@ is filled, preserving the comment indentation or line-starting decorations."
(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 @@ Returns nil if line starts inside a string, t if in a comment."
(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.