From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antoine Levitt Subject: Re: org-agenda-switch-to switches to weird place Date: Tue, 11 Oct 2011 22:24:03 +0200 Message-ID: <87botnp998.fsf@gmail.com> References: <87lisrwmf7.fsf@gmail.com> <804nzf79zu.fsf@somewhere.org> <87r52jqwju.fsf@gmail.com> <80hb3f5nj4.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDisF-0006S2-Cc for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 16:24:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDisD-0000hQ-Oy for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 16:24:27 -0400 Received: from lo.gmane.org ([80.91.229.12]:42556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDisD-0000hD-Cl for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 16:24:25 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RDisB-0001Lw-Uo for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 22:24:23 +0200 Received: from ney92-7-78-233-218-202.fbx.proxad.net ([78.233.218.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Oct 2011 22:24:23 +0200 Received: from antoine.levitt by ney92-7-78-233-218-202.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Oct 2011 22:24:23 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 11/10/11 21:35, Sebastien Vauban >> If I understand correctly, org-agenda-switch-to goes to the org-marker >> marker that is set by capture. > > No, I absolutely don't think so. Org files are plain text files: what you > don't see in there, is simply not there. So, how could such markers be stored > in the Org file, when capturing something, and not be visible? Via markers, see http://www.chemie.fu-berlin.de/chemnet/use/info/elisp/elisp_29.html. I don't know much about it either, I just know it exists :-) > IIUC, the markers are simply some sort of regexp search to find > certain typical positions: > > - org-marker matches the timestamp which is at the origin of the presence of > the entry in the agenda > > - org-hd-marker is the beginning of the heading. That doesn't seem likely. See this (simplified) code from org-agenda-switch-to: (let* ((marker (org-get-at-bol 'org-marker)) (pos (marker-position marker))) So apparently there is a marker. > Do you really modify the title more often than the date? You have luck! > Because of procrastination, I'd say I much, much more often change the date, to > reprogram the entry at a later date, and so on, and so on. I change the date directly from the agenda with C-c C-s or S-right. So when I press RET, it's that I want to edit the title. > > Anyway, would you jump onto the beginning of the heading, just where the `***' > start, I think you can change the line: > > (org-get-at-bol 'org-marker)) > > with: > > (org-get-at-bol 'org-hd-marker)) > > to get another behavior. Now, from that, adding a constant number, or -- > better -- moving forward a couple of times, or -- certainly there are still > better options -- ... would allow you to land on whichever component of the > heading. Right. I can hack something up that'll be specific to my case, I just wanted to know if there was a proper way to do it that'd benefit everybody.