浏览代码

Merge remote-tracking branch 'origin/master'

Rasmus 10 年之前
父节点
当前提交
ec216e2953
共有 6 个文件被更改,包括 83 次插入55 次删除
  1. 7 4
      etc/ORG-NEWS
  2. 54 42
      lisp/org-faces.el
  3. 7 3
      lisp/org.el
  4. 1 1
      lisp/ox-ascii.el
  5. 7 2
      lisp/ox-latex.el
  6. 7 3
      lisp/ox.el

+ 7 - 4
etc/ORG-NEWS

@@ -87,6 +87,9 @@ parameters are now supported: ~:raw~, ~:backend~.  Moreover, there are
 new parameters specific to some pre-defined translators, e.g.,
 ~:environment~ and ~:booktabs~ for ~orgtbl-to-latex~.  See translators
 docstrings (including ~orgtbl-to-generic~) for details.
+*** Non-floating minted listings in Latex export
+It is not possible to specify =#+attr_latex: :float nil= in conjunction with
+source blocks exported by the minted package.
 ** Miscellaneous
 *** File names in links accept are now compatible with URI syntax
 Absolute file names can now start with =///= in addition to =/=. E.g.,
@@ -140,7 +143,7 @@ So you need to replace
 
 : #+HTML_INCLUDE_STYLE: t
 
-by 
+by
 
 : #+OPTIONS: :html-include-style t
 
@@ -194,13 +197,13 @@ of the list.
   now use =amssymb= symbols by default instead.
 
 *** New functions for paragraph motion
-    
+
     The commands =C-down= and =C-up= now invoke special commands
     that use knowledge from the org-elements parser to move the cursor
     in a paragraph-like way.
 
 *** New entities in =org-entities.el=
-    
+
 Add support for ell, imath, jmath, varphi, varpi, aleph, gimel, beth,
 dalet, cdots, S (§), dag, ddag, colon, therefore, because, triangleq,
 leq, geq, lessgtr, lesseqgtr, ll, lll, gg, ggg, prec, preceq,
@@ -308,7 +311,7 @@ instructions:
 - when updating through ELPA (either from GNU ELPA or from Org ELPA),
   you have to install Org's ELPA package in a session where no Org
   function has been called already.
-  
+
 When in doubt, run =M-x org-version RET= and see if you have a mixed-up
 installation.
 

+ 54 - 42
lisp/org-faces.el

