ian martins <ia...@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 via email to