diff options
| author | Karoly Lorentey | 2004-01-26 21:22:42 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-01-26 21:22:42 +0000 |
| commit | 465fc071a1aa48e87f37bff460410eec921eaa53 (patch) | |
| tree | f7a4de710324c8bfa0c06079259384e8b59d71bb /lisp | |
| parent | d5188e3f1303543ddbe5c230bf93ab6a8fe66de5 (diff) | |
| parent | 41b867eaceb6bfab6be4ed62a2d4dd9cf1be62e3 (diff) | |
| download | emacs-465fc071a1aa48e87f37bff460410eec921eaa53.tar.gz emacs-465fc071a1aa48e87f37bff460410eec921eaa53.zip | |
Merged in changes from CVS HEAD
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-53
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-54
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-55
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-56
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-70
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 23 | ||||
| -rw-r--r-- | lisp/mail/rmail-spam-filter.el | 114 | ||||
| -rw-r--r-- | lisp/man.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/f90.el | 15 | ||||
| -rw-r--r-- | lisp/progmodes/fortran.el | 99 |
5 files changed, 156 insertions, 97 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c64f0d17698..1f5aece0510 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2004-01-25 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 2 | |||
| 3 | * progmodes/fortran.el (fortran-break-before-delimiters): Doc fix. | ||
| 4 | (fortran-break-delimiters-re, fortran-no-break-re): New defconsts. | ||
| 5 | (fortran-fill): When filling a string, adjust re-search-backward | ||
| 6 | argument for special case of string just on fill-column. | ||
| 7 | When filling non-string, allow one extra char if | ||
| 8 | fortran-break-before-delimiters is non-nil. Suggested by | ||
| 9 | Michael Hagemann <michael.hagemann@unibas.ch>. | ||
| 10 | Use fortran-break-delimiters-re and fortran-no-break-re to | ||
| 11 | correctly handle cases such as "**". | ||
| 12 | |||
| 13 | * progmodes/f90.el (f90-break-delimiters): Doc fix. | ||
| 14 | (f90-no-break-re): Add some extra tokens. Doc fix. | ||
| 15 | |||
| 16 | 2004-01-24 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 17 | |||
| 18 | * mail/rmail-spam-filter.el: | ||
| 19 | Use two semicolons as Commentary line prefix. | ||
| 20 | Add ";;; Code:" stylized comment. | ||
| 21 | Delete end-of-line whitespace. | ||
| 22 | Wrap (require 'cl) with `eval-when-compile'. | ||
| 23 | |||
| 1 | 2004-01-23 Benjamin Rutt <brutt@bloomington.in.us> | 24 | 2004-01-23 Benjamin Rutt <brutt@bloomington.in.us> |
| 2 | 25 | ||
| 3 | * vc.el (vc-annotate): Fix improper use of `make-local-variable' | 26 | * vc.el (vc-annotate): Fix improper use of `make-local-variable' |
diff --git a/lisp/mail/rmail-spam-filter.el b/lisp/mail/rmail-spam-filter.el index bb13eac55db..d5a45fe5d87 100644 --- a/lisp/mail/rmail-spam-filter.el +++ b/lisp/mail/rmail-spam-filter.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; rmail-spam-filter.el --- spam filter for rmail, the emacs mail reader. | 1 | ;;; rmail-spam-filter.el --- spam filter for RMAIL |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2002 | 3 | ;; Copyright (C) 2002 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | ;; Keywords: email, spam, filter, rmail | 5 | ;; Keywords: email, spam, filter, rmail |
| 6 | ;; Author: Eli Tziperman <eli@beach.weizmann.ac.il> | 6 | ;; Author: Eli Tziperman <eli@beach.weizmann.ac.il> |
| @@ -23,62 +23,64 @@ | |||
| 23 | ;; Boston, MA 02111-1307, USA. | 23 | ;; Boston, MA 02111-1307, USA. |
| 24 | 24 | ||
| 25 | ;;; Commentary: | 25 | ;;; Commentary: |
| 26 | ;;; ----------- | ||
| 27 | 26 | ||
| 28 | ;;; Automatically recognize and delete junk email before it is | 27 | ;; Automatically recognize and delete junk email before it is |
| 29 | ;;; displayed in rmail/rmail-summary. Spam emails are defined by | 28 | ;; displayed in rmail/rmail-summary. Spam emails are defined by |
| 30 | ;;; specifying one or more of the sender, subject and contents. | 29 | ;; specifying one or more of the sender, subject and contents. |
| 31 | ;;; URL: http://www.weizmann.ac.il/~eli/Downloads/rmail-spam-filter/ | 30 | ;; URL: http://www.weizmann.ac.il/~eli/Downloads/rmail-spam-filter/ |
| 32 | 31 | ||
| 33 | ;;; Usage: | 32 | ;; Usage: |
| 34 | ;;; ------ | 33 | ;; ------ |
| 35 | 34 | ||
| 36 | ;;; put in your .emacs: | 35 | ;; put in your .emacs: |
| 37 | 36 | ||
| 38 | ;;; (load "rmail-spam-filter.el") | 37 | ;; (load "rmail-spam-filter.el") |
| 39 | 38 | ||
| 40 | ;;; and use customize (in rmail-spam-filter group) to: | 39 | ;; and use customize (in rmail-spam-filter group) to: |
| 41 | 40 | ||
| 42 | ;;; (*) turn on the variable rmail-use-spam-filter, | 41 | ;; (*) turn on the variable rmail-use-spam-filter, |
| 43 | 42 | ||
| 44 | ;;; (*) specify in variable rmail-spam-definitions-alist what sender, | 43 | ;; (*) specify in variable rmail-spam-definitions-alist what sender, |
| 45 | ;;; subject and contents make an email be considered spam. | 44 | ;; subject and contents make an email be considered spam. |
| 46 | 45 | ||
| 47 | ;;; in addition, you may: | 46 | ;; in addition, you may: |
| 48 | 47 | ||
| 49 | ;;; (*) Block future mail with the subject or sender of a message | 48 | ;; (*) Block future mail with the subject or sender of a message |
| 50 | ;;; while reading it in RMAIL: just click on the "Spam" item on the | 49 | ;; while reading it in RMAIL: just click on the "Spam" item on the |
| 51 | ;;; menubar, and add the subject or sender to the list of spam | 50 | ;; menubar, and add the subject or sender to the list of spam |
| 52 | ;;; definitions using the mouse and the appropriate menu item. Â You | 51 | ;; definitions using the mouse and the appropriate menu item. Â You |
| 53 | ;;; need to later also save the list of spam definitions using the | 52 | ;; need to later also save the list of spam definitions using the |
| 54 | ;;; same menu item, or alternatively, see variable | 53 | ;; same menu item, or alternatively, see variable |
| 55 | ;;; `rmail-spam-filter-autosave-newly-added-spam-definitions'. | 54 | ;; `rmail-spam-filter-autosave-newly-added-spam-definitions'. |
| 56 | 55 | ||
| 57 | ;;; (*) specify if blind-cc'ed mail (no "To:" header field) is to be | 56 | ;; (*) specify if blind-cc'ed mail (no "To:" header field) is to be |
| 58 | ;;; treated as spam (variable rmail-spam-no-blind-cc; Thanks to Ethan | 57 | ;; treated as spam (variable rmail-spam-no-blind-cc; Thanks to Ethan |
| 59 | ;;; Brown <ethan@gso.saic.com> for this). | 58 | ;; Brown <ethan@gso.saic.com> for this). |
| 60 | 59 | ||
| 61 | ;;; (*) specify if rmail-spam-filter should ignore case of spam | 60 | ;; (*) specify if rmail-spam-filter should ignore case of spam |
| 62 | ;;; definitions (variable rmail-spam-filter-ignore-case; Thanks to | 61 | ;; definitions (variable rmail-spam-filter-ignore-case; Thanks to |
| 63 | ;;; Ethan Brown <ethan@gso.saic.com> for the suggestion). | 62 | ;; Ethan Brown <ethan@gso.saic.com> for the suggestion). |
| 64 | 63 | ||
| 65 | ;;; (*) Specify a "white-list" of trusted senders. If any | 64 | ;; (*) Specify a "white-list" of trusted senders. If any |
| 66 | ;;; rmail-spam-white-list string matches a substring of the "From" | 65 | ;; rmail-spam-white-list string matches a substring of the "From" |
| 67 | ;;; header, the message is flagged as a valid, non-spam message (Ethan | 66 | ;; header, the message is flagged as a valid, non-spam message (Ethan |
| 68 | ;;; Brown <ethan@gso.saic.com>). | 67 | ;; Brown <ethan@gso.saic.com>). |
| 69 | 68 | ||
| 70 | ;;; (*) rmail spam filter also works with bbdb to prevent spam senders | 69 | ;; (*) rmail spam filter also works with bbdb to prevent spam senders |
| 71 | ;;; from entering into the .bbdb file. See variable | 70 | ;; from entering into the .bbdb file. See variable |
| 72 | ;;; "rmail-spam-filter-auto-delete-spam-bbdb-entries". This is done | 71 | ;; "rmail-spam-filter-auto-delete-spam-bbdb-entries". This is done |
| 73 | ;;; in two ways: (a) bbdb is made not to auto-create entries for | 72 | ;; in two ways: (a) bbdb is made not to auto-create entries for |
| 74 | ;;; messages that are deleted by the rmail-spam-filter, (b) when a | 73 | ;; messages that are deleted by the rmail-spam-filter, (b) when a |
| 75 | ;;; message is deleted in rmail, the user is offered to delete the | 74 | ;; message is deleted in rmail, the user is offered to delete the |
| 76 | ;;; sender's bbdb entry as well _if_ it was created at the same day. | 75 | ;; sender's bbdb entry as well _if_ it was created at the same day. |
| 76 | |||
| 77 | ;;; Code: | ||
| 77 | 78 | ||
| 78 | (require 'rmail) | 79 | (require 'rmail) |
| 79 | 80 | ||
| 80 | ;; For find-if and other cool common lisp functions we may want to use. (EDB) | 81 | ;; For find-if and other cool common lisp functions we may want to use. (EDB) |
| 81 | (require 'cl) | 82 | (eval-when-compile |
| 83 | (require 'cl)) | ||
| 82 | 84 | ||
| 83 | (defgroup rmail-spam-filter nil | 85 | (defgroup rmail-spam-filter nil |
| 84 | "Spam filter for RMAIL, the mail reader for Emacs." | 86 | "Spam filter for RMAIL, the mail reader for Emacs." |
| @@ -120,7 +122,7 @@ spam, as one of the fields of `rmail-spam-definitions-alist'" | |||
| 120 | "*Seconds to wait after display of message that spam was found." | 122 | "*Seconds to wait after display of message that spam was found." |
| 121 | :type 'number | 123 | :type 'number |
| 122 | :group 'rmail-spam-filter ) | 124 | :group 'rmail-spam-filter ) |
| 123 | 125 | ||
| 124 | (defcustom rmail-spam-filter-auto-delete-spam-bbdb-entries nil | 126 | (defcustom rmail-spam-filter-auto-delete-spam-bbdb-entries nil |
| 125 | "*Non-nil to make sure no entries are made in bbdb for spam emails. | 127 | "*Non-nil to make sure no entries are made in bbdb for spam emails. |
| 126 | This is done in two ways: (1) bbdb is made not to auto-create entries | 128 | This is done in two ways: (1) bbdb is made not to auto-create entries |
| @@ -161,7 +163,7 @@ of the spam definitions. The strings that specify spam subject, | |||
| 161 | sender, etc, may be regexp. For example, to specify that the subject | 163 | sender, etc, may be regexp. For example, to specify that the subject |
| 162 | may be either 'this is spam' or 'another spam', use the regexp: 'this | 164 | may be either 'this is spam' or 'another spam', use the regexp: 'this |
| 163 | is spam\|another spam' (without the single quotes)." | 165 | is spam\|another spam' (without the single quotes)." |
| 164 | :type '(repeat | 166 | :type '(repeat |
| 165 | (list :format "%v" | 167 | (list :format "%v" |
| 166 | (cons :format "%v" :value (from . "") | 168 | (cons :format "%v" :value (from . "") |
| 167 | (const :format "" from) | 169 | (const :format "" from) |
| @@ -177,7 +179,7 @@ is spam\|another spam' (without the single quotes)." | |||
| 177 | (string :tag "Contents" "")) | 179 | (string :tag "Contents" "")) |
| 178 | (cons :format "%v" :value (action . output-and-delete) | 180 | (cons :format "%v" :value (action . output-and-delete) |
| 179 | (const :format "" action) | 181 | (const :format "" action) |
| 180 | (choice :tag "Action selection" | 182 | (choice :tag "Action selection" |
| 181 | (const :tag "output to spam folder and delete" output-and-delete) | 183 | (const :tag "output to spam folder and delete" output-and-delete) |
| 182 | (const :tag "delete spam" delete-spam) | 184 | (const :tag "delete spam" delete-spam) |
| 183 | )) | 185 | )) |
| @@ -208,7 +210,7 @@ it from rmail file. Called for each new message retrieved by | |||
| 208 | (save-current-msg) | 210 | (save-current-msg) |
| 209 | (rmail-spam-filter-saved-bbdb/mail_auto_create_p nil) | 211 | (rmail-spam-filter-saved-bbdb/mail_auto_create_p nil) |
| 210 | ) | 212 | ) |
| 211 | 213 | ||
| 212 | ;; make sure bbdb does not create entries for messages while spam | 214 | ;; make sure bbdb does not create entries for messages while spam |
| 213 | ;; filter is scanning the rmail file: | 215 | ;; filter is scanning the rmail file: |
| 214 | (setq rmail-spam-filter-saved-bbdb/mail_auto_create_p 'bbdb/mail_auto_create_p) | 216 | (setq rmail-spam-filter-saved-bbdb/mail_auto_create_p 'bbdb/mail_auto_create_p) |
| @@ -236,7 +238,7 @@ it from rmail file. Called for each new message retrieved by | |||
| 236 | 238 | ||
| 237 | ;;; do we want to ignore case in spam definitions: | 239 | ;;; do we want to ignore case in spam definitions: |
| 238 | (setq case-fold-search rmail-spam-filter-ignore-case) | 240 | (setq case-fold-search rmail-spam-filter-ignore-case) |
| 239 | 241 | ||
| 240 | ;; Check for blind CC condition. Set vars such that while | 242 | ;; Check for blind CC condition. Set vars such that while |
| 241 | ;; loop will be bypassed and spam condition will trigger (EDB) | 243 | ;; loop will be bypassed and spam condition will trigger (EDB) |
| 242 | (if (and rmail-spam-no-blind-cc | 244 | (if (and rmail-spam-no-blind-cc |
| @@ -245,7 +247,7 @@ it from rmail file. Called for each new message retrieved by | |||
| 245 | (setq exit-while-loop t) | 247 | (setq exit-while-loop t) |
| 246 | (setq maybe-spam t) | 248 | (setq maybe-spam t) |
| 247 | (setq this-is-a-spam-email t))) | 249 | (setq this-is-a-spam-email t))) |
| 248 | 250 | ||
| 249 | ;; Check white list, and likewise cause while loop | 251 | ;; Check white list, and likewise cause while loop |
| 250 | ;; bypass. (EDB) | 252 | ;; bypass. (EDB) |
| 251 | (if (find-if '(lambda (white-str) | 253 | (if (find-if '(lambda (white-str) |
| @@ -255,7 +257,7 @@ it from rmail file. Called for each new message retrieved by | |||
| 255 | (setq exit-while-loop t) | 257 | (setq exit-while-loop t) |
| 256 | (setq maybe-spam nil) | 258 | (setq maybe-spam nil) |
| 257 | (setq this-is-a-spam-email nil))) | 259 | (setq this-is-a-spam-email nil))) |
| 258 | 260 | ||
| 259 | ;; scan all elements of the list rmail-spam-definitions-alist | 261 | ;; scan all elements of the list rmail-spam-definitions-alist |
| 260 | (while (and | 262 | (while (and |
| 261 | (< num-element num-spam-definition-elements) | 263 | (< num-element num-spam-definition-elements) |
| @@ -277,7 +279,7 @@ it from rmail file. Called for each new message retrieved by | |||
| 277 | 279 | ||
| 278 | ;; start scanning incoming message: | 280 | ;; start scanning incoming message: |
| 279 | ;;--------------------------------- | 281 | ;;--------------------------------- |
| 280 | 282 | ||
| 281 | ;; if sender field is not specified in message being | 283 | ;; if sender field is not specified in message being |
| 282 | ;; scanned, AND if "from" field does not appear in spam | 284 | ;; scanned, AND if "from" field does not appear in spam |
| 283 | ;; definitions for this element, this may still be spam | 285 | ;; definitions for this element, this may still be spam |
| @@ -585,7 +587,7 @@ it from rmail file. Called for each new message retrieved by | |||
| 585 | 587 | ||
| 586 | (defun rmail-bbdb-auto-delete-spam-entries () | 588 | (defun rmail-bbdb-auto-delete-spam-entries () |
| 587 | "When deleting a message in RMAIL, check to see if the bbdb entry | 589 | "When deleting a message in RMAIL, check to see if the bbdb entry |
| 588 | was created today, and if it was, prompt to delete it too. This function | 590 | was created today, and if it was, prompt to delete it too. This function |
| 589 | needs to be called via the `rmail-delete-message-hook' like this: | 591 | needs to be called via the `rmail-delete-message-hook' like this: |
| 590 | \(add-hook 'rmail-delete-message-hook 'rmail-bbdb-auto-delete-spam-entries)" | 592 | \(add-hook 'rmail-delete-message-hook 'rmail-bbdb-auto-delete-spam-entries)" |
| 591 | (interactive) | 593 | (interactive) |
| @@ -604,14 +606,14 @@ needs to be called via the `rmail-delete-message-hook' like this: | |||
| 604 | "Make sure senderes of rmail messages marked as deleted are not added to bbdb. | 606 | "Make sure senderes of rmail messages marked as deleted are not added to bbdb. |
| 605 | Need to add this as a hook like this: | 607 | Need to add this as a hook like this: |
| 606 | \(setq bbdb/mail-auto-create-p 'rmail-spam-filter-bbdb-dont-create-entries-for-spam) | 608 | \(setq bbdb/mail-auto-create-p 'rmail-spam-filter-bbdb-dont-create-entries-for-spam) |
| 607 | and this is also used in conjunction with rmail-bbdb-auto-delete-spam-entries. | 609 | and this is also used in conjunction with rmail-bbdb-auto-delete-spam-entries. |
| 608 | More doc: rmail-bbdb-auto-delete-spam-entries will delete newly created bbdb | 610 | More doc: rmail-bbdb-auto-delete-spam-entries will delete newly created bbdb |
| 609 | entries of mail that is deleted. However, if one scrolls back to the deleted | 611 | entries of mail that is deleted. However, if one scrolls back to the deleted |
| 610 | messages, then the sender is again added to the bbdb. This function | 612 | messages, then the sender is again added to the bbdb. This function |
| 611 | prevents this. Also, don't create entries for messages in the `rmail-spam-file'." | 613 | prevents this. Also, don't create entries for messages in the `rmail-spam-file'." |
| 612 | (interactive) | 614 | (interactive) |
| 613 | (not | 615 | (not |
| 614 | ;; don't create a bbdb entry if one of the following conditions is satisfied: | 616 | ;; don't create a bbdb entry if one of the following conditions is satisfied: |
| 615 | (or | 617 | (or |
| 616 | ;; 1) looking at a deleted message: | 618 | ;; 1) looking at a deleted message: |
| 617 | (rmail-message-deleted-p rmail-current-message) | 619 | (rmail-message-deleted-p rmail-current-message) |
| @@ -631,4 +633,4 @@ prevents this. Also, don't create entries for messages in the `rmail-spam-file' | |||
| 631 | (provide 'rmail-spam-filter) | 633 | (provide 'rmail-spam-filter) |
| 632 | 634 | ||
| 633 | ;;; arch-tag: 03e1d45d-b72f-4dd7-8f04-e7fd78249746 | 635 | ;;; arch-tag: 03e1d45d-b72f-4dd7-8f04-e7fd78249746 |
| 634 | ;;; rmail-spam-filter ends here | 636 | ;;; rmail-spam-filter.el ends here |
diff --git a/lisp/man.el b/lisp/man.el index 61131db20be..faf153bc4c4 100644 --- a/lisp/man.el +++ b/lisp/man.el | |||
| @@ -801,7 +801,7 @@ Same for the ANSI bold and normal escape sequences." | |||
| 801 | ;; Try to recognize common forms of cross references. | 801 | ;; Try to recognize common forms of cross references. |
| 802 | (Man-highlight-references) | 802 | (Man-highlight-references) |
| 803 | (Man-softhyphen-to-minus) | 803 | (Man-softhyphen-to-minus) |
| 804 | (message "%s man page made up" Man-arguments)) | 804 | (message "%s man page formatted" Man-arguments)) |
| 805 | 805 | ||
| 806 | (defun Man-highlight-references () | 806 | (defun Man-highlight-references () |
| 807 | "Highlight the references on mouse-over. | 807 | "Highlight the references on mouse-over. |
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index a3f44743514..11553a1fdb6 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; f90.el --- Fortran-90 mode (free format) | 1 | ;;; f90.el --- Fortran-90 mode (free format) |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1995, 1996, 1997, 2000, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Torbj\"orn Einarsson <Torbjorn.Einarsson@era.ericsson.se> | 5 | ;; Author: Torbj\"orn Einarsson <Torbjorn.Einarsson@era.ericsson.se> |
| 6 | ;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk> | 6 | ;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk> |
| @@ -224,7 +224,10 @@ whether to blink the matching beginning." | |||
| 224 | :group 'f90) | 224 | :group 'f90) |
| 225 | 225 | ||
| 226 | (defcustom f90-break-delimiters "[-+\\*/><=,% \t]" | 226 | (defcustom f90-break-delimiters "[-+\\*/><=,% \t]" |
| 227 | "*Regexp holding list of delimiters at which lines may be broken." | 227 | "*Regexp matching delimiter characters at which lines may be broken. |
| 228 | There are certain tokens comprised entirely of characters | ||
| 229 | matching this regexp that should not be split, and these are | ||
| 230 | specified by the constant `f90-no-break-re'." | ||
| 228 | :type 'regexp | 231 | :type 'regexp |
| 229 | :group 'f90) | 232 | :group 'f90) |
| 230 | 233 | ||
| @@ -574,8 +577,12 @@ Can be overridden by the value of `font-lock-maximum-decoration'.") | |||
| 574 | "Regexp matching the definition of a derived type.") | 577 | "Regexp matching the definition of a derived type.") |
| 575 | 578 | ||
| 576 | (defconst f90-no-break-re | 579 | (defconst f90-no-break-re |
| 577 | (regexp-opt '("**" "//" "=>") 'paren) | 580 | (regexp-opt '("**" "//" "=>" ">=" "<=" "==" "/=") 'paren) |
| 578 | "Regexp specifying where not to break lines when filling.") | 581 | "Regexp specifying where not to break lines when filling. |
| 582 | This regexp matches certain tokens comprised entirely of | ||
| 583 | characters matching the regexp `f90-break-delimiters' that should | ||
| 584 | not be split by filling. Each element is assumed to be two | ||
| 585 | characters long.") | ||
| 579 | 586 | ||
| 580 | (defvar f90-cache-position nil | 587 | (defvar f90-cache-position nil |
| 581 | "Temporary position used to speed up region operations.") | 588 | "Temporary position used to speed up region operations.") |
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 39e74a8dc1f..f23eabe6e9c 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; fortran.el --- Fortran mode for GNU Emacs | 1 | ;;; fortran.el --- Fortran mode for GNU Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (c) 1986, 93, 94, 95, 97, 98, 99, 2000, 01, 2003 | 3 | ;; Copyright (c) 1986, 93, 94, 95, 97, 98, 99, 2000, 01, 03, 04 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Michael D. Prange <prange@erl.mit.edu> | 6 | ;; Author: Michael D. Prange <prange@erl.mit.edu> |
| @@ -237,10 +237,25 @@ See the variable `fortran-column-ruler-fixed' for fixed format mode." | |||
| 237 | 237 | ||
| 238 | (defcustom fortran-break-before-delimiters t | 238 | (defcustom fortran-break-before-delimiters t |
| 239 | "*Non-nil causes filling to break lines before delimiters. | 239 | "*Non-nil causes filling to break lines before delimiters. |
| 240 | Delimiters are whitespace, commas, quotes, and operators." | 240 | Delimiters are characters matching the regexp `fortran-break-delimiters-re'." |
| 241 | :type 'boolean | 241 | :type 'boolean |
| 242 | :group 'fortran) | 242 | :group 'fortran) |
| 243 | 243 | ||
| 244 | (defconst fortran-break-delimiters-re "[-+*/><=, \t]" | ||
| 245 | "Regexp matching delimiter characters at which lines may be broken. | ||
| 246 | There are certain tokens comprised entirely of characters | ||
| 247 | matching this regexp that should not be split, and these are | ||
| 248 | specified by the constant `fortran-no-break-re'.") | ||
| 249 | |||
| 250 | ;; The ">=", etc F77 extensions are supported by g77. | ||
| 251 | (defconst fortran-no-break-re | ||
| 252 | (regexp-opt '("**" "//" "=>" ">=" "<=" "==" "/=") 'paren) | ||
| 253 | "Regexp specifying where not to break lines when filling. | ||
| 254 | This regexp matches certain tokens comprised entirely of | ||
| 255 | characters matching the regexp `fortran-break-delimiters-re' that should | ||
| 256 | not be split by filling. Each element is assumed to be two | ||
| 257 | characters long.") | ||
| 258 | |||
| 244 | (defcustom fortran-mode-hook nil | 259 | (defcustom fortran-mode-hook nil |
| 245 | "Hook run when entering Fortran mode." | 260 | "Hook run when entering Fortran mode." |
| 246 | :type 'hook | 261 | :type 'hook |
| @@ -1646,56 +1661,68 @@ If ALL is nil, only match comments that start in column > 0." | |||
| 1646 | (bol (line-beginning-position)) | 1661 | (bol (line-beginning-position)) |
| 1647 | (eol (line-end-position)) | 1662 | (eol (line-end-position)) |
| 1648 | (bos (min eol (+ bol (fortran-current-line-indentation)))) | 1663 | (bos (min eol (+ bol (fortran-current-line-indentation)))) |
| 1664 | ;; If in a string at fill-column, break it either before the | ||
| 1665 | ;; initial quote, or at fill-col (if string is too long). | ||
| 1649 | (quote | 1666 | (quote |
| 1650 | (save-excursion | 1667 | (save-excursion |
| 1651 | (goto-char bol) | 1668 | (goto-char bol) |
| 1652 | ;; OK to break quotes on comment lines. | 1669 | ;; OK to break quotes on comment lines. |
| 1653 | (unless (looking-at fortran-comment-line-start-skip) | 1670 | (unless (looking-at fortran-comment-line-start-skip) |
| 1654 | (let (fcpoint start) | 1671 | (let (fcpoint start) |
| 1655 | (move-to-column fill-column) | 1672 | (move-to-column fill-column) |
| 1656 | (when (fortran-is-in-string-p (setq fcpoint (point))) | 1673 | (when (fortran-is-in-string-p (setq fcpoint (point))) |
| 1657 | (save-excursion | 1674 | (save-excursion |
| 1658 | (re-search-backward "\\S\"\\s\"\\S\"" bol t) | 1675 | (re-search-backward "\\S\"\\s\"\\S\"?" bol t) |
| 1659 | (setq start | 1676 | (setq start |
| 1660 | (if fortran-break-before-delimiters | 1677 | (if fortran-break-before-delimiters |
| 1661 | (point) | 1678 | (point) |
| 1662 | (1+ (point))))) | 1679 | (1+ (point))))) |
| 1663 | (if (re-search-forward "\\S\"\\s\"\\S\"" eol t) | 1680 | (if (re-search-forward "\\S\"\\s\"\\S\"" eol t) |
| 1664 | (backward-char 2)) | 1681 | (backward-char 2)) |
| 1665 | ;; If the current string is longer than 72 - 6 chars, | 1682 | ;; If the current string is longer than 72 - 6 chars, |
| 1666 | ;; break it at the fill column (else infinite loop). | 1683 | ;; break it at the fill column (else infinite loop). |
| 1667 | (if (> (- (point) start) | 1684 | (if (> (- (point) start) |
| 1668 | (- fill-column 6 fortran-continuation-indent)) | 1685 | (- fill-column 6 fortran-continuation-indent)) |
| 1669 | fcpoint | 1686 | fcpoint |
| 1670 | start)))))) | 1687 | start)))))) |
| 1671 | ;; Decide where to split the line. If a position for a quoted | 1688 | ;; Decide where to split the line. If a position for a quoted |
| 1672 | ;; string was found above then use that, else break the line | 1689 | ;; string was found above then use that, else break the line |
| 1673 | ;; before the last delimiter. | 1690 | ;; before/after the last delimiter. |
| 1674 | ;; Delimiters are whitespace, commas, and operators. | ||
| 1675 | ;; Will break before a pair of *'s. | ||
| 1676 | (fill-point | 1691 | (fill-point |
| 1677 | (or quote | 1692 | (or quote |
| 1678 | (save-excursion | 1693 | (save-excursion |
| 1679 | (move-to-column (1+ fill-column)) | 1694 | ;; If f-b-b-d is t, have an extra column to play with, |
| 1680 | ;; GM Make this a defcustom as in f90-mode? Add ", (? | 1695 | ;; since delimiter gets shifted to new line. |
| 1681 | (skip-chars-backward "^ \t\n,'+-/*=)" | 1696 | (move-to-column (if fortran-break-before-delimiters |
| 1682 | ;;; (if fortran-break-before-delimiters | 1697 | (1+ fill-column) |
| 1683 | ;;; "^ \t\n,'+-/*=" "^ \t\n,'+-/*=)") | 1698 | fill-column)) |
| 1684 | ) | 1699 | (let ((repeat t)) |
| 1685 | (when (<= (point) (1+ bos)) | 1700 | (while repeat |
| 1701 | (setq repeat nil) | ||
| 1702 | ;; Adapted from f90-find-breakpoint. | ||
| 1703 | (re-search-backward fortran-break-delimiters-re | ||
| 1704 | (line-beginning-position)) | ||
| 1705 | (if (not fortran-break-before-delimiters) | ||
| 1706 | (if (looking-at fortran-no-break-re) | ||
| 1707 | ;; Deal with cases such as "**" split over | ||
| 1708 | ;; fill-col. Simpler alternative would be | ||
| 1709 | ;; to start from (1- fill-column) above. | ||
| 1710 | (if (> (+ 2 (current-column)) fill-column) | ||
| 1711 | (setq repeat t) | ||
| 1712 | (forward-char 2)) | ||
| 1713 | (forward-char 1)) | ||
| 1714 | (backward-char) | ||
| 1715 | (or (looking-at fortran-no-break-re) | ||
| 1716 | (forward-char))))) | ||
| 1717 | ;; Line indented beyond fill-column? | ||
| 1718 | (when (<= (point) bos) | ||
| 1686 | (move-to-column (1+ fill-column)) | 1719 | (move-to-column (1+ fill-column)) |
| 1687 | ;; What is this doing??? | 1720 | ;; What is this doing??? |
| 1688 | (or (re-search-forward "[\t\n,'+-/*)=]" eol t) | 1721 | (or (re-search-forward "[\t\n,'+-/*)=]" eol t) |
| 1689 | (goto-char bol))) | 1722 | (goto-char bol))) |
| 1690 | (if (bolp) | 1723 | (if (bolp) |
| 1691 | (re-search-forward "[ \t]" opoint t) | 1724 | (re-search-forward "[ \t]" opoint t)) |
| 1692 | (backward-char) | 1725 | (point))))) |
| 1693 | (if (looking-at "\\s\"") | ||
| 1694 | (forward-char) | ||
| 1695 | (skip-chars-backward " \t\*"))) | ||
| 1696 | (if fortran-break-before-delimiters | ||
| 1697 | (point) | ||
| 1698 | (1+ (point))))))) | ||
| 1699 | ;; If we are in an in-line comment, don't break unless the | 1726 | ;; If we are in an in-line comment, don't break unless the |
| 1700 | ;; line of code is longer than it should be. Otherwise | 1727 | ;; line of code is longer than it should be. Otherwise |
| 1701 | ;; break the line at the column computed above. | 1728 | ;; break the line at the column computed above. |