@@ -31,19 +31,6 @@
 (require 'org-macs)
 (require 'org-compat)
 
-(defun org-copy-face (old-face new-face docstring &rest attributes)
-  (unless (facep new-face)
-    (if (fboundp 'set-face-attribute)
-	(progn
-	  (make-face new-face)
-	  (set-face-attribute new-face nil :inherit old-face)
-	  (apply 'set-face-attribute new-face nil attributes)
-	  (set-face-doc-string new-face docstring))
-      (copy-face old-face new-face)
-      (if (fboundp 'set-face-doc-string)
-	  (set-face-doc-string new-face docstring)))))
-(put 'org-copy-face 'lisp-indent-function 2)
-
 (when (featurep 'xemacs)
   (put 'mode-line 'face-alias 'modeline))
 
@@ -427,12 +414,15 @@ determines if it is a foreground or a background color."
   "Face for checkboxes."
   :group 'org-faces)
 
+(defface org-checkbox-statistics-todo
+  '((t (:inherit org-todo)))
+  "Face used for unfinished checkbox statistics."
+  :group 'org-faces)
 
-(org-copy-face 'org-todo 'org-checkbox-statistics-todo
-  "Face used for unfinished checkbox statistics.")
-
-(org-copy-face 'org-done 'org-checkbox-statistics-done
-  "Face used for finished checkbox statistics.")
+(defface org-checkbox-statistics-done
+  '((t (:inherit org-done)))
+  "Face used for finished checkbox statistics."
+  :group 'org-faces)
 
 (defcustom org-tag-faces nil
   "Faces for specific tags.
@@ -537,11 +527,15 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
   :group 'org-faces
   :version "22.1")
 
-(org-copy-face 'org-meta-line 'org-block-begin-line
-  "Face used for the line delimiting the begin of source blocks.")
+(defface org-block-begin-line
+  '((t (:inherit org-meta-line)))
+  "Face used for the line delimiting the begin of source blocks."
+  :group 'org-faces)
 
-(org-copy-face 'org-meta-line 'org-block-end-line
-  "Face used for the line delimiting the end of source blocks.")
+(defface org-block-end-line
+  '((t (:inherit org-block-begin-line)))
+  "Face used for the line delimiting the end of source blocks."
+  :group 'org-faces)
 
 (defface org-verbatim
   (org-compatible-face 'shadow
@@ -557,10 +551,15 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
   :group 'org-faces
   :version "22.1")
 
-(org-copy-face 'org-block 'org-quote
-  "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks.")
-(org-copy-face 'org-block 'org-verse
-  "Face for #+BEGIN_VERSE ... #+END_VERSE blocks.")
+(defface org-quote
+  '((t (:inherit org-block)))
+  "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks."
+  :group 'org-faces)
+
+(defface org-verse
+  '((t (:inherit org-block)))
+  "Face for #+BEGIN_VERSE ... #+END_VERSE blocks."
+  :group 'org-faces)
 
 (defcustom org-fontify-quote-and-verse-blocks nil
   "Non-nil means, add a special face to #+begin_quote and #+begin_verse block.
@@ -597,21 +596,28 @@ content of these blocks will still be treated as Org syntax."
   "Face used in agenda for captions and dates."
   :group 'org-faces)
 
-(org-copy-face 'org-agenda-structure 'org-agenda-date
-  "Face used in agenda for normal days.")
+(defface org-agenda-date
+  '((t (:inherit org-agenda-structure)))
+  "Face used in agenda for normal days."
+  :group 'org-faces)
 
-(org-copy-face 'org-agenda-date 'org-agenda-date-today
+(defface org-agenda-date-today
+  '((t (:inherit org-agenda-date :weight bold :italic t)))
   "Face used in agenda for today."
-  :weight 'bold :italic 't)
+  :group 'org-faces)
 
-(org-copy-face 'secondary-selection 'org-agenda-clocking
-  "Face marking the current clock item in the agenda.")
+(defface org-agenda-clocking
+  '((t (:inherit secondary-selection)))
+  "Face marking the current clock item in the agenda."
+  :group 'org-faces)
 
-(org-copy-face 'org-agenda-date 'org-agenda-date-weekend
+(defface org-agenda-date-weekend
+  '((t (:inherit org-agenda-date :weight bold)))
   "Face used in agenda for weekend days.
-See the variable `org-agenda-weekend-days' for a definition of which days
-belong to the weekend."
-  :weight 'bold)
+
+See the variable `org-agenda-weekend-days' for a definition of
+which days belong to the weekend."
+  :group 'org-faces)
 
 (defface org-scheduled
   (org-compatible-face nil
@@ -716,8 +722,10 @@ month and 365.24 days for a year)."
   "Face used for time grids."
   :group 'org-faces)
 
-(org-copy-face 'org-time-grid 'org-agenda-current-time
-  "Face used to show the current time in the time grid.")
+(defface org-agenda-current-time
+  '((t (:inherit org-time-grid)))
+  "Face used to show the current time in the time grid."
+  :group 'org-faces)
 
 (defface org-agenda-diary
   (org-compatible-face 'default nil)
@@ -788,11 +796,15 @@ level org-n-level-faces"
   :version "24.4"
   :package-version '(Org . "8.0"))
 
-(org-copy-face 'mode-line 'org-mode-line-clock
-  "Face used for clock display in mode line.")
-(org-copy-face 'mode-line 'org-mode-line-clock-overrun
+(defface org-mode-line-clock
+  '((t (:inherit mode-line)))
+  "Face used for clock display in mode line."
+  :group 'org-faces)
+
+(defface org-mode-line-clock-overrun
+  '((t (:inherit mode-line :background "red")))
   "Face used for clock display for overrun tasks in mode line."
-  :background "red")
+  :group 'org-faces)
 
 (provide 'org-faces)
 

+ 7 - 3
lisp/org.el

@@ -4000,6 +4000,7 @@ header, or they will be appended."
     (""     "marvosym"  t)
     (""     "wasysym"   t)
     (""     "amssymb"   t)
+    (""     "capt-of"   nil)
     (""     "hyperref"  nil)
     "\\tolerance=1000")
   "Alist of default packages to be inserted in the header.
@@ -4021,6 +4022,7 @@ Org mode to function properly:
 - textcomp, marvosymb, wasysym, amssymb: for various symbols used
   for interpreting the entities in `org-entities'.  You can skip
   some of these packages if you don't use any of their symbols.
+- capt-of: for captions outside of floats
 - hyperref: for cross references
 
 Therefore you should not modify this variable unless you know
@@ -19691,9 +19693,11 @@ overwritten, and the table is not marked as requiring realignment."
   (org-check-before-invisible-edit 'insert)
   (cond
    ((and org-use-speed-commands
-	 (setq org-speed-command
-	       (run-hook-with-args-until-success
-		'org-speed-command-hook (this-command-keys))))
+	 (let ((kv (this-command-keys-vector)))
+	   (setq org-speed-command
+		 (run-hook-with-args-until-success
+		  'org-speed-command-hook
+		  (make-string 1 (aref kv (1- (length kv))))))))
     (cond
      ((commandp org-speed-command)
       (setq this-command org-speed-command)

+ 1 - 1
lisp/ox-ascii.el

@@ -542,7 +542,7 @@ Empty lines are not indented."
   "Return string S with a partial box to its left.
 INFO is a plist used as a communication channel."
   (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
-    (format (if utf8p "╭────\n%s\n╰────" ",----\n%s\n`----")
+    (format (if utf8p "┌────\n%s\n└────" ",----\n%s\n`----")
 	    (replace-regexp-in-string
 	     "^" (if utf8p "│ " "| ")
 	     ;; Remove last newline character.

+ 7 - 2
lisp/ox-latex.el

@@ -1085,7 +1085,8 @@ This function shouldn't be used for floats.  See
 `org-latex--caption/label-string'."
   (let ((label (org-element-property :name element)))
     (if (not (and (org-string-nw-p output) (org-string-nw-p label))) output
-      (concat (format "\\label{%s}\n" (org-export-solidify-link-text label))
+      (concat (format "\\phantomsection\n\\label{%s}\n"
+		      (org-export-solidify-link-text label))
 	      output))))
 
 (defun org-latex--text-markup (text markup info)
@@ -2301,7 +2302,11 @@ contextual information."
        ((eq listings 'minted)
 	(let* ((caption-str (org-latex--caption/label-string src-block info))
 	       (float-env
-		(cond ((and (not float) (plist-member attributes :float)) "%s")
+		(cond ((and (not float) (plist-member attributes :float) caption)
+		       (format "%%s\n%s" (replace-regexp-in-string
+					  "\\\\caption" "\\captionof{listing}"
+					  caption-str t t)))
+		      ((and (not float) (plist-member attributes :float)) "%s")
 		      ((string= "multicolumn" float)
 		       (format "\\begin{listing*}\n%%s\n%s\\end{listing*}"
 			       caption-str))

+ 7 - 3
lisp/ox.el

@@ -833,7 +833,7 @@ This variable can be either set to `buffer' or `subtree'."
 
 (defcustom org-export-show-temporary-export-buffer t
   "Non-nil means show buffer after exporting to temp buffer.
-When Org exports to a file, the buffer visiting that file is ever
+When Org exports to a file, the buffer visiting that file is never
 shown, but remains buried.  However, when exporting to
 a temporary buffer, that buffer is popped up in a second window.
 When this variable is nil, the buffer remains buried also in
@@ -1346,6 +1346,10 @@ The back-end could then be called with, for example:
 ;;   - category :: tree
 ;;   - type :: list of elements and objects
 ;;
+;; + `:input-buffer' :: Original buffer name.
+;;   - category :: option
+;;   - type :: string
+;;
 ;; + `:input-file' :: Full path to input file, if any.
 ;;   - category :: option
 ;;   - type :: string or nil
@@ -1816,8 +1820,8 @@ Assume buffer is in Org mode.  Narrowing, if any, is ignored."
 
 (defun org-export--get-buffer-attributes ()
   "Return properties related to buffer attributes, as a plist."
-  ;; Store full path of input file name, or nil.  For internal use.
-  (list :input-file (buffer-file-name (buffer-base-buffer))))
+  (list :input-buffer (buffer-name (buffer-base-buffer))
+	:input-file (buffer-file-name (buffer-base-buffer))))
 
 (defun org-export--get-global-options (&optional backend)
   "Return global export options as a plist.