Ralph Amissah <ralph.amis...@gmail.com> writes:
>
> I did use a subdirectory as it looks cleaner and is available should
> there ever be more files to place there

The startup will need that, eg. per attached below.

> (and I copied the autoload file there as well).

Slight doubt about extending load-path in sisu-autoloads.el, otherwise
no worries.

> ultimately as upstream,

Actually on the upstream front I meant to say I think outline-regexp
should be buffer-local.  It could go in the main mode function too
as a setup for inter-operation.  Bit of a diff attached below,

2015-12-19  Kevin Ryde  <user42_ke...@yahoo.com.au>

        * sisu-mode.el: outline-regexp buffer local, more autoload cookies,
        auto-mode-alist use \' for end-of-string.


> Remaining holdouts: (i) from the most recent posting, not having sorted
> syntax highlighting for tic block types ```

Non-greedy might help (untested),

    ```.*?\n```\n

which matches as little as possible to satisfy.  Except . doesn't match
newline so umm \\(.\\|\n\\)*?  A matcher function is also possible if it
gets too much.

You might have seen in info node "(elisp)Multiline Font Lock" some extra
trouble is needed to make a multi-line match work fully.  Hard work this
font lock eh :-)

> (ii) anticipated changes for code block tags:
> will need to identify the code language held by the block (but that is
> down the line, as sisu does not take this into account yet (having come
> from a more law and literature text background rather than a code text
> one)).

Some "multiple major modes" things can supposedly apply different modes
to buffer sub-parts.  I think I've seen it work but never needed it.


;;; 50sisu.el -- debian emacs setups for sisu

(if (not (file-exists-p "/usr/share/emacs/site-lisp/sisu/sisu-mode.el"))
    (message "sisu removed but not purged, skipping setup")

  ;; not byte compiled so this is the source dir
  (debian-pkg-add-load-path-item "/usr/share/emacs/site-lisp/sisu")

  (autoload 'sisu-mode "sisu-mode" "Major mode for editing SiSU files." t)
  (add-to-list 'auto-mode-alist '("\\.sst\\'" . sisu-mode))
  (add-to-list 'auto-mode-alist '("\\.ssm\\'" . sisu-mode))
  (add-to-list 'auto-mode-alist '("\\.ssi\\'" . sisu-mode)))
--- sisu-mode.el.orig	2015-12-18 21:41:58.363452251 +1100
+++ sisu-mode.el	2015-12-19 14:22:46.341212973 +1100
@@ -470,8 +470,7 @@
 ;; enables outlining for sisu
 (add-hook 'sisu-mode-hook
        '(lambda ()
-         (outline-minor-mode)
-         (setq outline-regexp "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\|\\@[a-z]+:\\( \\|$\\)\\)")))
+         (outline-minor-mode)))
 
 ;;; outline mode "folding" if available
 ;;; TODO make sure linum (line numbering) is off, else performance penalty, sucks bigtime
@@ -491,7 +490,7 @@
 ;; C-c @ C-d hide subtree at cursor location
 
 ;; Sisu & Autoload:
-;; ##autoload
+;;;###autoload
 (define-derived-mode sisu-mode text-mode "SiSU"
   "Major mode for editing SiSU files."
   (interactive)
@@ -505,6 +504,9 @@
   (make-local-variable 'paragraph-ignore-fill-prefix)
   (setq paragraph-ignore-fill-prefix t)
 
+  (set (make-local-variable 'outline-regexp)
+       "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\|\\@[a-z]+:\\( \\|$\\)\\)")
+
   (make-local-variable 'require-final-newline)
   (setq require-final-newline t)
 
@@ -517,9 +519,12 @@
     ))
   (run-hooks 'sisu-mode-hook))
 
-(add-to-list 'auto-mode-alist '("\\.sst$" . sisu-mode))
-(add-to-list 'auto-mode-alist '("\\.ssm$" . sisu-mode))
-(add-to-list 'auto-mode-alist '("\\.ssi$" . sisu-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.sst\\'" . sisu-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.ssm\\'" . sisu-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.ssi\\'" . sisu-mode))
 
 ;;;; ChangeLog:
 

Reply via email to