* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
@ 2016-02-18 22:19 Ralph Amissah
2016-02-19 3:59 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Ralph Amissah @ 2016-02-18 22:19 UTC (permalink / raw)
To: Stefan Monnier, emacs-devel; +Cc: Kevin Ryde, Ambrose Kofi Laing
[-- Attachment #1: Type: text/plain, Size: 6058 bytes --]
Dear Stefan,
>> I've just added sisu-mode.el to Emacs's `elpa' branch in the
>> Bzr repository. It will appear in the GNU ELPA next time we update it
>> from the branch.
>>
I do not know whether you are still the correct person to address this
email to, but it is easiest to continue the trail where we last left
off. I hope this note finds you in good health.
>> Whenever there are any updates, please send a patch to
>> emacs-devel@gnu.org or via M-x report-emacs-bug so someone can install
>> it for you.
>
ah, I copy this request to emacs-devel@gnu.org
Please find attached sisu-mode.el and sisu-mode-autoloads.el updated to
for current sisu markup, and with corrections with regard to autoload
(re: the relevant filenames).
"Evil-mode" helm, org-mode have made serious inroads to my dependence on
vim, now "spacemacs" as well ... but one of the results is that I need
more ram for my laptop(s).
Kofi and Kevin, greetings and thank you.
Ralph Amissah
On Wed, Jul 06, 2011 at 08:39:18PM -0400, Ralph Amissah wrote:
> On Mon, Jul 4, 2011 at 3:32 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> > I've just added sisu-mode.el to Emacs's `elpa' branch in the
> > Bzr repository. It will appear in the GNU ELPA next time we update it
> > from the branch.
> >
> > I made a few changes to the format of the comments in the file you sent,
> > w.r.t ";;; Commentary:" and ";;; Code:", the Author and such fields, as
> > well as the license info, to make it follow Emacs conventions.
> > Thank you for your contribution,
> >
>
> Thank you.
>
> > Whenever there are any updates, please send a patch to
> > emacs-devel@gnu.org or via M-x report-emacs-bug so someone can install
> > it for you.
>
> Will do.
>
> > If you want, we could also give you access to the repository
> > so you can install changes yourself.
> >
>
> This might be interesting in future.
> Will come back to this when it seems convenient.
> Will have a look sometime and try to become familiar with how you
> would prefer commit comments to be.
>
> >
> > Stefan
> >
>
> Again thank you,
> Ralph
>
> >
> >>>>>> "Ralph" == Ralph Amissah <ralph.amissah@gmail.com> writes:
> >
> >> On Thu, Mar 17, 2011 at 4:07 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> >>> [ Requesting the copyright paperwork. ]
> >>>
> >>> Great. Could you remind me how Sun Tong's work is (ir)relevant here?
> >>> I.e. did you copy some of his code? If so, is that code still present
> >>> in sisu-mode or has it been superceded by new code since then? How much
> >>> code are we talking about?
> >>> I'm trying to assess whether we need him to sign some copyright paperwork
> >>> as well.
> >>>
> >
> >> We used his syntax highlighting file doc-mode.el as a starting point. We
> >> wrote to him and got permission for its use. I forward a copy of his
> >> response to our request, and attach: Sun Tong's doc-mode.el;
> >> sisu-mode.el as it was at the time here named sisu2008-mode.el, and; the
> >> current sisu-mode.el should you need to make a determination as to
> >> whether more needs to be done. I think it is fine.
> >
> >>>> ---------- Forwarded message ----------
> >>>> From: Tong Sun <suntong001@gmail.com>
> >>>> Date: Sun, Nov 2, 2008 at 11:20 PM
> >>>> Subject: Re: request to base another markup language syntax
> >>>> highlighting on your emacs doc-mode.el
> >>>> To: Ralph Amissah <ralph.amissah@gmail.com>
> >>>>
> >>>> Hi Ralph,
> >>>>
> >>>> Sure, no problem at all. My pleasure.
> >>>>
> >>>> Thanks a lot for the kind words in the credit intro.
> >>>>
> >>>> Cheers.
> >>>>
> >>>> tong
> >>>>
> >>>> On Sun, Nov 2, 2008 at 11:10 PM, Ralph Amissah <ralph.amissah@gmail.com> wrote:
> >>>>> Dear Tong,
> >>>>> I am the author of sisu, an open source project including a markup
> >>>>> language and processor.
> >>>>> I have been working on this project for the last 10 years:
> >>>>> http://www.jus.uio.no/sisu
> >>>>> the most recent blogging on it being:
> >>>>> http://twobits.net/2008/10/15/oh-wow-sisu-rocks-two-bits/
> >>>>>
> >>>>> This is to request permission to use our reworked sisu-mode.el for
> >>>>> sisu syntax highlighting (parts of which are) based on your emacs
> >>>>> doc-mode.el:
> >>>>> http://xpt.sourceforge.net/tools/doc-mode/
> >>>>> http://xpt.sourceforge.net/tools/doc-mode/doc-mode.el
> >>>>>
> >>>>> I confess to having been primarily a user of vim, and for a long time
> >>>>> wishing to have a emacs syntax highlighter for SiSU. Finally with a
> >>>>> friend (Kofi Laing), working with your file we have done this, the
> >>>>> syntax highlighter is attached and we would like to add it to the SiSU
> >>>>> program bundle under GPL together with credit to you for doc-mode.el
> >>>>>
> >>>>> A copy of sisu-mode.el is attached, the header currently reads as follows:
> >>>>>
> >>>>> ;;; sisu-mode.el --- a major-mode for highlighting a hierarchy structured text.
> >>>>> ;; @Author: Ambrose Kofi Laing
> >>>>> ;; @Keywords: text, processes, tools
> >>>>> ;; @Version: 0.96.4 2008-11-01
> >>>>> ;; @License: GPLv3
> >>>>> ;; @Home URL: SiSU: http://www.jus.uio.no/sisu
> >>>>> ;; originally looked at (based on) doc-mode, with kind permission of the author
> >>>>> ;; Author: SUN, Tong <suntong001@users.sf.net>, (c)2001-6, all right reserved
> >>>>> ;; Version: $Date: 2006/01/19 03:13:41 $ $Revision: 1.14 $
> >>>>> ;; Home URL: http://xpt.sourceforge.net/
> >>>>> ;;
> >>>>> ;; Distribute freely, but please include the author's info & copyright,
> >>>>> ;; the file's version & url with the distribution.
> >>>>> ;;
> >>>>> ; Viva Software Libre!
> >>>>> ;; Support the free software movement!
> >>>>>
> >>>>> We would be grateful for your permission to do this.
> >>>>>
> >>>>> Much gratitude in advance,
> >>>>> Sincerely,
> >>>>> Ralph Amissah
> >>>>>
> >>>>>
> >>>>> --
> >>>>> email: ralph.amissah@gmail.com
> >>>>> SiSU: http://www.jus.uio.no/sisu
> >
> >>>
> >>> Stefan
> >>>
> >>>
> >>> PS: Congratulation on your second child, BTW.
> >>>
> >
> >> Thank you :-) both young ones are joys.
> >
> >> Ralph
> >
[-- Attachment #2: sisu-mode.el --]
[-- Type: text/plain, Size: 15669 bytes --]
;;; sisu-mode.el --- a major-mode for highlighting a hierarchy structured text.
;; Copyright (C): Free Software Foundation, Inc. (FSF) (GNU EMACS)
;; Assigned to FSF 2011-04-08
;;
;; [this file has been edited and updated by Ralph Amissah]
;; Author: Ralph Amissah & Ambrose Kofi Laing
;; Keywords: text, syntax, processes, tools
;; Version: 7.1.7 2015-12-26 Ralph Amissah,
;; including patch from Kevin Ryde;
;; 5.7.2 2014-10-28 Ralph Amissah;
;; 4.0.8 2013-02-17 Ralph Amissah;
;; 3.0.7 2011-04-20 Ambrose Kofi Laing & Ralph Amissah;
;; 2008-12-14
;; URL: [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/emacs/sisu-mode.el;hb=HEAD]
;; License: GPLv3
;; Home URL: SiSU: http://www.jus.uio.no/sisu
;; originally looked at (based on) doc-mode, with kind permission of the author
;; Author: SUN, Tong <suntong001@users.sf.net>, (c)2001-6, all right reserved
;; Version: $Date: 2006/01/19 03:13:41 $ $Revision: 1.14 $
;; Home URL: http://xpt.sourceforge.net/
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see [http://www.gnu.org/licenses/].
;; Viva Software Libre!
;; Support the free software movement!
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; SiSU (http://www.sisudoc.org/) is a document structuring and
;; publishing framework. This package provides an Emacs major mode
;; for SiSU markup.
;; When this package is installed, files ending in ".sisu" are
;; automatically associated with sisu-mode. If a file doesn't have a
;; .sisu extension, add a first line:
;; # -*- Sisu -*-
;; The documentation for the "Structure Of The Hierarchy Text" can be
;; found in the sisustring for the sisu-mode function.
(defgroup sisu-faces nil
"AsciiSisu highlighting"
:group 'sisus)
;; == Colors
; color n is more prominent than color n+1
(defface sisu-title-1-face
`((((class color)
(background dark))
(:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch))
(((class color)
(background light))
(:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch))
(t (:weight bold :inherit variable-pitch)))
"Face for AsciiSisu titles at level 1."
:group 'sisu-faces)
(defface sisu-title-2-face
`((((class color)
(background dark))
(:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch))
(((class color)
(background light))
(:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch))
(t (:weight bold :inherit variable-pitch)))
"Face for AsciiSisu titles at level 2."
:group 'sisu-faces)
(defface sisu-title-3-face
`((((class color)
(background dark))
(:foreground "sienna3" :bold t))
(((class color)
(background light))
(:foreground "sienna3" :bold t))
(t (:weight bold)))
"Face for AsciiSisu titles at level 3."
:group 'sisu-faces)
(defface sisu-title-4-face
`((((class color)
(background dark))
(:foreground "burlywood3"))
(((class color)
(background light))
(:foreground "burlywood3"))
(t ()))
"Face for AsciiSisu titles at level 4."
:group 'sisu-faces)
(defface info-node
'((((class color) (background light)) (:foreground "brown" :bold t :italic t))
(((class color) (background dark)) (:foreground "white" :bold t :italic t))
(t (:bold t :italic t)))
"Face for Info node names."
:group 'sisu-faces)
(defvar sisu-title-1 'sisu-title-1-face)
(defvar sisu-title-2 'sisu-title-2-face)
(defvar sisu-title-3 'sisu-title-3-face)
(defvar sisu-title-4 'sisu-title-4-face)
(defvar general-font-lock-red1 font-lock-warning-face)
(defvar general-font-lock-red2 font-lock-comment-face)
(defvar general-font-lock-red3 font-lock-string-face)
(defvar general-font-lock-green1 font-lock-type-face)
(defvar general-font-lock-green2 font-lock-constant-face)
(defvar general-font-lock-blue1 font-lock-keyword-face)
(defvar general-font-lock-blue2 font-lock-function-name-face)
(defvar general-font-lock-blue3 font-lock-builtin-face)
(defvar general-font-lock-yellow1 font-lock-variable-name-face)
(defvar general-font-lock-yellow2 font-lock-comment-face)
;; == sisu-mode settings
(defvar sisu-mode-hook nil
"Normal hook run when entering Sisu Text mode.")
(defvar sisu-mode-abbrev-table nil
"Abbrev table in use in Sisu-mode buffers.")
(define-abbrev-table 'sisu-mode-abbrev-table ())
(defconst sisu-font-lock-keywords
(eval-when-compile
(list
;;grouped text ---------
;(cons "^```[ ]code\\(.\\|\n\\)+?\n```\n" 'general-font-lock-red2)
(cons "^```[ ]+code.*?$\\|^```$" 'general-font-lock-red2)
(cons "^```[ ]+table.*?$\\|^```$" 'general-font-lock-red2)
(cons "^```[ ]+group$\\|^```$" 'general-font-lock-red2)
(cons "^```[ ]+block$\\|^```$" 'general-font-lock-red2)
(cons "^```[ ]+poem$\\|^```$" 'general-font-lock-red2)
(cons "^```[ ]+alt$\\|^```$" 'general-font-lock-red2)
;;grouped text ---------
(cons "^group\{\\|^\}group" 'general-font-lock-red2)
(cons "^block\{\\|^\}block" 'general-font-lock-red2)
(cons "^code\{\\|^\}code" 'general-font-lock-red2)
(cons "^poem\{\\|^\}poem" 'general-font-lock-red2)
(cons "^alt\{\\|^\}alt" 'general-font-lock-red2)
(cons "^table\{.+\\|^\}table" 'general-font-lock-red2)
(cons "^\{table[^}]+\}" 'general-font-lock-red2)
(list
(concat
"^\`\\{3\\}[ ]+code.*?$"
"\\(.\\|\n\\)+?"
"\`\\{3\\}$"
)
'(1 general-font-lock-red2 t)
'(2 nil t)
'(3 general-font-lock-red2 t)
)
(list
(concat
"^\`\\{3\\}[ ]+table.*?$"
"\\(.\\|\n\\)+?"
"\`\\{3\\}$"
)
'(1 general-font-lock-red2 t)
'(2 nil t)
'(3 general-font-lock-red2 t)
)
(list
(concat
"^\`\\{3\\}[ ]+\\(group\\|block\\|alt\\|poem\\)$"
"\\(.\\|\n\\)+?"
"^\`\\{3\\}$"
)
'(1 general-font-lock-red2 t)
'(2 nil t)
'(3 general-font-lock-red2 t)
)
;; footnote/endnote ----
;(cons "\~\{.+?\}\~" 'general-font-lock-green1)
(cons "\~\{\\*\\*\\|\~\{\\*\\|\~\{\\|\}\~" 'general-font-lock-red2)
(cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~" 'general-font-lock-red2)
(cons "\~\\^ \\|^\\^\~ " 'general-font-lock-red2)
(list
(concat
"\\(\*\~\\)"
"\\([^ \r\t\n]+\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-blue2 t)
)
;; emphasis (can be program configured to be bold italics or underscore)
(list
(concat
"\\([*]\{\\)"
"\\([^\}]+\\)"
"\\(\}[*]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; bold ----------------
(list
(concat
"\\([!]\{\\)"
"\\([^\}]+\\)"
"\\(\}[!]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
(cons "\\*[^ ]+\\*" 'general-font-lock-red1)
(cons "^!_ .+" 'general-font-lock-red1)
;; italics -------------
(list
(concat
"\\([/]\{\\)"
"\\([^\}]+\\)"
"\\(\}[/]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-blue1 t)
'(3 general-font-lock-red1 t)
)
;; underscore ----------
(list
(concat
"\\([_]\{\\)"
"\\([^\}]+\\)"
"\\(\}[_]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; monospace -----------
(list
(concat
"\\([#]\{\\)"
"\\([^\}]+\\)"
"\\(\}[#]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; citation ------------
(list
(concat
"\\([\"]\{\\)"
"\\([^\}]+\\)"
"\\(\}[\"]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; inserted text -------
(list
(concat
"\\([\+]\{\\)"
"\\([^\}]+\\)"
"\\(\}[\+]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; strike through ------
(list
(concat
"\\(\\-\{\\)"
"\\([^\}]+\\)"
"\\(\}\\-\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; superscript ---------
(list
(concat
"\\(\\^\{\\)"
"\\([^\}]+\\)"
"\\(\}\\^\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; subscript -----------
(list
(concat
"\\([,]\{\\)"
"\\([^\}]+\\)"
"\\(\}[,]\\)"
)
'(1 general-font-lock-red1 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-red1 t)
)
;; numbered list
(cons "^# \\|^_# " 'general-font-lock-red1)
;; bullet text
(cons "^_\\*[1-9] \\|^_\\* " 'general-font-lock-red1)
;; indented text
(cons "^_[1-9] " 'general-font-lock-red1)
(cons "^_[1-9]! " 'general-font-lock-red1)
;; hanging indented text [proposed enable when implemented]
(cons "^__[1-9] " 'general-font-lock-red1)
(cons "^_[0-9]_[0-9] " 'general-font-lock-red1)
(cons "^__[1-9]! " 'general-font-lock-red1)
(cons "^_[0-9]_[0-9]! " 'general-font-lock-red1)
;; url
(cons "\\(^\\|[ ]\\)http:[/][/][^ \t\n\r<]+" 'general-font-lock-blue2)
;; Comment Lines
(cons "^% .*" 'general-font-lock-blue1)
;; page break
(cons "^\\(-\\\\\\\\-\\|=\\\\\\\\=\\|-\\.\\.-\\)" 'general-font-lock-red2)
;; line break
(cons " \\\\\\\\ " 'general-font-lock-red1)
;; line break (depreciated)
(cons "<br>" 'general-font-lock-red1)
;; Section titles
(list "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\)\\(.*\\)"
'(1 sisu-title-1 t)
'(3 sisu-title-2 t)
)
;; hyper-links
(list
(concat
"\\(\{~^\\|\{\\)"
"\\([^\}\{]+\\)"
"\\(\}http:[/][/][^ \r\n\t<]+\\)"
)
'(1 general-font-lock-blue2 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-blue2 t)
)
;; book index
(list
(concat
"^\\(\=\{\\)"
"\\([^\}\{]+\\)"
"\\(}\\)$"
)
'(1 general-font-lock-green1 t)
'(2 nil t)
'(3 general-font-lock-green1 t)
)
;(cons "^\=\{.+\}" 'general-font-lock-green1)
;; numbers
(cons "\\<[.0-9]+\\>" 'general-font-lock-green2)
;; bullets sisu_normal (nearly copied regexp)
(cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'general-font-lock-blue2)
;; image links
(list
(concat
"\\(\{\\)"
"\\([^\}\{]+\\)"
"\\(\}image\\)"
)
'(1 general-font-lock-blue2 t)
'(2 general-font-lock-red1 t)
'(3 general-font-lock-blue2 t)
)
;; insert file links
(list
(concat
"\\(<< \\)"
"\\([^ \r\t\n]+\\.ss\\)"
"\\(i\\|t\\)"
)
'(1 general-font-lock-blue2 t)
'(2 general-font-lock-blue2 t)
'(3 general-font-lock-blue2 t)
)
;; raw keywords
(list
(concat
"^\\(\\@\\("
"creator\\|"
"title\\|"
"date\\|"
"rights\\|"
"publisher\\|"
"classify\\|"
"identifier\\|"
"original\\|"
"notes\\|"
"links\\|"
"make\\|"
"\\):\\)\\(.*\\)"
)
'(1 sisu-title-2 keep)
'(3 sisu-title-3 keep)
)
)
)
"Default expressions to highlight in AsciiSisu mode."
)
;; enables outlining for sisu
(add-hook 'sisu-mode-hook
'(lambda ()
(outline-minor-mode)))
;;; outline mode "folding" if available
;;; TODO make sure linum (line numbering) is off, else performance penalty, sucks bigtime
;(define-key evil-normal-state-map (kbd ",0") (lambda() (interactive) (show-all)))
;(define-key evil-normal-state-map (kbd ",-") (lambda() (interactive) (hide-body)))
;(define-key evil-normal-state-map (kbd ",+") (lambda() (interactive) (show-subtree)))
;(define-key evil-normal-state-map (kbd ",=") (lambda() (interactive) (show-subtree)))
;
;;(define-key evil-normal-state-map ",0" 'show-all)
;;(define-key evil-normal-state-map ",-" 'hide-body)
;;(define-key evil-normal-state-map ",+" 'show-subtree)
;;(define-key evil-normal-state-map ",=" 'show-subtree)
;; C-c @ C-a show all
;; C-c @ C-t show only the headings
;; C-c @ C-s show subtree at cursor location
;; C-c @ C-d hide subtree at cursor location
;; Sisu & Autoload:
(define-derived-mode sisu-mode text-mode "SiSU"
"Major mode for editing SiSU files."
(interactive)
(modify-syntax-entry ?\' ".")
;(flyspell-mode nil)
(make-local-variable 'paragraph-start)
(setq paragraph-start (concat "$\\|>" page-delimiter))
(make-local-variable 'paragraph-separate)
(setq paragraph-separate paragraph-start)
(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)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults
'(sisu-font-lock-keywords
nil ; KEYWORDS-ONLY: no
nil ; CASE-FOLD: no
((?_ . "w")) ; SYNTAX-ALIST
))
(run-hooks 'sisu-mode-hook))
;; ##autoload
(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))
;;;; ChangeLog:
;; 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
;;
;; Fix version numbers of sisu-mode, register-list, and windresize.
;;
;; 2011-07-08 Chong Yidong <cyd@stupidchicken.com>
;;
;; sisu-mode.el: Add .sisu to auto-mode-alist using autoload cookie.
;; Minor doc fixes.
;;
;; 2011-07-06 Stefan Monnier <monnier@iro.umontreal.ca>
;;
;; * sisu-mode.el (sisu-mode): Autoload.
;;
;; 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
;;
;; Add sisu-mode.el. Update all.el licence.
;;
(provide 'sisu-mode)
[-- Attachment #3: sisu-mode-autoloads.el --]
[-- Type: text/plain, Size: 414 bytes --]
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
(autoload 'sisu-mode "sisu-mode" "\
Major mode for editing SiSU markup files.
SiSU (http://www.sisudoc.org/) document structuring, publishing
and search.
\(fn)" t nil)
(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))
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-18 22:19 Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text Ralph Amissah
@ 2016-02-19 3:59 ` Stefan Monnier
2016-02-19 6:18 ` Ralph Amissah
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2016-02-19 3:59 UTC (permalink / raw)
To: Ralph Amissah; +Cc: Kevin Ryde, Ambrose Kofi Laing, emacs-devel
> I do not know whether you are still the correct person to address this
> email to, but it is easiest to continue the trail where we last left
> off.
Yes, this address still works.
> I hope this note finds you in good health.
Fine, thank you very much.
> Please find attached sisu-mode.el and sisu-mode-autoloads.el updated to
> for current sisu markup, and with corrections with regard to autoload
> (re: the relevant filenames).
Please send us a patch against the current code in
git://git.savannah.gnu.org/emacs/elpa.git.
Note that sisu-mode-autoloads.el is not there, because it's auto-generated.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-19 3:59 ` Stefan Monnier
@ 2016-02-19 6:18 ` Ralph Amissah
2016-02-19 18:42 ` Stefan Monnier
2016-02-20 2:05 ` Kevin Ryde
0 siblings, 2 replies; 9+ messages in thread
From: Ralph Amissah @ 2016-02-19 6:18 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Kevin Ryde, Ambrose Kofi Laing, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]
On Thu, Feb 18, 2016 at 10:59:53PM -0500, Stefan Monnier wrote:
> > I do not know whether you are still the correct person to address this
> > email to, but it is easiest to continue the trail where we last left
> > off.
>
> Yes, this address still works.
>
> > I hope this note finds you in good health.
>
> Fine, thank you very much.
>
Am glad for all of the above :)
> > Please find attached sisu-mode.el and sisu-mode-autoloads.el updated to
> > for current sisu markup, and with corrections with regard to autoload
> > (re: the relevant filenames).
>
> Please send us a patch against the current code in
> git://git.savannah.gnu.org/emacs/elpa.git.
Please find attached sisu-mode.diff for sisu-mode.el
> Note that sisu-mode-autoloads.el is not there, because it's auto-generated.
I apologise for my ignorance, how does the auto-generation of
sisu-mode-autoloads.el work, as I have done nothing to take this into account.
sisu markup is applied to files with the suffix .sst (regular sisu files) .ssm
(a master file that is made up of inserts (if used)) .ssi (insert files if used
that are not to be processed regularly). (recognised say in vim since 2006, in
emacs the result of the auto-generation appears to autoload against files with a
.sisu suffix). So I attach sisu-mode-autoloads.el again, for how I hope it to
look. (If sisu-mode-autoloads.el is controlled in some way in sisu-mode.el I
will need to send it again).
>
> Stefan
Thanks,
Ralph
http://www.sisudoc.org/
http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary
[-- Attachment #2: sisu-mode.diff --]
[-- Type: text/x-diff, Size: 18339 bytes --]
--- sisu-mode.el 2016-02-19 00:37:21.798481323 -0500
+++ sisu-mode-7.1.7.el 2016-02-19 00:41:27.824326557 -0500
@@ -1,10 +1,19 @@
-;;; sisu-mode.el --- Major mode for SiSU markup text
+;;; sisu-mode.el --- a major-mode for highlighting a hierarchy structured text.
-;; Copyright (C) 2011 Free Software Foundation, Inc.
+;; Copyright (C): Free Software Foundation, Inc. (FSF) (GNU EMACS)
+;; Assigned to FSF 2011-04-08
+;;
+;; [this file has been edited and updated by Ralph Amissah]
-;; Author: Ambrose Kofi Laing (& Ralph Amissah)
-;; Keywords: text, processes, tools
-;; Version: 3.0.3
+;; Author: Ralph Amissah & Ambrose Kofi Laing
+;; Keywords: text, syntax, processes, tools
+;; Version: 7.1.7 2015-12-26 Ralph Amissah,
+;; including patch from Kevin Ryde;
+;; 5.7.2 2014-10-28 Ralph Amissah;
+;; 4.0.8 2013-02-17 Ralph Amissah;
+;; 3.0.7 2011-04-20 Ambrose Kofi Laing & Ralph Amissah;
+;; 2008-12-14
+;; URL: [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/emacs/sisu-mode.el;hb=HEAD]
;; License: GPLv3
;; Home URL: SiSU: http://www.jus.uio.no/sisu
;; originally looked at (based on) doc-mode, with kind permission of the author
@@ -23,7 +32,7 @@
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+;; along with this program. If not, see [http://www.gnu.org/licenses/].
;; Viva Software Libre!
;; Support the free software movement!
@@ -43,10 +52,6 @@
;; The documentation for the "Structure Of The Hierarchy Text" can be
;; found in the sisustring for the sisu-mode function.
-;;; Code:
-
-;;{{{ Variables:
-
(defgroup sisu-faces nil
"AsciiSisu highlighting"
:group 'sisus)
@@ -136,210 +141,334 @@
(defconst sisu-font-lock-keywords
(eval-when-compile
(list
+ ;;grouped text ---------
+ ;(cons "^```[ ]code\\(.\\|\n\\)+?\n```\n" 'general-font-lock-red2)
+ (cons "^```[ ]+code.*?$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+table.*?$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+group$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+block$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+poem$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+alt$\\|^```$" 'general-font-lock-red2)
+ ;;grouped text ---------
+ (cons "^group\{\\|^\}group" 'general-font-lock-red2)
+ (cons "^block\{\\|^\}block" 'general-font-lock-red2)
+ (cons "^code\{\\|^\}code" 'general-font-lock-red2)
+ (cons "^poem\{\\|^\}poem" 'general-font-lock-red2)
+ (cons "^alt\{\\|^\}alt" 'general-font-lock-red2)
+ (cons "^table\{.+\\|^\}table" 'general-font-lock-red2)
+ (cons "^\{table[^}]+\}" 'general-font-lock-red2)
+
+ (list
+ (concat
+ "^\`\\{3\\}[ ]+code.*?$"
+ "\\(.\\|\n\\)+?"
+ "\`\\{3\\}$"
+ )
+ '(1 general-font-lock-red2 t)
+ '(2 nil t)
+ '(3 general-font-lock-red2 t)
+ )
+ (list
+ (concat
+ "^\`\\{3\\}[ ]+table.*?$"
+ "\\(.\\|\n\\)+?"
+ "\`\\{3\\}$"
+ )
+ '(1 general-font-lock-red2 t)
+ '(2 nil t)
+ '(3 general-font-lock-red2 t)
+ )
+ (list
+ (concat
+ "^\`\\{3\\}[ ]+\\(group\\|block\\|alt\\|poem\\)$"
+ "\\(.\\|\n\\)+?"
+ "^\`\\{3\\}$"
+ )
+ '(1 general-font-lock-red2 t)
+ '(2 nil t)
+ '(3 general-font-lock-red2 t)
+ )
+
+ ;; footnote/endnote ----
+ ;(cons "\~\{.+?\}\~" 'general-font-lock-green1)
+ (cons "\~\{\\*\\*\\|\~\{\\*\\|\~\{\\|\}\~" 'general-font-lock-red2)
+ (cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~" 'general-font-lock-red2)
+ (cons "\~\\^ \\|^\\^\~ " 'general-font-lock-red2)
+ (list
+ (concat
+ "\\(\*\~\\)"
+ "\\([^ \r\t\n]+\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-blue2 t)
+ )
+
+ ;; emphasis (can be program configured to be bold italics or underscore)
+ (list
+ (concat
+ "\\([*]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[*]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; bold ----------------
+ (list
+ (concat
+ "\\([!]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[!]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+ (cons "\\*[^ ]+\\*" 'general-font-lock-red1)
+ (cons "^!_ .+" 'general-font-lock-red1)
+
+ ;; italics -------------
+ (list
+ (concat
+ "\\([/]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[/]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-blue1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; underscore ----------
+ (list
+ (concat
+ "\\([_]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[_]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; monospace -----------
+ (list
+ (concat
+ "\\([#]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[#]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; citation ------------
+ (list
+ (concat
+ "\\([\"]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[\"]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; inserted text -------
+ (list
+ (concat
+ "\\([\+]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[\+]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; strike through ------
+ (list
+ (concat
+ "\\(\\-\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}\\-\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; superscript ---------
+ (list
+ (concat
+ "\\(\\^\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}\\^\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; subscript -----------
+ (list
+ (concat
+ "\\([,]\{\\)"
+ "\\([^\}]+\\)"
+ "\\(\}[,]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; numbered list
+ (cons "^# \\|^_# " 'general-font-lock-red1)
+
+ ;; bullet text
+ (cons "^_\\*[1-9] \\|^_\\* " 'general-font-lock-red1)
+
+ ;; indented text
+ (cons "^_[1-9] " 'general-font-lock-red1)
+ (cons "^_[1-9]! " 'general-font-lock-red1)
+
+ ;; hanging indented text [proposed enable when implemented]
+ (cons "^__[1-9] " 'general-font-lock-red1)
+ (cons "^_[0-9]_[0-9] " 'general-font-lock-red1)
+ (cons "^__[1-9]! " 'general-font-lock-red1)
+ (cons "^_[0-9]_[0-9]! " 'general-font-lock-red1)
+
+ ;; url
+ (cons "\\(^\\|[ ]\\)http:[/][/][^ \t\n\r<]+" 'general-font-lock-blue2)
+
+ ;; Comment Lines
+ (cons "^% .*" 'general-font-lock-blue1)
+
+ ;; page break
+ (cons "^\\(-\\\\\\\\-\\|=\\\\\\\\=\\|-\\.\\.-\\)" 'general-font-lock-red2)
+
+ ;; line break
+ (cons " \\\\\\\\ " 'general-font-lock-red1)
+
+ ;; line break (depreciated)
+ (cons "<br>" 'general-font-lock-red1)
+
+ ;; Section titles
+ (list "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\)\\(.*\\)"
+ '(1 sisu-title-1 t)
+ '(3 sisu-title-2 t)
+ )
+
+ ;; hyper-links
+ (list
+ (concat
+ "\\(\{~^\\|\{\\)"
+ "\\([^\}\{]+\\)"
+ "\\(\}http:[/][/][^ \r\n\t<]+\\)"
+ )
+ '(1 general-font-lock-blue2 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-blue2 t)
+ )
+
+ ;; book index
+ (list
+ (concat
+ "^\\(\=\{\\)"
+ "\\([^\}\{]+\\)"
+ "\\(}\\)$"
+ )
+ '(1 general-font-lock-green1 t)
+ '(2 nil t)
+ '(3 general-font-lock-green1 t)
+ )
+
+ ;(cons "^\=\{.+\}" 'general-font-lock-green1)
+
+ ;; numbers
+ (cons "\\<[.0-9]+\\>" 'general-font-lock-green2)
+
+ ;; bullets sisu_normal (nearly copied regexp)
+ (cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'general-font-lock-blue2)
+
+ ;; image links
+ (list
+ (concat
+ "\\(\{\\)"
+ "\\([^\}\{]+\\)"
+ "\\(\}image\\)"
+ )
+ '(1 general-font-lock-blue2 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-blue2 t)
+ )
+
+ ;; insert file links
+ (list
+ (concat
+ "\\(<< \\)"
+ "\\([^ \r\t\n]+\\.ss\\)"
+ "\\(i\\|t\\)"
+ )
+ '(1 general-font-lock-blue2 t)
+ '(2 general-font-lock-blue2 t)
+ '(3 general-font-lock-blue2 t)
+ )
+
+ ;; raw keywords
+ (list
+ (concat
+ "^\\(\\@\\("
+ "creator\\|"
+ "title\\|"
+ "date\\|"
+ "rights\\|"
+ "publisher\\|"
+ "classify\\|"
+ "identifier\\|"
+ "original\\|"
+ "notes\\|"
+ "links\\|"
+ "make\\|"
+ "\\):\\)\\(.*\\)"
+ )
+ '(1 sisu-title-2 keep)
+ '(3 sisu-title-3 keep)
+ )
+ )
+ )
+ "Default expressions to highlight in AsciiSisu mode."
+)
+
+;; enables outlining for sisu
+(add-hook 'sisu-mode-hook
+ '(lambda ()
+ (outline-minor-mode)))
+
+;;; outline mode "folding" if available
+;;; TODO make sure linum (line numbering) is off, else performance penalty, sucks bigtime
+;(define-key evil-normal-state-map (kbd ",0") (lambda() (interactive) (show-all)))
+;(define-key evil-normal-state-map (kbd ",-") (lambda() (interactive) (hide-body)))
+;(define-key evil-normal-state-map (kbd ",+") (lambda() (interactive) (show-subtree)))
+;(define-key evil-normal-state-map (kbd ",=") (lambda() (interactive) (show-subtree)))
+;
+;;(define-key evil-normal-state-map ",0" 'show-all)
+;;(define-key evil-normal-state-map ",-" 'hide-body)
+;;(define-key evil-normal-state-map ",+" 'show-subtree)
+;;(define-key evil-normal-state-map ",=" 'show-subtree)
+
+;; C-c @ C-a show all
+;; C-c @ C-t show only the headings
+;; C-c @ C-s show subtree at cursor location
+;; C-c @ C-d hide subtree at cursor location
- ;;grouped text
- (cons "^group\{\\|^\}group" 'general-font-lock-red2)
- (cons "^block\{\\|^\}block" 'general-font-lock-red2)
- (cons "^code\{\\|^\}code" 'general-font-lock-red2)
- (cons "^poem\{\\|^\}poem" 'general-font-lock-red2)
- (cons "^alt\{\\|^\}alt" 'general-font-lock-red2)
- (cons "^table\{.+\\|^\}table" 'general-font-lock-red2)
- (cons "^\{table[^}]+\}" 'general-font-lock-red2)
-
- ;; footnote/endnote
- ;(cons "\~\{.+?\}\~" 'general-font-lock-green1)
- (cons "\~\{\\*\\*\\|\~\{\\*\\|\~\{\\|\}\~" 'general-font-lock-red2)
- (cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~" 'general-font-lock-red2)
-
- (cons "\~\\^ \\|^\\^\~ " 'general-font-lock-red2)
-
- (list (concat
- "\\(\*\~\\)"
- "\\([^ \r\t\n]+\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-blue2 t))
-
- ;; emphasis (can be program configured to be bold italics or underscore)
- (list (concat
- "\\([*]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[*]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; bold
- (list (concat
- "\\([!]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[!]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
- (cons "\\*[^ ]+\\*" 'general-font-lock-red1)
- (cons "^!_ .+" 'general-font-lock-red1)
-
- ;;; italics
- (list (concat
- "\\([/]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[/]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-blue1 t)
- '(3 general-font-lock-red1 t))
-
- ;; underscore
- (list (concat
- "\\([_]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[_]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; monospace
- (list (concat
- "\\([#]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[#]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; citation
- (list (concat
- "\\([\"]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[\"]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; inserted text
- (list (concat
- "\\([\+]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[\+]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; strike through
- (list (concat
- "\\(\\-\{\\)"
- "\\([^\}]+\\)"
- "\\(\}\\-\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; superscript
- (list (concat
- "\\(\\^\{\\)"
- "\\([^\}]+\\)"
- "\\(\}\\^\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; subscript
- (list (concat
- "\\([,]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[,]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;;numbered list
- (cons "^# \\|^_# " 'general-font-lock-red1)
-
- ;;bullet text
- (cons "^_\\*[1-9] \\|^_\\* " 'general-font-lock-red1)
-
- ;;indented text
- (cons "^_[1-9] " 'general-font-lock-red1)
-
- ;;url
- (cons "\\(^\\|[ ]\\)http:[/][/][^ \t\n\r<]+" 'general-font-lock-blue2)
-
-;; \\|\$
-
- ;; Comment Lines
- (cons "^% .*" 'general-font-lock-blue1)
- ;; line break
- (cons "<br>" 'general-font-lock-red1)
-
- ;; Section titles
- (list "^\\(\\([1-8]\\|:?[A-C]\\)\\~\\)\\(.*\\)"
- '(1 sisu-title-1 t)
- '(3 sisu-title-2 t))
-
- ;; hyper-links
- (list (concat
- "\\(\{~^\\|\{\\)"
- "\\([^\}\{]+\\)"
- "\\(\}http:[/][/][^ \r\n\t<]+\\)")
- '(1 general-font-lock-blue2 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-blue2 t))
-
- ;; book index
- (cons "^\=\{.+\}" 'general-font-lock-green1)
-
- ;; numbers
- (cons "\\<[.0-9]+\\>" 'general-font-lock-green2)
-
- ;; bullets sisu_normal (nearly copied regexp)
- (cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'general-font-lock-blue2)
-
- ;; image links
- (list (concat
- "\\(\{\\)"
- "\\([^\}\{]+\\)"
- "\\(\}image\\)")
- '(1 general-font-lock-blue2 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-blue2 t))
-
- ;; insert file links
- (list (concat
- "\\(<< \\)"
- "\\([^ \r\t\n]+\\.ss\\)"
- "\\(i\\|t\\)")
- '(1 general-font-lock-blue2 t)
- '(2 general-font-lock-blue2 t)
- '(3 general-font-lock-blue2 t))
-
- ;; raw keywords
- (list (concat
- "^\\(\\@\\("
- "title\\|"
- "creator\\|"
- "date\\|"
- "publisher\\|"
- "rights\\|"
- "classify\\|"
- "original\\|"
- "notes\\|"
- "links\\|"
- "make\\|"
- "\\):\\)\\(.*\\)")
- '(1 sisu-title-2 keep)
- '(3 sisu-title-3 keep))
-
- ))
- "Default expressions to highlight in AsciiSisu mode.")
-
-;;}}}
-
-;;{{{ Sisu & Autoload:
-
-;;;###autoload
+;; Sisu & Autoload:
(define-derived-mode sisu-mode text-mode "SiSU"
- "Major mode for editing SiSU files.
-SiSU (http://www.sisudoc.org/) is a document structuring and
-publishing framework. This major mode handles SiSU markup."
+ "Major mode for editing SiSU files."
+ (interactive)
(modify-syntax-entry ?\' ".")
;(flyspell-mode nil)
@@ -350,6 +479,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)
@@ -362,10 +494,29 @@
))
(run-hooks 'sisu-mode-hook))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.sisu\\'" . sisu-mode))
+;; ##autoload
+(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))
-(provide 'sisu-mode)
+;;;; ChangeLog:
-;;}}}
+;; 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
+;;
+;; Fix version numbers of sisu-mode, register-list, and windresize.
+;;
+;; 2011-07-08 Chong Yidong <cyd@stupidchicken.com>
+;;
+;; sisu-mode.el: Add .sisu to auto-mode-alist using autoload cookie.
+;; Minor doc fixes.
+;;
+;; 2011-07-06 Stefan Monnier <monnier@iro.umontreal.ca>
+;;
+;; * sisu-mode.el (sisu-mode): Autoload.
+;;
+;; 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
+;;
+;; Add sisu-mode.el. Update all.el licence.
+;;
-;;; sisu-mode.el ends here
+(provide 'sisu-mode)
[-- Attachment #3: sisu-mode-autoloads.el --]
[-- Type: text/plain, Size: 414 bytes --]
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
(autoload 'sisu-mode "sisu-mode" "\
Major mode for editing SiSU markup files.
SiSU (http://www.sisudoc.org/) document structuring, publishing
and search.
\(fn)" t nil)
(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))
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-19 6:18 ` Ralph Amissah
@ 2016-02-19 18:42 ` Stefan Monnier
2016-02-20 0:30 ` Ralph Amissah
2016-02-21 7:04 ` Ralph Amissah
2016-02-20 2:05 ` Kevin Ryde
1 sibling, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2016-02-19 18:42 UTC (permalink / raw)
To: Ralph Amissah; +Cc: Kevin Ryde, Ambrose Kofi Laing, emacs-devel
> Please find attached sisu-mode.diff for sisu-mode.el
Thanks. I was about to apply it, but I think it's not quite right.
it's a bit hard to see what the patch does because it includes a lot of
whitespace changes, but even after accounting for those, there are some
changes which I don't think really want to install. See below.
Stefan
> -;;; sisu-mode.el --- Major mode for SiSU markup text
> +;;; sisu-mode.el --- a major-mode for highlighting a hierarchy structured text.
Why did you remove SiSU from the description?
[ Not opposed to it, but rather curious. ]
> -;; Copyright (C) 2011 Free Software Foundation, Inc.
> +;; Copyright (C): Free Software Foundation, Inc. (FSF) (GNU EMACS)
We want to keep all the years of publication in this line.
> -;; Author: Ambrose Kofi Laing (& Ralph Amissah)
> -;; Keywords: text, processes, tools
> -;; Version: 3.0.3
> +;; Author: Ralph Amissah & Ambrose Kofi Laing
> +;; Keywords: text, syntax, processes, tools
> +;; Version: 7.1.7 2015-12-26 Ralph Amissah,
The Version: pseudo-header should be of the form AA.BB.CC.DD... only.
> +;; URL: [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/emacs/sisu-mode.el;hb=HEAD]
Better than a link to the file would be a link to some "sisu-mode
project" web-page with further information than what's in this file.
> ;; License: GPLv3
This is redundant.
> + (cons "^group\{\\|^\}group" 'general-font-lock-red2)
^ ^
These two backslashes do not do anything.
> +;; enables outlining for sisu
> +(add-hook 'sisu-mode-hook
> + '(lambda ()
> + (outline-minor-mode)))
Please don't quote your lambdas.
Also (lambda () (outline-minor-mode)) is just a round-about way to say
#'outline-minor-mode.
Finally, it's generally preferred to put such code directly in the
sisu-mode function and leave the sisu-mode-hook nil by default.
> +;(define-key evil-normal-state-map (kbd ",0") (lambda() (interactive) (show-all)))
Single-semicolon comments are traditionally indented to comment-column
(e.g. column 40 or so), so you should probably use ";;" instead here.
> -;;;###autoload
> +;; Sisu & Autoload:
> (define-derived-mode sisu-mode text-mode "SiSU"
This ";;;###autoload" comment is the magic cookie used to auto-generate
sisu-mode-autoloads.el, so you don't want to remove it.
> - "Major mode for editing SiSU files.
> -SiSU (http://www.sisudoc.org/) is a document structuring and
> -publishing framework. This major mode handles SiSU markup."
> + "Major mode for editing SiSU files."
> + (interactive)
`define-derived-mode` already declares the function as interactive.
> (run-hooks 'sisu-mode-hook))
And `define-derived-mode` also automatically runs sisu-mode-hook for
you, so you don't need this either.
> -;;;###autoload (add-to-list 'auto-mode-alist '("\\.sisu\\'" . sisu-mode))
> +;; ##autoload
> +(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))
I think you want to use something like
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.ss[itm]\\'" . sisu-mode))
or
;;;###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))
> +;; 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
> +;;
> +;; Fix version numbers of sisu-mode, register-list, and windresize.
> +;;
> +;; 2011-07-08 Chong Yidong <cyd@stupidchicken.com>
> +;;
> +;; sisu-mode.el: Add .sisu to auto-mode-alist using autoload cookie.
> +;; Minor doc fixes.
> +;;
> +;; 2011-07-06 Stefan Monnier <monnier@iro.umontreal.ca>
> +;;
> +;; * sisu-mode.el (sisu-mode): Autoload.
> +;;
> +;; 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
> +;;
> +;; Add sisu-mode.el. Update all.el licence.
This gets auto-added (from the Git log) when generating the ELPA
package, so we don't need it.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-19 18:42 ` Stefan Monnier
@ 2016-02-20 0:30 ` Ralph Amissah
2016-02-21 7:04 ` Ralph Amissah
1 sibling, 0 replies; 9+ messages in thread
From: Ralph Amissah @ 2016-02-20 0:30 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Kevin Ryde, Ambrose Kofi Laing, emacs-devel
On Fri, Feb 19, 2016 at 01:42:19PM -0500, Stefan Monnier wrote:
> > Please find attached sisu-mode.diff for sisu-mode.el
>
> Thanks. I was about to apply it, but I think it's not quite right.
> it's a bit hard to see what the patch does because it includes a lot of
> whitespace changes, but even after accounting for those, there are some
> changes which I don't think really want to install. See below.
>
>
> Stefan
Stephan, you ended up doing a lot of work, thank you for your comprehensive
response (and patience). I will look into it and send an updated patch; I see at
a glance that you you are right about many things (much for which I can't even
try hide behind the excuse of not being a lisper).
Thanks,
Ralph
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-19 18:42 ` Stefan Monnier
2016-02-20 0:30 ` Ralph Amissah
@ 2016-02-21 7:04 ` Ralph Amissah
2016-02-21 15:51 ` Stefan Monnier
1 sibling, 1 reply; 9+ messages in thread
From: Ralph Amissah @ 2016-02-21 7:04 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Kevin Ryde, Ambrose Kofi Laing, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 6489 bytes --]
Stefan, thank you for your work. Find attached a new diff against the
original Gnu sisu-mode.el
I hope I have understood what needed to be done. Sorry if there are
further things to address. I am glad to try; also please feel free to make
changes you think necessary before applying it. In the unlikely event that
I have reason to think otherwise, I can send you a subsequent request.
On Fri, Feb 19, 2016 at 01:42:19PM -0500, Stefan Monnier wrote:
> > Please find attached sisu-mode.diff for sisu-mode.el
>
> Thanks. I was about to apply it, but I think it's not quite right.
> it's a bit hard to see what the patch does because it includes a lot of
> whitespace changes, but even after accounting for those, there are some
> changes which I don't think really want to install. See below.
>
> Stefan
>
> > -;;; sisu-mode.el --- Major mode for SiSU markup text
> > +;;; sisu-mode.el --- a major-mode for highlighting a hierarchy structured text.
>
> Why did you remove SiSU from the description?
> [ Not opposed to it, but rather curious. ]
>
+;;; sisu-mode.el --- Major mode for SiSU markup text
thanks, corrected (not sure when or why it happened and have not gone back to
try find out, reverted)
> > -;; Copyright (C) 2011 Free Software Foundation, Inc.
> > +;; Copyright (C): Free Software Foundation, Inc. (FSF) (GNU EMACS)
>
> We want to keep all the years of publication in this line.
>
+;; Copyright (C) 2011, 2016 Free Software Foundation, Inc.
> > -;; Author: Ambrose Kofi Laing (& Ralph Amissah)
> > -;; Keywords: text, processes, tools
> > -;; Version: 3.0.3
> > +;; Author: Ralph Amissah & Ambrose Kofi Laing
> > +;; Keywords: text, syntax, processes, tools
> > +;; Version: 7.1.7 2015-12-26 Ralph Amissah,
>
> The Version: pseudo-header should be of the form AA.BB.CC.DD... only.
>
+;; Author: Ralph Amissah & Ambrose Kofi Laing
+;; Keywords: text, syntax, processes, tools
+;; Version: 7.1.8
> > +;; URL: [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/emacs/sisu-mode.el;hb=HEAD]
>
> Better than a link to the file would be a link to some "sisu-mode
> project" web-page with further information than what's in this file.
>
+;; URL: 'http://www.sisudoc.org'
or should it follow the original format:
;; Home URL: SiSU: http://www.sisudoc.org
> > ;; License: GPLv3
>
> This is redundant.
>
removed
added
+;; with contributions from Kevin Ryde and Stefan Monnier
> > + (cons "^group\{\\|^\}group" 'general-font-lock-red2)
> ^ ^
> These two backslashes do not do anything.
>
several such escapes removed
> > +;; enables outlining for sisu
> > +(add-hook 'sisu-mode-hook
> > + '(lambda ()
> > + (outline-minor-mode)))
>
> Please don't quote your lambdas.
> Also (lambda () (outline-minor-mode)) is just a round-about way to say
> #'outline-minor-mode.
got as far as this
+;; enables outlining for sisu
+(add-hook 'sisu-mode-hook
+ 'outline-minor-mode)
+
> Finally, it's generally preferred to put such code directly in the
> sisu-mode function and leave the sisu-mode-hook nil by default.
>
I did not get this quite
> > +;(define-key evil-normal-state-map (kbd ",0") (lambda() (interactive) (show-all)))
>
> Single-semicolon comments are traditionally indented to comment-column
> (e.g. column 40 or so), so you should probably use ";;" instead here.
>
used ;;
> > -;;;###autoload
> > +;; Sisu & Autoload:
> > (define-derived-mode sisu-mode text-mode "SiSU"
>
> This ";;;###autoload" comment is the magic cookie used to auto-generate
> sisu-mode-autoloads.el, so you don't want to remove it.
>
reinstated
> > - "Major mode for editing SiSU files.
> > -SiSU (http://www.sisudoc.org/) is a document structuring and
> > -publishing framework. This major mode handles SiSU markup."
> > + "Major mode for editing SiSU files."
> > + (interactive)
>
> `define-derived-mode` already declares the function as interactive.
>
removed (interactive)
also modified the description to match what is in use elsewhere
"Major mode for editing SiSU files.
+SiSU document structuring, publishing in multiple formats and search.
+URL `http://www.sisudoc.org/'
this description may be a bit terse, and I have no problem with some
modification, or with the removed repetition of "This major mode handles
SiSU markup"
> > (run-hooks 'sisu-mode-hook))
>
> And `define-derived-mode` also automatically runs sisu-mode-hook for
> you, so you don't need this either.
>
> > -;;;###autoload (add-to-list 'auto-mode-alist '("\\.sisu\\'" . sisu-mode))
> > +;; ##autoload
> > +(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))
>
> I think you want to use something like
>
> ;;;###autoload
> (add-to-list 'auto-mode-alist '("\\.ss[itm]\\'" . sisu-mode))
>
> or
>
> ;;;###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))
>
thanks
+;;;###autoload (add-to-list 'auto-mode-alist '("\\.ss[imt]\\'" . sisu-mode))
> > +;; 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
> > +;;
> > +;; Fix version numbers of sisu-mode, register-list, and windresize.
> > +;;
> > +;; 2011-07-08 Chong Yidong <cyd@stupidchicken.com>
> > +;;
> > +;; sisu-mode.el: Add .sisu to auto-mode-alist using autoload cookie.
> > +;; Minor doc fixes.
> > +;;
> > +;; 2011-07-06 Stefan Monnier <monnier@iro.umontreal.ca>
> > +;;
> > +;; * sisu-mode.el (sisu-mode): Autoload.
> > +;;
> > +;; 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
> > +;;
> > +;; Add sisu-mode.el. Update all.el licence.
>
> This gets auto-added (from the Git log) when generating the ELPA
> package, so we don't need it.
>
>
ok, removed
> Stefan
I did a diff against the original file and put a few things back (e.g. the
triple curly braces).
Please let me know if there is more that needs to be done.
Thanks again,
Ralph
P.S. SiSU markup samples, for SiSU git contains some sample files
http://git.sisudoc.org/gitweb/?p=doc/sisu-markup-samples.git;a=summary
in particular here:
http://git.sisudoc.org/gitweb/?p=doc/sisu-markup-samples.git;a=tree;f=data/samples/current/en;hb=HEAD
P.P.S quick note to Kevin, thanks, (feel free to review the file)
[-- Attachment #2: sisu-mode-7.1.8.diff --]
[-- Type: text/x-diff, Size: 16742 bytes --]
--- sisu-mode.el 2016-02-20 23:27:42.226633771 -0500
+++ sisu-mode-7.1.8.el 2016-02-21 01:16:40.236406813 -0500
@@ -2,15 +2,15 @@
;; Copyright (C) 2011 Free Software Foundation, Inc.
-;; Author: Ambrose Kofi Laing (& Ralph Amissah)
-;; Keywords: text, processes, tools
-;; Version: 3.0.3
-;; License: GPLv3
-;; Home URL: SiSU: http://www.jus.uio.no/sisu
+;; Author: Ralph Amissah & Ambrose Kofi Laing
+;; Keywords: text, syntax, processes, tools
+;; Version: 7.1.8
+;; URL: 'http://www.sisudoc.org'
;; originally looked at (based on) doc-mode, with kind permission of the author
;; Author: SUN, Tong <suntong001@users.sf.net>, (c)2001-6, all right reserved
;; Version: $Date: 2006/01/19 03:13:41 $ $Revision: 1.14 $
;; Home URL: http://xpt.sourceforge.net/
+;; with contributions from Kevin Ryde and Stefan Monnier
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -136,200 +136,328 @@
(defconst sisu-font-lock-keywords
(eval-when-compile
(list
-
- ;;grouped text
- (cons "^group\{\\|^\}group" 'general-font-lock-red2)
- (cons "^block\{\\|^\}block" 'general-font-lock-red2)
- (cons "^code\{\\|^\}code" 'general-font-lock-red2)
- (cons "^poem\{\\|^\}poem" 'general-font-lock-red2)
- (cons "^alt\{\\|^\}alt" 'general-font-lock-red2)
- (cons "^table\{.+\\|^\}table" 'general-font-lock-red2)
- (cons "^\{table[^}]+\}" 'general-font-lock-red2)
-
- ;; footnote/endnote
- ;(cons "\~\{.+?\}\~" 'general-font-lock-green1)
- (cons "\~\{\\*\\*\\|\~\{\\*\\|\~\{\\|\}\~" 'general-font-lock-red2)
- (cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~" 'general-font-lock-red2)
-
- (cons "\~\\^ \\|^\\^\~ " 'general-font-lock-red2)
-
- (list (concat
- "\\(\*\~\\)"
- "\\([^ \r\t\n]+\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-blue2 t))
-
- ;; emphasis (can be program configured to be bold italics or underscore)
- (list (concat
- "\\([*]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[*]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; bold
- (list (concat
- "\\([!]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[!]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
- (cons "\\*[^ ]+\\*" 'general-font-lock-red1)
- (cons "^!_ .+" 'general-font-lock-red1)
-
- ;;; italics
- (list (concat
- "\\([/]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[/]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-blue1 t)
- '(3 general-font-lock-red1 t))
-
- ;; underscore
- (list (concat
- "\\([_]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[_]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; monospace
- (list (concat
- "\\([#]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[#]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; citation
- (list (concat
- "\\([\"]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[\"]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; inserted text
- (list (concat
- "\\([\+]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[\+]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; strike through
- (list (concat
- "\\(\\-\{\\)"
- "\\([^\}]+\\)"
- "\\(\}\\-\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; superscript
- (list (concat
- "\\(\\^\{\\)"
- "\\([^\}]+\\)"
- "\\(\}\\^\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;; subscript
- (list (concat
- "\\([,]\{\\)"
- "\\([^\}]+\\)"
- "\\(\}[,]\\)")
- '(1 general-font-lock-red1 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-red1 t))
-
- ;;numbered list
- (cons "^# \\|^_# " 'general-font-lock-red1)
-
- ;;bullet text
- (cons "^_\\*[1-9] \\|^_\\* " 'general-font-lock-red1)
-
- ;;indented text
- (cons "^_[1-9] " 'general-font-lock-red1)
-
- ;;url
- (cons "\\(^\\|[ ]\\)http:[/][/][^ \t\n\r<]+" 'general-font-lock-blue2)
-
-;; \\|\$
-
- ;; Comment Lines
- (cons "^% .*" 'general-font-lock-blue1)
- ;; line break
- (cons "<br>" 'general-font-lock-red1)
-
- ;; Section titles
- (list "^\\(\\([1-8]\\|:?[A-C]\\)\\~\\)\\(.*\\)"
- '(1 sisu-title-1 t)
- '(3 sisu-title-2 t))
-
- ;; hyper-links
- (list (concat
- "\\(\{~^\\|\{\\)"
- "\\([^\}\{]+\\)"
- "\\(\}http:[/][/][^ \r\n\t<]+\\)")
- '(1 general-font-lock-blue2 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-blue2 t))
-
- ;; book index
- (cons "^\=\{.+\}" 'general-font-lock-green1)
-
- ;; numbers
- (cons "\\<[.0-9]+\\>" 'general-font-lock-green2)
-
- ;; bullets sisu_normal (nearly copied regexp)
- (cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'general-font-lock-blue2)
-
- ;; image links
- (list (concat
- "\\(\{\\)"
- "\\([^\}\{]+\\)"
- "\\(\}image\\)")
- '(1 general-font-lock-blue2 t)
- '(2 general-font-lock-red1 t)
- '(3 general-font-lock-blue2 t))
-
- ;; insert file links
- (list (concat
- "\\(<< \\)"
- "\\([^ \r\t\n]+\\.ss\\)"
- "\\(i\\|t\\)")
- '(1 general-font-lock-blue2 t)
- '(2 general-font-lock-blue2 t)
- '(3 general-font-lock-blue2 t))
-
- ;; raw keywords
- (list (concat
- "^\\(\\@\\("
- "title\\|"
- "creator\\|"
- "date\\|"
- "publisher\\|"
- "rights\\|"
- "classify\\|"
- "original\\|"
- "notes\\|"
- "links\\|"
- "make\\|"
- "\\):\\)\\(.*\\)")
- '(1 sisu-title-2 keep)
- '(3 sisu-title-3 keep))
-
- ))
- "Default expressions to highlight in AsciiSisu mode.")
+ ;;grouped text ---------
+ ;(cons "^```[ ]code\\(.\\|\n\\)+?\n```\n" 'general-font-lock-red2)
+ (cons "^```[ ]+code.*?$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+table.*?$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+group$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+block$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+poem$\\|^```$" 'general-font-lock-red2)
+ (cons "^```[ ]+alt$\\|^```$" 'general-font-lock-red2)
+ ;;grouped text ---------
+ (cons "^group{\\|^}group" 'general-font-lock-red2)
+ (cons "^block{\\|^}block" 'general-font-lock-red2)
+ (cons "^code{\\|^}code" 'general-font-lock-red2)
+ (cons "^poem{\\|^}poem" 'general-font-lock-red2)
+ (cons "^alt{\\|^}alt" 'general-font-lock-red2)
+ (cons "^table{.+\\|^}table" 'general-font-lock-red2)
+ (cons "^{table[^}]+}" 'general-font-lock-red2)
+
+ (list
+ (concat
+ "^\`\\{3\\}[ ]+code.*?$"
+ "\\(.\\|\n\\)+?"
+ "\`\\{3\\}$"
+ )
+ '(1 general-font-lock-red2 t)
+ '(2 nil t)
+ '(3 general-font-lock-red2 t)
+ )
+ (list
+ (concat
+ "^\`\\{3\\}[ ]+table.*?$"
+ "\\(.\\|\n\\)+?"
+ "\`\\{3\\}$"
+ )
+ '(1 general-font-lock-red2 t)
+ '(2 nil t)
+ '(3 general-font-lock-red2 t)
+ )
+ (list
+ (concat
+ "^\`\\{3\\}[ ]+\\(group\\|block\\|alt\\|poem\\)$"
+ "\\(.\\|\n\\)+?"
+ "^\`\\{3\\}$"
+ )
+ '(1 general-font-lock-red2 t)
+ '(2 nil t)
+ '(3 general-font-lock-red2 t)
+ )
+
+ ;; footnote/endnote ----
+ ;(cons "\~{.+?}\~" 'general-font-lock-green1)
+ (cons "\~{\\*\\*\\|\~{\\*\\|\~{\\|}\~" 'general-font-lock-red2)
+ (cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~" 'general-font-lock-red2)
+ (cons "\~\\^ \\|^\\^\~ " 'general-font-lock-red2)
+ (list
+ (concat
+ "\\(\*\~\\)"
+ "\\([^ \r\t\n]+\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-blue2 t)
+ )
+
+ ;; emphasis (can be program configured to be bold italics or underscore)
+ (list
+ (concat
+ "\\([*]{\\)"
+ "\\([^}]+\\)"
+ "\\(}[*]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; bold ----------------
+ (list
+ (concat
+ "\\([!]{\\)"
+ "\\([^}]+\\)"
+ "\\(}[!]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+ (cons "\\*[^ ]+\\*" 'general-font-lock-red1)
+ (cons "^!_ .+" 'general-font-lock-red1)
+
+ ;; italics -------------
+ (list
+ (concat
+ "\\([/]{\\)"
+ "\\([^}]+\\)"
+ "\\(}[/]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-blue1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; underscore ----------
+ (list
+ (concat
+ "\\([_]{\\)"
+ "\\([^}]+\\)"
+ "\\(\}[_]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; monospace -----------
+ (list
+ (concat
+ "\\([#]{\\)"
+ "\\([^}]+\\)"
+ "\\(}[#]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; citation ------------
+ (list
+ (concat
+ "\\([\"]{\\)"
+ "\\([^}]+\\)"
+ "\\(}[\"]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; inserted text -------
+ (list
+ (concat
+ "\\([\+]{\\)"
+ "\\([^}]+\\)"
+ "\\(}[\+]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; strike through ------
+ (list
+ (concat
+ "\\(\\-{\\)"
+ "\\([^}]+\\)"
+ "\\(}\\-\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; superscript ---------
+ (list
+ (concat
+ "\\(\\^{\\)"
+ "\\([^}]+\\)"
+ "\\(}\\^\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; subscript -----------
+ (list
+ (concat
+ "\\([,]{\\)"
+ "\\([^}]+\\)"
+ "\\(}[,]\\)"
+ )
+ '(1 general-font-lock-red1 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-red1 t)
+ )
+
+ ;; numbered list
+ (cons "^# \\|^_# " 'general-font-lock-red1)
+
+ ;; bullet text
+ (cons "^_\\*[1-9] \\|^_\\* " 'general-font-lock-red1)
+
+ ;; indented text
+ (cons "^_[1-9] " 'general-font-lock-red1)
+ (cons "^_[1-9]! " 'general-font-lock-red1)
+
+ ;; hanging indented text [proposed enable when implemented]
+ (cons "^__[1-9] " 'general-font-lock-red1)
+ (cons "^_[0-9]_[0-9] " 'general-font-lock-red1)
+ (cons "^__[1-9]! " 'general-font-lock-red1)
+ (cons "^_[0-9]_[0-9]! " 'general-font-lock-red1)
+
+ ;; url
+ (cons "\\(^\\|[ ]\\)http:[/][/][^ \t\n\r<]+" 'general-font-lock-blue2)
+
+ ;; Comment Lines
+ (cons "^% .*" 'general-font-lock-blue1)
+
+ ;; page break
+ (cons "^\\(-\\\\\\\\-\\|=\\\\\\\\=\\|-\\.\\.-\\)" 'general-font-lock-red2)
+
+ ;; line break
+ (cons " \\\\\\\\ " 'general-font-lock-red1)
+
+ ;; line break (depreciated)
+ (cons "<br>" 'general-font-lock-red1)
+
+ ;; Section titles
+ (list "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\)\\(.*\\)"
+ '(1 sisu-title-1 t)
+ '(3 sisu-title-2 t)
+ )
+
+ ;; hyper-links
+ (list
+ (concat
+ "\\({~^\\|{\\)"
+ "\\([^}{]+\\)"
+ "\\(}http:[/][/][^ \r\n\t<]+\\)"
+ )
+ '(1 general-font-lock-blue2 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-blue2 t)
+ )
+
+ ;; book index
+ (list
+ (concat
+ "^\\(\={\\)"
+ "\\([^}{]+\\)"
+ "\\(}\\)$"
+ )
+ '(1 general-font-lock-green1 t)
+ '(2 nil t)
+ '(3 general-font-lock-green1 t)
+ )
+
+ ;(cons "^\={.+}" 'general-font-lock-green1)
+
+ ;; numbers
+ (cons "\\<[.0-9]+\\>" 'general-font-lock-green2)
+
+ ;; bullets sisu_normal (nearly copied regexp)
+ (cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'general-font-lock-blue2)
+
+ ;; image links
+ (list
+ (concat
+ "\\({\\)"
+ "\\([^}{]+\\)"
+ "\\(}image\\)"
+ )
+ '(1 general-font-lock-blue2 t)
+ '(2 general-font-lock-red1 t)
+ '(3 general-font-lock-blue2 t)
+ )
+
+ ;; insert file links
+ (list
+ (concat
+ "\\(<< \\)"
+ "\\([^ \r\t\n]+\\.ss\\)"
+ "\\(i\\|t\\)"
+ )
+ '(1 general-font-lock-blue2 t)
+ '(2 general-font-lock-blue2 t)
+ '(3 general-font-lock-blue2 t)
+ )
+
+ ;; raw keywords
+ (list
+ (concat
+ "^\\(\\@\\("
+ "creator\\|"
+ "title\\|"
+ "date\\|"
+ "rights\\|"
+ "publisher\\|"
+ "classify\\|"
+ "identifier\\|"
+ "original\\|"
+ "notes\\|"
+ "links\\|"
+ "make\\|"
+ "\\):\\)\\(.*\\)"
+ )
+ '(1 sisu-title-2 keep)
+ '(3 sisu-title-3 keep)
+ )
+ )
+ )
+ "Default expressions to highlight in AsciiSisu mode."
+)
+
+;; enables outlining for sisu
+(add-hook 'sisu-mode-hook
+ 'outline-minor-mode)
+
+;;; outline mode "folding" if available
+;;; TODO make sure linum (line numbering) is off, else performance penalty, sucks bigtime
+;;(define-key evil-normal-state-map (kbd ",0") (lambda() (interactive) (show-all)))
+;;(define-key evil-normal-state-map (kbd ",-") (lambda() (interactive) (hide-body)))
+;;(define-key evil-normal-state-map (kbd ",+") (lambda() (interactive) (show-subtree)))
+;;(define-key evil-normal-state-map (kbd ",=") (lambda() (interactive) (show-subtree)))
+;;
+;;(define-key evil-normal-state-map ",0" 'show-all)
+;;(define-key evil-normal-state-map ",-" 'hide-body)
+;;(define-key evil-normal-state-map ",+" 'show-subtree)
+;;(define-key evil-normal-state-map ",=" 'show-subtree)
+
+;; C-c @ C-a show all
+;; C-c @ C-t show only the headings
+;; C-c @ C-s show subtree at cursor location
+;; C-c @ C-d hide subtree at cursor location
;;}}}
@@ -338,8 +466,9 @@
;;;###autoload
(define-derived-mode sisu-mode text-mode "SiSU"
"Major mode for editing SiSU files.
-SiSU (http://www.sisudoc.org/) is a document structuring and
-publishing framework. This major mode handles SiSU markup."
+SiSU document structuring, publishing in multiple formats and search.
+URL `http://www.sisudoc.org/'
+"
(modify-syntax-entry ?\' ".")
;(flyspell-mode nil)
@@ -350,6 +479,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)
@@ -362,7 +494,7 @@
))
(run-hooks 'sisu-mode-hook))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.sisu\\'" . sisu-mode))
+;;;###autoload (add-to-list 'auto-mode-alist '("\\.ss[imt]\\'" . sisu-mode))
(provide 'sisu-mode)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-21 7:04 ` Ralph Amissah
@ 2016-02-21 15:51 ` Stefan Monnier
2016-02-21 17:17 ` Ralph Amissah
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2016-02-21 15:51 UTC (permalink / raw)
To: Ralph Amissah; +Cc: Kevin Ryde, Ambrose Kofi Laing, emacs-devel
> +;; enables outlining for sisu
> +(add-hook 'sisu-mode-hook
> + 'outline-minor-mode)
>> Finally, it's generally preferred to put such code directly in the
>> sisu-mode function and leave the sisu-mode-hook nil by default.
> I did not get this quite
If you want to enable outline-minor-mode, then you can add
(outline-minor-mode 1)
at the end of the `sisu-mode' function. This way sisu-mode-hook will
still be empty by default, as is the convention.
> I did a diff against the original file and put a few things back (e.g. the
> triple curly braces).
Thanks, installed.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-21 15:51 ` Stefan Monnier
@ 2016-02-21 17:17 ` Ralph Amissah
0 siblings, 0 replies; 9+ messages in thread
From: Ralph Amissah @ 2016-02-21 17:17 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Kevin Ryde, Ambrose Kofi Laing, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> Thanks, installed.
>
>
> Stefan
Stefan, thanks.
Ralph
P.S.
>> +;; enables outlining for sisu
>> +(add-hook 'sisu-mode-hook
>> + 'outline-minor-mode)
>
>>> Finally, it's generally preferred to put such code directly in the
>>> sisu-mode function and leave the sisu-mode-hook nil by default.
>> I did not get this quite
>
> If you want to enable outline-minor-mode, then you can add
>
> (outline-minor-mode 1)
>
> at the end of the `sisu-mode' function. This way sisu-mode-hook will
> still be empty by default, as is the convention.
>
thanks
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text
2016-02-19 6:18 ` Ralph Amissah
2016-02-19 18:42 ` Stefan Monnier
@ 2016-02-20 2:05 ` Kevin Ryde
1 sibling, 0 replies; 9+ messages in thread
From: Kevin Ryde @ 2016-02-20 2:05 UTC (permalink / raw)
To: Ralph Amissah; +Cc: Ambrose Kofi Laing, emacs-devel
Ralph Amissah <ralph.amissah@gmail.com> writes:
>
> (define-derived-mode sisu-mode text-mode "SiSU"
> - "Major mode for editing SiSU files.
> -SiSU (http://www.sisudoc.org/) is a document structuring and
> -publishing framework. This major mode handles SiSU markup."
> + "Major mode for editing SiSU files."
A url in a docstring can be good as a link or cross reference. Just at
the end if lower importance. It's good to buttonize by usual
URL `http://www.sisudoc.org/'
(I made a checkdoc addition to suggest such buttonizing, but I'm not
sure checkdoc digs into define-derived-mode docstring.)
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-02-21 17:17 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 22:19 Ambrose Kofi Laing & Ralph Neelante Amissah [Emacs] sisu-mode.el - a major-mode for highlighting a structured text Ralph Amissah
2016-02-19 3:59 ` Stefan Monnier
2016-02-19 6:18 ` Ralph Amissah
2016-02-19 18:42 ` Stefan Monnier
2016-02-20 0:30 ` Ralph Amissah
2016-02-21 7:04 ` Ralph Amissah
2016-02-21 15:51 ` Stefan Monnier
2016-02-21 17:17 ` Ralph Amissah
2016-02-20 2:05 ` Kevin Ryde
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.