# HG changeset patch # User Dave Love # Date 979240405 0 # Node ID 682d1ffa0b5edd5e9fddeac763947af168c208e3 # Parent 569b2a1b20dfb637a012186c8af5b5aa911c7f38 (fortran-mode-map): Modify Customization entry for custom-menu-create change. (fortran-strip-sqeuence-nos): Make arg optional. Fix regexp and don't cons it in the search loop. diff -r 569b2a1b20df -r 682d1ffa0b5e lisp/progmodes/fortran.el --- a/lisp/progmodes/fortran.el Thu Jan 11 19:04:29 2001 +0000 +++ b/lisp/progmodes/fortran.el Thu Jan 11 19:13:25 2001 +0000 @@ -421,53 +421,52 @@ (define-key map "9" 'fortran-electric-line-number) ;; Menu - (unless (boundp 'fortran-mode-menu) - (easy-menu-define - fortran-mode-menu map "" - `("Fortran" - ["Manual" (info "(emacs)Fortran")] - ["Customize" :filter (lambda (&rest junk) - (cdr (custom-menu-create 'fortran)))] - ["Set" Custom-set t] - ["Save" Custom-save t] - ["Reset to Current" Custom-reset-current t] - ["Reset to Saved" Custom-reset-saved t] - ["Reset to Standard Settings" Custom-reset-standard t] - "----" - ["Toggle Auto-fill" auto-fill-mode :style toggle - :selected auto-fill-function] - ["Toggle abbrev-mode" abbrev-mode :style toggle :selected abbrev-mode] - "----" - ["Comment-out Region" fortran-comment-region mark-active] - ["Uncomment-out region" - (fortran-comment-region (region-beginning) (region-end) 1) - mark-active] - ["Indent Region" indent-region mark-active] - ["Indent Subprogram" fortran-indent-subprogram t] - "----" - ["Beginning of Subprogram" fortran-beginning-of-subprogram t] - ["End of Subprogram" fortran-end-of-subprogram t] - ("Mark" - ["Subprogram" mark-defun t] - ["IF Block" fortran-mark-if t] - ["DO Block" fortran-mark-do t]) - ["Narrow to Subprogram" narrow-to-defun t] - ["Widen" widen t] - "----" - ["Temporary column ruler" fortran-column-ruler t] - ["72-column window" fortran-window-create t] - ["Full Width Window" - (enlarge-window-horizontally (- (frame-width) (window-width))) - (< (window-width) (frame-width))] - ["Momentary 72-column window" fortran-window-create-momentarily t] - "----" - ["Break Line at Point" fortran-split-line t] - ["Join Line" fortran-join-line t] - ["Fill Statement/Comment" fill-paragraph t] - "----" - ["Add imenu menu" - imenu-add-menubar-index (not (and (boundp 'imenu--index-alist) - imenu--index-alist))]))) + (easy-menu-define + fortran-mode-menu map "" + `("Fortran" + ["Manual" (info "(emacs)Fortran")] + ("Customization" + ,(custom-menu-create 'fortran) + ["Set" Custom-set t] + ["Save" Custom-save t] + ["Reset to Current" Custom-reset-current t] + ["Reset to Saved" Custom-reset-saved t] + ["Reset to Standard Settings" Custom-reset-standard t]) + "----" + ["Toggle Auto-fill" auto-fill-mode :style toggle + :selected auto-fill-function] + ["Toggle abbrev-mode" abbrev-mode :style toggle :selected abbrev-mode] + "----" + ["Comment-out Region" fortran-comment-region mark-active] + ["Uncomment-out region" + (fortran-comment-region (region-beginning) (region-end) 1) + mark-active] + ["Indent Region" indent-region mark-active] + ["Indent Subprogram" fortran-indent-subprogram t] + "----" + ["Beginning of Subprogram" fortran-beginning-of-subprogram t] + ["End of Subprogram" fortran-end-of-subprogram t] + ("Mark" + ["Subprogram" mark-defun t] + ["IF Block" fortran-mark-if t] + ["DO Block" fortran-mark-do t]) + ["Narrow to Subprogram" narrow-to-defun t] + ["Widen" widen t] + "----" + ["Temporary column ruler" fortran-column-ruler t] + ["72-column window" fortran-window-create t] + ["Full Width Window" + (enlarge-window-horizontally (- (frame-width) (window-width))) + (< (window-width) (frame-width))] + ["Momentary 72-column window" fortran-window-create-momentarily t] + "----" + ["Break Line at Point" fortran-split-line t] + ["Join Line" fortran-join-line t] + ["Fill Statement/Comment" fill-paragraph t] + "----" + ["Add imenu menu" + imenu-add-menubar-index (not (and (boundp 'imenu--index-alist) + imenu--index-alist))])) map) "Keymap used in Fortran mode.") @@ -1789,15 +1788,14 @@ (fortran-previous-statement))) (fortran-indent-line))) -(defun fortran-strip-sqeuence-nos (do-space) +(defun fortran-strip-sqeuence-nos (&optional do-space) "Delete all text after column 72 (assumed to be sequence numbers). Also delete trailing whitespace after stripping such text. Supplying -prefix arg DO-SPACE prevent stripping the whitespace." +prefix arg DO-SPACE prevents stripping the whitespace." (interactive "p") (save-excursion (goto-char (point-min)) - (while (re-search-forward (concat "^" (make-string 72 ?.)" \\(.*\\)") - nil t) + (while (re-search-forward "^.\\{72\\}\\(.*\\)" nil t) (replace-match "" nil nil nil 1) (unless do-space (delete-horizontal-space)))))