|
|
1.1 ! root 1: ;; outdent.el ! 2: ! 3: ;; binds meta-tab to a function that reduces indentation to that of the next previous ! 4: ;; line with smaller indentation. Can be used repeatedly to "outdent" several levels. ! 5: ;; Must be loaded after sml-mode.el, which defines sml-mode-map. ! 6: ! 7: (defun back-to-outer-indent () ! 8: "Unindents out to the next outer level of indentation. Bound to \e\t" ! 9: (interactive) ! 10: (let ((start-column (current-column)) ! 11: (indent (current-column))) ! 12: (if (> start-column 0) ! 13: (progn ! 14: (save-excursion ! 15: (while (>= indent start-column) ! 16: (if (re-search-backward "^[^\n]" nil t) ! 17: (setq indent (current-indentation)) ! 18: (setq indent 0)))) ! 19: (backward-delete-char-untabify (- start-column indent)))))) ! 20: ! 21: ! 22: (define-key sml-mode-map "\e\t" 'back-to-outer-indent)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.