emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Make the point visible when jumping to the mark


From: Ian Kelling
Subject: Re: [O] [PATCH] Make the point visible when jumping to the mark
Date: Wed, 21 May 2014 12:01:29 -0700
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.4.50 (gnu/linux)

Bastien <address@hidden> writes:
> The formatting of the Changelog message not good.
>
> It should be
>
> * org.el: Advise commands which jump to the mark.
>
> See http://orgmode.org/worg/org-contribute.html and example in
> the git logs.
>

My mistake. Fixed in the attached patch.

>> +(eval-after-load "simple"
>> +  '(defadvice set-mark-command (after org-make-visible activate)
>> +     "Make the point visible with `org-show-context'."
>> +     (org-mark-jump-unhide)))
>
> Why this one?  The user don't want to use C-SPC in hidden parts.

Yes, I agree. They want to use C-u C-SPC to go to hidden parts. I've
updated the patch to advise pop-to-mark-command instead. It is attached.

>From ead59ed465eb33e822dd69f6e34b087477ebc239 Mon Sep 17 00:00:00 2001
From: Ian Kelling <address@hidden>
Date: Wed, 30 Apr 2014 21:54:08 -0700
Subject: [PATCH] Make the point visible when jumping to the mark

* org.el: Advise commands which jump to the mark
---
 lisp/org.el |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 40e16ea..17f7997 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -24510,6 +24510,27 @@ To get rid of the restriction, use 
\\[org-agenda-remove-restriction-lock]."
                           (outline-invisible-p)))
        (org-show-context 'bookmark-jump)))
 
+(eval-after-load "simple"
+  '(defadvice pop-to-mark-command (after org-make-visible activate)
+     "Make the point visible with `org-show-context'."
+     (org-mark-jump-unhide)))
+
+(eval-after-load "simple"
+  '(defadvice exchange-point-and-mark (after org-make-visible activate)
+     "Make the point visible with `org-show-context'."
+     (org-mark-jump-unhide)))
+
+(eval-after-load "simple"
+  '(defadvice pop-global-mark (after org-make-visible activate)
+     "Make the point visible with `org-show-context'."
+     (org-mark-jump-unhide)))
+
+(defun org-mark-jump-unhide ()
+  "Make the point visible with `org-show-context' after jumping to the mark."
+  (when (and (derived-mode-p 'org-mode)
+            (outline-invisible-p))
+    (org-show-context 'mark-goto)))
+
 ;; Make session.el ignore our circular variable
 (defvar session-globals-exclude)
 (eval-after-load "session"
-- 
1.7.10.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]