You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
;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 ;;
...)
...)
The text was updated successfully, but these errors were encountered:
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).
Original bug ID: 5727
Reporter: Drakken
Assigned to: @damiendoligez
Status: closed (set by @xavierleroy on 2015-12-11T18:08:11Z)
Resolution: fixed
Priority: low
Severity: tweak
Version: 3.12.1
Target version: 4.00.1+dev
Category: ~DO NOT USE (was: OCaml general)
Bug 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
))
;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 ;;
...)
...)
The text was updated successfully, but these errors were encountered: