Open main menu

Changes

459 bytes added ,  10:57, 2 July 2020
m
drop navbox
== Help with delimters delimiters and math mode ==
These customizations are mostly for faster insertion of special characters (and math mode).
(backward-char 5))
  (add-hook 'ConTeXt-mode-hook '(lambda () (local-set-key "\C-cnr" 'context-insert-nattab-row) (local-set-key "\C-cnc" 'context-insert-nattab-column) (local-set-key "\C-cnn" 'context-insert-nattab)))</pre> == Help with FLOW charts (from m-chart.tex) == <pre>;; Johan Sandblom. No copyright.(defun context-FLOW-shift-cells (x y &optional beg end) "Shifts FLOW cells in region right and down"
(interactive "nRight: \nnDown: \nr")
(save-excursion
(let ((beg (if beg beg (point)))) (let ((end (if (<= (line-number-at-pos end) (+ 2 (line-number-at-pos beg))) (search-forward "\\stopFLOWchart") end))) (message "beg %s, line %s end %s, line %s" beg (line-number-at-pos beg) end (line-number-at-pos end)) (goto-char beg) (while (search-forward-regexp "{\\([0-9]+\\),\\([0-9]+\\)}" end t) (replace-match (concat "{" (number-to-string (+ (string-to-number (match-string 1)) x)) "," (number-to-string (+ (string-to-number (match-string 2)) y)) "}") nil nil))))))
(defun context-FLOW-insert-cells (%optional n)
(insert "\\stopFLOWcell\n")
(setq x (1+ x)))))
 
(add-hook 'ConTeXt-mode-hook
'(lambda ()
(define-key (current-local-map) "\C-cnF" 'context-FLOW-insert-cells)
(local-setdefine-key "\C(current-cnr" 'context-insert-nattablocal-rowmap) (local-set-key "\C-cnccnS" 'context-insert-nattab-column) (local-set-key "\C-cnn" 'contextFLOW-insertshift-nattabcells)))
</pre>
== Metapost-mode and r-mode (from ESS, http://ess.r-project.org) in context-mode with mmm-mode ==
<pre>
;; Johan Sandblom. No copyright.
(require 'mmm-mode)
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 2)(mmm-add-group 'context-plus '((context-mpR :submode r-mode :face mmm-comment-submode-face :front ".*\\\\startR\\w*\\({\\w*}\\|\\[\\w*\\]\\|\\)\\W*" :back '(".*\\\\stopR") (context-MP :submode metapost-mode :face mmm-code-submode-face :front ".*\\\\start\\w*MP\\w*\\({\\w*}\\|\\[\\w*\\]\\|\\)\\W*" :back ".*\\\\stop\\w*MP") ))(add-to-list 'mmm-mode-ext-classes-alist '(context-mode nil context-mpplus))
</pre>
 
 
[[Category:Text Editors]]