[ESS] patch: identing quit statement like run statement in ess-sas

Vinh Nguyen vinhdizzo at gmail.com
Wed Jun 12 23:06:03 CEST 2013


Should probably use this one instead to incorporate the smart semi-colon key:

diff --git a/lisp/ess-sas-d.el b/lisp/ess-sas-d.el
index 70670ed..8356d58 100644
--- a/lisp/ess-sas-d.el
+++ b/lisp/ess-sas-d.el
@@ -244,7 +244,7 @@ Better logic needed!  (see 2 uses, in this file).")

 ;; rmh Jul 10 2003
 (defun ess-electric-run-semicolon (arg)
-  "Insert character.  If the line contains \"run;\" and nothing else
then indent line."
+  "Insert character.  If the line contains \"run;\" or \"quit;\" and
nothing else then indent line."
   (interactive "P")
   (if ess-sas-edit-keys-toggle (insert ";") (let (insertpos)
                                               (if (and (not arg)
@@ -252,7 +252,7 @@ Better logic needed!  (see 2 uses, in this file).")
                                                        (save-excursion

(skip-chars-backward " \t")
                                                          (backward-word 1)
-                                                         (and
(looking-at "run")
+                                                         (and
(looking-at "run\\|quit")
                                                               (progn

(skip-chars-backward " \t")
                                                                 (bolp)))))
diff --git a/lisp/ess-sas-l.el b/lisp/ess-sas-l.el
index 912e469..b9ff685 100644
--- a/lisp/ess-sas-l.el
+++ b/lisp/ess-sas-l.el
@@ -811,7 +811,7 @@ number."
                (back-to-indentation)
                (or (bobp)
                    (looking-at
-                    "data[ ;]\\|proc[ ;]\\|run[ ;]\\|endsas[
;]\\|g?options[ ;]\\|%macro[ ;]\\|%mend[ ;]")))
+                    "data[ ;]\\|proc[ ;]\\|run[ ;]\\|quit[
;]\\|endsas[ ;]\\|g?options[ ;]\\|%macro[ ;]\\|%mend[ ;]")))
              ;;  Case where current statement is DATA, PROC, etc...
              (setq prev-end (point))
              (goto-char (point-min))
-- Vinh


On Wed, Jun 12, 2013 at 1:05 PM, Vinh Nguyen <vinhdizzo at gmail.com> wrote:
> I believe the quit statement should be indented like the run
> statement.  Attached is the patch.  Hopefully this gets incorporated.
>
> diff --git a/lisp/ess-sas-l.el b/lisp/ess-sas-l.el
> index 912e469..b9ff685 100644
> --- a/lisp/ess-sas-l.el
> +++ b/lisp/ess-sas-l.el
> @@ -811,7 +811,7 @@ number."
>                 (back-to-indentation)
>                 (or (bobp)
>                     (looking-at
> -                    "data[ ;]\\|proc[ ;]\\|run[ ;]\\|endsas[
> ;]\\|g?options[ ;]\\|%macro[ ;]\\|%mend[ ;]")))
> +                    "data[ ;]\\|proc[ ;]\\|run[ ;]\\|quit[
> ;]\\|endsas[ ;]\\|g?options[ ;]\\|%macro[ ;]\\|%mend[ ;]")))
>               ;;  Case where current statement is DATA, PROC, etc...
>               (setq prev-end (point))
>               (goto-char (point-min))
>
> -- Vinh


More information about the ESS-help mailing list