emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Maxim Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: bug#42484: org-mode should display value of links in mini-buffer
Date: Thu, 10 Sep 2020 15:30:22 -0700	[thread overview]
Message-ID: <CAJcAo8uwJESZXKPB_aNuV=5v1i3biVxnFu-Tg+7Zw8jHseYHgw@mail.gmail.com> (raw)
In-Reply-To: <rjddg8$c9f$1@ciao.gmane.io>

the problem for eldoc for me is that for some reason it gets pretty
confusing trying to implement lots of things all at once, at least
when emacs is already using it for something, or so.

here is my current jumble of code.  it does work.  and has comments
but idk if it is of any use.  or even understandable to anybody.

one other use for it that i have not gotten to in yeras but woulkd be
good is to have hovering over timestamps show you the number of days
from now to that timestamp.

so lots of uses for eldoc.

;; hover text
(with-no-warnings
  (if (< emacs-major-version 24)
      (setq tooltip-use-echo-area t)
    (tooltip-mode -1)))

(unless (version< emacs-version "25")
  ;; i find this annoying in at least elisp, and prefer my
  ;; function enabled in elisp, which does interesting things for
  ;; org-link-minor-mode.  emacs 25 enables this by default.  it
  ;; might be itneresting to see where eldoc is useful.
  (global-eldoc-mode -1))
;; make pointer emit help-echo
;;   over org links
;; (setq eldoc-idle-delay 8.0)
;; (setq eldoc-idle-delay 0.0)
;; (add-hook 'prog-mode-hook 'eldoc-mode)
;; [[http://google.com][test]]
;; fixme why does this not work in either org or elisp?
;;   because there is no help-echo
;;   fixme add help-echo
;; [2017-01-16 Mon 12:48]
;; fixme why does this work on links in elisp without this hook?
;; (add-hook 'prog-mode-hook 'alpha-eldoc-help-echo-mode)
;; (add-hook 'org-link-minor-mode-hook 'alpha-eldoc-help-echo-mode)
(add-hook 'org-mode-hook 'alpha-eldoc-help-echo-mode)
;; in elisp we might want both link eldoc and elisp eldoc
;;   we also want org ts eldoc
(defun hoka-eldoc-help-echo-at-point ()
  "Eldoc thingy for help-echo text properties.
This works for links, should work for tses in at least
org-link-minor mode and org mode, and is/was broken by emacs 25
enabling eldoc at some point.  Fixing these things one by one."
  ;; does this mean we do this every movement?
  ;;   apparently eldoc does
  (let ((val
         (or (get-text-property (point) 'help-echo)
             ;; fixme if at a timestamp (alpha-eldoc-time-span)
             ;; adding help echo time span to every timestamp
             ;;     seems like it would require org
             ;; ;; (add-hook 'alpha-eldoc-non-help-echo-hook
'alpha-eldoc-timestamp-hook)
             ;; (run-hooks alpha-eldoc-non-help-echo-hook)
             )))
    val))
;; (alpha-eldoc-help-echo-mode)
(defun alpha-eldoc-help-echo-mode ()
  "Enable eldoc mode with e.g. org links to display in minibuffer
when cursor is over them.  Call in the relevant buffer.  M-x
eldoc-mode to turn off.  /Add this to mode hooks/."
  (interactive)
  (eval-when-compile (require 'eldoc))
  (setq-local eldoc-documentation-function 'hoka-eldoc-help-echo-at-point)
  (eldoc-mode))




On 9/10/20, Maxim Nikulin <manikulin@gmail.com> wrote:
> 06.09.2020 21:18, Kévin Le Gouguec wrote:
>>> Boruch Baum <boruch_baum@gmx.com> writes:
>>>
>>>> In org-mode, when POINT is moved over an org-mode link, wouldn't it be
>>>> reasonable for the value of that link to appear in the mini-buffer? The
>>>> advantage of that is the user would know where the link points and what
>>>> would happen if the link is opened (eg. would an external program open,
>>>> would the network be queried).
>>
>> That would be very welcome, IMO.  FWIW, markdown-mode does that (when
>> markup is hidden) using ElDoc; cf. markdown-eldoc-function.
>
> There was a similar question in May. A message in the middle of that
> thread:
> https://orgmode.org/list/CAJ51ETo0x=ZRAV7LFuDVAp7D2Pz-DUHzCrUt+GUby0sLSSwi7w@mail.gmail.com/
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


      reply	other threads:[~2020-09-10 22:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06  9:03 [bzg@gnu.org: Re: bug#42484: 26.1: org-mode should display value of links in mini-buffer] Boruch Baum
2020-09-06 14:18 ` Kévin Le Gouguec
2020-09-10 14:33   ` bug#42484: org-mode should display value of links in mini-buffer Maxim Nikulin
2020-09-10 22:30     ` Samuel Wales [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJcAo8uwJESZXKPB_aNuV=5v1i3biVxnFu-Tg+7Zw8jHseYHgw@mail.gmail.com' \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).