| Anonymous | Login | Signup for a new account | 2013-05-21 13:54 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
| 0005727 | OCaml | OCaml general | public | 2012-08-14 19:45 | 2012-09-27 18:03 | |||||||
| Reporter | Drakken | |||||||||||
| Assigned To | doligez | |||||||||||
| Priority | low | Severity | tweak | Reproducibility | always | |||||||
| Status | resolved | Resolution | fixed | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | 3.12.1 | |||||||||||
| Target Version | 4.00.1+dev | Fixed in Version | ||||||||||
| Summary | 0005727: emacs caml-mode indents shebang line in toplevel scripts | |||||||||||
| Description | When editing a toplevel script in emacs caml-mode, auto-tabbing indents the shebang line and the directive immediately following it if one is present. | |||||||||||
| Steps To Reproduce | Create and auto-indent a toplevel script with a shebang line, using emacs and caml-mode. | |||||||||||
| Additional Information | The following code is a patch for caml.el. It seems to work, but I'm not an elisp expert, so it may be slow or otherwise suboptimal :( ;small addition to caml-compute-basic-indent (defun caml-compute-basic-indent (prio) (if (= 1 (line-beginning-position)) 0 <current body of caml-compute-basic-indent>)) ;new function (defun caml-in-shebang-line () (save-excursion (beginning-of-line) (and (= 1 (point)) (looking-at "#!")))) ;one-line insertion into the COND form in caml-in-expr-p (defun caml-in-expr-p () (let (...) (caml-find-kwop ...) (cond ((caml-in-shebang-line) (setq in-expr nil)) ;; maybe reset pos? ; special case for ;; ...) ...) | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Notes |
|
|
(0008173) doligez (manager) 2012-09-27 18:03 edited on: 2012-09-28 18:56 |
I have applied a simplified version of your patch. There is one remaining problem (with or without the simplification): if the shebang line is already indented to any non-zero level, then emacs will indent it to two spaces. Edit: I had forgotten to commit the change. It is now done in 4.00.1+dev (r 12973) and trunk (r 12974). |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-08-14 19:45 | Drakken | New Issue | |
| 2012-09-06 16:43 | doligez | Target Version | => 4.00.1+dev |
| 2012-09-27 15:57 | doligez | Assigned To | => doligez |
| 2012-09-27 15:57 | doligez | Status | new => assigned |
| 2012-09-27 18:03 | doligez | Note Added: 0008173 | |
| 2012-09-27 18:03 | doligez | Status | assigned => resolved |
| 2012-09-27 18:03 | doligez | Resolution | open => fixed |
| 2012-09-28 18:56 | doligez | Note Edited: 0008173 | View Revisions |
| Copyright © 2000 - 2011 MantisBT Group |