* [babel] [PATCH] enhanced org-babel-goto-named-src-block
@ 2012-02-22 20:51 Andreas Leha
2012-02-25 16:36 ` Eric Schulte
2012-02-29 0:39 ` Thomas S. Dye
0 siblings, 2 replies; 10+ messages in thread
From: Andreas Leha @ 2012-02-22 20:51 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 419 bytes --]
Hi all,
attached is a patch that enhances org-babel-goto-named-src-block (bound
to C-c C-v g by default). Included are two enhancements:
1. the point is pushed to the org-mark-ring, such that returning with
C-c & becomes possible
2. the target src block is guessed from
a) noweb-reference
b) #+call:
c) #+results:
d) symbol-at-point
if one of these is found (in that order)
- Andreas
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch for org-babel-goto-named-src-block --]
[-- Type: text/x-diff, Size: 1763 bytes --]
diff --git a/lisp/ob.el b/lisp/ob.el
index f021943..9962817 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1457,13 +1457,35 @@ If the point is not on a source block then return nil."
(defun org-babel-goto-named-src-block (name)
"Go to a named source-code block."
(interactive
- (let ((completion-ignore-case t))
+ (let ((completion-ignore-case t)
+ (under-point (thing-at-point 'line)))
(list (org-icompleting-read "source-block name: "
- (org-babel-src-block-names) nil t))))
+ (org-babel-src-block-names)
+ nil
+ t
+ (cond
+ ;; noweb
+ ((string-match (org-babel-noweb-wrap) under-point)
+ (let ((block-name (match-string 1 under-point)))
+ (string-match "[^(]*" block-name)
+ (match-string 0 block-name)))
+ ;; #+call:
+ ((string-match org-babel-lob-one-liner-regexp under-point)
+ (let ((source-info (car (org-babel-lob-get-info))))
+ (if (string-match "^\\([^\\[]+?\\)\\(\\[.*\\]\\)?(" source-info)
+ (let ((source-name (match-string 1 source-info)))
+ source-name))))
+ ;; #+results:
+ ((string-match (concat "#\\+" org-babel-results-keyword "\\:\s+\\([^\\(]*\\)") under-point)
+ (match-string 1 under-point))
+ ;; symbol-at-point
+ ((and (thing-at-point 'symbol) )(org-babel-find-named-block (thing-at-point 'symbol))
+ (thing-at-point 'symbol))
+ (""))))))
(let ((point (org-babel-find-named-block name)))
(if point
;; taken from `org-open-at-point'
- (progn (goto-char point) (org-show-context))
+ (progn (org-mark-ring-push) (goto-char point) (org-show-context))
(message "source-code block '%s' not found in this buffer" name))))
(defun org-babel-find-named-block (name)
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-22 20:51 [babel] [PATCH] enhanced org-babel-goto-named-src-block Andreas Leha
@ 2012-02-25 16:36 ` Eric Schulte
2012-02-29 0:39 ` Thomas S. Dye
1 sibling, 0 replies; 10+ messages in thread
From: Eric Schulte @ 2012-02-25 16:36 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
Applied, Thanks!
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Hi all,
>
> attached is a patch that enhances org-babel-goto-named-src-block (bound
> to C-c C-v g by default). Included are two enhancements:
>
> 1. the point is pushed to the org-mark-ring, such that returning with
> C-c & becomes possible
> 2. the target src block is guessed from
> a) noweb-reference
> b) #+call:
> c) #+results:
> d) symbol-at-point
> if one of these is found (in that order)
>
> - Andreas
>
>
> diff --git a/lisp/ob.el b/lisp/ob.el
> index f021943..9962817 100644
> --- a/lisp/ob.el
> +++ b/lisp/ob.el
> @@ -1457,13 +1457,35 @@ If the point is not on a source block then return nil."
> (defun org-babel-goto-named-src-block (name)
> "Go to a named source-code block."
> (interactive
> - (let ((completion-ignore-case t))
> + (let ((completion-ignore-case t)
> + (under-point (thing-at-point 'line)))
> (list (org-icompleting-read "source-block name: "
> - (org-babel-src-block-names) nil t))))
> + (org-babel-src-block-names)
> + nil
> + t
> + (cond
> + ;; noweb
> + ((string-match (org-babel-noweb-wrap) under-point)
> + (let ((block-name (match-string 1 under-point)))
> + (string-match "[^(]*" block-name)
> + (match-string 0 block-name)))
> + ;; #+call:
> + ((string-match org-babel-lob-one-liner-regexp under-point)
> + (let ((source-info (car (org-babel-lob-get-info))))
> + (if (string-match "^\\([^\\[]+?\\)\\(\\[.*\\]\\)?(" source-info)
> + (let ((source-name (match-string 1 source-info)))
> + source-name))))
> + ;; #+results:
> + ((string-match (concat "#\\+" org-babel-results-keyword "\\:\s+\\([^\\(]*\\)") under-point)
> + (match-string 1 under-point))
> + ;; symbol-at-point
> + ((and (thing-at-point 'symbol) )(org-babel-find-named-block (thing-at-point 'symbol))
> + (thing-at-point 'symbol))
> + (""))))))
> (let ((point (org-babel-find-named-block name)))
> (if point
> ;; taken from `org-open-at-point'
> - (progn (goto-char point) (org-show-context))
> + (progn (org-mark-ring-push) (goto-char point) (org-show-context))
> (message "source-code block '%s' not found in this buffer" name))))
>
> (defun org-babel-find-named-block (name)
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-22 20:51 [babel] [PATCH] enhanced org-babel-goto-named-src-block Andreas Leha
2012-02-25 16:36 ` Eric Schulte
@ 2012-02-29 0:39 ` Thomas S. Dye
2012-02-29 8:57 ` Andreas Leha
1 sibling, 1 reply; 10+ messages in thread
From: Thomas S. Dye @ 2012-02-29 0:39 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Hi all,
>
> attached is a patch that enhances org-babel-goto-named-src-block (bound
> to C-c C-v g by default). Included are two enhancements:
>
> 1. the point is pushed to the org-mark-ring, such that returning with
> C-c & becomes possible
> 2. the target src block is guessed from
> a) noweb-reference
> b) #+call:
> c) #+results:
> d) symbol-at-point
> if one of these is found (in that order)
>
> - Andreas
>
>
Hi all,
Should C-c & be included in Key Bindings and Useful Functions, Section
14.11 of the Org Mode manual? Or, is this a general Emacs thing
documented elsewhere?
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-29 0:39 ` Thomas S. Dye
@ 2012-02-29 8:57 ` Andreas Leha
2012-02-29 16:09 ` Thomas S. Dye
0 siblings, 1 reply; 10+ messages in thread
From: Andreas Leha @ 2012-02-29 8:57 UTC (permalink / raw)
To: emacs-orgmode
tsd@tsdye.com (Thomas S. Dye) writes:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Hi all,
>>
>> attached is a patch that enhances org-babel-goto-named-src-block (bound
>> to C-c C-v g by default). Included are two enhancements:
>>
>> 1. the point is pushed to the org-mark-ring, such that returning with
>> C-c & becomes possible
>> 2. the target src block is guessed from
>> a) noweb-reference
>> b) #+call:
>> c) #+results:
>> d) symbol-at-point
>> if one of these is found (in that order)
>>
>> - Andreas
>>
>>
> Hi all,
>
> Should C-c & be included in Key Bindings and Useful Functions, Section
> 14.11 of the Org Mode manual? Or, is this a general Emacs thing
> documented elsewhere?
>
> Tom
In my opinion, it would be nice to have this listed in the Org Mode
manual.
- Andreas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-29 8:57 ` Andreas Leha
@ 2012-02-29 16:09 ` Thomas S. Dye
2012-02-29 19:48 ` Jonathan Leech-Pepin
0 siblings, 1 reply; 10+ messages in thread
From: Thomas S. Dye @ 2012-02-29 16:09 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>
>>> Hi all,
>>>
>>> attached is a patch that enhances org-babel-goto-named-src-block (bound
>>> to C-c C-v g by default). Included are two enhancements:
>>>
>>> 1. the point is pushed to the org-mark-ring, such that returning with
>>> C-c & becomes possible
>>> 2. the target src block is guessed from
>>> a) noweb-reference
>>> b) #+call:
>>> c) #+results:
>>> d) symbol-at-point
>>> if one of these is found (in that order)
>>>
>>> - Andreas
>>>
>>>
>> Hi all,
>>
>> Should C-c & be included in Key Bindings and Useful Functions, Section
>> 14.11 of the Org Mode manual? Or, is this a general Emacs thing
>> documented elsewhere?
>>
>> Tom
>
> In my opinion, it would be nice to have this listed in the Org Mode
> manual.
>
> - Andreas
>
>
>
Hi Andreas,
Is C-c & correct here? On my system I can jump back following the
instructions:
Position saved to mark ring, go back with M-x org-mark-ring-goto.
But C-c & waits for more input.
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-29 16:09 ` Thomas S. Dye
@ 2012-02-29 19:48 ` Jonathan Leech-Pepin
2012-02-29 21:44 ` Sebastien Vauban
0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Leech-Pepin @ 2012-02-29 19:48 UTC (permalink / raw)
To: Thomas S. Dye; +Cc: Andreas Leha, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]
Hello Thomas,
I ran into exactly that question this morning and managed to figure it out.
If I use "emacs -q" then C-c & works as expected and is mapped to
(org-mark-ring-goto & optional N). However when trying C-c & C-h I find
out that C-c & is a prefix for a few yasnippet commands:
,----
| `yas/minor-mode' Minor Mode Bindings Starting With C-c &:
| key binding
| --- -------
|
| C-c & C-f yas/find-snippets
| C-c & C-n yas/new-snippet
| C-c & C-s yas/insert-snippet
| C-c & C-v yas/visit-snippet-file
`----
Seems this is another place where yas and org don't get along well together
On Wed, Feb 29, 2012 at 11:09, Thomas S. Dye <tsd@tsdye.com> wrote:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> tsd@tsdye.com (Thomas S. Dye) writes:
>>
>>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>>
>>>> Hi all,
>>>>
>>>> attached is a patch that enhances org-babel-goto-named-src-block (bound
>>>> to C-c C-v g by default). Included are two enhancements:
>>>>
>>>> 1. the point is pushed to the org-mark-ring, such that returning with
>>>> C-c & becomes possible
>>>> 2. the target src block is guessed from
>>>> a) noweb-reference
>>>> b) #+call:
>>>> c) #+results:
>>>> d) symbol-at-point
>>>> if one of these is found (in that order)
>>>>
>>>> - Andreas
>>>>
>>>>
>>> Hi all,
>>>
>>> Should C-c & be included in Key Bindings and Useful Functions, Section
>>> 14.11 of the Org Mode manual? Or, is this a general Emacs thing
>>> documented elsewhere?
>>>
>>> Tom
>>
>> In my opinion, it would be nice to have this listed in the Org Mode
>> manual.
>>
>> - Andreas
>>
>>
>>
> Hi Andreas,
>
> Is C-c & correct here? On my system I can jump back following the
> instructions:
> Position saved to mark ring, go back with M-x org-mark-ring-goto.
>
> But C-c & waits for more input.
>
> Tom
> --
> Thomas S. Dye
> http://www.tsdye.com
>
[-- Attachment #2: Type: text/html, Size: 4261 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-29 19:48 ` Jonathan Leech-Pepin
@ 2012-02-29 21:44 ` Sebastien Vauban
2012-02-29 22:24 ` Andreas Leha
0 siblings, 1 reply; 10+ messages in thread
From: Sebastien Vauban @ 2012-02-29 21:44 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Jonathan,
Jonathan Leech-Pepin wrote:
> I ran into exactly that question this morning and managed to figure it out.
>
> If I use "emacs -q" then C-c & works as expected and is mapped to
> (org-mark-ring-goto & optional N). However when trying C-c & C-h I find
> out that C-c & is a prefix for a few yasnippet commands:
>
> ,----
> | `yas/minor-mode' Minor Mode Bindings Starting With C-c &:
> | key binding
> | --- -------
> |
> | C-c & C-f yas/find-snippets
> | C-c & C-n yas/new-snippet
> | C-c & C-s yas/insert-snippet
> | C-c & C-v yas/visit-snippet-file
> `----
>
> Seems this is another place where yas and org don't get along well together
Something along these lines should work:
#+begin_src emacs-lisp
;; remove the binding of `C-c &'
(add-hook 'yas/minor-mode-hook
(lambda ()
(define-key global-map (kbd "C-c & C-s") nil)
(define-key global-map (kbd "C-c & C-n") nil)
(define-key global-map (kbd "C-c & C-v") nil)
(define-key global-map (kbd "C-c & C-f") nil)
))
#+end_src
... but it doesn't. And I don't understand yet why. Maybe the hook in which
this is placed is not the right one? If anyone sees an obvious reason for
it...
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-29 21:44 ` Sebastien Vauban
@ 2012-02-29 22:24 ` Andreas Leha
2012-02-29 23:52 ` Thomas S. Dye
0 siblings, 1 reply; 10+ messages in thread
From: Andreas Leha @ 2012-02-29 22:24 UTC (permalink / raw)
To: emacs-orgmode
"Sebastien Vauban"
<wxhgmqzgwmuf@spammotel.com> writes:
> Hi Jonathan,
>
> Jonathan Leech-Pepin wrote:
>> I ran into exactly that question this morning and managed to figure it out.
>>
>> If I use "emacs -q" then C-c & works as expected and is mapped to
>> (org-mark-ring-goto & optional N). However when trying C-c & C-h I find
>> out that C-c & is a prefix for a few yasnippet commands:
>>
>> ,----
>> | `yas/minor-mode' Minor Mode Bindings Starting With C-c &:
>> | key binding
>> | --- -------
>> |
>> | C-c & C-f yas/find-snippets
>> | C-c & C-n yas/new-snippet
>> | C-c & C-s yas/insert-snippet
>> | C-c & C-v yas/visit-snippet-file
>> `----
>>
>> Seems this is another place where yas and org don't get along well together
>
> Something along these lines should work:
>
> #+begin_src emacs-lisp
> ;; remove the binding of `C-c &'
> (add-hook 'yas/minor-mode-hook
> (lambda ()
> (define-key global-map (kbd "C-c & C-s") nil)
> (define-key global-map (kbd "C-c & C-n") nil)
> (define-key global-map (kbd "C-c & C-v") nil)
> (define-key global-map (kbd "C-c & C-f") nil)
> ))
> #+end_src
>
> ... but it doesn't. And I don't understand yet why. Maybe the hook in which
> this is placed is not the right one? If anyone sees an obvious reason for
> it...
>
> Best regards,
> Seb
Thanks for looking into this. I am not using yas myself - so I did not
notice.
@Tom: I think, if C-c & is documented, this issue (together with a
fix/work-around, as soon as found) should be mentioned there as well.
There will be more org- and yas-users.
Regards,
Andreas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-29 22:24 ` Andreas Leha
@ 2012-02-29 23:52 ` Thomas S. Dye
2012-03-01 8:19 ` Andreas Leha
0 siblings, 1 reply; 10+ messages in thread
From: Thomas S. Dye @ 2012-02-29 23:52 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> "Sebastien Vauban"
> <wxhgmqzgwmuf@spammotel.com> writes:
>
>> Hi Jonathan,
>>
>> Jonathan Leech-Pepin wrote:
>>> I ran into exactly that question this morning and managed to figure it out.
>>>
>>> If I use "emacs -q" then C-c & works as expected and is mapped to
>>> (org-mark-ring-goto & optional N). However when trying C-c & C-h I find
>>> out that C-c & is a prefix for a few yasnippet commands:
>>>
>>> ,----
>>> | `yas/minor-mode' Minor Mode Bindings Starting With C-c &:
>>> | key binding
>>> | --- -------
>>> |
>>> | C-c & C-f yas/find-snippets
>>> | C-c & C-n yas/new-snippet
>>> | C-c & C-s yas/insert-snippet
>>> | C-c & C-v yas/visit-snippet-file
>>> `----
>>>
>>> Seems this is another place where yas and org don't get along well together
>>
>> Something along these lines should work:
>>
>> #+begin_src emacs-lisp
>> ;; remove the binding of `C-c &'
>> (add-hook 'yas/minor-mode-hook
>> (lambda ()
>> (define-key global-map (kbd "C-c & C-s") nil)
>> (define-key global-map (kbd "C-c & C-n") nil)
>> (define-key global-map (kbd "C-c & C-v") nil)
>> (define-key global-map (kbd "C-c & C-f") nil)
>> ))
>> #+end_src
>>
>> ... but it doesn't. And I don't understand yet why. Maybe the hook in which
>> this is placed is not the right one? If anyone sees an obvious reason for
>> it...
>>
>> Best regards,
>> Seb
>
> Thanks for looking into this. I am not using yas myself - so I did not
> notice.
>
> @Tom: I think, if C-c & is documented, this issue (together with a
> fix/work-around, as soon as found) should be mentioned there as well.
> There will be more org- and yas-users.
>
> Regards,
> Andreas
>
>
>
Aloha Andreas,
IMO the manual should stick to describing Org Mode, and not get too
much into working around conflicts with other modes. At the same time,
I tend to agree with your guess that there are lots of Org Mode users
who also use yas.
I wonder what others think about adding a babel key binding for
org-mark-ring-goto? C-c C-v something. This could be documented in the
babel key bindings, along with a reference there to the standard Org
Mode binding, C-c &.
Assuming Seb's attempt finds a solution, then perhaps that could go
into the FAQ under something like "Why doesn't C-c & work for me?"
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [babel] [PATCH] enhanced org-babel-goto-named-src-block
2012-02-29 23:52 ` Thomas S. Dye
@ 2012-03-01 8:19 ` Andreas Leha
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Leha @ 2012-03-01 8:19 UTC (permalink / raw)
To: emacs-orgmode
tsd@tsdye.com (Thomas S. Dye) writes:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> "Sebastien Vauban"
>> <wxhgmqzgwmuf@spammotel.com> writes:
>>
>>> Hi Jonathan,
>>>
>>> Jonathan Leech-Pepin wrote:
>>>> I ran into exactly that question this morning and managed to figure it out.
>>>>
>>>> If I use "emacs -q" then C-c & works as expected and is mapped to
>>>> (org-mark-ring-goto & optional N). However when trying C-c & C-h I find
>>>> out that C-c & is a prefix for a few yasnippet commands:
>>>>
>>>> ,----
>>>> | `yas/minor-mode' Minor Mode Bindings Starting With C-c &:
>>>> | key binding
>>>> | --- -------
>>>> |
>>>> | C-c & C-f yas/find-snippets
>>>> | C-c & C-n yas/new-snippet
>>>> | C-c & C-s yas/insert-snippet
>>>> | C-c & C-v yas/visit-snippet-file
>>>> `----
>>>>
>>>> Seems this is another place where yas and org don't get along well together
>>>
>>> Something along these lines should work:
>>>
>>> #+begin_src emacs-lisp
>>> ;; remove the binding of `C-c &'
>>> (add-hook 'yas/minor-mode-hook
>>> (lambda ()
>>> (define-key global-map (kbd "C-c & C-s") nil)
>>> (define-key global-map (kbd "C-c & C-n") nil)
>>> (define-key global-map (kbd "C-c & C-v") nil)
>>> (define-key global-map (kbd "C-c & C-f") nil)
>>> ))
>>> #+end_src
>>>
>>> ... but it doesn't. And I don't understand yet why. Maybe the hook in which
>>> this is placed is not the right one? If anyone sees an obvious reason for
>>> it...
>>>
>>> Best regards,
>>> Seb
>>
>> Thanks for looking into this. I am not using yas myself - so I did not
>> notice.
>>
>> @Tom: I think, if C-c & is documented, this issue (together with a
>> fix/work-around, as soon as found) should be mentioned there as well.
>> There will be more org- and yas-users.
>>
>> Regards,
>> Andreas
>>
>>
>>
> Aloha Andreas,
>
> IMO the manual should stick to describing Org Mode, and not get too
> much into working around conflicts with other modes.
Valid point.
> At the same time,
> I tend to agree with your guess that there are lots of Org Mode users
> who also use yas.
>
> I wonder what others think about adding a babel key binding for
> org-mark-ring-goto? C-c C-v something. This could be documented in the
> babel key bindings, along with a reference there to the standard Org
> Mode binding, C-c &.
>
> Assuming Seb's attempt finds a solution, then perhaps that could go
> into the FAQ under something like "Why doesn't C-c & work for me?"
Good idea. That should be "visible enough" to the ones hit by this.
>
> All the best,
> Tom
Regards,
Andreas
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-03-01 8:20 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22 20:51 [babel] [PATCH] enhanced org-babel-goto-named-src-block Andreas Leha
2012-02-25 16:36 ` Eric Schulte
2012-02-29 0:39 ` Thomas S. Dye
2012-02-29 8:57 ` Andreas Leha
2012-02-29 16:09 ` Thomas S. Dye
2012-02-29 19:48 ` Jonathan Leech-Pepin
2012-02-29 21:44 ` Sebastien Vauban
2012-02-29 22:24 ` Andreas Leha
2012-02-29 23:52 ` Thomas S. Dye
2012-03-01 8:19 ` Andreas Leha
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).