summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2008-05-27 08:08:28 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2008-05-27 08:08:28 +0200
commitcd16b872165b41b0ec45361c65f51e61643c3d76 (patch)
treedde4cc487172ec4e982264657f7abf527140dfdc
parentf9fa54fcf4547e059215f2e4216d688bd4845234 (diff)
downloadorg-mode-cd16b872165b41b0ec45361c65f51e61643c3d76.tar.gz
Make C-c ' edit even more things around point.
-rw-r--r--ORGWEBPAGE/Changes.org54
-rw-r--r--contrib/lisp/org-eval.el2
-rw-r--r--doc/org.texi9
-rw-r--r--doc/orgcard.tex2
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/org-exp.el6
-rw-r--r--lisp/org.el19
7 files changed, 54 insertions, 43 deletions
diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org
index 49cf852..b9761b7 100644
--- a/ORGWEBPAGE/Changes.org
+++ b/ORGWEBPAGE/Changes.org
@@ -10,39 +10,6 @@
#+LINK_UP: index.html
#+LINK_HOME: http://orgmode.org
-* Version 6.05
-
-** Details
-*** Source code example editing expanded.
-
-The editing of source code in the proper major mode has been
-expanded. It works now inside all kinds of constructs, for
-example
-
-#+begin_src org
-,#+HTML: this code can be edited in html-mode
-
-,#+BEGIN_HTML
-,Same here
-,#+BEGIN_HTML
-
-,#+LaTeX: this code can be edited in latex-mode
-
-,#+BEGIN_LaTeX
-,Same here
-,#+BEGIN_LaTeX
-
-,#+BEGIN_SRC fortran
-,Here we can edit in fortran-mode
-,#+END_SRC
-#+end_src
-
-In addition to that, the syntax that is used by Emacs Muse (<src>
-or <example> tags, even <literal> and <lisp>) works as well - in
-fact, I think you can call `org-edit-src-code' directly from
-Muse. Hey, if you guys bind it to "C-c '" in Muse mode as well,
-this could be a nice convergence.
-
* Version 6.04
:PROPERTIES:
:VISIBILITY: content
@@ -111,6 +78,27 @@ editing by pressing "C-c '" again. This is important, because
lines that have syntactic meaning in Org will be quoted by
calling this command.
+"C-c '" also edits include files, the setupfile in a =#+setufile=
+line, and all those little foreign snippets like:
+
+#+begin_src org
+,#+HTML: this code can be edited in html-mode
+
+,#+BEGIN_HTML
+,Same here
+,#+BEGIN_HTML
+
+,#+LaTeX: this code can be edited in latex-mode
+
+,#+BEGIN_LaTeX
+,Same here
+,#+BEGIN_LaTeX
+
+,#+BEGIN_SRC fortran
+,Here we can edit in fortran-mode
+,#+END_SRC
+#+end_src
+
*** iCalendar now defines proper UIDs for entries
This is necessary for synchronization services. The UIDs are
diff --git a/contrib/lisp/org-eval.el b/contrib/lisp/org-eval.el
index 146d2cc..0dd3ade 100644
--- a/contrib/lisp/org-eval.el
+++ b/contrib/lisp/org-eval.el
@@ -56,6 +56,8 @@
;; the variable `org-eval-interpreters' to add more interpreters like
;; `perl', `python', or the `shell'.
;;
+;; You can edit the code snippets with "C-c '" (org-edit-src-code).
+;;
;; Please note that this mechanism is potentially dangerous, because it
;; executes code that you don't even see. This gives you great power,
;; but also enough rope to hang yourself. And, it gives your friends
diff --git a/doc/org.texi b/doc/org.texi
index d87d7bf..4311592 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -6860,6 +6860,12 @@ language for formatting the contents. The markup is optional, if it is not
given, the text will be assumed to be in Org mode format and will be
processed normally.
+@table @kbd
+@kindex C-c '
+@item C-c '
+Visit the include file at point.
+@end table
+
@node Tables exported, Footnotes, Include files, Markup rules
@subheading Tables
@cindex tables, markup rules
@@ -8014,7 +8020,8 @@ entirely ignored. Only when the buffer is parsed for option-setting lines
(i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
settings line, or when exporting), then the contents of this file are parsed
as if they had been included in the buffer. In particlar, the file can be
-any other Org mode file with internal setup.
+any other Org mode file with internal setup. You can visit the file the
+cursor is in the line with @kbd{C-c '}.
@item #+STARTUP:
This line sets options to be used at startup of Org mode, when an
Org file is being visited. The first set of options deals with the
diff --git a/doc/orgcard.tex b/doc/orgcard.tex
index 8cc67eb..71b8799 100644
--- a/doc/orgcard.tex
+++ b/doc/orgcard.tex
@@ -454,7 +454,7 @@ formula, \kbd{:=} a field formula.
\key{jump back to last followed link(s)}{C-c \&}
\key{Find next link}{C-c C-x C-n}
\key{Find previous link}{C-c C-x C-p}
-
+\key{Edit code snippet of file at point}{C-c '}
{\bf Internal Links}
\key{\kbd{<<My Target>>}}{\rm target}
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5b409b6..78f78c9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-27 Carsten Dominik <dominik@science.uva.nl>
+
+ * org-exp.el (org-export-html-style): Changed the size of in the
+ <pre> element to 90%.
+
2008-05-26 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-find-src-example-start): Function removed.
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index dd9495c..3d038e0 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -464,6 +464,7 @@ Org-mode file."
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
+ font-size: 90%;
}
table { border-collapse: collapse; }
td, th {
@@ -1359,7 +1360,7 @@ on this string to produce the exported version."
(while (re-search-forward "^#\\+BEGIN_EXAMPLE[ \t]*\n" nil t)
(goto-char (match-end 0))
(while (not (looking-at "#\\+END_EXAMPLE"))
- (insert ": ")
+ (insert ": ")
(beginning-of-line 2)))
(goto-char (point-min))
(while (re-search-forward "^[ \t]*:.*\\(\n[ \t]*:.*\\)*" nil t)
@@ -1755,6 +1756,9 @@ backends, it converts the segment into an EXAMPLE segment."
(concat "#+BEGIN_HTML\n" htmltext "\n#+END_HTML\n"))))
(t
;; This is not HTML, so just make it an example.
+ (when (equal lang "org")
+ (while (string-match "^," code)
+ (setq code (replace-match "" t t code))))
(concat "#+BEGIN_EXAMPLE\n" code
(if (string-match "\n\\'" code) "" "\n")
"#+END_EXAMPLE\n")))))
diff --git a/lisp/org.el b/lisp/org.el
index 0edfebe..ca6e13a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12710,14 +12710,19 @@ See the individual commands for more information."
(defun org-edit-special ()
"Call a special editor for the stuff at point.
When at a table, call the formula editor with `org-table-edit-formulas'.
-When at the first line of an src example, call `org-edit-src-code'."
+When at the first line of an src example, call `org-edit-src-code'.
+When in an #+include line, visit the include file. Otherwise call
+`ffap' to visit the file at point."
(interactive)
- (if (org-at-table-p)
- (call-interactively 'org-table-edit-formulas)
- (or (org-edit-src-code)
- (error "%s"
- (substitute-command-keys
- "\\[org-edit-special] can do nothing useful here.")))))
+ (cond
+ ((org-at-table-p)
+ (call-interactively 'org-table-edit-formulas))
+ ((save-excursion
+ (beginning-of-line 1)
+ (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ \t]*<include\\>.*?file=\"\\)\\([^\"\n>]+\\)"))
+ (find-file (org-trim (match-string 1))))
+ ((org-edit-src-code))
+ (t (call-interactively 'ffap))))
(defun org-ctrl-c-ctrl-c (&optional arg)
"Set tags in headline, or update according to changed information at point.