[O] [PATCH] Do not save target buffer after archiving subtree
The attached patch removes the call to save-buffer in org-archive-subtree. This significantly reduces the time necessary to archive a subtree, especially when archiving many subtrees in a region. Without this patch, Org Mode will save the archive buffer after each subtree is archived. If one were archiving a region of 50 trees, this would result in 50 writes to disk in quick succession. This patch makes the behavior of org-archive-subtree match that of org-refile, which does not save the target buffer after a refile. Best, Matt >From 5c10b578461879d2770a85ae69c8182942074ee7 Mon Sep 17 00:00:00 2001 From: Matt LundinDate: Sat, 25 Nov 2017 09:26:15 -0600 Subject: [PATCH] Do not save target buffer after archiving subtree * lisp/org-archive.el: (org-archive-subtree) Do not save buffer after each archive. Saving the archive buffer after archiving each subtree results in substantial slowdown and many writes to disk when archiving an active region. This brings the behavior of org-archive-subtree into line with org-refile, which does not save the target buffer after refiling. --- lisp/org-archive.el | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lisp/org-archive.el b/lisp/org-archive.el index b2e2178dc..37c5d6f62 100644 --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -381,10 +381,7 @@ direct children of this heading." (point) (concat "ARCHIVE_" (upcase (symbol-name item))) value - (widen) - ;; Save and kill the buffer, if it is not the same - ;; buffer. - (unless (eq this-buffer buffer) (save-buffer) + (widen ;; Here we are back in the original buffer. Everything seems ;; to have worked. So now run hooks, cut the tree and finish ;; up. -- 2.15.0
Re: [O] ob-python newline & indentation behavior
ob-ipython[1] provides a working alternative: #+BEGIN_SRC jupyter-python :session :results output foo = 0 for _ in range(10): foo += 1 foo += 1 print(foo) #+END_SRC #+RESULTS: : 20 I've long wished that more org people would show ob-ipython some love. Letting jupyter handle things on the backend seems like it should simplifly things considerably. [1] https://github.com/gregsexton/ob-ipython Best, Ista On Tue, Nov 21, 2017 at 3:28 AM, Jack Kammwrote: > Yes, I'm starting to see now how difficult it is to properly support > ":session :results value". I would vote to remove it from ob-python... > > I think the patch still improves ":session :results output" so I will > simplify it and restrict to that case, leaving ":session :results value" > unchanged for now. > > Sorry for sending this twice Kyle, forgot to reply all. > > On 21 Nov 2017 4:04 am, "Kyle Meyer" wrote: >> >> Jack Kamm writes: >> >> > In response to this: >> > >> >> I can't think of a good solution, though. Stepping back a bit, I think >> >> it's unfortunate that python blocks handle ":results value" differently >> >> depending on whether the block is hooked up to a session or not. For >> >> non-sessions, you have to use return. Using the same approach >> >> (org-babel-python-wrapper-method) for ":session :results value", we >> >> could then get the return value reliably, but the problem with this >> >> approach is that any variables defined in a ":results value" block >> >> wouldn't be defined in the session after executing the block because >> >> the >> >> code is wrapped in a function. >> > >> > How about if we used the "globals()" and "locals()" functions in Python? >> > >> > Something like this at the end of the wrapper block, before return: >> > >> > for k, v in locals().items(): >> > globals()[k] = v >> >> Hmm, placing that code "before return" is a problem. Like with >> non-session ":results value" blocks, the user would be responsible for >> inserting the return (or even multiple return's), so we can't know where >> to insert the above code without parsing the block :/ >> >> > Another bug with the current approach is that it breaks if common idioms >> > like "for _ in range(10)" are used. ("_" is used to inspect the last >> > output >> > of the shell, an obscure feature I hadn't known about until now). >> >> Right. Also, IIRC the built-in interactive python and ipython treat >> multiline blocks differently. With >> >> if True: >> "ipython ignores my existence" >> >> the built-in shell binds "_" to the string's value, but ipython doesn't. >> >> -- >> Kyle
Re: [O] Bug: ps-print-buffer-with-faces does not work properly in column view [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/share/emacs/27.0.50/lisp/org/)]
Hello, Francisco Velázquezwrites: > Hello Org Mode community > > 1. What exactly did you do? > >In any orgmode file, like the one attached, I did: > >1.1 M-x org-mode >1.2 C-c C-x C-x (org-columns) >1.3 C-u ps-print-buffer-with-faces (output attached) > > 2. What did you expect to happen? > >Org entries should be printed Org columns uses overlays. I think `ps-print-buffer-with-faces' doesn't support them. Regards, -- Nicolas Goaziou
Re: [O] Confusing interaction when typing leading * for headings when org-hide-emphasis-markers is on
Hello, Stig Brautasetwrites: > I've got =(setq org-hide-emphasis-markers t)= in my config, and it's > mostly great but it does confuse me when I manually start sub-sub > headings. (Which perhaps is a silly thing to do, but getting over > muscle memory is hard to change.) After typing the third =*= (and on > any subsequent ones typed) the first and last asterisks are hidden and > the remaining appear bolded, until I type a space when what I'm typing > is suddenly recognised as a heading and snaps back to displaying all > the typed asterisks as expected. > > I couldn't figure out how to post a video, so visually, here is what > I see. One character typed on each line (comments after =;=): > > : * > : ** > : * ; this is in bold > : ** ; this is in bold > : ; asterisks no longer bold after typing a space > > I tried adding an asterisks to the BORDER characters in > org-emphasis-regexp-components, but that didn't seem to help. It is something to be expected with a non-nil `org-hide-emphasis-markers'. "***" at the beginning of the line is really a bold asterisk, whereas "*** " is a headline. I suggest to use M-RET to circumvent the problem. You will quickly get used to it. Regards, -- Nicolas Goaziou
Re: [O] Export (sometimes) skips sections without preceding blank line
Ken Mankoffwrites: > I'm testing this with the following MWE: > > 1) Launching Emacs -Q with this: > > open -n -a EmacsMac.app --args --debug-init -Q --eval="(add-to-list > 'load-path \"~/.emacs.d/elpa/org-20171120\")" > > 2) Visiting test.org which contains this: > > #+BEGIN_SRC emacs-lisp :results value > (org-version nil t) > #+END_SRC > > #+RESULTS: > : Org mode version 9.1.3 (9.1.3-2-g322612-elpa @ > /Users/kdm/.emacs.d/elpa/org-20171120/) > > * Skipping Exports > ** One :noexport: > > #+BEGIN_SRC sh :results verbatim :eval no-export > echo "hello, world" > #+END_SRC > #+RESULTS: > : hello, world > ** Two > Good bye cruel world > > > 3) Exporting via C-e l L to a LaTeX buffer which contains the header plus > this: > > > \begin{document} > > \tableofcontents > > \begin{verbatim} > (org-version nil t) > \end{verbatim} > \section{Skipping Exports} > \label{sec:orge984613} > \end{document} Fixed. Thank you. Regards,
Re: [O] Problem with TAB key
On Saturday, 25 Nov 2017 at 18:43, claude fuhrer wrote: > Dear all, > > sorry for the probably stupid question, but I have a problem with the > TAB key. I do not really understand how orgmode process the multiple > definition of the same key sequence. For a while (if my memories are > right) I could type ".. END_SRC" or signature.asc Description: PGP signature
Re: [O] Export (sometimes) skips sections without preceding blank line
On Saturday, 25 Nov 2017 at 18:44, Ken Mankoff wrote: > Hi Nicolas, > > I'm not sure we ran the same test. The version I thought I posted and > that I see in GMail, my mu4e sent-mail, and the mailing list archives > on gmane does not have an empty line between "#+END_SRC" and > "#+RESULTS:". The version you replied to appears to have a blank line > I did not post. Confirmed: if there is no blank line between end_src and results, the second subsection is not exported. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.3-170-g51234f signature.asc Description: PGP signature
[O] Problem with TAB key
Dear all, sorry for the probably stupid question, but I have a problem with the TAB key. I do not really understand how orgmode process the multiple definition of the same key sequence. For a while (if my memories are right) I could type "
Re: [O] Export (sometimes) skips sections without preceding blank line
Hi Nicolas, I'm not sure we ran the same test. The version I thought I posted and that I see in GMail, my mu4e sent-mail, and the mailing list archives on gmane does not have an empty line between "#+END_SRC" and "#+RESULTS:". The version you replied to appears to have a blank line I did not post. On 2017-11-25 at 13:44, Nicolas Goaziouwrote: >> * Skipping Exports >> ** One >> :noexport: >> >> #+BEGIN_SRC sh :results verbatim :eval no-export >> echo "hello, world" >> #+END_SRC >> >> #+RESULTS: >> : hello, world >> ** Two >> Good bye cruel world >> If I run your version it does work. I need a blank line either before "#+RESULTS:" or before "** Two". Or as previously stated no RESULTS section and no blank line also works. I'm testing this with the following MWE: 1) Launching Emacs -Q with this: open -n -a EmacsMac.app --args --debug-init -Q --eval="(add-to-list 'load-path \"~/.emacs.d/elpa/org-20171120\")" 2) Visiting test.org which contains this: #+BEGIN_SRC emacs-lisp :results value (org-version nil t) #+END_SRC #+RESULTS: : Org mode version 9.1.3 (9.1.3-2-g322612-elpa @ /Users/kdm/.emacs.d/elpa/org-20171120/) * Skipping Exports ** One :noexport: #+BEGIN_SRC sh :results verbatim :eval no-export echo "hello, world" #+END_SRC #+RESULTS: : hello, world ** Two Good bye cruel world 3) Exporting via C-e l L to a LaTeX buffer which contains the header plus this: \begin{document} \tableofcontents \begin{verbatim} (org-version nil t) \end{verbatim} \section{Skipping Exports} \label{sec:orge984613} \end{document}
[O] Confusing interaction when typing leading * for headings when org-hide-emphasis-markers is on
Hello, I've got =(setq org-hide-emphasis-markers t)= in my config, and it's mostly great but it does confuse me when I manually start sub-sub headings. (Which perhaps is a silly thing to do, but getting over muscle memory is hard to change.) After typing the third =*= (and on any subsequent ones typed) the first and last asterisks are hidden and the remaining appear bolded, until I type a space when what I'm typing is suddenly recognised as a heading and snaps back to displaying all the typed asterisks as expected. I couldn't figure out how to post a video, so visually, here is what I see. One character typed on each line (comments after =;=): : * : ** : * ; this is in bold : ** ; this is in bold : ; asterisks no longer bold after typing a space I tried adding an asterisks to the BORDER characters in org-emphasis-regexp-components, but that didn't seem to help. PS: I realise that ironing out all visual niggles here is perhaps not possible, and perhaps me just learning to use the Org functions for inserting headings would hide the problem from me, but I decided to report it in case it turns out to be simple to find an acceptable fix for someone. Stig -- ; GNU Emacs 27.0.50, Org mode version 9.1.3
[O] Bug: ps-print-buffer-with-faces does not work properly in column view [9.1.2 (release_9.1.2-40-g6ca906 @ /usr/share/emacs/27.0.50/lisp/org/)]
Hello Org Mode community 1. What exactly did you do? In any orgmode file, like the one attached, I did: 1.1 M-x org-mode 1.2 C-c C-x C-x (org-columns) 1.3 C-u ps-print-buffer-with-faces (output attached) 2. What did you expect to happen? Org entries should be printed 3. What happened instead? Only the first character '*' is printed. I tested this with other org-mode files, and only the first four characters of headlines were printed. Org-mode files are printed correctly when they are *not* in column view. Data generated with `M-x org-submit-bug-report': Emacs : GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-11-06 Package: Org mode version 9.1.2 (release_9.1.2-40-g6ca906 @ /usr/share/emacs/27.0.50/lisp/org/) current state: == (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-after-todo-state-change-hook '(org-clock-out-if-current) org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-block-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^A\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-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-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("id" :follow org-id-open) ("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) ("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") ("doi" :follow org--open-doi-link) ("elisp" :follow org--open-elisp-link) ("file" :complete org-file-complete-link) ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path ("help" :follow org--open-help-link) ("http" :follow (lambda (path) (browse-url (concat "http:" path ("https" :follow (lambda (path) (browse-url (concat "https:" path ("mailto" :follow (lambda (path) (browse-url (concat "mailto:; path ("news" :follow (lambda (path) (browse-url (concat "news:; path ("shell" :follow org--open-shell-link)) ) Best regards. #+COLUMNS: %ITEM * Test item Some text here test.org.ps Description: PostScript document -- Francisco Velázquez
Re: [O] C++ code block not linked
On 25/11/2017 15:59, Roger Mason wrote: Hello, This code compiles fine on command line but org-babel can't link it. #+BEGIN_SRC C++ :flags "-std=c++11 -I/usr/local/include" :libs "-L/usr/local/lib -lginac" #include #include using namespace std; using namespace GiNaC; int main () { symbol a("a"), b("b"), x("x"), y("y"); lst eqns, vars; eqns = a*x+b*y==3, x-y==b; vars = x, y; cout << lsolve(eqns, vars) << endl; // -> {x==(3+b^2)/(b+a),y==(3-b*a)/(b+a) return 0; } #+END_SRC The error buffer contains many lines like this: /tmp//ccv5YYn1.o: In function `main': C-src-1046xti.cpp:(.text+0x67): undefined reference to `GiNaC::symbol::symbol(std::__cxx11::basic_stringconst&)' Org mode version 9.0.3 (release_9.0.3-170-gfed1cf @ /home/rmason/.emacs.d/org-git/org-mode/lisp/) GNU Emacs 25.3.1 (i386-portbld-freebsd10.3, GTK+ Version 3.22.15) of 2017-11-22 Thanks for any help. Roger I get the correct result: #+RESULTS: | {x==(3+b^2)*(a+b)^(-1) | y==-(-3+a*b)*(a+b)^(-1)} | I use Or mode version 9.1.1
[O] C++ code block not linked
Hello, This code compiles fine on command line but org-babel can't link it. #+BEGIN_SRC C++ :flags "-std=c++11 -I/usr/local/include" :libs "-L/usr/local/lib -lginac" #include #include using namespace std; using namespace GiNaC; int main () { symbol a("a"), b("b"), x("x"), y("y"); lst eqns, vars; eqns = a*x+b*y==3, x-y==b; vars = x, y; cout << lsolve(eqns, vars) << endl; // -> {x==(3+b^2)/(b+a),y==(3-b*a)/(b+a) return 0; } #+END_SRC The error buffer contains many lines like this: /tmp//ccv5YYn1.o: In function `main': C-src-1046xti.cpp:(.text+0x67): undefined reference to `GiNaC::symbol::symbol(std::__cxx11::basic_stringconst&)' Org mode version 9.0.3 (release_9.0.3-170-gfed1cf @ /home/rmason/.emacs.d/org-git/org-mode/lisp/) GNU Emacs 25.3.1 (i386-portbld-freebsd10.3, GTK+ Version 3.22.15) of 2017-11-22 Thanks for any help. Roger
Re: [O] Org emphasis markers inside src blocks causes incorrect fontification
Hello, Kaushal Modiwrites: > That patch works great! Thanks! Applied. Thank you. Regards, -- Nicolas Goaziou
Re: [O] Export (sometimes) skips sections without preceding blank line
On Saturday, 25 Nov 2017 at 13:18, Ken Mankoff wrote: > Hi Org list, > > I'm wondering if anyone else experiences LaTeX export skipping > sections. It appears to be related to no blank lines after code RESULT > blocks? Using emacs -Q on version 9.1.3. > > The following MWE does *not* export subsection "Two". It works for me both with the version noted in my signature (a few days old) and with the current version from git. I exported to text and subsection two was there in the export. -- : Eric S Fraga via Emacs 27.0.50, Org release_9.1.3-170-g51234f signature.asc Description: PGP signature
Re: [O] Export (sometimes) skips sections without preceding blank line
Hello, Ken Mankoffwrites: > Hi Org list, > > I'm wondering if anyone else experiences LaTeX export skipping sections. It > appears to be related to no blank lines after code RESULT blocks? Using emacs > -Q on version 9.1.3. > > The following MWE does *not* export subsection "Two". > > * Skipping Exports > ** One > :noexport: > > #+BEGIN_SRC sh :results verbatim :eval no-export > echo "hello, world" > #+END_SRC > > #+RESULTS: > : hello, world > ** Two > Good bye cruel world > > It also doesn't export if the results are wrapped in a #+BEGIN_example > block. I cannot reproduce it. You may want to double-check your configuration. Regards, -- Nicolas Goaziou
Re: [O] org-mode alarms
On Friday, 24 Nov 2017 at 20:37, ma343...@openmailbox.org wrote: > What are good ways of setting up alarms for Deadlines and Scheduling > in org-mode to integrate with Windows or GNU/Linux environments? I use the following on Linux and it works very well. Relies on there being a notification daemon running (I use dunst as the easiest to configure). #+begin_src emacs-lisp ;; from Tassilo's blog: ;; and from RichardRiley's entry: http://www.emacswiki.org/emacs/OrgMode-OSD ;; and from Nick Dokos: http://article.gmane.org/gmane.emacs.orgmode/5271 (message "ESF-ORG: setting up org->appt link") (require 'appt) (require 'notifications) (defun esf/notification-display (min-to-app new-time msg) (let (m delay) (setq m (string-to-number min-to-app) delay (if (<= m 0) 0 (* 1000 (- 20 m (notifications-notify :title "Agenda" :body (format "%s\nIn %s minutes." msg min-to-app) :app-name "emacs" :app-icon "PATHTOICONS/emacs-icon.xpm" :timeout delay))) (setq appt-display-format 'window) (setq appt-disp-window-function (function esf/notification-display)) (setq appt-delete-window-function '(lambda ())) ;; Run once, activate and schedule refresh (run-at-time "5 minutes" 3600 'org-agenda-to-appt) (appt-activate t) (setq appt-time-msg-list nil) (defadvice org-agenda-redo (after org-agenda-redo-add-appts) "Pressing `r' on the agenda will also add appointments." (progn (setq appt-time-msg-list nil) (org-agenda-to-appt))) (ad-activate 'org-agenda-redo) (message "ESF-ORG: done setting up org->appt link") #+end_src -- : Eric S Fraga via Emacs 27.0.50, Org release_9.1.3-170-g51234f signature.asc Description: PGP signature
[O] Export (sometimes) skips sections without preceding blank line
Hi Org list, I'm wondering if anyone else experiences LaTeX export skipping sections. It appears to be related to no blank lines after code RESULT blocks? Using emacs -Q on version 9.1.3. The following MWE does *not* export subsection "Two". * Skipping Exports ** One :noexport: #+BEGIN_SRC sh :results verbatim :eval no-export echo "hello, world" #+END_SRC #+RESULTS: : hello, world ** Two Good bye cruel world It also doesn't export if the results are wrapped in a #+BEGIN_example block. It does export it if there is a blank line before "* Two", but the blank line is not required - for example, if the preceding line is "#+END_SRC" but there is no blank line, it does export (but not #+END_example). -k.
Re: [O] schedule third last day of every month
On 24/11/2017 21:32, ma343...@openmailbox.org wrote: Hi, Can it be possible to schedule third last day of every month? Thanks, Matt Try C-h f diary-list-sexp-entries What you are looking for could be something close to: %%(diary-date t 27 t) notice on the 27th of every month %%(diary-float t 1 -1) notice on the last Monday of every month Put that in your ~/diary file. For Org Mode integration you need to customize the org-agenda-include-diary variable.
Re: [O] schedule third last day of every month
On 24/11/2017 21:32, ma343...@openmailbox.org wrote: Hi, Can it be possible to schedule third last day of every month? Thanks, Matt Try M-x calendar i m To fine tune do C-h f diary-cyclic