summaryrefslogtreecommitdiff
path: root/lisp/progmodes/f90.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2002-04-28 22:15:51 +0000
committerGlenn Morris <rgm@gnu.org>2002-04-28 22:15:51 +0000
commit82b4fc4ab4cea651f8341db488fffa1bb180ef8a (patch)
treed9b1e31dde7bd29ac399031cb51c1266daaeaef0 /lisp/progmodes/f90.el
parent1bb3ae5c0b337d3b05eb4cd34bdfddf6267c1001 (diff)
downloademacs-82b4fc4ab4cea651f8341db488fffa1bb180ef8a.tar.gz
(f90-mark-subprogram-overlay): New internal variable.
(f90-mark-subprogram): Use it to highlight the subprogram with an overlay.
Diffstat (limited to 'lisp/progmodes/f90.el')
-rw-r--r--lisp/progmodes/f90.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index f88d94cca46..873520c7544 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1215,9 +1215,14 @@ Return (type name) or nil if not found."
(message "No end found.")
nil)))
+(defvar f90-mark-subprogram-overlay nil
+ "Used internally by `f90-mark-subprogram' to highlight the subprogram.")
+(make-variable-buffer-local 'f90-mark-subprogram-overlay)
+
(defun f90-mark-subprogram ()
- "Put mark at end of F90 subprogram, point at beginning.
-Marks are pushed and highlight (grey shadow) is turned on."
+ "Put mark at end of F90 subprogram, point at beginning, push marks.
+If called interactively, highlight the subprogram with the face `highlight'.
+Call again to remove the highlighting."
(interactive)
(let ((pos (point)) program)
(f90-end-of-subprogram)
@@ -1228,7 +1233,14 @@ Marks are pushed and highlight (grey shadow) is turned on."
(if f90-xemacs-flag
(zmacs-activate-region)
(setq mark-active t
- deactivate-mark nil))
+ deactivate-mark nil)
+ (if (interactive-p)
+ (if (overlayp f90-mark-subprogram-overlay)
+ (if (overlay-buffer f90-mark-subprogram-overlay)
+ (delete-overlay f90-mark-subprogram-overlay)
+ (move-overlay f90-mark-subprogram-overlay (point) (mark)))
+ (setq f90-mark-subprogram-overlay (make-overlay (point) (mark)))
+ (overlay-put f90-mark-subprogram-overlay 'face 'highlight))))
program))
(defun f90-comment-region (beg-region end-region)