Org-mode mailing list
 help / color / mirror / Atom feed
* from dired to an org file with list of files with links
@ 2020-12-10 19:44 Uwe Brauer
  2020-12-10 20:36 ` [one pkf found] (was: from dired to an org file with list of files with links) Uwe Brauer
  2020-12-10 21:04 ` from dired to an org file with list of files with links Jean Louis
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Brauer @ 2020-12-10 19:44 UTC (permalink / raw)
  To: emacs-orgmode


Hi 

Suppose via dired I see

  -rw-rw-r--   1 oub oub 1003 dic 10 18:17 auto-org-md-autoloads.el
  -rw-rw-r--   1 oub oub 2,0K dic 10 18:17 auto-org-md.el
  -rw-rw-r--   1 oub oub 2,3K dic 10 18:17 auto-org-md.elc
  -rw-rw-r--   1 oub oub  486 dic 10 18:17 auto-org-md-pkg.el

I'd like to create a org file
with lists these files and there links to it

Like this


[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-autoloads.el][outo-org-md-autoloads.el]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.elc][outo-org-md.elc]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-pkg.elc][outo-org-md-pkg.elc]]

Anybody know whether such a functionality/package exist?

Thanks 

Uwe Brauer 



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

* [one pkf found] (was: from dired to an org file with list of files with links)
  2020-12-10 19:44 from dired to an org file with list of files with links Uwe Brauer
@ 2020-12-10 20:36 ` Uwe Brauer
  2020-12-10 21:04 ` from dired to an org file with list of files with links Jean Louis
  1 sibling, 0 replies; 6+ messages in thread
From: Uwe Brauer @ 2020-12-10 20:36 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

>>> "UB" == Uwe Brauer <oub@mat.ucm.es> writes:

> Hi 

> Suppose via dired I see

>   -rw-rw-r--   1 oub oub 1003 dic 10 18:17 auto-org-md-autoloads.el
>   -rw-rw-r--   1 oub oub 2,0K dic 10 18:17 auto-org-md.el
>   -rw-rw-r--   1 oub oub 2,3K dic 10 18:17 auto-org-md.elc
>   -rw-rw-r--   1 oub oub  486 dic 10 18:17 auto-org-md-pkg.el

> I'd like to create a org file
> with lists these files and there links to it

> Like this


> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-autoloads.el][outo-org-md-autoloads.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.elc][outo-org-md.elc]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-pkg.elc][outo-org-md-pkg.elc]]

> Anybody know whether such a functionality/package exist?
It seems that 
https://github.com/JayDugger/.emacs.d/blob/master/el-get/org-fstree/org-fstree.el

Does what I want. That pkg is 8 years old maybe there is a more recent
pkg with a similar feature?

Regards

Uwe Brauer 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

* Re: from dired to an org file with list of files with links
  2020-12-10 19:44 from dired to an org file with list of files with links Uwe Brauer
  2020-12-10 20:36 ` [one pkf found] (was: from dired to an org file with list of files with links) Uwe Brauer
@ 2020-12-10 21:04 ` Jean Louis
  2020-12-11  8:09   ` Uwe Brauer
  1 sibling, 1 reply; 6+ messages in thread
From: Jean Louis @ 2020-12-10 21:04 UTC (permalink / raw)
  To: emacs-orgmode

Dear Uwe,

* Uwe Brauer <oub@mat.ucm.es> [2020-12-10 22:45]:
> 
> Hi 
> 
> Suppose via dired I see
> 
>   -rw-rw-r--   1 oub oub 1003 dic 10 18:17 auto-org-md-autoloads.el
>   -rw-rw-r--   1 oub oub 2,0K dic 10 18:17 auto-org-md.el
>   -rw-rw-r--   1 oub oub 2,3K dic 10 18:17 auto-org-md.elc
>   -rw-rw-r--   1 oub oub  486 dic 10 18:17 auto-org-md-pkg.el
> 
> I'd like to create a org file
> with lists these files and there links to it
> 
> Like this
> 
> 
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-autoloads.el][outo-org-md-autoloads.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.elc][outo-org-md.elc]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-pkg.elc][outo-org-md-pkg.elc]]
> 
> Anybody know whether such a functionality/package exist?

(require 'dired-x)

(defun dired-to-org-links ()
  "Generates Org links for Dired files and stores in memory. Yank
it in other buffer"
  (interactive)
  (let* ((files (dired-get-marked-files)))
    (when files
      (kill-new
       (with-temp-buffer
	 (dolist (file files)
	   (let* ((base (file-name-nondirectory file))
		  (link (format "[[file:%s][%s]]\n" file base)))
	     (insert link)))
	 (buffer-string))))))


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

* Re: from dired to an org file with list of files with links
  2020-12-10 21:04 ` from dired to an org file with list of files with links Jean Louis
