From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ELjdJ59BnF++MAAA0tVLHw (envelope-from ) for ; Fri, 30 Oct 2020 16:38:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4Bu9I59BnF/rcwAA1q6Kng (envelope-from ) for ; Fri, 30 Oct 2020 16:38:55 +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 356AF94051B for ; Fri, 30 Oct 2020 16:38:55 +0000 (UTC) Received: from localhost ([::1]:56668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYXQT-0002m4-I3 for larch@yhetil.org; Fri, 30 Oct 2020 12:38:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYXPn-0002ik-Ur for emacs-orgmode@gnu.org; Fri, 30 Oct 2020 12:38:11 -0400 Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:36924 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYXPm-0002NU-9u for emacs-orgmode@gnu.org; Fri, 30 Oct 2020 12:38:11 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kYXPh-0003R4-Gd for emacs-orgmode@gnu.org; Fri, 30 Oct 2020 17:38:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Garjola Dindi Subject: Re: Viewing link information Date: Fri, 30 Oct 2020 17:38:00 +0100 Message-ID: <874kmb7jpz.fsf@pc-117-162.ovh.com> References: <20201030161437.GE28730@maokai> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:sV+JhC7En2w+M40xC4vG5RJj32g= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 12:29:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.51 X-TUID: f2oIftp8vd3R On Fri 30-Oct-2020 at 17:14:37 +01, Russell Adams wrote: > Are there other ways to view information about an org link that I > don't list below? > > - M-x org-insert-link, the prompts for link and description show the > current values. Requires interacting with the prompts. > > - Switch to fundamental mode > > - M-x org-toggle-link-display > > Are there ways to see this information live while navigating? Maybe on > the modeline, or messages? > I have this in my init file. I don't remember where I got it from. It displays the link target in the minibuffer when point is on a link. #+BEGIN_SRC emacs-lisp (defvar my/org-link-target-message-timer nil "Variable to store the link message timer in.") (defun my/org-link-target-show-link-messages () "Turn on link messages. You will see a message in the minibuffer when on an org link." (interactive) (or my/org-link-target-message-timer (setq my/org-link-target-message-timer (run-with-idle-timer 0.5 t 'my/org-link-target-link-message) my/org-link-target-show-link-on-enter t))) (defun my/org-link-target-cancel-link-messages () "Stop showing messages in minibuffer when on a link." (interactive) (cancel-timer my/org-link-target-message-timer) (setq my/org-link-target-message-timer nil my/org-link-target-show-link-on-enter nil)) (setq my/org-link-target-show-link-on-enter t) (when my/org-link-target-show-link-on-enter (my/org-link-target-show-link-messages)) (defun my/org-link-target-link-message () "Print a minibuffer message about the link that point is on." (interactive) ;; the way links are recognized in org-element-context counts blank ;; spaces after a link and the closing brackets in literal links. We ;; don't try to get a message if the cursor is on those, or if it is ;; on a blank line. (when (not (or (looking-at " ") ;looking at a space (lookinpg-at "^$") ;looking at a blank line (looking-at "]") ;looking at a bracket at the end ;looking at the end of the line. (looking-at "$"))) (save-restriction (widen) (when (eq major-mode 'org-mode) (let* ((object (org-element-context)) (type (org-element-property :type object)) (link-content (org-element-property :path object))) (save-excursion (when (-contains? '("http" "https" "file") type) (message "%s:%s" type link-content)))))))) #+END_SRC