Re: Regular expressions that describe most (?) org syntax ?
> On Oct 30, 2021, at 14:18, Ihor Radchenko wrote: > > Jean-Christophe Helary writes: > >> I am looking for a set of regular expressions that roughly describe most of >> the important org syntax. > > You need to study org-element.el starting from > `org-element--current-element'. Thank you Ihor ! Jean-Christophe
Re: Regular expressions that describe most (?) org syntax ?
Jean-Christophe Helary writes: > I am looking for a set of regular expressions that roughly describe most of > the important org syntax. > > A bit like > > @code\{[^\}]*\}|@command\{[^\}]*\} ... > > describes part of the texi code found in the Emacs manuals. > > I could figure something out, but I thought maybe there is already something > around… You need to study org-element.el starting from `org-element--current-element'. Best, Ihor
Regular expressions that describe most (?) org syntax ?
I am looking for a set of regular expressions that roughly describe most of the important org syntax. A bit like @code\{[^\}]*\}|@command\{[^\}]*\} ... describes part of the texi code found in the Emacs manuals. I could figure something out, but I thought maybe there is already something around… -- Jean-Christophe Helary @brandelune https://mac4translators.blogspot.com https://sr.ht/~brandelune/omegat-as-a-book/
Re: [BUG] org-element-cache-map calls native-comp-available-p without checking if it is bound first [9.5 (9.5-gf5faff @ /home/n/.emacs.d/straight/build/org/)]
No Wayman writes: > See: > https://www.reddit.com/r/emacs/comments/qil2qh/symbols_function_definition_is_void/ > > > For context: > >>(and (symbolp func) >> (native-comp-available-p) >> (fboundp 'subr-native-elisp-p) > > The check could be wrapped in a function to prevent this in the > future. e.g. Oops. Thanks for noticing. I genuinely thought that I had this check there. Fixed on main. Best, Ihor
[BUG] org-element-cache-map calls native-comp-available-p without checking if it is bound first [9.5 (9.5-gf5faff @ /home/n/.emacs.d/straight/build/org/)]
See: https://www.reddit.com/r/emacs/comments/qil2qh/symbols_function_definition_is_void/ For context: (and (symbolp func) (native-comp-available-p) (fboundp 'subr-native-elisp-p) The check could be wrapped in a function to prevent this in the future. e.g. (defun org-native-comp-available-p () (and (fboundp 'native-comp-available-p) (native-comp-available-p)))
[BUG] org-link-descriptive not honored as file-local-variable [9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/)]
Hi All, Currently, trying to set `org-link-descriptive' as file-local-variable is not honored by Org, and doing so, leads to one of mismatched states between `org-link-descriptive' and the invisibility specs. An ECM for it. Start ~emacs -Q~ and setup current Org: #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/elpa/org-9.5") #+end_src Visit =document.org= containing: #+begin_src org [[https://orgmode.org/][Org mode for Emacs]] # Local Variables: # org-link-descriptive: nil # End: #+end_src The default value of `org-link-descriptive' is t, and after visiting this file, the local variable is indeed set (inspect it, and it tells you it is nil). However, the links are still "descriptive", and `buffer-invisibility-spec' does contain `(org-link)'. Indeed, if at that point, you try `org-toggle-link-display', it will fail the first time, but work the second one. Possibly related threads: https://list.orgmode.org/87pmzdhl4b@kenko.localhost.com/ https://list.orgmode.org/orgmode/87lfeqzm3a@gmail.com/ Best regards, Gustavo. Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2021-03-25 Package: Org mode version 9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/) 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-reveal-start-hook '(org-decrypt-entry) 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-babel-pre-tangle-hook '(save-buffer) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-agenda-loop-over-headlines-in-active-region nil org-occur-hook '(org-first-headline-recenter) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-export-before-parsing-hook '(org-attach-expand-links) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow org-eww-open :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) ("doi" :follow org-link-doi-open :export org-link-doi-export) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[514 "\301\300\302Q\"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("mailto" :follow #[514 "\301\300\302Q\"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("https" :follow #[514 "\301\300\302Q\"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("http" :follow #[514 "\301\300\302Q\"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("ftp" :follow #[514 "\301\300\302Q\"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("help" :follow org-link--open-help :store org-link--store-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp)) org-link-elisp-confirm-function 'yes-or-no-p )
Re: tangle option to not write a file with same contents?
Max, > > i wonder if it would be reasonable to add an option such that, when > > tangling, `org-babel-tangle` would not write a file with the > > already-existing contents of the target file? > > Are you going to celebrate a decade of the feature request? > I agree with you, make is wide spread and fast tool that is really > convenient in simple cases. hah -- i should have waited a few weeks! > Some hash-based build systems are mentioned in that thread. Since that > time more more similar tools have appeared, e.g. buck, > reimplementations of DJB's redo https://cr.yp.to/redo.html i think different people will settle on different build tools. > It seems `compare-buffer-substrings` has more logic than just byte to > byte comparison. Is it to handle alternatives for unicode character > alternatives? For tangled buffer it should be size that is checked > first... you are right, it definitely makes sense to look first at size. (which is what, e.g., rsync(1) does.) also, probably i needn't have mentioned `compare-buffer-substrings` -- i was really just trying to suggest "simple" (which maybe i anti-did?). cheers, Greg
Re: [BUG] Source code of type 'conf' disappears in LaTeX export [N/A (N/A @ /usr/share/emacs/site-lisp/org-mode/)]
Aloha, Marc van der Sluys writes: Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. Thank you for the incredible orgmode software! I ran into this issue. When I have a block of 'code' from a configuration file, e.g. #+begin_src conf Host server HostName servername.domainname.org User username #+end_src it shows up nicely in emacs. However, when exporting to LaTeX and pdf using the Minted package, the code blocks go missing completely. The code is converted in LaTeX to \begin{minted}[]{conf} Host server HostName servername.domainname.org User username \end{minted} which disappears upon compilation because 'conf' is not one of the lexers recognised by Minted. Replacing 'conf' with 'aconf' (for Apache config) has the opposite result: no syntax highlighting in emacs orgmode, but acceptable output in LaTeX, because it is supported by Minted. A 'quick fix' could therefore be to either: 1) rename conf -> aconf when exporting orgmode to LaTeX, or 2) adding the syntax highlighting that is used for conf to source blocks of type aconf. Expected behaviour: + conf code block shows up in LaTeX/pdf with syntax highlighting after converting from orgmode to LaTeX/PDF. Actual behaviour: + conf code block completely disappears in PDF after converting from orgmode to LaTeX/PDF. Sincerely, Marc van der Sluys. Does org-latex-minted-langs help? All the best, Tom -- Thomas S. Dye https://tsdye.online/tsdye
Re: org-persist warning when archiving
> Ihor Radchenko writes: > Colin Baxter writes: >> Hi Ihor, >> >> My ECM is as follows. I'm using GNU-Linux and emacs-28.0.60. > Thanks! I was able to reproduce on my system. Should be fixed on > main via 9f87b1cc3. Yes, I can confirm the problem is fixed for me. Great! Thank you. Best wishes, Colin.
Re: tangle option to not write a file with same contents?
On 28/10/2021 11:04, Greg Minshall wrote: i wonder if it would be reasonable to add an option such that, when tangling, `org-babel-tangle` would not write a file with the already-existing contents of the target file? Are you going to celebrate a decade of the feature request? https://list.orgmode.org/orgmode/cafdswjtmzfzgrqqsftiqnt7c1ufe7hv4kek5j9akx1yadwz...@mail.gmail.com/T/#u Holger Hoefling @ 2011-11-18 13:17 UTC Not overwriting unchanged source code files when tangling this would be helpful, e.g., for those of us who use make(1)-based work flows. I agree with you, make is wide spread and fast tool that is really convenient in simple cases. Some hash-based build systems are mentioned in that thread. Since that time more more similar tools have appeared, e.g. buck, reimplementations of DJB's redo https://cr.yp.to/redo.html then, if this might generally be thought useful, i wonder if this should be implemented as specifically this, or whether we might implement a callback at the appropriate point in `org-babel-tangle` asking whether or not to proceed. (then, the user's callback routine could do the comparison.) if we do "specifically this", i would suggest that this comparison be dead simple: read in the existing file's contents into some hidden buffer, and use `compare-buffer-substrings` to compare point-{min,max} of both. Tom Gillespie mentioned that it is easy to lost modifications of tangled files created during debugging. https://list.orgmode.org/orgmode/CA+G3_PNo8i8U9rOrC8BBydjEv9=lkgtjbopwx9j6vynxdnj...@mail.gmail.com/T/#u I think, some header may be added to tangled file containing hash of rest part of file. So the file may be checked for user modifications before overwriting, that hash may be compared with the new buffer to keep existing file in place. It seems `compare-buffer-substrings` has more logic than just byte to byte comparison. Is it to handle alternatives for unicode character alternatives? For tangled buffer it should be size that is checked first...
Re: org-persist warning when archiving
Colin Baxter writes: > Hi Ihor, > > My ECM is as follows. I'm using GNU-Linux and emacs-28.0.60. Thanks! I was able to reproduce on my system. Should be fixed on main via 9f87b1cc3. Best, Ihor
[BUG] Source code of type 'conf' disappears in LaTeX export [N/A (N/A @ /usr/share/emacs/site-lisp/org-mode/)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. Thank you for the incredible orgmode software! I ran into this issue. When I have a block of 'code' from a configuration file, e.g. #+begin_src conf Host server HostName servername.domainname.org User username #+end_src it shows up nicely in emacs. However, when exporting to LaTeX and pdf using the Minted package, the code blocks go missing completely. The code is converted in LaTeX to \begin{minted}[]{conf} Host server HostName servername.domainname.org User username \end{minted} which disappears upon compilation because 'conf' is not one of the lexers recognised by Minted. Replacing 'conf' with 'aconf' (for Apache config) has the opposite result: no syntax highlighting in emacs orgmode, but acceptable output in LaTeX, because it is supported by Minted. A 'quick fix' could therefore be to either: 1) rename conf -> aconf when exporting orgmode to LaTeX, or 2) adding the syntax highlighting that is used for conf to source blocks of type aconf. Expected behaviour: + conf code block shows up in LaTeX/pdf with syntax highlighting after converting from orgmode to LaTeX/PDF. Actual behaviour: + conf code block completely disappears in PDF after converting from orgmode to LaTeX/PDF. Sincerely, Marc van der Sluys. Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.16.0) of 2021-10-01 Package: Org mode version N/A (N/A @ /usr/share/emacs/site-lisp/org-mode/) current state: == (setq org-duration-format 'h:mm org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-latex-listings 'minted org-columns-default-format "%ITEM(Task) %PRIORITY(Prio) %TODO(Status) %EFFORT(Effort) %CLOCKSUM(Clocked)" org-link-shell-confirm-function 'yes-or-no-p org-num-format-function 'org-num-default-format org-metadown-hook '(org-babel-pop-to-session-maybe) org-after-todo-statistics-hook '(org-summary-todo) org-global-properties '(("Effort_ALL" . "0 0:15 0:30 1:00 1:30 2:00 3:00 4:00 5:00 6:00 7:00 8:00")) org-agenda-tags-todo-honor-ignore-options t org-refile-targets '((nil :maxlevel . 1) (org-agenda-files :maxlevel . 1) ("GWs.org" :maxlevel . 2) ("HAN.org" :maxlevel . 2)) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-odt-format-headline-function 'org-odt-format-headline-default-function org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f") org-agenda-category-icon-alist '(("Gentoo" "/home/sluys/local/www/avatars/software_logos/Gentoo_logo_10.png" nil nil :ascent center) ("gcalMvdS" "/home/sluys/local/www/avatars/software_logos/google-logo-10.jpg" nil nil :ascent center) ("Email" "/home/sluys/local/www/avatars/software_logos/email-10b.jpg" nil nil :ascent center) ("calendar" "/home/sluys/local/www/avatars/software_logos/gcalendar-10a.png" nil nil :ascent center) ("Birgit" "/home/sluys/local/www/avatars/Birgit-Nero-10.jpg" nil nil :ascent center) ("Priv" "/home/sluys/local/www/avatars/Faces/marc_cool_10.jpg" nil nil :ascent center) ("RU" "/home/sluys/local/www/avatars/RUN-icon-10.png" nil nil :ascent center) ("Hack" "/home/sluys/local/www/avatars/AstroFloyd_icon_10.png" nil nil :ascent center) ("AstroC" "/home/sluys/local/www/avatars/software_logos/hwc-icon-10.png" nil nil :ascent center) ("Sky" "/home/sluys/local/www/avatars/software_logos/hwc-icon-10.png" nil nil :ascent center) ("GitHub" "/home/sluys/local/www/avatars/software_logos/GitHub-icon2-10.png" nil nil :ascent center) ("Git" "/home/sluys/local/www/avatars/software_logos/git-icon-10.png" nil nil :ascent center) ("HAN" "/home/sluys/local/www/avatars/HAN/HAN-logo-10.png" nil nil :ascent center)
Re: org-persist warning when archiving
Hi Ihor, My ECM is as follows. I'm using GNU-Linux and emacs-28.0.60. 1. Delete any existing org-persist directory. 2. mkdir ~/a 3. emacs -Q 4. Evaluate path to latest org-mode. I enter (add-to-list 'load-path (expand-file-name "~/path/to/git/org-mode/lisp")) in the scratch buffer and do C-j. 5. C-x C-f ~/test.org 6. Enter the following in test.org: * Test :PROPERTIES: :CATEGORY: Test :DESCRIPTION: Test :ARCHIVE: ~/a/%s_archive::datetree/* Test :LOG_INTO_DRAWER: LOGDRAWER :END: ** TODO archive test SCHEDULED: <2021-10-29 Fri> # Local Variables: # eval: (setq org-adapt-indentation t) # End: 7. Same the file and close down emacs in order to populate the or-persist directory. 8. emacs -Q 9. Evaluate path to latest org-mode, as before. 10. Open ~/test.org and make the TODO as DONE. 11. Save ~/test.org 12. I think I then closed down emacs and re-launched emacs to ensure org-persist noted the changes. I don't think this step is necessary. 13. With cursor on DONE do C-c C-x C-a to archive the item. 14. Item is archived to ~/a but with the warning: --8<---cut here---start->8--- Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting. If this warning appears regularly, please report it to Org mode mailing list (M-x org-submit-bug-report). The buffer is: test.org_archive Current command: org-archive-subtree-default Disable showing Disable logging Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting. If this warning appears regularly, please report it to Org mode mailing list (M-x org-submit-bug-report). The buffer is: test.org_archive Current command: org-archive-subtree-default Disable showing Disable logging Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting. If this warning appears regularly, please report it to Org mode mailing list (M-x org-submit-bug-report). The buffer is: test.org_archive Current command: org-archive-subtree-default Disable showing Disable logging --8<---cut here---end--->8--- 15. If the test is repeated but with :ARCHIVE: ~/a/%s_archive::datetree/* Test removed. Then we get the warning --8<---cut here---start->8--- Warning (emacs): org-element--cache: Unregistered buffer modifications detected. Resetting. If this warning appears regularly, please report it to Org mode mailing list (M-x org-submit-bug-report). The buffer is: test.org_archive Current command: org-archive-subtree-default Disable showing Disable logging --8<---cut here---end--->8--- It would appear that the local variables and the archive path are both conspiring to produce the warning. Best wishes, Colin.
Re: [BUG] Future repeated tasks marked done in Org Agenda don't show as done [9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/)]
Hi Ihor, On Fri, 29 Oct 2021 at 21:40, Ihor Radchenko wrote: Confirmed Thanks for checking and marking. Best, Gustavo.
Re: [BUG] Future repeated tasks marked done in Org Agenda don't show as done [9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/)]
Gustavo Barros writes: > The glitch is that some repeated tasks, when marked done in the Agenda, > show no visual feedback that the action has taken place, as usual, and > if you refresh the Agenda, they just vanish, which demonstrates the > action had indeed taken place in the agenda file, just not shown in the > Agenda buffer itself. And, as far as I can tell, this happens to > repeated tasks, scheduled in future. For tasks scheduled for today or > in the past, they appear to be done as expected. Confirmed Best, Ihor
[BUG] Future repeated tasks marked done in Org Agenda don't show as done [9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/)]
Hi All, I've been meeting a small glitch on the Agenda, which had been eluding me for some time, as it "sometimes works, sometimes doesn't", and I wasn't being able to recognize the rule for it. So I started keeping track of it a while, and I was thus able to come up with a ECM. I'm not sure the "rule" is the one I came up with, since it was based on inference, but I hope the ECM is reproducible. The glitch is that some repeated tasks, when marked done in the Agenda, show no visual feedback that the action has taken place, as usual, and if you refresh the Agenda, they just vanish, which demonstrates the action had indeed taken place in the agenda file, just not shown in the Agenda buffer itself. And, as far as I can tell, this happens to repeated tasks, scheduled in future. For tasks scheduled for today or in the past, they appear to be done as expected. The ECM runs as follows. Start ~emacs -Q~ and setup current Org and the agenda files: #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/elpa/org-9.5") (setq org-agenda-files '("~/test/agenda.org")) #+end_src Where =~/test/agenda.org= contains: #+begin_src org ,* TODO Foo (scheduled for yesterday) SCHEDULED: <2021-10-28 Thu +1w> ,* TODO Bar (scheduled for today) SCHEDULED: <2021-10-29 Fri +1w> ,* TODO Baz (scheduled for tomorrow) SCHEDULED: <2021-10-30 Sat +1w> #+end_src And note the dates relative to today are critical for the ECM to demonstrate what it intends to. So, if you try this out another day, shift the schedules as appropriate. Now, run ~M-x org-agenda~, then "a" to get to the default agenda. And mark each of these tasks done with "t". "Foo" and "Bar" appear as "DONE", as usual and expected. "Baz" does not. Refresh the agenda, and see they are indeed all gone from this week's view (hence marked done in the actual file). And indeed, with "f" we see they are there next week. Best regards, Gustavo. Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2021-03-25 Package: Org mode version 9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/) 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-agenda-files '("~/test/agenda.org") 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-babel-pre-tangle-hook '(save-buffer) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-agenda-loop-over-headlines-in-active-region nil org-occur-hook '(org-first-headline-recenter) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-export-before-parsing-hook '(org-attach-expand-links) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow org-eww-open :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) ("doi" :follow org-link-doi-open :export org-link-doi-export) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[514 "\301\300\302Q\"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
[PATCH] oc-basic: add shorten-name function
While I'm at it, here's a followup to the "date" patch that adds a little function to shorten author names, and uses it for the "plain" entry output. This is a simple function ATM; it only strips given names from personal names, and is only used on the "plain" entry output. But it should be easily extended to handle, for example, initializing given names. I'm still waiting to hear back from FSF, but I think the LOC should be small enough? Bruce PS - I assume here it's better as a separate thread rather than replying to the earlier one; is that correct? From c1b634f5c8a31ad98f7453b77fd45ab9322f9cf2 Mon Sep 17 00:00:00 2001 From: Bruce D'Arcus Date: Fri, 29 Oct 2021 08:42:27 -0400 Subject: [PATCH] oc-basic: Add function to shorten names * lisp/oc-basic.el (org-cite-basic--shorten-names): new function to shorten author names * lisp/oc-basic.el (org-cite-basic--print-entry): shorten author name list for the "plain" output style --- lisp/oc-basic.el | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el index 1c5634341..2000dafeb 100644 --- a/lisp/oc-basic.el +++ b/lisp/oc-basic.el @@ -309,6 +309,19 @@ non-nil." (org-export-raw-string value) value))) +(defun org-cite-basic--shorten-names (names) + "Return a list of family names from a list of full NAMES. + +To better accomomodate corporate names, this will only shorten +personal names of the form 'family, given'." + (when (stringp names) +(mapconcat + (lambda (name) + (if (eq 1 (length name)) + (cdr (split-string name " ")) + (car (split-string name ", " + (split-string names " and ") ", "))) + (defun org-cite-basic--number-to-suffix (n) "Compute suffix associated to number N. This is used for disambiguation." @@ -384,7 +397,8 @@ Optional argument INFO is the export state, as a property list." (pcase style ("plain" (org-cite-concat -author ". " title (and from (list ", " from)) ", " year ".")) +(org-cite-basic--shorten-names author) +". " title (and from (list ", " from)) ", " year ".")) ("numeric" (let ((n (org-cite-basic--key-number (cdr (assq 'id entry)) info))) (org-cite-concat -- 2.33.1
Error during PDF export but the PDF file is exported
Hello, I use Emacs 27.1 on Windows and Org 9.3. >From time to time I work on files mounted from a remote host which is late compared to my pc. Then I encounter errors when producing files from Org: File xxx wasn't produced But the file is produced and is up-to-date. The error message comes from org-compile-file. In that function the test is to compare the date at the start of function with the date of the produced file. I don't know if it's still the case in recent versions, but I think it could be changed. For example, instead of using the date at the start of the function, we could use the date of the file if it already exists (time (if (file-exists-p output) (file-attribute-modification-time (file-attributes output)) '(0 0 0 0))) -- Pascal Quesseveur pques...@gmail.com
[PATCH] oc-basic: support biblatex date field
This is a tiny change that just checks for a 'date' field if 'year' is nil, and if present, grabs the first four characters. Bruce From feee2ca6d54d3495050de334c258438950494372 Mon Sep 17 00:00:00 2001 From: Bruce D'Arcus Date: Fri, 29 Oct 2021 08:17:43 -0400 Subject: [PATCH] oc-basic: Support biblatex date field * lisp/oc-basic.el (org-cite-basic--print-bibliography, org-cite-basic--get-year): Check 'date' field if 'year' nil. --- lisp/oc-basic.el | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el index 1a01ea408..1c5634341 100644 --- a/lisp/oc-basic.el +++ b/lisp/oc-basic.el @@ -345,7 +345,9 @@ patterns." ;; the cite key, as a string, and SUFFIX is the generated suffix ;; string, or the empty string. (let* ((author (org-cite-basic--get-field 'author entry-or-key info 'raw)) - (year (org-cite-basic--get-field 'year entry-or-key info 'raw)) + (year + (or (org-cite-basic--get-field 'year entry-or-key info 'raw) + (substring (org-cite-basic--get-field 'date entry-or-key info 'raw) 0 4))) (cache-key (cons author year)) (key (pcase entry-or-key @@ -371,7 +373,9 @@ ENTRY is an alist, as returned by `org-cite-basic--get-entry'. Optional argument INFO is the export state, as a property list." (let ((author (org-cite-basic--get-field 'author entry info)) (title (org-cite-basic--get-field 'title entry info)) -(year (org-cite-basic--get-field 'year entry info)) +(year + (or (org-cite-basic--get-field 'year entry info) + (substring (org-cite-basic--get-field 'date entry info) 0 4))) (from (or (org-cite-basic--get-field 'publisher entry info) (org-cite-basic--get-field 'journal entry info) -- 2.33.1
Re: [BUG] Consecutive emphasis markers only work every other time [9.5 (9.5-??-cc2490a70 @ /home/joe/.emacs.d/.local/straight/build-27.1/org/)]
Joseph Peterson writes: > > > Steps to reproduce: > Enter org mode (I am on cc2490a7061955395c4f5a1a23a088044554a2f7) > Type *bold* *bold* *bold* > Notice that the second instance is not bolded while the first and third > are. Should be fixed now.
problems with org indent timer
I upgraded org to latest from git yesterday and now the indent timer (I didn't realize the indenting required a timer) says: Error running timer ‘org-indent-initialize-agent’: (args-out-of-range ["" "" #("*" 0 1 (face org-indent)) [...] #("" 0 48 (face org-indent))] 86) [2 times] The elided bit consists of the lists including stars (increasing by one each time), the face sexp and the count. I don't have time to track this down right now (teaching takes precendence!) but thought I'd mention this. Emacs was also updated at the same time so the problem could be due to Emacs itself. -- : Eric S Fraga via Emacs 28.0.60, Org release_9.5-189-g1b2d06 : Latest paper written in org: https://arxiv.org/abs/2106.05096