emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org, jkitchin@andrew.cmu.edu
Subject: Re: [PATCH] org-id-goto doesn't work if buffer is narrowed.
Date: Sun, 25 Oct 2015 07:11:06 -0400	[thread overview]
Message-ID: <m2lharkxth.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <87oafof8km.fsf@gmx.us>

In my solution I do store the buffer. Maybe for some reason the id is in
another buffer with narrowing, and you want to preserve that narrowing
when you return. I originally did that with a marker, so you could
restore point to, but I decided to take that out. I wasn't aware you
could have dangling markers! I guess you would want to use more global
variables, so there would only be two. and hopefully you don't follow
multiple id links through narrowed buffers in a row!


Rasmus writes:

> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> I like the idea too. I worked out a partial solution for id links here:
>> http://kitchingroup.cheme.cmu.edu/blog/2015/10/24/Saving-the-current-restriction-and-restoring-it-while-following-links/
>> using the idea for saving and restoring the restriction.
>
> Thanks, John.
>
> You will probably want to use markers since one might edit stuff
> in-between the widening and going back to the narrow.
>
>      http://www.gnu.org/software/emacs/manual/html_node/elisp/Overview-of-Markers.html#Overview-of-Markers
>
> Markers should be cleaned up, which might prove difficult since one might
> not go back with C-c &, but you can at least ensure that at most two loose
> markers exists (potentially per Org buffer).
>
> Also, I wonder if there exits cases where you would need to store the
> buffer as well as the narrow points...  I guess not?
>
> Thanks,
> Rasmus

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

  reply	other threads:[~2015-10-25 11:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 15:11 [PATCH] org-id-goto doesn't work if buffer is narrowed Puneeth Chaganti
2015-10-23 15:27 ` Rasmus
2015-10-23 18:05   ` Puneeth Chaganti
2015-10-23 18:48     ` John Kitchin
2015-10-23 20:22     ` Rasmus
2015-10-24  5:29       ` Puneeth Chaganti
2015-10-24 11:33         ` John Kitchin
2015-10-24 11:49           ` Puneeth Chaganti
2015-10-24 11:57           ` Nicolas Goaziou
2015-10-24 12:47           ` Rasmus
2015-10-24 17:48             ` John Kitchin
2015-10-24 18:03               ` Rasmus
2015-10-25 11:11                 ` John Kitchin [this message]
2015-10-24 12:27         ` Rasmus
2015-10-25  2:24           ` Puneeth Chaganti
2015-10-25  3:12             ` Puneeth Chaganti
2015-10-25  8:38               ` Nicolas Goaziou
2015-10-25  9:10                 ` Puneeth Chaganti
2015-10-25  9:42                   ` Nicolas Goaziou
2015-10-25  9:57                     ` Puneeth Chaganti
2015-10-25 11:19             ` Rasmus
2015-10-26 14:14               ` Puneeth Chaganti
2015-10-23 19:59   ` Matt Lundin
2015-10-23 20:18     ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2lharkxth.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).