emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Filippo A. Salustri" <salustri@ryerson.ca>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: emacs-orgmode mailing list <emacs-orgmode@gnu.org>
Subject: Re: odd behaviour in a function - looking for advice
Date: Thu, 16 Jun 2011 22:01:26 -0400	[thread overview]
Message-ID: <BANLkTinh4Dwf179ABvt+cgu7tDkm=iTiEg@mail.gmail.com> (raw)
In-Reply-To: <8139j9mdr0.fsf@gmail.com>

save-window-excursion did the trick.  Never heard of that one.
Thanks!
Cheers.
Fil

On 16 June 2011 21:46, Jambunathan K <kjambunathan@gmail.com> wrote:
> "Filippo A. Salustri" <salustri@ryerson.ca> writes:
>
>> Hi all,
>>
>> I've got this function:
>>
>> (defun fas/org-priority (&optional p)
>>   "Change the priority of the current item, then refresh agenda."
>>   (interactive)
>>   (save-excursion
>>     (if (org-priority p)
>>         (org-agenda-redo))))
>>
>> I set up my window to have 2 frames side by side.  The org agenda is
>> in the left frame.  In the right frame is whatever org file I'm
>> working on.
>> In the org file (right frame), I call the above function, having bound
>> it to \C-,
>> It does what it's supposed to to the priority, but then the point
>> moves to the agenda frame and goes to the end of the agenda buffer.
>> I would have thought 'save-excursion' would have returned the point to
>> wherever I was when I called the function.
>>
>
> save-window-excursion maybe?
> Or you could solve the problem by one switch-to-buffer-other-window.
>
> Just a quick hint.
>
>> Anyone got any idea what I'm doing wrong?
>> Cheers.
>> Fil
>
> --
>



-- 
\V/_
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salustri@ryerson.ca
http://deseng.ryerson.ca/~fil/

  parent reply	other threads:[~2011-06-17  2:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-17  1:34 odd behaviour in a function - looking for advice Filippo A. Salustri
2011-06-17  1:46 ` Jambunathan K
2011-06-17  1:56   ` Jambunathan K
2011-06-17  2:01   ` Filippo A. Salustri [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-17 10:12 Rustom Mody
2011-06-17 12:54 Rustom Mody

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='BANLkTinh4Dwf179ABvt+cgu7tDkm=iTiEg@mail.gmail.com' \
    --to=salustri@ryerson.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=kjambunathan@gmail.com \
    /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).