浏览代码

New STARTUP keywords to turn on inline images

* lisp/org.el (org-startup-with-inline-images): New option.
(org-startup-options): Add new keywords inlineimages and
noinlineimages.
(org-mode): Inline images when this has been configured.
* doc/org.texi (Handling links):
(In-buffer settings): Document inlining images on startup.
Carsten Dominik 14 年之前
父节点
当前提交
9f96a1ead1
共有 2 个文件被更改,包括 32 次插入1 次删除
  1. 19 1
      doc/org.texi
  2. 13 0
      lisp/org.el

+ 19 - 1
doc/org.texi

@@ -3061,11 +3061,17 @@ variable @code{org-display-internal-link-with-indirect-buffer}}.
 @cindex inlining images
 @cindex images, inlining
 @kindex C-c C-x C-v
+@vindex org-startup-with-inline-images
+@cindex @code{inlineimages}, STARTUP keyword
+@cindex @code{noinlineimages}, STARTUP keyword
 @item C-c C-x C-v
 Toggle the inline display of linked images.  Normally this will only inline
 images that have no description part in the link, i.e. images that will also
 be inlined during export.  When called with a prefix argument, also display
-images that do have a link description.
+images that do have a link description.  You can ask for inline images to be
+displayed at startup by configuring the variable
+@code{org-startup-with-inline-images}@footnote{with corresponding
+@code{#+STARTUP} keywords @code{inlineimages} and @code{inlineimages}}.
 @cindex mark ring
 @kindex C-c %
 @item C-c %
@@ -12686,6 +12692,18 @@ variable is @code{org-startup-align-all-tables}, with a default value
 align      @r{align all tables}
 noalign    @r{don't align tables on startup}
 @end example
+
+@vindex org-startup-with-inline-images
+When visiting a file, inline images can be automatically displayed.  The
+corresponding variable is @code{org-startup-with-inline-images}, with a
+default value @code{nil} to avoid delays when visiting a file.
+@cindex @code{inlineimages}, STARTUP keyword
+@cindex @code{noinlineimages}, STARTUP keyword
+@example
+inlineimages   @r{show inline images}
+noinlineimages @r{don't show inline images on startup}
+@end example
+
 @vindex org-log-done
 @vindex org-log-note-clock-out
 @vindex org-log-repeat

+ 13 - 0
lisp/org.el

@@ -471,6 +471,15 @@ the following lines anywhere in the buffer:
   :group 'org-startup
   :type 'boolean)
 
+(defcustom org-startup-with-inline-images nil
+  "Non-nil means show inline images when loading a new Org file.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+   #+STARTUP: inlineimages
+   #+STARTUP: noinlineimages"
+  :group 'org-startup
+  :type 'boolean)
+
 (defcustom org-insert-mode-line-in-empty-file nil
   "Non-nil means insert the first line setting Org-mode in empty files.
 When the function `org-mode' is called interactively in an empty file, this
@@ -4148,6 +4157,8 @@ After a match, the following groups carry important information:
     ("oddeven" org-odd-levels-only nil)
     ("align" org-startup-align-all-tables t)
     ("noalign" org-startup-align-all-tables nil)
+    ("inlineimages" org-startup-with-inline-images t)
+    ("noinlineimages" org-startup-with-inline-images nil)
     ("customtime" org-display-custom-times t)
     ("logdone" org-log-done time)
     ("lognotedone" org-log-done note)
@@ -4718,6 +4729,8 @@ The following commands are available:
       (let ((bmp (buffer-modified-p)))
 	(org-table-map-tables 'org-table-align 'quietly)
 	(set-buffer-modified-p bmp)))
+    (when org-startup-with-inline-images
+      (org-display-inline-images))
     (when org-startup-indented
       (require 'org-indent)
       (org-indent-mode 1))