From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Danjou Subject: Re: [PATCH] org: remove org-invisible-p Date: Wed, 26 Jan 2011 11:21:25 +0100 Message-ID: References: <1296037134-8243-1-git-send-email-julien@danjou.info> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1551978656==" Return-path: Received: from [140.186.70.92] (port=35504 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pi2VF-0002iy-0I for emacs-orgmode@gnu.org; Wed, 26 Jan 2011 05:21:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pi2VD-0007Dm-5J for emacs-orgmode@gnu.org; Wed, 26 Jan 2011 05:21:28 -0500 Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]:49938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pi2VC-0007DX-Kc for emacs-orgmode@gnu.org; Wed, 26 Jan 2011 05:21:27 -0500 Received: from cigue.easter-eggs.fr (cigue.easter-eggs.fr [10.0.0.33]) by rose.easter-eggs.fr (Postfix) with ESMTPS id 6A25A14029 for ; Wed, 26 Jan 2011 11:21:24 +0100 (CET) Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1Pi2VC-0002B3-24 for emacs-orgmode@gnu.org; Wed, 26 Jan 2011 11:21:26 +0100 In-Reply-To: <1296037134-8243-1-git-send-email-julien@danjou.info> (Julien Danjou's message of "Wed, 26 Jan 2011 11:18:54 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1551978656== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain I just found a left over in org-list.el. :) Updated patch attached. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-remove-org-invisible-p.patch Content-Transfer-Encoding: quoted-printable From=20bf6c65a42e04d4753c58795442a479685bb5f318 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 26 Jan 2011 11:14:11 +0100 Subject: [PATCH] org: remove org-invisible-p * org.el: Remove org-invisible-p: outline-invisible-p is available in Emacs 22 and in recent XEmacs 21. Replace in various files. Signed-off-by: Julien Danjou =2D-- lisp/org-clock.el | 2 +- lisp/org-crypt.el | 2 +- lisp/org-exp.el | 2 +- lisp/org-list.el | 3 +- lisp/org.el | 59 +++++++++++++++++++++----------------------------= --- 5 files changed, 28 insertions(+), 40 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 8bb67d9..dac035f 100644 =2D-- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2481,7 +2481,7 @@ The details of what will be saved are regulated by th= e variable (goto-char (cdr resume-clock)) (let ((org-clock-auto-clock-resolution nil)) (org-clock-in) =2D (if (org-invisible-p) + (if (outline-invisible-p) (org-show-context)))))))))) =20 ;;;###autoload diff --git a/lisp/org-crypt.el b/lisp/org-crypt.el index 1d76104..1758a81 100644 =2D-- a/lisp/org-crypt.el +++ b/lisp/org-crypt.el @@ -112,7 +112,7 @@ This setting can also be overridden in the CRYPTKEY pro= perty." (let ((start-heading (point))) (forward-line) (when (not (looking-at "-----BEGIN PGP MESSAGE-----")) =2D (let ((folded (org-invisible-p)) + (let ((folded (outline-invisible-p)) (epg-context (epg-make-context nil t t)) (crypt-key (org-crypt-key-for-heading)) (beg (point)) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 7c814cd..e84a7c2 100644 =2D-- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2615,7 +2615,7 @@ command." (goto-char (point-min)) (while (re-search-forward org-drawer-regexp nil t) (goto-char (match-beginning 1)) =2D (or (org-invisible-p) (org-flag-drawer nil)))) + (or (outline-invisible-p) (org-flag-drawer nil)))) (with-current-buffer buffer (erase-buffer)) (save-excursion (setq s (goto-char (point-min))) diff --git a/lisp/org-list.el b/lisp/org-list.el index bc8e7bd..0c519fc 100644 =2D-- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -44,7 +44,6 @@ (defvar org-ts-regexp) (defvar org-ts-regexp-both) =20 =2D(declare-function org-invisible-p "org" ()) (declare-function org-on-heading-p "org" (&optional invisible-ok)) (declare-function outline-next-heading "outline" ()) (declare-function org-back-to-heading "org" (&optional invisible-ok)) @@ -1101,7 +1100,7 @@ item is invisible." (unless (or (not (org-in-item-p)) (save-excursion (goto-char (org-get-item-beginning)) =2D (org-invisible-p))) + (outline-invisible-p))) (if (save-excursion (goto-char (org-get-item-beginning)) (org-at-item-timer-p)) diff --git a/lisp/org.el b/lisp/org.el index fcdf245..d6b9c0d 100644 =2D-- a/lisp/org.el +++ b/lisp/org.el @@ -6010,7 +6010,7 @@ in special contexts. (save-excursion (goto-char eos) (outline-next-heading) =2D (if (org-invisible-p) (org-flag-heading nil)))) + (if (outline-invisible-p) (org-flag-heading nil)))) ((and (or (>=3D eol eos) (not (string-match "\\S-" (buffer-substring eol eos)))) (or has-children @@ -6024,7 +6024,7 @@ in special contexts. (save-excursion (goto-char eos) (outline-next-heading) =2D (if (org-invisible-p) (org-flag-heading nil))) + (if (outline-invisible-p) (org-flag-heading nil))) (setq org-cycle-subtree-status 'children) (run-hook-with-args 'org-cycle-hook 'children)) ((or children-skipped @@ -6191,9 +6191,9 @@ This function is the default value of the hook `org-c= ycle-hook'." ;; Properly fold already folded siblings (goto-char (point-min)) (while (re-search-forward re nil t) =2D (if (and (not (org-invisible-p)) + (if (and (not (outline-invisible-p)) (save-excursion =2D (goto-char (point-at-eol)) (org-invisible-p))) + (goto-char (point-at-eol)) (outline-invisible-p))) (hide-entry)))) (org-cycle-show-empty-lines 'overview) (org-cycle-hide-drawers 'overview))))) @@ -6526,7 +6526,7 @@ the headline hierarchy above." (progn (org-mark-ring-push org-goto-start-pos) (goto-char selected-point) =2D (if (or (org-invisible-p) (org-invisible-p2)) + (if (or (outline-invisible-p) (org-invisible-p2)) (org-show-context 'org-goto))) (message "Quit")))) =20 @@ -6571,7 +6571,7 @@ or nil." (org-show-siblings t) (org-show-following-heading t)) (goto-char org-goto-start-pos) =2D (and (org-invisible-p) (org-show-context))) + (and (outline-invisible-p) (org-show-context))) (goto-char (point-min))) (let (org-special-ctrl-a/e) (org-beginning-of-line)) (message "Select location and press RET") @@ -6786,14 +6786,14 @@ This is important for non-interactive uses of the c= ommand." (cond ((and (org-on-heading-p) (bolp) (or (bobp) =2D (save-excursion (backward-char 1) (not (org-invisible-p))))) + (save-excursion (backward-char 1) (not (outline-invisible-p))))) ;; insert before the current line (open-line (if blank 2 1))) ((and (bolp) (not org-insert-heading-respect-content) (or (bobp) (save-excursion =2D (backward-char 1) (not (org-invisible-p))))) + (backward-char 1) (not (outline-invisible-p))))) ;; insert right here nil) (t @@ -6801,7 +6801,7 @@ This is important for non-interactive uses of the com= mand." (save-excursion (setq previous-pos (point-at-bol)) (end-of-line) =2D (setq hide-previous (org-invisible-p))) + (setq hide-previous (outline-invisible-p))) (and org-insert-heading-respect-content (org-show-subtree)) (let ((split (and (org-get-alist-option org-M-RET-may-split-line 'headline) @@ -7257,7 +7257,7 @@ case." (setq beg (point))) (save-match-data (save-excursion (outline-end-of-heading) =2D (setq folded (org-invisible-p))) + (setq folded (outline-invisible-p))) (outline-end-of-subtree)) (outline-next-heading) (setq ne-end (org-back-over-empty-lines)) @@ -7349,7 +7349,7 @@ useful if the caller implements cut-and-paste as copy= -then-paste-then-cut." (skip-chars-forward " \t\r\n") (save-match-data (save-excursion (outline-end-of-heading) =2D (setq folded (org-invisible-p))) + (setq folded (outline-invisible-p))) (condition-case nil (org-forward-same-level (1- n) t) (error nil)) @@ -7397,7 +7397,7 @@ the inserted text when done." (error "%s" (substitute-command-keys "The kill is not a (set of) tree(s) - please use \\[yank] to yank an= yway"))) =2D (let* ((visp (not (org-invisible-p))) + (let* ((visp (not (outline-invisible-p))) (txt tree) (^re (concat "^\\(" outline-regexp "\\)")) (re (concat "\\(" outline-regexp "\\)")) @@ -7459,7 +7459,7 @@ the inserted text when done." (goto-char beg) (skip-chars-forward " \t\n\r") (setq beg (point)) =2D (if (and (org-invisible-p) visp) + (if (and (outline-invisible-p) visp) (save-excursion (outline-show-heading))) ;; Shift if necessary (unless (=3D shift 0) @@ -8976,7 +8976,7 @@ If the link is in hidden text, expose it." (if (re-search-forward org-any-link-re nil t) (progn (goto-char (match-beginning 0)) =2D (if (org-invisible-p) (org-show-context))) + (if (outline-invisible-p) (org-show-context))) (goto-char pos) (setq org-link-search-failed t) (error "No further link found")))) @@ -8996,7 +8996,7 @@ If the link is in hidden text, expose it." (if (re-search-backward org-any-link-re nil t) (progn (goto-char (match-beginning 0)) =2D (if (org-invisible-p) (org-show-context))) + (if (outline-invisible-p) (org-show-context))) (goto-char pos) (setq org-link-search-failed t) (error "No further link found")))) @@ -9642,7 +9642,7 @@ onto the ring." (setq m (car p)) (switch-to-buffer (marker-buffer m)) (goto-char m) =2D (if (or (org-invisible-p) (org-invisible-p2)) (org-show-context 'mar= k-goto)))) + (if (or (outline-invisible-p) (org-invisible-p2)) (org-show-context 'm= ark-goto)))) =20 (defun org-remove-angle-brackets (s) (if (equal (substring s 0 1) "<") (setq s (substring s 1))) @@ -12023,7 +12023,7 @@ How much context is shown depends upon the variables ;; Show heading or entry text (if (and heading-p (not entry-p)) (org-flag-heading nil) ; only show the heading =2D (and (or entry-p (org-invisible-p) (org-invisible-p2)) + (and (or entry-p (outline-invisible-p) (org-invisible-p2)) (org-show-hidden-entry))) ; show entire entry (when following-p ;; Show next sibling, or heading below text @@ -13807,7 +13807,7 @@ formats in the current buffer." (setq end (point)) (goto-char beg) (while (re-search-forward re end t)) =2D (setq hiddenp (org-invisible-p)) + (setq hiddenp (outline-invisible-p)) (end-of-line 1) (and (equal (char-after) ?\n) (forward-char 1)) (while (looking-at "^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|CLOCK:\\|:END:\\)") @@ -19176,13 +19176,6 @@ interactive command with similar behavior." =20 (define-key org-mode-map "\C-y" 'org-yank) =20 =2D(defun org-invisible-p () =2D "Check if point is at a character currently not visible." =2D ;; Early versions of noutline don't have `outline-invisible-p'. =2D (if (fboundp 'outline-invisible-p) =2D (outline-invisible-p) =2D (get-char-property (point) 'invisible))) =2D (defun org-truely-invisible-p () "Check if point is at a character currently not visible. This version does not only check the character property, but also @@ -19190,18 +19183,14 @@ This version does not only check the character pr= operty, but also ;; Early versions of noutline don't have `outline-invisible-p'. (if (org-bound-and-true-p visible-mode) nil =2D (if (fboundp 'outline-invisible-p) =2D (outline-invisible-p) =2D (get-char-property (point) 'invisible)))) + (outline-invisible-p))) =20 (defun org-invisible-p2 () "Check if point is at a character currently not visible." (save-excursion (if (and (eolp) (not (bobp))) (backward-char 1)) ;; Early versions of noutline don't have `outline-invisible-p'. =2D (if (fboundp 'outline-invisible-p) =2D (outline-invisible-p) =2D (get-char-property (point) 'invisible)))) + (outline-invisible-p))) =20 (defun org-back-to-heading (&optional invisible-ok) "Call `outline-back-to-heading', but provide a better error message." @@ -19429,7 +19418,7 @@ it wil also look at invisible ones." (setq l (- (match-end 0) (match-beginning 0) 1)) (=3D l level) (not invisible-ok) =2D (progn (backward-char 1) (org-invisible-p))) + (progn (backward-char 1) (outline-invisible-p))) (if (< l level) (setq arg 1))) (setq arg (1- arg))) (beginning-of-line 1))) @@ -19448,7 +19437,7 @@ Stop at the first and last subheadings of a superio= r heading." (setq l (- (match-end 0) (match-beginning 0) 1)) (=3D l level) (not invisible-ok) =2D (org-invisible-p)) + (outline-invisible-p)) (if (< l level) (setq arg 1))) (setq arg (1- arg))))) =20 @@ -19669,9 +19658,9 @@ To get rid of the restriction, use \\[org-agenda-re= move-restriction-lock]." (defun org-bookmark-jump-unhide () "Unhide the current position, to show the bookmark location." (and (org-mode-p) =2D (or (org-invisible-p) + (or (outline-invisible-p) (save-excursion (goto-char (max (point-min) (1- (point)))) =2D (org-invisible-p))) + (outline-invisible-p))) (org-show-context 'bookmark-jump))) =20 ;; Make session.el ignore our circular variable =2D-=20 1.7.2.3 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D-=20 Julien Danjou =E2=9D=B1 http://julien.danjou.info --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk0/9aUACgkQpGK1HsL+5c3LGACfbFg8w2gdl/l2n72/KC9eoHMP VwEAn02SCeLZiSUjd7+HDb8kBfMHHrCH =8gXj -----END PGP SIGNATURE----- --==-=-=-- --===============1551978656== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1551978656==--