summaryrefslogtreecommitdiff
path: root/tools/editors
diff options
context:
space:
mode:
authorblais <blais@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2008-01-28 06:18:42 +0000
committerblais <blais@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2008-01-28 06:18:42 +0000
commit49bfb07d9c46c3d96b7bd23420c19cf5f6e3ffc5 (patch)
tree20e3ce45e374ee4a14f757c2a5ce049f82240a7d /tools/editors
parent029938c57d9b7d8642c1e19ab55cbfbbccbe060a (diff)
downloaddocutils-49bfb07d9c46c3d96b7bd23420c19cf5f6e3ffc5.tar.gz
rst.el: Added rst-minor-mode, to be used along mail-mode and other modes derived from text-mode.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5506 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'tools/editors')
-rw-r--r--tools/editors/emacs/rst.el36
1 files changed, 30 insertions, 6 deletions
diff --git a/tools/editors/emacs/rst.el b/tools/editors/emacs/rst.el
index 1a2d18f3c..8bd4d4b28 100644
--- a/tools/editors/emacs/rst.el
+++ b/tools/editors/emacs/rst.el
@@ -322,7 +322,8 @@ is for which (pred elem) is true)"
("contents" ".. contents::\n..\n " nil 0)
("con" ".. contents::\n..\n " nil 0)
("cont" "[...]" nil 0)
- ("skip" "[...]" nil 0)
+ ("skip" "\n\n[...]\n\n " nil 0)
+ ("seq" "\n\n[...]\n\n " nil 0)
;; FIXME: Add footnotes, links, and more.
))
@@ -443,6 +444,31 @@ blocks."
)
+;;;###autoload
+(define-minor-mode rst-minor-mode
+ "ReST Minor Mode.
+Toggle ReST minor mode.
+With no argument, this command toggles the mode.
+Non-null prefix argument turns on the mode.
+Null prefix argument turns off the mode.
+
+When ReST minor mode is enabled, the ReST mode
+keybindings are installed on top of the major
+mode bindings. Use this for modes derived from
+text-mode, like mail-mode.."
+ ;; The initial value.
+ nil
+ ;; The indicator for the mode line.
+ " ReST"
+ ;; The minor mode bindings.
+ rst-mode-map
+ :group 'rst)
+
+;; FIXME: can I somehow install these too?
+;; :abbrev-table rst-mode-abbrev-table
+;; :syntax-table rst-mode-syntax-table
+
+
@@ -3386,11 +3412,9 @@ column is used (fill-column vs. end of previous/next line)."
(defun rst-portable-mark-active-p ()
"A portable function that returns non-nil if the mark is active."
- (or
- (and (fboundp 'region-active-p)
- (region-active-p) (region-exists-p))
- (and (boundp 'transient-mark-mode)
- transient-mark-mode mark-active)))
+ (cond
+ ((fboundp 'region-active-p) (region-active-p))
+ ((boundp 'transient-mark-mode) transient-mark-mode mark-active)))