浏览代码

Make M-right/left work on regions again

Patch by Matt Lundin
Carsten Dominik 15 年之前
父节点
当前提交
6a98418b66
共有 2 个文件被更改,包括 13 次插入9 次删除
  1. 5 0
      lisp/ChangeLog
  2. 8 9
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2010-05-07  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-check-for-hidden): When there is a region, skip
+	the check.
+
 2010-05-02  Dan Davison  <davison@stats.ox.ac.uk>
 
 	* org-src.el (org-edit-src-code): allow-write-back-p had

+ 8 - 9
lisp/org.el

@@ -16146,20 +16146,19 @@ this fucntion returns t, nil otherwise."
 	beg end)
     (save-excursion
       (catch 'exit
-	(if (org-region-active-p)
-	    (setq beg (region-beginning) end (region-end))
+	(unless (org-region-active-p)
 	  (setq beg (point-at-bol))
 	  (beginning-of-line 2)
 	  (while (and (not (eobp)) ;; this is like `next-line'
 		      (get-char-property (1- (point)) 'invisible))
 	    (beginning-of-line 2))
-	  (setq end (point)))
-	(goto-char beg)
-	(goto-char (point-at-eol))
-	(setq end (max end (point)))
-	(while (re-search-forward re end t)
-	  (if (get-char-property (match-beginning 0) 'invisible)
-	      (throw 'exit t)))
+	  (setq end (point))
+	  (goto-char beg)
+	  (goto-char (point-at-eol))
+	  (setq end (max end (point)))
+	  (while (re-search-forward re end t)
+	    (if (get-char-property (match-beginning 0) 'invisible)
+		(throw 'exit t))))
 	nil))))
 
 (defun org-metaup (&optional arg)