@ 2020-12-11  8:09   ` Uwe Brauer
  2020-12-11 16:14     ` TRS-80
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2020-12-11  8:09 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]


> Dear Uwe,
> * Uwe Brauer <oub@mat.ucm.es> [2020-12-10 22:45]:

> (require 'dired-x)

> (defun dired-to-org-links ()
>   "Generates Org links for Dired files and stores in memory. Yank
> it in other buffer"
>   (interactive)
>   (let* ((files (dired-get-marked-files)))
>     (when files
>       (kill-new
>        (with-temp-buffer
> 	 (dolist (file files)
> 	   (let* ((base (file-name-nondirectory file))
> 		  (link (format "[[file:%s][%s]]\n" file base)))
> 	     (insert link)))
> 	 (buffer-string))))))

Thanks, that is very nice. 
I played a bit around with org-fstree, that is also useful.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

* Re: from dired to an org file with list of files with links
  2020-12-11  8:09   ` Uwe Brauer
@ 2020-12-11 16:14     ` TRS-80
  2020-12-13 15:46       ` Jean Louis
  0 siblings, 1 reply; 6+ messages in thread
From: TRS-80 @ 2020-12-11 16:14 UTC (permalink / raw)
  To: emacs-orgmode

On 2020-12-11 03:09, Uwe Brauer wrote:
>> Dear Uwe,
>> * Uwe Brauer <oub@mat.ucm.es> [2020-12-10 22:45]:
> 
>> (require 'dired-x)
> 
>> (defun dired-to-org-links ()
>>   "Generates Org links for Dired files and stores in memory. Yank
>> it in other buffer"
>>   (interactive)
>>   (let* ((files (dired-get-marked-files)))
>>     (when files
>>       (kill-new
>>        (with-temp-buffer
>> 	 (dolist (file files)
>> 	   (let* ((base (file-name-nondirectory file))
>> 		  (link (format "[[file:%s][%s]]\n" file base)))
>> 	     (insert link)))
>> 	 (buffer-string))))))
> 
> Thanks, that is very nice.
> I played a bit around with org-fstree, that is also useful.

Indeed, nice function!

And what great and fast service!  :)

If I may be permitted to pick a nit; Uwe, you may want to prefix the
function with `my-` or `uwe-` or your initials, etc. for namespace
reasons.  Unless of course this is something Jean Louis is planning on
submitting as a patch to dired itself... ;)

Cheers,
TRS-80


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

* Re: from dired to an org file with list of files with links
  2020-12-11 16:14     ` TRS-80
@ 2020-12-13 15:46       ` Jean Louis
  0 siblings, 0 replies; 6+ messages in thread
From: Jean Louis @ 2020-12-13 15:46 UTC (permalink / raw)
  To: TRS-80; +Cc: emacs-orgmode

* TRS-80 <lists.trs-80@isnotmyreal.name> [2020-12-11 19:21]:
> On 2020-12-11 03:09, Uwe Brauer wrote:
> > > Dear Uwe,
> > > * Uwe Brauer <oub@mat.ucm.es> [2020-12-10 22:45]:
> > 
> > > (require 'dired-x)
> > 
> > > (defun dired-to-org-links ()
> > >   "Generates Org links for Dired files and stores in memory. Yank
> > > it in other buffer"
> > >   (interactive)
> > >   (let* ((files (dired-get-marked-files)))
> > >     (when files
> > >       (kill-new
> > >        (with-temp-buffer
> > > 	 (dolist (file files)
> > > 	   (let* ((base (file-name-nondirectory file))
> > > 		  (link (format "[[file:%s][%s]]\n" file base)))
> > > 	     (insert link)))
> > > 	 (buffer-string))))))
> > 
> > Thanks, that is very nice.
> > I played a bit around with org-fstree, that is also useful.
> 
> Indeed, nice function!
> 
> And what great and fast service!  :)
> 
> If I may be permitted to pick a nit; Uwe, you may want to prefix the
> function with `my-` or `uwe-` or your initials, etc. for namespace
> reasons.  Unless of course this is something Jean Louis is planning on
> submitting as a patch to dired itself... ;)

It is more Org related. In my opinion all built-in Org hyperlink types
should be already integrated in Org, probably also this is integrated.

The org-store-link actually works in Dired.

The org-insert-last-link works to put link into buffer

So it is just iteration missing.





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

end of thread, other threads:[~2020-12-13 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10 19:44 from dired to an org file with list of files with links Uwe Brauer
2020-12-10 20:36 ` [one pkf found] (was: from dired to an org file with list of files with links) Uwe Brauer
2020-12-10 21:04 ` from dired to an org file with list of files with links Jean Louis
2020-12-11  8:09   ` Uwe Brauer
2020-12-11 16:14     ` TRS-80
2020-12-13 15:46       ` Jean Louis

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git