Re: [O] [Discuss] make :tangle header argument respect :dir could save info typing
Sean O'Halpin writes: > Hi, > > =:dir= specifies the directory for code execution, i.e. when you hit =C-c > C-c= what is the environment in which the code is run? I know currently it specify directory for code execution. I'm saying whether consider extend =:dir= semantic for tangling too. Because the header arguments could becoming very long if I repeat the sub-directory information in executing directory =:dir= and for =:tangle=. Like this: #+begin_src sh :mkdirp yes :dir "data/code/project-name-1" :tangle "data/code/project-name-1/src/project-name/main/App.java" #+end_src You see, The "=data/code/project-name-1=" path part is duplicate. And the header arguments is very long. Even though I can put header arguments in ~#+HEADERS:~ line of source block. But still duplicate info inputting, isn't it? > > =:mkdirp= forces creation of the directory for tangle output, i.e. when you > =org-babel-tangle= where do you put the output source code? =:mkdirp= already support for auto force create of directory =:dir= now. > > They are quite separate concerns. > > Regards, > Sean > > On Tue, 5 Mar 2019 at 06:03, stardiviner wrote: > > I realized one thing, the combination of ~:mkdir~, ~:dir~, and ~:tangle~ > does not work > good enough. Can make ~:tangle~ respect ~:dir~ too. WDYT? > > Here is an example: > > #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle > "src/clj_crawler_demo/core.clj" > (ns clj-crawler-demo.core >(:require [clj-http.client :as http]) >(:require [net.cgrand.enlive-html :as html])) > > (html/select > (-> (http/get "https://www.baidu.com;) > :body > html/html-snippet) > [:div]) > #+end_src > > Why need this? If ~:tangle~ respect ~:dir~, it will don't need the complete > path to > tangled file. And when the source block has other header argument need dir > like > ~:file~, this will make ~:tangle~ and other related header arguments shorter. > > If ~:tangle~ does not respect ~:dir~, user need to repeat the path: > > #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle > "data/code/clj-crawler-demo/src/clj_crawler_demo/core.clj" > (ns clj-crawler-demo.core >(:require [clj-http.client :as http]) >(:require [net.cgrand.enlive-html :as html])) > > (html/select > (-> (http/get "https://www.baidu.com;) > :body > html/html-snippet) > [:div]) > #+end_src > > This is long, I know there is ~#+headers:~ for source block. But reduce info > would > be better. I also consider the disadvantage of this change. Some user's > existing > source block might be broken. > > Let's level this change for discussion. > > -- > [ stardiviner ] > I try to make every word tell the meaning what I want to express. > > Blog: https://stardiviner.github.io/ > IRC(freenode): stardiviner, Matrix: stardiviner > GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
Re: [O] [PATCH] make 'org-at-date-range-p work like org-at-timestamp-p
Nicolas, thanks for taking care. But there's another thing. I don't know what I've done to my Org buffer, but what look like timestamps are a mixture of element types 'timestamp and 'planning. Anyway, 'org-at-timestamp-p returns nil for the 'planning timestamps. Which causes breakage. Please take a look at the patch. It could be that 'org-check-*-date functions might also be affected by the same problem, I haven't tested. Regards Thomas >From dda6f686e40663b1da3151686145cd125d1f88d1 Mon Sep 17 00:00:00 2001 From: Thomas Plass Date: Tue, 19 Mar 2019 21:24:19 +0200 Subject: [PATCH] Check timestamp contexts for both element types 'timestamp and 'planning. --- lisp/org.el | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ee1082376..3f2e429dd 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15178,10 +15178,10 @@ When matching, the match groups are the following: (and (bound-and-true-p org-agenda-include-inactive-timestamps) (org-at-clock-log-p -(eq 'timestamp -(save-excursion - (when (= pos (cdr boundaries)) (forward-char -1)) - (org-element-type (org-element-context))) +(memq (save-excursion +(when (= pos (cdr boundaries)) (forward-char -1)) +(org-element-type (org-element-context))) + '(timestamp planning) (cond ((not match?)nil) ((= pos (match-beginning 0)) 'bracket) -- 2.13.1.windows.2
Re: [O] [PATCH] make 'org-at-date-range-p work like org-at-timestamp-p
Hello, thu...@arcor.de (Thomas Plass) writes: > I don't know what I've done to my Org buffer, but what look like > timestamps are a mixture of element types 'timestamp and 'planning. > > Anyway, 'org-at-timestamp-p returns nil for the 'planning timestamps. > Which causes breakage. That behaviour is correct. Planning lines are not timestamps. See `extended' parameter in `org-at-timestamp-p'. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] make 'org-at-date-range-p work like org-at-timestamp-p
Nicolas, thanks for taking care. But there's another thing. I don't know what I've done to my Org buffer, but what look like timestamps are a mixture of element types 'timestamp and 'planning. Anyway, 'org-at-timestamp-p returns nil for the 'planning timestamps. Which causes breakage. Please take a look at the patch. It could be that 'org-check-*-date functions might also be affected by the same problem, I haven't tested. Regards Thomas >From dda6f686e40663b1da3151686145cd125d1f88d1 Mon Sep 17 00:00:00 2001 From: Thomas Plass Date: Tue, 19 Mar 2019 21:24:19 +0200 Subject: [PATCH] Check timestamp contexts for both element types 'timestamp and 'planning. --- lisp/org.el | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ee1082376..3f2e429dd 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15178,10 +15178,10 @@ When matching, the match groups are the following: (and (bound-and-true-p org-agenda-include-inactive-timestamps) (org-at-clock-log-p -(eq 'timestamp -(save-excursion - (when (= pos (cdr boundaries)) (forward-char -1)) - (org-element-type (org-element-context))) +(memq (save-excursion +(when (= pos (cdr boundaries)) (forward-char -1)) +(org-element-type (org-element-context))) + '(timestamp planning) (cond ((not match?)nil) ((= pos (match-beginning 0)) 'bracket) -- 2.13.1.windows.2
Re: [O] Open drawers ...
Eric S Fraga writes: > On Monday, 18 Mar 2019 at 18:26, Sharon Kimble wrote: >> Is it possible to open all drawers of a file from one command please? >> >> Or to have them opened when the file is loaded up, either on restart >> of emacs or be manually opened, please? > > Put > > #+startup: showeverything Thank you Eric, this is working a treat, and will shortly become my 'de facto' standard for certain files :) Thanks Sharon. > > and all drawers will be open when you visit the file and if you type C-u > C-u TAB when already in the file. In the info manual at Document > Structure -> Visibility Cycling -> Initial visibility (section 2.2.2). -- A taste of linux = http://www.sharons.org.uk TGmeds = http://www.tgmeds.org.uk DrugFacts = https://www.drugfacts.org.uk Debian 9.8, fluxbox 1.3.7, emacs 26.1.92, org 9.2.2 signature.asc Description: PGP signature
Re: [O] [Discuss] make :tangle header argument respect :dir could save info typing
Hi, =:dir= specifies the directory for code execution, i.e. when you hit =C-c C-c= what is the environment in which the code is run? =:mkdirp= forces creation of the directory for tangle output, i.e. when you =org-babel-tangle= where do you put the output source code? They are quite separate concerns. Regards, Sean On Tue, 5 Mar 2019 at 06:03, stardiviner wrote: > > I realized one thing, the combination of ~:mkdir~, ~:dir~, and ~:tangle~ > does not work > good enough. Can make ~:tangle~ respect ~:dir~ too. WDYT? > > Here is an example: > > #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle > "src/clj_crawler_demo/core.clj" > (ns clj-crawler-demo.core > (:require [clj-http.client :as http]) > (:require [net.cgrand.enlive-html :as html])) > > (html/select > (-> (http/get "https://www.baidu.com;) > :body > html/html-snippet) > [:div]) > #+end_src > > Why need this? If ~:tangle~ respect ~:dir~, it will don't need the > complete path to > tangled file. And when the source block has other header argument need dir > like > ~:file~, this will make ~:tangle~ and other related header arguments > shorter. > > If ~:tangle~ does not respect ~:dir~, user need to repeat the path: > > #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle > "data/code/clj-crawler-demo/src/clj_crawler_demo/core.clj" > (ns clj-crawler-demo.core > (:require [clj-http.client :as http]) > (:require [net.cgrand.enlive-html :as html])) > > (html/select > (-> (http/get "https://www.baidu.com;) > :body > html/html-snippet) > [:div]) > #+end_src > > This is long, I know there is ~#+headers:~ for source block. But reduce > info would > be better. I also consider the disadvantage of this change. Some user's > existing > source block might be broken. > > Let's level this change for discussion. > > -- > [ stardiviner ] >I try to make every word tell the meaning what I want to express. > >Blog: https://stardiviner.github.io/ >IRC(freenode): stardiviner, Matrix: stardiviner >GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 > > >
Re: [O] [PATCH] ob-core: Add edit-prep in org-babel-make-language-alias
Nicolas Goaziou writes: > Could you provide a commit message for your patch? * lisp/ob-core.el (org-babel-make-language-alias): Add edit-prep to the list of defalias'ed functions. --- lisp/ob-core.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 02efa1dc9..7591e99ca 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -3135,7 +3135,8 @@ after the babel API for OLD-type source blocks is fully defined. Callers of this function will probably want to add an entry to `org-src-lang-modes' as well." (dolist (fn '("execute" "expand-body" "prep-session" - "variable-assignments" "load-session")) + "variable-assignments" "load-session" + "edit-prep")) (let ((sym (intern-soft (concat "org-babel-" fn ":" old (when (and sym (fboundp sym)) (defalias (intern (concat "org-babel-" fn ":" new)) sym -- 2.21.0
[O] org-notmuch: Improved tree support
Hi, 1. `org-notmuch-store-link' does not allow to store links to email at point in tree view. Easy fix: --8<---cut here---start->8--- (defun org-notmuch-store-link () "Store a link to a notmuch search or message." - (when (eq major-mode 'notmuch-show-mode) + (when (or (eq major-mode 'notmuch-show-mode) +(eq major-mode 'notmuch-tree-mode)) (let* ((message-id (notmuch-show-get-message-id t)) --8<---cut here---end--->8--- 2. A while back https://lists.gnu.org/archive/html/emacs-orgmode/2014-07/msg00380.html was merged. I think using a defcustom here is not very intuitive for people who use both the tree view and the thread view. I would expect the following: - Opening a tree link will open the tree view. - Opening a search link will open the search view. It's easy to implement: - Deprecate the former defcustom. - Copy/paste the org-notmuch-search* code to org-notmuch-tree*. Thoughts? -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: [O] [ANN] Changes to link syntax
Nicolas Goaziou writes: > Hello, > > stardiviner writes: > >> So I have to consider a safer and larger method to upgrade link. I can't >> manually open every Org files and run linter on them. > > I already offered a function for replacing it in a file. You can wrap it > within a `dolist' on `directory-files-recursively'. Hmm, I will randomly copy some files on my disk to do a separate test out. > >> (Maybe linter can run on Org files automatically in programtically >> way?) > > When not called interactively, it returns a non-nil value if any error > is found. And you can call it on a limited set of checkers. Though, > I think the function I provided is better. I see. you're right. > >> Seems I can wait for better solution now. > > I don't see any other solution. Hm.. Let me go back to check out your commit. So that I can settle my heart down. :) > > Regards, -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3