emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-remember: Ignore gnus link if not on a message
@ 2009-01-20 16:37 Bernt Hansen
  2009-01-20 17:17 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Bernt Hansen @ 2009-01-20 16:37 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Bernt Hansen

This allows you to use org-remember in any gnus buffer - even when
not on a location that will create a usable link.  Instead of
failing with the error "Not on a group" just create a remember
note with no link instead.

This makes org-remember more user-friendly - we don't have to
change buffers to a non-gnus buffer to create a remember note.
---
Carsten: This patch is available at git://git.norang.ca/org-mode for-carsten

 lisp/org-gnus.el |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
index 23b2809..7826eba 100644
--- a/lisp/org-gnus.el
+++ b/lisp/org-gnus.el
@@ -111,12 +111,12 @@ If `org-store-link' was called with a prefix arg the meaning of
 			 (gnus-group-name))
 			(t "???")))
 	   desc link)
-      (unless group (error "Not on a group"))
-      (org-store-link-props :type "gnus" :group group)
-      (setq desc (org-gnus-group-link group)
-	    link desc)
-      (org-add-link-props :link link :description desc)
-      link))
+      (when group
+	(org-store-link-props :type "gnus" :group group)
+	(setq desc (org-gnus-group-link group)
+	      link desc)
+	(org-add-link-props :link link :description desc)
+	link)))
 
    ((memq major-mode '(gnus-summary-mode gnus-article-mode))
     (and (eq major-mode 'gnus-summary-mode) (gnus-summary-show-article))
-- 
1.6.1.28.gc32f76

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] org-remember: Ignore gnus link if not on a message
  2009-01-20 16:37 [PATCH] org-remember: Ignore gnus link if not on a message Bernt Hansen
@ 2009-01-20 17:17 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2009-01-20 17:17 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On Jan 20, 2009, at 5:37 PM, Bernt Hansen wrote:

> This allows you to use org-remember in any gnus buffer - even when
> not on a location that will create a usable link.  Instead of
> failing with the error "Not on a group" just create a remember
> note with no link instead.
>
> This makes org-remember more user-friendly - we don't have to
> change buffers to a non-gnus buffer to create a remember note.
> ---
> Carsten: This patch is available at git://git.norang.ca/org-mode for- 
> carsten
>
> lisp/org-gnus.el |   12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
> index 23b2809..7826eba 100644
> --- a/lisp/org-gnus.el
> +++ b/lisp/org-gnus.el
> @@ -111,12 +111,12 @@ If `org-store-link' was called with a prefix  
> arg the meaning of
> 			 (gnus-group-name))
> 			(t "???")))
> 	   desc link)
> -      (unless group (error "Not on a group"))
> -      (org-store-link-props :type "gnus" :group group)
> -      (setq desc (org-gnus-group-link group)
> -	    link desc)
> -      (org-add-link-props :link link :description desc)
> -      link))
> +      (when group
> +	(org-store-link-props :type "gnus" :group group)
> +	(setq desc (org-gnus-group-link group)
> +	      link desc)
> +	(org-add-link-props :link link :description desc)
> +	link)))
>
>    ((memq major-mode '(gnus-summary-mode gnus-article-mode))
>     (and (eq major-mode 'gnus-summary-mode) (gnus-summary-show- 
> article))
> -- 
> 1.6.1.28.gc32f76
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-20 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-20 16:37 [PATCH] org-remember: Ignore gnus link if not on a message Bernt Hansen
2009-01-20 17:17 ` Carsten Dominik

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).