emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: ian martins <ianxm@jhu.edu>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-timer.el: Allow org-timer-set-timer from non-Org buffers
Date: Sun, 17 Nov 2019 18:09:46 -0500	[thread overview]
Message-ID: <87v9ri14n9.fsf@kyleam.com> (raw)
In-Reply-To: <CAC=rjb4P3-HO0jMcC3=fbyVyC8R41rwW89tyi1Tv+ZJbQJDnZQ@mail.gmail.com>

ian martins <ianxm@jhu.edu> writes:

> Subject: [PATCH] org-timer.el: Allow org-timer-set-timer from non-Org buffers
>
> * org-timer.el (org-timer--get-timer-title): If the current buffer is

The file name should include the directory, "lisp/".  (I'll add it.)

> not an Org buffer, use the buffer name as the timer title.
>
> Currently all of the `org-timer-' operations work from any buffer
> except `org-timer-set-timer' which must be run from an Org buffer.
> This is because `org-timer-set-timer' sets a timer name based on an
> Org heading or filename.  By setting the timer title to the current
> buffer name we can use `org-timer-set-timer' from any buffer and
> preserve the timer naming convention of using the buffer name if there
> isn't an Org header.

Makes sense.

> @@ -482,7 +483,7 @@ time is up."
>     ((derived-mode-p 'org-mode)
>      (or (ignore-errors (org-get-heading))
>  	(buffer-name (buffer-base-buffer))))
> -   (t (error "Not in an Org buffer"))))
> +   (t (buffer-name (buffer-base-buffer)))))

Looks good.  An alternative that avoids repeating the buffer-name call
would be

    (cond
     [...]
     ((and (derived-mode-p 'org-mode)
           (ignore-errors (org-get-heading))))
     (t (buffer-name (buffer-base-buffer))))

but I think it's fine as is.  Applied and pushed (044e9718c).

Thanks.

  reply	other threads:[~2019-11-17 23:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17 11:50 [PATCH] org-timer.el: Allow org-timer-set-timer from non-Org buffers ian martins
2019-11-17 23:09 ` Kyle Meyer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-11-16 18:22 ian martins
2019-11-17  6:12 ` Adam Porter

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=87v9ri14n9.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ianxm@jhu.edu \
    /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).