Re: Viewing link information
2020-10-30 Russell Adams wrote: Are there other ways to view information about an org link that I don't list below? ... Are there ways to see this information live while navigating? Maybe on the modeline, or messages? C-h . Displaying links in minibuffer is regularly discussed here. E.g. the following message has a link to an older thread therein https://orgmode.org/list/rjddg8$c9f$1...@ciao.gmane.io/ Sometimes I think of something like footnotes or margin notes representation for links in the visible part of the buffer. Unsure however if it would be really convenient and feasible. Unlike with literal links option, long URLs should not distort paragraphs but no additional action is required to view link target.
Re: worg changes
Thanks. I pushed. The docs for java are here [1]. It looks like many of the language pages don't pick up their formatting. Mine did the same at first. Is it fine if I fix them? The =#+HTML_HEAD:= property breaks them. I suspect that it's existence blocks the page from picking up the default css. Also It points to an html id that doesn't exist, so it would have no effect. [1] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-java.html On Fri, Oct 30, 2020 at 12:40 AM Kyle Meyer wrote: > ian martins writes: > > > I've written some documentation for ob-java for worg. Should I submit a > > patch or is it fine to just push? it doesn't modify any existing files. > > It's fine to just push. >
Bug: problem caused by eval-after-load "speedbar" [9.3 (release_9.3 @ c:/ProgramData/chocolatey/lib/Emacs/tools/emacs/share/emacs/27.1/lisp/org/)]
Hello, I was getting the following error on emacs startup: Symbol’s function definition is void: speedbar-add-supported-extension I tracked it down to the form in org-compat.el (line 873 in my copy): (eval-after-load "speedbar" ...) This condition was being triggered because in my emacs init, I was loading a file called "speedbar.el" which contained my speedbar configuration. I will understand if this is not considered a bug, because I can (and have) rename my speedbar configuration script to a different filename. However, I noticed that 'eval-after-load can take either a filename or a feature symbol as its argument. If the string "speedbar" were changed to the symbol 'speedbar, the eval form would be triggered by speedbar's 'provide form, not only loading a file that happened to be called "speedbar.el" Thank you, -John Emacs : GNU Emacs 27.1 (build 1, x86_64-w64-mingw32) of 2020-08-21 Package: Org mode version 9.3 (release_9.3 @ c:/ProgramData/chocolatey/lib/Emacs/tools/emacs/share/emacs/27.1/lisp/org/) current state: == (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-link-shell-confirm-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-adapt-indentation nil org-babel-pre-tangle-hook '(save-buffer) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-occur-hook '(org-first-headline-recenter) org-agenda-window-setup 'current-window org-log-into-drawer t org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-todo-keywords '((sequence "TODO(t!)" "STARTED(s!)" "|" "DONE(d!)" "CANCELLED(c!)") (sequence "QUESTION(q!)" "|" "ANSWERED(a!)")) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-open-link :export org-attach-export-link :complete org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow eww :store org-eww-store-link) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export) ("info" :follow org-info-open :export org-info-export :store org-info-store-link) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[257 "\301\300\302 Q!\207" ["news" browse-url ":"] 5 "\n\n(fn URL)"]) ("mailto" :follow #[257 "\301\300\302 Q!\207" ["mailto" browse-url ":"] 5 "\n\n(fn URL)"] ) ("https" :follow #[257 "\301\300\302 Q!\207" ["https" browse-url ":"] 5 "\n\n(fn URL)"]) ("http" :follow #[257 "\301\300\302 Q!\207" ["http" browse-url ":"] 5 "\n\n(fn URL)"]) ("ftp" :follow #[257 "\301\300\302 Q!\207" ["ftp" browse-url ":"] 5 "\n\n(fn URL)"]) ("help" :follow org-link--open-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp) ("doi" :follow org-link--open-doi)) org-log-states-order-reversed
Re: org-sort-entries sorting by top-level with first entry at bob
yes, you understood my points. if you already understood them and they are not useful to you, then please disregard them. On 10/30/20, Gustavo Barros wrote: > Hi Samuel, > > On Fri, 30 Oct 2020 at 17:43, Samuel Wales wrote: > >> i always have everyting under a top level, so taht files are trees not >> forests and org can work treeishly even at toplevel. > > This would be a workaround, not a solution. Is it a formal requirement > of Org that files must be kept in this form? > >> but to not use >> the mark, typically you supply point-min and point-max to some >> function. > > `org-sort-entries' does not take beg/end as arguments, it uses the > active region, as reported. > > Regards, > Gustavo. > > > > > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
Re: org-sort-entries sorting by top-level with first entry at bob
Hi Samuel, On Fri, 30 Oct 2020 at 17:43, Samuel Wales wrote: i always have everyting under a top level, so taht files are trees not forests and org can work treeishly even at toplevel. This would be a workaround, not a solution. Is it a formal requirement of Org that files must be kept in this form? but to not use the mark, typically you supply point-min and point-max to some function. `org-sort-entries' does not take beg/end as arguments, it uses the active region, as reported. Regards, Gustavo.
Re: org-sort-entries sorting by top-level with first entry at bob
i always have everyting under a top level, so taht files are trees not forests and org can work treeishly even at toplevel. but to not use the mark, typically you supply point-min and point-max to some function. major changes to o-s-r migth not be needed, merely that. On 10/30/20, Gustavo Barros wrote: > Hi All, > > `org-sort-entries' provides no easy way to sort by top-level when the > first entry is at the beginning of buffer. This is true for both > interactive and non-interactive uses of the function, but a little more > inconvenient in the latter case. > > Indeed, `org-sort-entries', when deciding what to sort, first tests for > `org-region-active-p', then `org-at-heading-p' (or if after a heading), > failing those tests, it falls back to top-level sorting. However, if > the first heading is at the beginning of buffer and we want to sort by > top-level, we'll never get to the fall back case, because > `org-at-heading-p' will return non-nil, and the children of the first > entry will be sorted instead. > > Not an ECM, just an use case with the situation at hand. Consider a > buffer with contents: > > #+begin_src org > ,* B Foo > ,** B Baz > ,** A Foo > ,* A Bar > #+end_src > > How to sort by top-level? > > The currently existing alternative is to `mark-whole-buffer', and let > `org-sort-entries' sort by region. While this is reasonable in the > interactive case, it is less so if `org-sort-entries' is being called in > code. Using `mark-whole-buffer' in your code will grant you a nice > compiler warning and pretending you don't use it by doing the same thing > yourself is explicitly advised against in its docstring: "it is usually > a mistake for a Lisp function to use any subroutine that uses or sets > the mark". Behind the scenes, Org is using `use-region-p', which means > the region must not only exist but transient-mark-mode must be on and > the mark must be active. It can be made to work, of course, but it is > clearly less than ideal. Either way, currently the only way to ensure > that sorting is done by top-level when you don't know whether there is > something before the first heading (including possible narrowing) is to > rely on the region case. > > What to do with it is somewhat tricky, though. My first thought was to > test if we are actually looking at a heading regexp, and sort on the > heading's level in this case. But, on second thought, I believe this is > not a good idea, because it will conflict with current and expected > behavior for speed-keys, in particular. Perhaps test if point is at > beginning of buffer, and handle this case specially? > > > Best regards, > Gustavo. > > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
Re: Viewing link information
Russell, > Are there other ways to view information about an org link that I > don't list below? i'll admit, this is how i do it: position cursor just before link, right arrow, C-d: having deleted the initial '[', the rest is revealed. then, C-_ to undo.
Re: Viewing link information
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
Viewing link information
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? -- Russell Adamsrlad...@adamsinfoserv.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint:1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
org-sort-entries sorting by top-level with first entry at bob
Hi All, `org-sort-entries' provides no easy way to sort by top-level when the first entry is at the beginning of buffer. This is true for both interactive and non-interactive uses of the function, but a little more inconvenient in the latter case. Indeed, `org-sort-entries', when deciding what to sort, first tests for `org-region-active-p', then `org-at-heading-p' (or if after a heading), failing those tests, it falls back to top-level sorting. However, if the first heading is at the beginning of buffer and we want to sort by top-level, we'll never get to the fall back case, because `org-at-heading-p' will return non-nil, and the children of the first entry will be sorted instead. Not an ECM, just an use case with the situation at hand. Consider a buffer with contents: #+begin_src org ,* B Foo ,** B Baz ,** A Foo ,* A Bar #+end_src How to sort by top-level? The currently existing alternative is to `mark-whole-buffer', and let `org-sort-entries' sort by region. While this is reasonable in the interactive case, it is less so if `org-sort-entries' is being called in code. Using `mark-whole-buffer' in your code will grant you a nice compiler warning and pretending you don't use it by doing the same thing yourself is explicitly advised against in its docstring: "it is usually a mistake for a Lisp function to use any subroutine that uses or sets the mark". Behind the scenes, Org is using `use-region-p', which means the region must not only exist but transient-mark-mode must be on and the mark must be active. It can be made to work, of course, but it is clearly less than ideal. Either way, currently the only way to ensure that sorting is done by top-level when you don't know whether there is something before the first heading (including possible narrowing) is to rely on the region case. What to do with it is somewhat tricky, though. My first thought was to test if we are actually looking at a heading regexp, and sort on the heading's level in this case. But, on second thought, I believe this is not a good idea, because it will conflict with current and expected behavior for speed-keys, in particular. Perhaps test if point is at beginning of buffer, and handle this case specially? Best regards, Gustavo.
Re: Org-Mode as DSL
Eric S Fraga writes: It's not a crazy idea but one which misses one of the best features of org mode: it is part of Emacs. For me, a markup language is not so exciting: we have plenty of them. What makes org mode powerful is that it is infinitely customizable by being part of Emacs. I can add code, change existing code, advice code, etc. The org I use is not the org others use, as a result. I have wondered whether it might be viable to create a LSP client by putting Emacs /inside/ the LSP client. Checking ~ls -lh /usr/bin/emacs-nox~ I am told that my terminal-only Emacs client is 5.3 MiB. This seems nice and small. Hence, any and all concerns about feature parity etc. are completely resolved. One 'just' needs to implement the bindings and piping (as opposed to the whole shebang). Maybe this is the real 'crazy idea' in this thread :P Hopefully it's of some interest :) All the best, Timothy.
Re: Reply-All noise
On Friday, 30 Oct 2020 at 12:30, Russell Adams wrote: > Welcome to the next stage of Eternal September. ;-) $ sdate Fri 9922 Sep 11:58:07 GMT 1993 $ -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-61-ga88806.dirty
Re: Org-Mode as DSL
On Thursday, 29 Oct 2020 at 22:12, Mauro Mandracchia wrote: > Is it a crazy idea if Org-Mode could become a DSL rather than a mode for > emacs? It's not a crazy idea but one which misses one of the best features of org mode: it is part of Emacs. For me, a markup language is not so exciting: we have plenty of them. What makes org mode powerful is that it is infinitely customizable by being part of Emacs. I can add code, change existing code, advice code, etc. The org I use is not the org others use, as a result. But I'm sure many would love to have org markup understood in many more tools. My own approach is to ensure I have Emacs with me wherever I go. Hence my obsession with palmtop computers... ;-) -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-61-ga88806.dirty
Re: Reply-All noise
On Fri, Oct 09, 2020 at 10:10:41PM +0200, to...@tuxteam.de wrote: > For mailing lists which allow posting by non-subscribers (this is one), Org-mode is a subscriber only mailing list. It does not allow non-members to post for spam prevention. If you did not have to subscribe to the mailing list when you started posting to it, then you likely had your message manually accepted by a volunteer moderator and they added you to the subscriber list. Email etiquette is something that has been declining over time. Welcome to the next stage of Eternal September. -- Russell Adamsrlad...@adamsinfoserv.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint:1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
S-left / S-right with (double) prefix C-u without scheduled time (only date)
Hi list, i often use shift with left or right arrow keys to change the date in org-(super-)agenda. These key combinations can be used with prefix C-u and double prefix C-u C-u. In my setup in org 9.4 the behaviour is like this for a scheduled date without scheduled time (for example SCHEDULED: <2020-10-27>: C-u S-left: Date changes to date before (26th) C-u S-right: Date does not change C-u C-u S-left: Date changes to date before (26th) C-u C-u: S-right: Date does not change I would prefer this behaviour instead (my proposal): C-u S-left: Add a default time (e.g. 6:00) C-u S-right: Add a default time (e.g. 6:00) C-u C-u S-left: Add a default time (e.g. 6:00) C-u C-u: S-right: Add a default time (e.g. 6:00) Scheduled date+time Timestamps can afterwards be changed as expected with C-u prefix(es). What I found out until now: ( org-schedule nil "12:00" ) adds a time 12:00 to a SCHEDULED date property. (if (< (length (org-entry-get nil "SCHEDULED")) 16) (print 'scheduled_time_missing) (print 'scheduled_time_existent)) org-timestamp-has-time-p: could maybe better be used instead for finding out if time is not present. I think this would be a better default behaviour or the current behaviour might even be a bug. Thanks, Martin :)
Re: Inconsistency between code and manual: org-lowest-priority or org-priority-lowest
On 30/10/2020 05:57, Kyle Meyer wrote: > Daniele Nicolodi writes: > >> Hello, >> >> I found an inconsistency between the manual and implementation: the >> Priorities section says that the range of valid priorities can be set >> modifying the `org-priority-highest', `org-priority-lowest' and >> `org-priority-default' variables. However, in the code the variables >> names are `org-highest-priority', `org-lowest-priority' and >> `org-default-priority'. >> >> In can submit a patch with a fix. However, in a case like this, should >> the code modified to match the documentation, or vice-versa? > > The org-X-priority -> org-priority-X rename happened in v9.4, with > org-X-priority names retained as aliases. So, it sounds like there are > some leftover bits in the code. You are absolutely right. This is what you get when you read the manual for the latest version but look at the code for an old one... Cheers, Dan
Re: [PATCH] add new link type "contact:" for org-contacts.el
Accidentally pressed send button without email body. Hope org-contacts.el author can review this patch. [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Fri, Oct 30, 2020 at 3:35 PM stardiviner wrote: > > > [stardiviner] GPG key ID: 47C32433 > IRC(freeenode): stardiviner Twitter: @numbchild > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 > Blog: http://stardiviner.github.io/ >
[PATCH] add new link type "contact:" for org-contacts.el
[stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ From 18b12dac615085e4c55029568b65c30b17ec5189 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Fri, 30 Oct 2020 15:11:53 +0800 Subject: [PATCH] org-contacts.el: Add new link type "contact:" * contrib/lisp/org-contacts.el (org-contacts-link-store): Store a link of org-contacts in Org file. * contrib/lisp/org-contacts.el (org-contacts-link-open): Open contact: link in Org file. * contrib/lisp/org-contacts.el (org-contacts-link-complete): Insert a contact: link with completion of contacts. * contrib/lisp/org-contacts.el (org-contacts-link-face): Set different face for contact: link. --- contrib/lisp/org-contacts.el | 66 1 file changed, 66 insertions(+) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 4b3693a0e..851802916 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -1146,6 +1146,72 @@ (defun org-contacts-split-property (string &optional separators omit-nulls) (setq proplist (cons bufferstring proplist (cdr (reverse proplist +;;; Add an Org link type `contact:' for easy jump to or searching org-contacts headline. +;;; link spec: [[contact:query][desc]] +(org-link-set-parameters "contact" + :follow 'org-contacts-link-open + :complete 'org-contacts-link-complete + :store 'org-contacts-link-store + :face 'org-contacts-link-face) + +(defun org-contacts-link-store () + "Store the contact in `org-contacts-files' with a link." + (when (eq major-mode 'org-mode) +;; (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files)) +(let ((headline-str (substring-no-properties (org-get-heading t t t t + (org-store-link-props + :type "contact" + :link headline-str + :description headline-str + +(defun org-contacts--all-contacts () + "Return an alist (name . (file . position)) of all contacts in `org-contacts-files'." + (car (mapcar + (lambda (file) + (unless (buffer-live-p (get-buffer (file-name-nondirectory file))) + (find-file file)) + (with-current-buffer (get-buffer (file-name-nondirectory file)) + (org-map-entries + (lambda () + (let ((name (substring-no-properties (org-get-heading t t t t))) + (file (buffer-file-name)) + (position (point))) + `(:name ,name :file ,file :position ,position)) + org-contacts-files))) + +(defun org-contacts-link-open (path) + "Open contacts: link type with jumping or searching." + (let ((query path)) +(cond + ((string-match "/.*/" query) + (let* ((f (car org-contacts-files)) + (buf (get-buffer (file-name-nondirectory f + (unless (buffer-live-p buf) (find-file f)) + (with-current-buffer buf + (string-match "/\\(.*\\)/" query) + (occur (match-string 1 query) + (t + (let* ((f (car org-contacts-files)) + (buf (get-buffer (file-name-nondirectory f + (unless (buffer-live-p buf) (find-file f)) + (with-current-buffer buf + (goto-char (marker-position (org-find-exact-headline-in-buffer query) + +(defun org-contacts-link-complete (&optional arg) + "Create a org-contacts link using completion." + (let ((name (completing-read "Contact Name: " + (mapcar +(lambda (plist) (plist-get plist :name)) +(org-contacts--all-contacts) +(concat "contact:" name))) + +(defun org-contacts-link-face (path) + "Different face color for different org-contacts link query." + (cond + ((string-match "/.*/" path) +'(:background "sky blue" :overline t :slant 'italic)) + (t '(:background "green yellow" :underline t + (provide 'org-contacts) ;;; org-contacts.el ends here -- 2.28.0