Browse Source

Merge branch 'maint'

Kyle Meyer 10 years ago
parent
commit
b5f5d66d8f
4 changed files with 10 additions and 5 deletions
  1. 1 1
      lisp/org-colview.el
  2. 2 1
      lisp/org-list.el
  3. 3 1
      lisp/org-src.el
  4. 4 2
      lisp/org.el

+ 1 - 1
lisp/org-colview.el

@@ -1068,7 +1068,7 @@ display, or in the #+COLUMNS line of the current buffer."
 (defun org-nofm-to-completion (n m &optional percent)
 (defun org-nofm-to-completion (n m &optional percent)
   (if (not percent)
   (if (not percent)
       (format "[%d/%d]" n m)
       (format "[%d/%d]" n m)
-    (format "[%d%%]"(floor (+ 0.5 (* 100. (/ (* 1.0 n) m)))))))
+    (format "[%d%%]" (round (* 100.0 n) m))))
 
 
 
 
 (defun org-columns-string-to-number (s fmt)
 (defun org-columns-string-to-number (s fmt)

+ 2 - 1
lisp/org-list.el

@@ -2573,7 +2573,8 @@ With optional prefix argument ALL, do this for the whole buffer."
 	      (total (nth 4 cookie)))
 	      (total (nth 4 cookie)))
 	 (goto-char beg)
 	 (goto-char beg)
 	 (insert
 	 (insert
-	  (if percent (format "[%d%%]" (/ (* 100 checked) (max 1 total)))
+	  (if percent (format "[%d%%]" (floor (* 100.0 checked)
+					      (max 1 total)))
 	    (format "[%d/%d]" checked total)))
 	    (format "[%d/%d]" checked total)))
 	 (delete-region (point) (+ (point) (- end beg)))
 	 (delete-region (point) (+ (point) (- end beg)))
 	 (when org-auto-align-tags (org-fix-tags-on-the-fly)))))))
 	 (when org-auto-align-tags (org-fix-tags-on-the-fly)))))))

+ 3 - 1
lisp/org-src.el

@@ -497,7 +497,9 @@ as `org-src-fontify-natively' is non-nil."
 	  (delete-region (point-min) (point-max))
 	  (delete-region (point-min) (point-max))
 	  (insert string " ") ;; so there's a final property change
 	  (insert string " ") ;; so there's a final property change
 	  (unless (eq major-mode lang-mode) (funcall lang-mode))
 	  (unless (eq major-mode lang-mode) (funcall lang-mode))
-	  (font-lock-ensure)
+	  ;; Avoid `font-lock-ensure', which does not display fonts in
+	  ;; source block.
+	  (font-lock-fontify-buffer)
 	  (setq pos (point-min))
 	  (setq pos (point-min))
 	  (while (setq next (next-single-property-change pos 'face))
 	  (while (setq next (next-single-property-change pos 'face))
 	    (put-text-property
 	    (put-text-property

+ 4 - 2
lisp/org.el

@@ -4549,7 +4549,8 @@ is nil, return nil unconditionally."
       (goto-char (point-min))
       (goto-char (point-min))
       (while (re-search-forward org-table-any-line-regexp nil t)
       (while (re-search-forward org-table-any-line-regexp nil t)
 	(unless quietly
 	(unless quietly
-	  (message "Mapping tables: %d%%" (/ (* 100.0 (point)) (buffer-size))))
+	  (message "Mapping tables: %d%%"
+		   (floor (* 100.0 (point)) (buffer-size))))
 	(beginning-of-line 1)
 	(beginning-of-line 1)
 	(when (and (looking-at org-table-line-regexp)
 	(when (and (looking-at org-table-line-regexp)
 		   ;; Exclude tables in src/example/verbatim/clocktable blocks
 		   ;; Exclude tables in src/example/verbatim/clocktable blocks
@@ -12966,7 +12967,8 @@ statistics everywhere."
 	    	(outline-next-heading)))
 	    	(outline-next-heading)))
 	    (setq new
 	    (setq new
 	    	  (if is-percent
 	    	  (if is-percent
-	    	      (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all)))
+		      (format "[%d%%]" (floor (* 100.0 cnt-done)
+					      (max 1 cnt-all)))
 	    	    (format "[%d/%d]" cnt-done cnt-all))
 	    	    (format "[%d/%d]" cnt-done cnt-all))
 	    	  ndel (- (match-end 0) checkbox-beg))
 	    	  ndel (- (match-end 0) checkbox-beg))
 	    ;; handle overlays when updating cookie from column view
 	    ;; handle overlays when updating cookie from column view