Bug: org-agenda-skip-unavailable-files removes files instead of skipping [9.2.6 (9.2.6-5-g9c611f-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20191111/)]
The docstring for org-agenda-skip-unavailable-files says: Non-nil means to just skip non-reachable files in ‘org-agenda-files’. A nil value means to remove them, after a query, from the list. However, doing a grep over the org mode code, the only place where this variable is checked is in org-agenda-files (it is also let bound in exactly two places): (when org-agenda-skip-unavailable-files (setq files (delq nil (mapcar (function (lambda (file) (and (file-readable-p file) file))) files The behavior appears to be contrary to the docstring: A non-nil value means silently remove non-reachable files and a nil value means do nothing. Or so it appears. Actually, the querying for removal happens in org-check-agenda-file. It looks like the "just skip non-reachable files" is implemented by filtering them out so we don't call org-check-agenda-file on them later. The problem is that when org-agenda-file-to-front or org-remove-file is called, any non-reachable files get filtered out from org-agenda-files and then saved back to the user's customizations. The result is that setting org-agenda-skip-unavailable-files to t ends up remove the user's un-reachable agenda files rather than skipping them, contrary to the docstring. If a user did not realize this, they may end up missing important items on their agenda, if they have some agenda files that are sometimes missing and get removed from org-agenda-files (e.g., mounted via a network drive), so in my opinion this is a serious bug. Emacs : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29 Package: Org mode version 9.2.6 (9.2.6-5-g9c611f-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-2019/)
Re: Exporting agendas as org-mode files?
org-ql would make this pretty easy, I think. Use an org-ql query to select entries, and for the :action function, use a simple function that copies the entry or subtree and yanks it into a buffer. Then save that buffer to a file.
Re: Anyone use 3rd party search tools w/org-mode?
Emacs (shortened name from "Editor Macros") has the fastest Regular Expression engine in the world--when you compare the engines that are programmed to find and display character strings AS YOU TYPE THEM. So, just hoping you keep that in mind: As far as editing documents and searching documents and in some cases replacing strings, there is nothing faster than Emacs and its native regular expression engine, which is built for editing tasks--editing tasks that are especially related to and programmed for searching strings and/or regular expressions as you type them in In many other ways, of course other engines are faster; but, not for editing and searching and replacing tasks And even when you talk about editing multi-gigabyte and even multi-terabyte files--suggest you look into and try out vlf-mode (i.e. "Very Large File Mode") for that, just for the fun and excitement of it, if for nothing else. So, again, GNU Emacs is by far the world's most powerful editor, and it has been for many, many years--there is no need for 3rd party tools, maybe there's a need to investigate the "engines under the hood" and why they work the way they do. On Tue, Nov 12, 2019 at 8:04 AM Russell Adams wrote: > To further explain my setup, I have three libraries of files Personal, > Technical > and Business. Personal is all personal data including Org files, Technical > is > all whitepapers and vendor documentation, and Business is Org projects and > other > matters. Recoll is used to search all of them. > > In my shell profile I have a few functions to access each library, and to > file > away new documents (ie: I downloaded a whitepaper, and just want to slap > it into > a unique directory in the library). > > #+BEGIN_EXAMPLE > # For recoll and library > func _FileRecoll() { DEST="$HOME/Library/$1/$(date +%Y/%m/%d)" ; mkdir > -p $DEST ; mv -i "$2" $DEST ; } > func FileTech() { _FileRecoll "Technical" "$1" ; } > func FilePersonal() { _FileRecoll "Personal" "$1" ; } > func FileBiz() { _FileRecoll "Business" "$1" ; } > > func recollt() { RECOLL_CONFDIR=~/Library/.recoll-Technical > ~/scripts/recolltui.sh $@ ; } > func recollp() { RECOLL_CONFDIR=~/Library/.recoll-Personal > ~/scripts/recolltui.sh $@ ; } > func recollb() { RECOLL_CONFDIR=~/Library/.recoll-Business > ~/scripts/recolltui.sh $@ ; } > #+END_EXAMPLE > > I have a daily cronjob to index those directories: > > #+BEGIN_EXAMPLE > # Recoll > 00 2 * * * /usr/bin/recollindex -c ${HOME}/Library/.recoll-Personal/ > >> "${HOME}/Library/.recoll-Personal/recollindex.log" 2>&1 > 00 3 * * * /usr/bin/recollindex -c ${HOME}/Library/.recoll-Technical/ > >> "${HOME}/Library/.recoll-Technical/recollindex.log" 2>&1 > 00 4 * * * /usr/bin/recollindex -c ${HOME}/Library/.recoll-Business/ > >> "${HOME}/Library/.recoll-Business/recollindex.log" 2>&1 > #+END_EXAMPLE > > Then I have a simple TUI shell script which wraps dialog around recoll's > CLI. This puts the filename in my clip board for command line pasting, and > opens > PDFs in Firefox. > > #+BEGIN_EXAMPLE > #!/bin/sh > # ~/scripts/recolltui.sh > > # requires recollq optional cli binary to be present from recoll package > # uses base64, xsel, and dialog > > DB=$(mktemp) > MENU=$(mktemp) > trap 'rm -f -- "${DB}" "${MENU}"' INT TERM HUP EXIT > > # Make sure to customize RECOLL_CONFDIR (ie: > ~/Library/.recoll-Technical) if needed > > # query recoll, save the base64 output to $DB as 3 space separated > columns: row #, title, url > recollq -e -F "title url" $@ 2>/dev/null | nl > $DB > > # copy header into menu > head -n 2 $DB | while read num rest ; do > echo "= \"$rest\"" >> $MENU > done > > # Convert results to dialog menu using row # and title + filename as > list item > # skip first two lines of results, they are not base64 > tail -n +3 $DB | while read num title url ; do > echo "$num \"$(echo "$title" | base64 -w0 -d ) : $(basename "$(echo > "$url" | base64 -w0 -d | sed 's,file://,,g')")\"" >> $MENU > done > > # ask the user which results to view > SEL=$(dialog --menu "Search results" 0 0 0 --file $MENU --stdout) > > # if a choice was made, open the url in firefox AND copy it to the > clipboard > [ $? -eq 0 ] && { > URL="$(awk "\$1 == $SEL {print \$3}" $DB | base64 -w0 -d)" > echo "$URL" | sed 's,file://,,g' | xsel > firefox "$URL" > } > > #+END_EXAMPLE > > I've often thought that the dialog script could be easily replaced by an > Emacs > interface, but I haven't taken the time to try to write one. > > I've found that recoll's indexing in Xapian is excellent. I frequently can > find > my search terms in technical documentation very rapidly. The support of > many > file types makes it index well. I think my most frequent formats are text > including Org, PDF, and DOC. > > I used to have a "Scrapbook" extension in Firefox which would instantly > save a > webpage being viewed into my Personal library. Unfortunately that isn'
Exporting agendas as org-mode files?
I'd like to be able to export agendas as org-mode files, so that I can use the agenda system's ability to make subsets of my tasks, then sync those with Google tasks using michel-orgmode (so I don't end up with hundreds of tasks to look through on my phone, but only the ones with tags such as :soon: etc). Is there an existing command for this? I've tried the manual, the wiki and the function names in the code, and nothing looks like it will do this. I don't mind writing it myself, I'm quite familiar with emacs-lisp, but I'd rather pick up anything existing if there is one. __John
Re: Using variables in org-capture-templates
> What is the "correct" way to do this in elisp? I believe you want to use backquote - comma https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html Josiah
Using variables in org-capture-templates
Hello all, I'm sure this is a basic elisp thing but I'd like some help: I wanted to abstract the "sprintf-like" formats of the template expansion into readable variables that I can reuse in my templates. However, upon substituting variable for the formats, I am getting "Invalid capture template" for the capture template "T" below -- for comparison the "t" template works. What am I doing wrong? I'm sure it has to do with the '() value of org-capture templates, and the fact that the (concat) is not evaluated. What is the "correct" way to do this in elisp? Here's my code: #+begin_src emacs-lisp (setq org-capture-templates '()) (setq njn-clocked-entry "\nclocked: %K\n") (setq njn-from-entry "\nfrom: %a\n") (setq njn-capture-trailer "\n--\n") (setq org-capture-templates '( ("T" "Todo: Detailed" entry (file+headline "" "Tasks") (concat "* todo %^{Heading}\n%U\n%?" njn-from-entry njn-clocked-entry njn-capture-trailer) :prepend t) ("t" "Todo: Basic" entry (file+headline "" "Tasks") "* todo %^{Heading}\n%U\n%?\nclocked: %K\n" :prepend t))) Thanks, --Nate
[PATCH] Fix typos
Please consider applying the below patch, which fixes many spelling errors. I did not write a commit message that lists every file and function/variable that happened to contain a typo. That seems rather unnecessary for this type of change, but if you want that I can do it. In addition to the below typos I also found some things I don't know how to deal with: * "visibile" as a supported value of org-s5-control-visibility * "ded" appearing in doc/orgcard.tex Cheers, Jonas --- README_maintainer | 4 ++-- contrib/lisp/ob-oz.el | 2 +- contrib/lisp/ob-spice.el | 6 +++--- contrib/lisp/ol-notmuch.el| 6 +++--- contrib/lisp/org-annotate-file.el | 2 +- contrib/lisp/org-collector.el | 2 +- contrib/lisp/org-expiry.el| 2 +- contrib/lisp/org-mac-link.el | 2 +- contrib/lisp/org-passwords.el | 2 +- contrib/lisp/org-screenshot.el| 6 +++--- contrib/lisp/org-sudoku.el| 2 +- contrib/lisp/org-toc.el | 2 +- contrib/lisp/orgtbl-sqlinsert.el | 2 +- contrib/lisp/ox-deck.el | 16 contrib/lisp/ox-groff.el | 2 +- contrib/lisp/ox-koma-letter.el| 2 +- contrib/lisp/ox-s5.el | 4 ++-- contrib/scripts/StartOzServer.oz | 4 ++-- doc/.aspell.org.conf | 2 +- doc/doc-setup.org | 2 +- doc/org-guide.org | 2 +- doc/org-manual.org| 10 +- etc/ORG-NEWS | 26 +- lisp/ob-C.el | 6 +++--- lisp/org-agenda.el| 8 lisp/org-attach-git.el| 4 ++-- lisp/org-feed.el | 2 +- lisp/org-plot.el | 2 +- lisp/org-table.el | 2 +- lisp/org.el | 6 +++--- lisp/ox-odt.el| 6 +++--- mk/eldo.el| 2 +- testing/examples/ob-awk-test.org | 4 ++-- testing/lisp/test-ob-sqlite.el| 2 +- testing/lisp/test-org-agenda.el | 2 +- testing/lisp/test-org-attach.el | 2 +- testing/lisp/test-org.el | 8 37 files changed, 83 insertions(+), 83 deletions(-) diff --git a/README_maintainer b/README_maintainer index a5eda1caf..d2e9ada50 100644 --- a/README_maintainer +++ b/README_maintainer @@ -42,7 +42,7 @@ The release number for minor releases look like this: =9.1.7= Minor releases are small amends to main releases. Usually they fix critical bugs discovered in a main release. Minor bugs are usually -not fixed -- they will be adressed in the next main release. +not fixed -- they will be addressed in the next main release. Only the fix to the bug is bundled into a release, without the main development work going on in the master branch. Since the bug fix @@ -194,7 +194,7 @@ The list of all contributors from who we have the papers is kept on Worg at https://orgmode.org/worg/org-contribute.html, so that committers can check if a patch can go into the core. -The assignment process does not allways go smoothly, and it has +The assignment process does not always go smoothly, and it has happened several times that it gets stuck or forgotten at the FSF. The contact at the FSF for this is: mailto:copyright-cl...@fsf.org diff --git a/contrib/lisp/ob-oz.el b/contrib/lisp/ob-oz.el index 626c4f316..46bf536f7 100644 --- a/contrib/lisp/ob-oz.el +++ b/contrib/lisp/ob-oz.el @@ -106,7 +106,7 @@ (require 'mozart nil t) ;; back any results from Oz to Emacs. The following code creates a ;; socket for sending code to the OPI compiler and results are ;; returned by the same socket. On the Oz side, a socket is opened and -;; conected to the compiler of the OPI (via oz-send-string). On the +;; connected to the compiler of the OPI (via oz-send-string). On the ;; Emacs side, a connection to this socket is created for feeding code ;; and receiving results. This additional communication channel to the ;; OPI compiler ensures that results are returned cleanly (e.g., only diff --git a/contrib/lisp/ob-spice.el b/contrib/lisp/ob-spice.el index 24ef3c874..c452c993f 100644 --- a/contrib/lisp/ob-spice.el +++ b/contrib/lisp/ob-spice.el @@ -58,7 +58,7 @@ (defun org-babel-expand-body:spice (body params) (progn ;loop through the words (if (string-match "\\$\\(.*\\)\\[\\(.*\\)\\]" word) (progn - ;; if matchs a vector variable format + ;; if matches a vector variable format (setq varname (match-string 1 word)) (setq varindex (match-string 2 word)) ;; search varname in vars and use the value of varindex to word @@ -75,7 +75,7 @@ (defun org-babel-expand-body:spice (body params) ) ; end of (if (string-match "\\$\\(.*\\)\\[\\(.*\\)\\]" word)) (if (string-match "\\$\\(.*\\)\\." word) ; if variable has a dot in the end (progn -
Re: Anyone use 3rd party search tools w/org-mode?
To further explain my setup, I have three libraries of files Personal, Technical and Business. Personal is all personal data including Org files, Technical is all whitepapers and vendor documentation, and Business is Org projects and other matters. Recoll is used to search all of them. In my shell profile I have a few functions to access each library, and to file away new documents (ie: I downloaded a whitepaper, and just want to slap it into a unique directory in the library). #+BEGIN_EXAMPLE # For recoll and library func _FileRecoll() { DEST="$HOME/Library/$1/$(date +%Y/%m/%d)" ; mkdir -p $DEST ; mv -i "$2" $DEST ; } func FileTech() { _FileRecoll "Technical" "$1" ; } func FilePersonal() { _FileRecoll "Personal" "$1" ; } func FileBiz() { _FileRecoll "Business" "$1" ; } func recollt() { RECOLL_CONFDIR=~/Library/.recoll-Technical ~/scripts/recolltui.sh $@ ; } func recollp() { RECOLL_CONFDIR=~/Library/.recoll-Personal ~/scripts/recolltui.sh $@ ; } func recollb() { RECOLL_CONFDIR=~/Library/.recoll-Business ~/scripts/recolltui.sh $@ ; } #+END_EXAMPLE I have a daily cronjob to index those directories: #+BEGIN_EXAMPLE # Recoll 00 2 * * * /usr/bin/recollindex -c ${HOME}/Library/.recoll-Personal/ >> "${HOME}/Library/.recoll-Personal/recollindex.log" 2>&1 00 3 * * * /usr/bin/recollindex -c ${HOME}/Library/.recoll-Technical/ >> "${HOME}/Library/.recoll-Technical/recollindex.log" 2>&1 00 4 * * * /usr/bin/recollindex -c ${HOME}/Library/.recoll-Business/ >> "${HOME}/Library/.recoll-Business/recollindex.log" 2>&1 #+END_EXAMPLE Then I have a simple TUI shell script which wraps dialog around recoll's CLI. This puts the filename in my clip board for command line pasting, and opens PDFs in Firefox. #+BEGIN_EXAMPLE #!/bin/sh # ~/scripts/recolltui.sh # requires recollq optional cli binary to be present from recoll package # uses base64, xsel, and dialog DB=$(mktemp) MENU=$(mktemp) trap 'rm -f -- "${DB}" "${MENU}"' INT TERM HUP EXIT # Make sure to customize RECOLL_CONFDIR (ie: ~/Library/.recoll-Technical) if needed # query recoll, save the base64 output to $DB as 3 space separated columns: row #, title, url recollq -e -F "title url" $@ 2>/dev/null | nl > $DB # copy header into menu head -n 2 $DB | while read num rest ; do echo "= \"$rest\"" >> $MENU done # Convert results to dialog menu using row # and title + filename as list item # skip first two lines of results, they are not base64 tail -n +3 $DB | while read num title url ; do echo "$num \"$(echo "$title" | base64 -w0 -d ) : $(basename "$(echo "$url" | base64 -w0 -d | sed 's,file://,,g')")\"" >> $MENU done # ask the user which results to view SEL=$(dialog --menu "Search results" 0 0 0 --file $MENU --stdout) # if a choice was made, open the url in firefox AND copy it to the clipboard [ $? -eq 0 ] && { URL="$(awk "\$1 == $SEL {print \$3}" $DB | base64 -w0 -d)" echo "$URL" | sed 's,file://,,g' | xsel firefox "$URL" } #+END_EXAMPLE I've often thought that the dialog script could be easily replaced by an Emacs interface, but I haven't taken the time to try to write one. I've found that recoll's indexing in Xapian is excellent. I frequently can find my search terms in technical documentation very rapidly. The support of many file types makes it index well. I think my most frequent formats are text including Org, PDF, and DOC. I used to have a "Scrapbook" extension in Firefox which would instantly save a webpage being viewed into my Personal library. Unfortunately that isn't supported on modern Firefox versions so I need to find a replacement for that functionality. On Tue, Nov 12, 2019 at 12:34:29PM +0100, Roland Everaert wrote: > I had a quick look at the recoll and I notice that there is a python API > to update/create index. > > Maybe something could be developped using the python package recently > released by Karl Voit, to feed a recoll index with org data. > > Roland. -- Russell Adamsrlad...@adamsinfoserv.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint:1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
Re: Anyone use 3rd party search tools w/org-mode?
I had a quick look at the recoll and I notice that there is a python API to update/create index. Maybe something could be developped using the python package recently released by Karl Voit, to feed a recoll index with org data. Roland. Roland Everaert writes: > Good to know, I will have a look at it when time permit. > Russell Adams writes: > >> Recoll is xaipan based. >> >> On Fri, Nov 08, 2019 at 08:28:22AM -0500, John Kitchin wrote: >>> It could be dead. At the time I worked with it, the project had already >>> switched to a library form that was not directly useful to me, and the >>> original swish project was not being further developed. These days, I would >>> look to something like xapian or postgresql I think (assuming sqlite is not >>> sufficient for your needs). >>> >>> John >>> >>> --- >>> Professor John Kitchin >>> Doherty Hall A207F >>> Department of Chemical Engineering >>> Carnegie Mellon University >>> Pittsburgh, PA 15213 >>> 412-268-7803 >>> @johnkitchin >>> http://kitchingroup.cheme.cmu.edu >>> >>> >>> >>> On Fri, Nov 8, 2019 at 8:13 AM Roland Everaert wrote: >>> >>> > Is it me or Swish-e is dead? >>> > >>> > The url www.swish-e.org, leads to a whisky e-shop oO. >>> > Eric Abrahamsen writes: >>> > >>> > > John Kitchin writes: >>> > > >>> > >> The way I got Swish to index org files was to create a script that >>> > >> generated an xml file >>> > >> ( >>> > https://kitchingroup.cheme.cmu.edu/blog/2015/07/06/Indexing-headlines-in-org-files-with-swish-e-with-laser-sharp-results/ >>> > ) >>> > >> or html >>> > >> ( >>> > http://kitchingroup.cheme.cmu.edu/blog/2015/07/03/Using-swish-e-to-index-org-files-as-html/ >>> > ) >>> > >> that it could index. This is probably a general strategy for these >>> > tools. >>> > > >>> > > That seems unfortunately roundabout, but I don't know enough about the >>> > > various FTS engines to know if they could be taught to read Org files >>> > directly... >>> > >>> > >>> > -- >>> > Luke, use the FOSS >>> > >>> > Sent from Emacs >>> > >>> > >> >> >> -- >> Russell Adamsrlad...@adamsinfoserv.com >> >> PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ >> >> Fingerprint:1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 -- Luke, use the FOSS Sent from Emacs
Re: Display problems
Thanks Eric for this explanation! I can't read emacs-devel as often as I did. Fabrice Le mar. 12 nov. 2019 à 07:45, Fraga, Eric a écrit : > On Monday, 11 Nov 2019 at 17:12, Fabrice Popineau wrote: > > - with global-hl-line-mode: the cursor disappears on empty lines, > > quite disturbing in my opinion > > Known problem in latest versions of Emacs with extended faces (hl-line > face is one such face). If you customize the face and remove the > :extend property, everything is fine in terms of the cursor but, of > course, the face will no longer extend across the window. > > -- > Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78 >