Yes, what you want is a "hungry" or "greedy" delete/backspace.
f90-mode doesn't come with such a thing, but
cc-mode does. It includes two inter-related families of functions
c-hungry-delete-*. Specifically take a look at
c-hungry-delete-backwards via Emacs's built in function help (
C-h f c-hungry-delete-backwards). From there you can view its implementation; it's relatively small, and will give you a good start at implementing your own "hungry delete".
Edit: Someone's done the work for you, see https://github.com/nflath/hungry-delete
Edit: a naive function to delete two spaces could look something like this. In your
~/.emacs.d/init.el you would add:
;; define a toy function to delete two spaces at once
;; if the preceding two characters are indeed spaces
(defun nega/two-space-delete ()
(if (and (eq ?\ (char-before))
(eq ?\ (char-before (- (point) 1))))
;; after f90-mode is loaded, remap instances of (delete-backward-char) to
;; instead use our previously defined toy function
'(define-key f90-mode-map [remap delete-backward-char] #'nega/two-space-delete))
In your comment you stated
An elisp function which knows the tab-size in spaces and deletes the same number of spaces would solve the problem
This would be the idea solution, but that's not how
f90-mode works. Unlike many other modes, it has more than one
indent level. In fact it has seven.
Extra indentation within do blocks (default 3).
Extra indentation within if/select/where/forall blocks (default 3).
Extra indentation within type/enum/interface/block-data blocks (default 3).
Extra indentation within program/module/subroutine/function blocks (default 2).
Extra indentation within associate blocks (default 2).
Extra indentation within critical/block blocks (default 2).
Extra indentation applied to continuation lines (default 5).
This complicates writing a comprehensive function that "deletes backwards one indentation level". A "greedy backwards delete" that deletes whitespace back to the beginning of the line, followed by a stroke of the TAB key to set you at the correct indent level would serve you well.