From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6HWrCoocnWHIFAEAgWs5BA (envelope-from ) for ; Tue, 23 Nov 2021 17:53:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yGQnBoocnWGUagAAbx9fmQ (envelope-from ) for ; Tue, 23 Nov 2021 16:53:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ADCE3272A6 for ; Tue, 23 Nov 2021 17:53:29 +0100 (CET) Received: from localhost ([::1]:46234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpZ2u-0001MK-Rl for larch@yhetil.org; Tue, 23 Nov 2021 11:53:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpZ2J-0001Ly-SX for emacs-orgmode@gnu.org; Tue, 23 Nov 2021 11:52:51 -0500 Received: from mout01.posteo.de ([185.67.36.65]:36343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpZ2H-0006VK-2O for emacs-orgmode@gnu.org; Tue, 23 Nov 2021 11:52:51 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id BAF6E240026 for ; Tue, 23 Nov 2021 17:52:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1637686364; bh=go81/pKCInnRCx4ChClXK9A1DWkZk6UacDUchxF9CAQ=; h=From:To:Subject:Date:From; b=fDdn0meVDBu5Xya+29gXzprvuFblFhjWM3enEkvRz6fWgSjhCVNqj2VJtaKyg+rFi SCunmwcWk2Az5Xjia6ssxdFjfjcVhETOdmHzbiz3GFFqdArfznepihObZoGxIFDflC 87UEOKrhZx9eGuCboQIc1OYpfRvl27T2vBnFKKR7ImWjHsHKIzuEJvcPZtUkY77xOu VrkbDDk6MXJ95aVcA7Ab9XjeV6xc30Ny9bIKm68iL1od5+DLLwLtWmCkWrLFs7KlAP unzO1aAuszEFG9UBFR6ZhqFEHTnbFleGaL/91HWRYixE9nhmtC5RmbNcIjNzQ8zV8l iLtU6Sa2CXaxA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Hz9DX1rvyz6tn2 for ; Tue, 23 Nov 2021 17:52:44 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: Dired images in an Org buffer Date: Tue, 23 Nov 2021 16:52:42 +0000 Message-ID: <87ilwihl0l.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637686409; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=I/oqb+FRMlgcFkW6MSX2SoWqlwbMNlLZKAEqF8rsIoo=; b=f+JOSEuFhDqN6ZQi6v4+WYe1v14dDXRv0ScPH7POhzaA0IdgRO7x+qjBlb0EYiFl3ENBb3 vg4LAVmnsoC47Bdh+oSIvwKu5QX6qcdMXtvKK6BEaM3s5a/D6eA0RQfgY4ZT2i9mpGVhxl aq/1gG+gS4fLkkgCGNT4QZaU1GFe5WTTT8Hq2FhnzHgFjHw4PzV5K2Dk5/l393+JoGSYDW BuDb9stygzjjlfJD+fQ6/KMgoLn9j6yiR00t05a1IZs960+AMP2LZAxkD7rRU800amaGpm iueB6+d5Eex7FrB3owdWFPhabSwShpoO28CLLFwiTO+Lx4IGjSthksLs/anrkg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637686409; a=rsa-sha256; cv=none; b=sC1MZKjiOi06mR2aLV8luwXqjC1rBAEB3ZfOq4Yqh9WoP1NwikTFZwy5WMX3icXSnEYdo0 GouI6f0EKpRgUJncRX0T7F/0FzqehYsdSz8yQzSi/+tLrdcDugsTwJJbtuHbE7ltDAunz6 ddDTIy2BoDyljtinLXl/m55ppXA6d1MuK3Yopwd7BBVx01DlDlegRQZNTs2qAH61YqWb6Z JtfrMMM5mODi3vXfrIPIc4/lgOAakW3KMJsDHQffO/wzylQF3GZN9cmEcBsLbALHS5xdci +DD8rHbklmg+yTP3Rh0AYVF4X1eQOGlZneb6YnXKdZnLMZLxqvj2PwhgJ4arAw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fDdn0meV; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.29 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fDdn0meV; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: ADCE3272A6 X-Spam-Score: -4.29 X-Migadu-Scanner: scn0.migadu.com X-TUID: Gwb3F1JaENdk Hi, I don't like image-dired thumbnails, so I wrote this function to preview all images in a directory in an Org buffer. I share it here, in case it is useful to someone: #+begin_src emacs-lisp (defun my-org-img-dired-preview () (interactive) (if (not (derived-mode-p 'dired-mode)) (error "not in dired") (let* ((dir-name default-directory) (buf (concat "*" dir-name "--images *"))) (setq my-img-dired-list nil) (save-excursion (goto-char (point-min)) (while (re-search-forward "\\.png\\|\\.jpg\\|\\.tif" nil t) (let* ((img-path (dired-get-filename))) (add-to-list 'my-img-dired-list img-path t)))) (when (get-buffer buf) (kill-buffer buf)) (get-buffer-create buf) (set-buffer buf) (org-mode) (let ((img-list (mapconcat (lambda (el) (let ((link (concat "[[file:" el "]]"))) link)) my-img-dired-list "\n\n")) (img-num (number-to-string (length my-img-dired-list)))) (insert (concat "* Images in " dir-name "\n\n")) (insert (concat img-num " files:\n\n")) (insert img-list) (org-toggle-inline-images)) (pop-to-buffer buf) (beginning-of-buffer)))) (with-eval-after-load 'dired (define-key dired-mode-map (kbd "P") 'my-org-img-dired-preview)) #+end_src Best regards, Juan Manuel