Re: [O] General advice beyond Org

2018-05-18 Thread edgar

On 2018-05-18 07:12, S. Champailler wrote:

Be aware that free software is politcally loaded. It's just not a
matter of having the right or best tools, it' sometimes a question of
ideal, that is something that is *very* hard to negociate about...

Moreover, if the people you work with use, say Word, it's pretty tough
to bring in, say Latex. Because you'll disrupt the organisation of the
team.

In the case of emacs, though, things are easier : it's made to work
with text files and that is quite compatible with any other
proprietary software. You won't affect anybody's job with that.

Here at my job, I don't control any of the software I use (I have to
use Oracle, Windows, Skype), but I can choose the software that *I*
use for myself. So it's a balance.

Changing other's mind, or methods is super hard, what you experience
is just the normal. It'd be nice to know why your advisor rejects free
software equivalents (lack of features ? fear of legal battles ?
organisational ...)

Stefan


Merci, Stefan. I have tried to understand her point, and I can dissect 
it into:


1. She does not see the advantage of having to learn how to use anything 
else. It works well for her, why change and waste time on doing it?


2. She likes and is used to the "features" of the software (today, I 
discovered that one of these is the so-called "track changes"; I swear I 
have tried to introduce her to Git, not that she cares).


3. I think that she is used to the interface.

4. She says (and I have no reason to question) that the whole department 
uses the proprietary software that she uses. It is an imposition to 
others (including her) to ask them to use something different.


It is only when we have to collaborate directly that the issue arises. I 
guess that it's a similar situation as you are having (programming? she 
does not care, I can do whatever I want; publication abstract? she wants 
a DOCX or DOC). What I find unfathomable is that I can produce the 
format that she needs (even with style) with free software (thanks 
community!), but what I perceive as her reluctance to my software (or 
just plain miscommunication) prevents her from informing me or me 
understanding what exactly it is that she considers important. In other 
words, she does not seem to want to deal with it in any way.


I'm sorry, I didn't want to make this very long. I hope that I explained 
myself.


The count goes like this (so that everyone knows that I am listening, 
the count is by far the least important):
- Yield partially (1) :: You will have to work with proprietary software 
in some way, but not always.
- There is no escape (1) :: You will have to work with proprietary 
software


-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] export to odt with LaTeX math formulae and tables

2018-05-18 Thread Joseph Vidal-Rosset
Hello Edgar, Nicolas, Eric, and everybody of the emacs-orgmode list,

I give news of my export tentatives from my .org file to odt , in a word:
it fails.
I suspect that the problem is my setup, but I am unable to be more precise
(if it was not the case, I could probably fix it).

Anyway, pandoc alone was useful and with

pandoc -f latex -t odt -o output.odt input.tex
>

or

pandoc my-document.tex -o my-document.docx
>
>
(I got help here:
https://askubuntu.com/questions/82634/how-to-convert-tex-into-odt
and here: https://jabranham.com/blog/2016/11/using-pandoc-export-to-word/ )

I have succeeded to get odt and docx files . But in these files:

   1. tables from tabular with multicolumn are not correctly exported,
   2. the bibliography is not exported
   3. figures of natural deduction proofs produced with proof.sty cannot be
   read, because only the latex code is given (I suppose that I need png
   images, but because my org export to odt fails, the export of all natural
   deductions proof schema also fails.).

 *Comment:* It is a terrible waste of time for a result that even if with a
lot of efforts the odt or docx export will finally succeed, the final
result will be far to be as nice as the pdf produced by the latex file.

Anyway, your help is still welcome.

Best wishes,

Jo.


2018-05-17 18:31 GMT+02:00 Joseph Vidal-Rosset <
joseph.vidal.ros...@gmail.com>:

> Many thanks Edgar,
>
> I  did not  pay attention  to  the list  because  I had  to finish  this
> paper. It is finished, now, but still not exported in odt format. I hope
> that I  will succeed to do  it. Thanks to you  and to all for  your kind
> help.
>
> Best wishes,
> --
> Joseph
>


[O] [PATCH] ox-taskjuggler.el: Check return code instead of error buffer

2018-05-18 Thread Grégoire Jadi
Hello orgmode@,

I've recently tried taskjuggler and it reports some warnings about
Fixnum: https://github.com/taskjuggler/TaskJuggler/issues/200

However, this warnings do not prevent taskjuggler from exporting a
report. This patch checks the return code instead of the error buffer to
determine if the export process was successful or not.

WDYT?
Best,

From 7113e79ef8a9cd476873d278e1a4124be2f20f12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= 
Date: Fri, 18 May 2018 10:30:38 +0200
Subject: [PATCH] ox-taskjuggler.el: Check return code instead of error buffer

* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-compile): Check the
return code of the taskjuggler call instead of the error buffer to
determine if the export by taskjuggler was successful or not (ignore
warnings). Also, do not erase the output buffer as it is already done
by `shell-command'.
---
 contrib/lisp/ox-taskjuggler.el | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 5dd9b2202..125cf7891 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -998,18 +998,16 @@ Return a list of reports."
   (let ((outbuf (get-buffer-create "*Org Taskjuggler Output*")))
 	(unless (file-directory-p out-dir)
 	  (make-directory out-dir t))
-	(with-current-buffer outbuf (erase-buffer))
-	(shell-command
-	 (replace-regexp-in-string
-	  "%f" (shell-quote-argument full-name)
-	  (replace-regexp-in-string
-	   "%o" (shell-quote-argument out-dir)
-	   org-taskjuggler-process-command t t) t t) outbuf)
-	;; Collect standard errors from output buffer.
-	(setq errors (org-taskjuggler--collect-errors outbuf)))
-  (if (not errors)
-	  (message "Process completed.")
-	(error (format "TaskJuggler failed with errors: %s" errors
+	(if (zerop (shell-command
+		(replace-regexp-in-string
+		 "%f" (shell-quote-argument full-name)
+		 (replace-regexp-in-string
+		  "%o" (shell-quote-argument out-dir)
+		  org-taskjuggler-process-command t t) t t) outbuf))
+	(message "Process completed.")
+	  ;; Collect standard errors from output buffer.
+	  (setq errors (org-taskjuggler--collect-errors outbuf))
+	  (error (format "TaskJuggler failed with errors: %s" errors)
 (file-expand-wildcards (format "%s/*.html" out-dir
 
 (defun org-taskjuggler--collect-errors (buffer)
-- 
2.16.2



signature.asc
Description: PGP signature


Re: [O] export to odt with LaTeX math formulae and tables

2018-05-18 Thread edgar

On 2018-05-18 08:35, Joseph Vidal-Rosset wrote:

Hello Edgar, Nicolas, Eric, and everybody of the emacs-orgmode list,

I give news of my export tentatives from my .org file to odt , in a 
word:

it fails.
I suspect that the problem is my setup, but I am unable to be more 
precise

(if it was not the case, I could probably fix it).

Anyway, pandoc alone was useful and with

pandoc -f latex -t odt -o output.odt input.tex




or

pandoc my-document.tex -o my-document.docx




(I got help here:
https://askubuntu.com/questions/82634/how-to-convert-tex-into-odt
and here: 
https://jabranham.com/blog/2016/11/using-pandoc-export-to-word/ )


I have succeeded to get odt and docx files . But in these files:

   1. tables from tabular with multicolumn are not correctly exported,
   2. the bibliography is not exported
   3. figures of natural deduction proofs produced with proof.sty 
cannot be
   read, because only the latex code is given (I suppose that I need 
png
   images, but because my org export to odt fails, the export of all 
natural

   deductions proof schema also fails.).

 *Comment:* It is a terrible waste of time for a result that even if 
with a

lot of efforts the odt or docx export will finally succeed, the final
result will be far to be as nice as the pdf produced by the latex file.

Anyway, your help is still welcome.

Best wishes,

Jo.



Dear Jo,

First of all, I don't want you to have the wrong impression: I am not an 
Emacs nor Org guru. If I give you an advice, always, always take it with 
caution.


Secondly, I am glad that you are having progress! :D .

Thirdly, I think that I can help you with point (2). Did you try with 
pandoc like I said before?:


On 2018-05-16 20:19, hidden@mail wrote:

Export to ~LaTeX~ file first with ~C-c C-e l l~



  pandoc --csl=council-of-science-editors.csl \
  --bibliography=/path/to/myreferences.bib \
  -f latex+smart inputfile.tex \
  -t docx+smart -o outputname.docx


You will need
1. a CSL file to set a style to your references 
(council-of-science-editors.csl in this example). You can get some from 
here: https://github.com/citation-style-language/styles

2. a bib style (I use Biber; I don't know if that matters, just try).

This has worked for me in the past to produce a DOCX with references.

What I actually recommend is to get that DOCX and copy the references to 
what Org mode exports as ODT 
(https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00346.html), 
then save the ODT as DOCX in LibreOffice. The ODT produced by Org is 
almost ready, and it carries the advantage of
1. tweaking an OTT (template) to your needs to set a specific format 
(see the link above; you can try the same with --reference-doc in 
pandoc, by the way).
2. being able to (partially use siunitx or other LaTeX commands with 
LaTeXMLMath; although pandoc is working on getting siunitx as well--make 
sure to get the latest version). If you see siunitx.sty.ltxml from 
Authorea's github.com (see link above), you'll see that it may be 
possible to tweak it to your needs for proof.sty.
3. produces tables (you may need to change the format; did I mention the 
OTT?)


One disadvantage of this method is that you may need to replace the key 
to the references to the format which you need (i.e. [authoryear] to 
[1]), but you can use the Replace All function from LibreOffice (if 
there are not many references). I would advise to keep a copy of the 
list after you do the first Replace All, because it's going to be lost 
the next time that you export.


I am sure that there is a good reason for which exporting with 
references has not been implemented in the ODT export function in Org. 
As I said, I am not a guru, and I am not going to complain to the 
developers if I can't code it myself, but you may want to post a feature 
request (may be I should too).


I have never used proof.sty, but I know that there is a way to ask Org 
to load a set of packages when exporting. May be that helps (look for 
the documentation of org-latex-default-packages-alist and 
org-latex-packages-alist; C-h v org-latex-default-packages-alist)


Bonne chance! :) .

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] export to odt with LaTeX math formulae and tables

2018-05-18 Thread Joseph Vidal-Rosset
Dear Edgar,

Thanks for your help on the export of bibliography for docx or odt. I am
going to persist in trying to succeed it.

About proof.sty, really there is not  the least problem from org-mode to
latex, everything  is smoothly  exported and the  final pdf  document is
really nice (with the really pretty smfart.class
[[http://smf4.emath.fr/Publications/Formats/]] that I advice.)

No,  my problem  is only  with the  export of  these proof  to odt,  and
Authorea fails  also (that is  the main reason  why I gave  up Authorea,
which seems  to me  being a  nice project, but  not complete  enough and
therefore unfortunately  useless for me). The  only reasonable solutions
seems to me the png export from a succeeding org export to an odt file.

Best wishes,

-- 
Joseph 



Re: [O] General advice beyond Org

2018-05-18 Thread Diego Zamboni
Hi Edgar,

As in many other contexts, it’s important to keep the big picture in mind. As a 
grad student, is your goal to learn about your field, to do interesting 
work/research, and to eventually graduate? Or is it to defend your ideals and 
use the software you like? If it’s the second, by all means the software you 
use should be a central consideration (to the point of looking for other places 
of study, as suggested in your original post). But if it’s the first (as it 
should, IMO), then the central considerations change: is your professor 
good/nice/competent (insert your own criteria here)? Does she foster your 
work/research in productive ways? Does she give you good challenges and 
research topics? Only you can answer those questions.

You can always compromise. Not all of us get to use only the tools we like all 
day long. In my case, I like my job very much, despite the fact that I have to 
use tools like Exchange, Sharepoint and Jira. But at home, during my free time, 
I get to code and use whatever tools I want (e.g. Emacs, org-mode, Elvish, 
Hammerspoon).  I get to use some of them at work too, but I am aware that I 
have to stick to the accepted standards of communication and collaboration with 
others.

From what you say, the tools your advisor uses are the recognized/accepted ones 
for doing the work. You could try to challenge this status quo, given enough 
time and energy. But again, think about what your goals are. You have to choose 
your battles. In any case, after you graduate, you can go on an be much more 
selective about (or even, define yourself) the tools with which you work.

As a former grad student myself, I can give you two pieces of wisdom I received 
over the years, one from my Ph.D. advisor, and one from one of my colleagues. 
Both express the same feeling:

“You may think now that getting your Ph.D. is the goal, but it’s only the 
beginning. The Ph.D. only opens the door for whatever you want to do next”
“The goal of a Ph.D. is to finish it”

All the best,

—Diego


> On 18 May 2018, at 10:10, ed...@openmail.cc wrote:
> 
> On 2018-05-18 07:12, S. Champailler wrote:
>> Be aware that free software is politcally loaded. It's just not a
>> matter of having the right or best tools, it' sometimes a question of
>> ideal, that is something that is *very* hard to negociate about...
>> Moreover, if the people you work with use, say Word, it's pretty tough
>> to bring in, say Latex. Because you'll disrupt the organisation of the
>> team.
>> In the case of emacs, though, things are easier : it's made to work
>> with text files and that is quite compatible with any other
>> proprietary software. You won't affect anybody's job with that.
>> Here at my job, I don't control any of the software I use (I have to
>> use Oracle, Windows, Skype), but I can choose the software that *I*
>> use for myself. So it's a balance.
>> Changing other's mind, or methods is super hard, what you experience
>> is just the normal. It'd be nice to know why your advisor rejects free
>> software equivalents (lack of features ? fear of legal battles ?
>> organisational ...)
>> Stefan
> 
> Merci, Stefan. I have tried to understand her point, and I can dissect it 
> into:
> 
> 1. She does not see the advantage of having to learn how to use anything 
> else. It works well for her, why change and waste time on doing it?
> 
> 2. She likes and is used to the "features" of the software (today, I 
> discovered that one of these is the so-called "track changes"; I swear I have 
> tried to introduce her to Git, not that she cares).
> 
> 3. I think that she is used to the interface.
> 
> 4. She says (and I have no reason to question) that the whole department uses 
> the proprietary software that she uses. It is an imposition to others 
> (including her) to ask them to use something different.
> 
> It is only when we have to collaborate directly that the issue arises. I 
> guess that it's a similar situation as you are having (programming? she does 
> not care, I can do whatever I want; publication abstract? she wants a DOCX or 
> DOC). What I find unfathomable is that I can produce the format that she 
> needs (even with style) with free software (thanks community!), but what I 
> perceive as her reluctance to my software (or just plain miscommunication) 
> prevents her from informing me or me understanding what exactly it is that 
> she considers important. In other words, she does not seem to want to deal 
> with it in any way.
> 
> I'm sorry, I didn't want to make this very long. I hope that I explained 
> myself.
> 
> The count goes like this (so that everyone knows that I am listening, the 
> count is by far the least important):
> - Yield partially (1) :: You will have to work with proprietary software in 
> some way, but not always.
> - There is no escape (1) :: You will have to work with proprietary software
> 
> -
> 
> ONLY AT VFEmail! - Use our Metadata Mitigator

Re: [O] export to odt with LaTeX math formulae and tables

2018-05-18 Thread Joseph Vidal-Rosset
Hello again,

I just got this message error:

OpenDocument export failed: Wrong type argument: listp, 67
>

What is the meaning of this message and how can I do?

Many thanks for your help,

Jo.

2018-05-18 12:01 GMT+02:00 Joseph Vidal-Rosset <
joseph.vidal.ros...@gmail.com>:

> Dear Edgar,
>
> Thanks for your help on the export of bibliography for docx or odt. I am
> going to persist in trying to succeed it.
>
> About proof.sty, really there is not  the least problem from org-mode to
> latex, everything  is smoothly  exported and the  final pdf  document is
> really nice (with the really pretty smfart.class
> [[http://smf4.emath.fr/Publications/Formats/]] that I advice.)
>
> No,  my problem  is only  with the  export of  these proof  to odt,  and
> Authorea fails  also (that is  the main reason  why I gave  up Authorea,
> which seems  to me  being a  nice project, but  not complete  enough and
> therefore unfortunately  useless for me). The  only reasonable solutions
> seems to me the png export from a succeeding org export to an odt file.
>
> Best wishes,
>
> --
> Joseph
>


Re: [O] General advice beyond Org

2018-05-18 Thread hymie!
In our last episode, the evil Dr. Lacto had captured our hero,
  ed...@openmail.cc , who said:

> I am in graduate school, and I keep having issues with my 
> advisor for my strong inclination to use free software. [...]
>
> Is anyone here aware of a place where they do computational human 
> biomechanics, mechanics, materials or finite elements where I could 
> interact with free software?

First question -- it sounds like you are doing very specific research
with very specific tools, software, equations, and things like that.
Are you sure that free software exists that will do what you want?

For example, good luck finding free software that will do your taxes.

> Do you just nod and wave your freedom good bye?

Second question -- you keep using that word "free".  Are you really "free"
in this situation?  You said you are getting tuition covered and a
stipend.  The way employment typically works is that, in return for
salary and/or compensation, you give your full devotion to your employer's
wants and needs instead of your own.  Using your employer's software is
not a huge jump.

I don't mean this as a personal attack.  That's how it works.  I am
"free" to wear a t-shirt that says "F**K THE POLICE" on it, but the
person who pays my salary would prefer if, for 40 hours each week, I
wear a different shirt.  I am "free" to ignore his request.  He is "free"
to stop paying my salary.

So I'm afraid that's my answer.  Suck it up and do what the nice person
who is giving you lots of money wants you to do, they way he/she wants
you to do it.

--hymie! http://lactose.homelinux.net/~hymiehy...@lactose.homelinux.net




Re: [O] General advice beyond Org

2018-05-18 Thread Aaron Ecay
Hi Edgar,

2018ko maiatzak 18an, -ek idatzi zuen:

> It is only when we have to collaborate directly that the issue
> arises. 

It sounds like the issue you are having is about collaboration workflow,
and not about the usage of free software per se.  Reading between the
lines, it sounds like your biggest difficulty is with Microsoft Word.
Itʼs very unlikely that you will be able to convince your advisor to
switch to another program when writing with you.  As Diego said, it is
ultimately up to you whether you can live with this.  But there are
certainly compromises you could entertain that might make it easier.

There are important benefits, to a field and to individual researchers,
of open analyses.  On the other hand, what maters about a scientific
publication is principally the words themselves and where they are
published – not the workflow that was used to create them, which mostly
passes into irrelevance once they become part of the scientific record.
So you might find pragmatic benefits to focusing on free software
analysis tools and programming languages, and on the importance of
publicly releasing analysis materials (whether based on free software or
not) at an appropriate stage of the research, rather than on document
authorship workflow where your advisor seems to have a particularly
entrenched position.

Another suggestion to reach out to other graduate students, who have the
surplus of time* and lack of pre-established workflow habits conducive to
learning new techniques.  This wonʼt directly solve your issues with
your advisor, but if you are contributing to the success of free
software in other areas you might feel like your sacrifices with her are
being balanced out.

(*Having been a graduate student, Iʼm only too aware of the falsity of
the premise that grad students have ample free time in an absolute
sense.  But relative to other career stages, grad students are probably
the best situated in that regard.  Itʼs also true that there are many
things that grad students need to learn that could be learned either
with free or nonfree software.  The marginal time cost of replacing
nonfree software in that learning with free software is likely to be
small.)

Itʼs also true that free software has network effects.  Once someone is
using R or Python, they are introduced to things like Jupyter or knitr
(which are literate programming systems) – or even org mode.  They also
get exposed to VCS (like git), free text editors (like emacs, or RStudio),
and other tools that do not directly replace Word but contribute to an
alternate ecosystem.  They might eventually be induced to switch their
writing software of choice because of the features of such environments.
So by evangelizing the pieces of free software that are most appetizing
to others in your field, you are laying the groundwork for subsequent
improvements that might initially be a harder sell.

Finally, a very pragmatic suggestion.  You might suggest to your advisor
that you and her collaborate via Google Docs rather than MS Word.  This
is something I have found helpful with colleagues of mine who are not
otherwise prepared to change their writing habits.  The Google Docs
interface is very similar to Word (but actually avoids some of the
radical UI changes that MS has made recently, which might make it even
more appetizing to certain users).  While Gdocs is not free software (as
itʼs important to point out), it enables me to use less proprietary
software, on average.  Iʼve never been able to get Libreoffice to work
satisfactorily for iterative edits to a Word doc; I find that it too
often loses formatting, included images, or otherwise doesnʼt
interoperate with Word well enough.  So in the absence of Google Docs I
would have to maintain a Windows system on which to use Word.  With
Gdocs I have one browser tab that runs unfree JS, but the rest of my
system is GNU/Linux.  (There are also benefits to the online-first
nature of Google Docs, which avoids the emailing back and forth of
dueling versions of a Word document that I have sometimes encountered in
groups that primarily use Word – but these are orthogonal to the
free/nonfree distinction.)

I hope that some of this comes as useful advice.

-- 
Aaron Ecay



Re: [O] General advice beyond Org

2018-05-18 Thread Adonay Felipe Nogueira
2018-05-18T00:28:22+ ed...@openmail.cc wrote:
> Hello,
>
> _I_ need help. I am in graduate school, and I keep having issues with

I'm undergraduating (seeking a bachelor's degree in organization
management). :D

> _I_ need help. I am in graduate school, and I keep having issues with
> my advisor for my strong inclination to use free software. I am
> obviously not in position to refuse, but she dislikes to have

At first glance I would recommend you to keep using free/libre software
only, and advocating for it where you live, work and study. But please
read on...

> discussions about it. She pays a stipend to me every month, and my
> tuition is waved.

... Now this is a tricky challenge. Not that difficult, but as far as I
can see these are the options:

a) worst: make the compromise and use these non-free tools in your
   computer (the same applies when using a virtual machine or a
   container), because all-in-alll, it's still your personal
   computer. Besides, the virtual machine or container can misbehave and
   impact your real system or personal files.

   You will still have to deal with side-effects caused by loss of
   control over your own computing, let alone the need to learn
   how to use that non-free tool;

b) somewhat better, although slow: use another computer (or get one from
   a rent) to do the work, and only do the work with that machine.

   The same case described in the second paragraph of (a) applies here;

c) better: do it with only free/libre software, and perhaps even teach
   or show the people involved how to make use of tools that support
   your workflow. For example Software Carpentry has awesome
   collaborative material on the basics of VCS using Git and of
   statistics wih R.

   If you don't have time to teach, make use of a tool that eases *them*
   participating in their terms.

   As an example, I'm writing my final course work using Org-mode, LaTeX
   and TikZ/PGF (this last one is for graphics), and whenever I want to
   send a snapshot for review to my advisor I do so through making a
   .pdf, but there is even more...

   The .pdf files don't actually track changes, so I must go into the
   extra step of doing the following:

   --8<---cut here---start->8--- #
   # Convert old .pdf work snapshot to text. Makes a .txt file of the same
   # name, minus ".pdf". Caution here because if you don't specify a name or
   # path to place the .txt file, `pdftotext' will put it in the same
   # directory where the original is, contrary to what most commands do in
   # GNU+Linux. In Trisquel 8.0 Flidas, `pdftotext' comes from the
   # "poppler-utils" package.

   pdftotext "Documents/Work_---_2018-05-01.pdf"

   # Same for current .pdf which will be sent.

   pdftotext "Work.pdf"

   # Use GNU `diff' to produce Unified diff for text-only content.  For us
   # who use GNU+Linux or GNU-with-Linux computers (GC) the diff files
   # commonly have .diff or .patch extensions, but we use .txt here so that
   # users of Windows computers (WC) can open those with ease in their
   # default plain text editor.

   diff -u "Work_---_2018-05-01.txt" "Work.txt" > "Work_diff.txt"

   # Among other unknown reasons, WCs make use of "\r\n" (carriage return
   # followed by line feed, commonly known as "CRLF" or "CR+LF") in the end
   # of each line to distinguish these plain text files from binary files.
   # WCs' default notepad will open a non-CRLF file but with all lines
   # joined, so we correct that using the `sed' line below. The side-effect
   # for us GC users is that some editing software might present two line
   # breaks.

   sed -i '/\r$/! { s/\($\)/\r\1/g }' "Work_diff.txt"
   --8<---cut here---end--->8---

   Then send them both the .pdf and the diff file (the one which has
   .txt extension of course). And explain to them that the .txt is plain
   text that can be opened in plain text editor (usually called
   "Notepad" in Windows), and mention that it essentially shows the
   difference between old and new versions, and that:

   - Lines that begin with "+ " is new content;

   - ... "- " old content being removed;

   - ... "@@ -old_start,count_old +new_start,count_new @@" a line jump to
 given "old_start" line in the old file.

   With all that said, the advantages of .pdf files is that the advisors
   can highlight and annote/comment on these, save the changes and send
   it back to you (they can't change the structure or content of the
   document itself, but can at least give you hints).

With all the options I presented, there is still another issue which is
quite common at least in the college I study: the advisors don't
actually orient people that well here, so even if someone theoretically
decides to "suck it up and use non-free software anyways" this doesn't
stop the advisor from being too vague as to give comments such as "it's
not compliant with the institutional norms" (what exactly i

Re: [O] Bug: refile from capture template doesn't update org-clock-current-task [9.1.6 (9.1.6-57-gec8590-elpaplus @ /Users/ag.ibragimov/.emacs.d/elpa/26.0/develop/org-plus-contrib-20180219/)]

2018-05-18 Thread agzam . ibragimov
I sumbitted this long time ago and although it looks like it was fixed (it
updates the modeline), I just noticed that it still doesn't update
`org-clock-current-task` and I think it should, because otherwise there's
no way of accessing current-task value from outside of org-mode and
outside of Emacs.

Let's say I want to show current task in a third-party bar like yabar or
lemonbar.

Calling this

'emacsclient -e \"(if org-clock-current-task (string-trim
(substring-no-properties (org-clock-get-clock-string))) ' )\"

would not work for a task that was refiled by a capture template.

I'm sorry for nitpicking - I would have tried fixing it myself, I tried
diving into the code and I was quickly amazed how complex Org-mode's code
is. No wonder no one has ever succeeded in replicating it for other
editors.

Thank you guys for all amazing hard work that doesn't get appreciated
enough.


On Wed, Feb 21, 2018 at 6:06 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Ag Ibragimov  writes:
>
> > I'm not sure if that's a legitimate bug, just something I have run into
> > on my Spacemacs config
> >
> > # Description
> >
> > org-clock-current-task doesn't update mode-line after refile on capture
> >
> > # To reproduce:
> >
> > Create a capture template with :clock-in and :clock-keep fields, e.g.:
> >
> > ("i" "Immediate" entry (file "tasks.org")
> >  "* ONGOING %?" :clock-in t :clock-resume t :clock-keep t)
> >
> > Create an item using the template.
> > In org-capture dialog - type title, e.g.: "foo"
> >
> > # Observed behavior:
> >
> > After refiling (C-c C-c) - the task header doesn't update in the
> modeline. It shows
> > correctly the time, but not the title.
> > =org-clock-current-task= contains nil.
> > Compare that with the regular way of clocking-in (without using
> > capture) - the title and the variable updates correctly
>
> Fixed. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>



-- 
Regards,
Ag.


Re: [O] Inheriting some local variables from source code block editing buffers

2018-05-18 Thread Göktuğ Kayaalp
On 2018-05-15 21:36 +03, Göktuğ Kayaalp  wrote:
> So, today I've started implementing a version of this that works like
> this:
>
> #+begin_example
>   #+property: edit-bindings /varlist/
>   * heading
>   :properties:
>   :edit_bindings: /varlist/
>   :end:
>   #+header: edit-bindings /varlist/
> #+end_example
>
>
> where scoping is like (x > y meaning x overrides y):
>
>   header line bindings > subtree bindings > #+property bindings before
>   the element
>
> I'll send a complete patch soon.

And here it is.  Please find the patch attached.  I have ran the entire
test suite against this, which completed w/ 6 failures, seemingly
unrelated (they fail on revision 58c9bedfd too); find the list below.  I
have tried to follow apparent conventions in each file w.r.t. the
copyright/authors lines, sorry if I modified them unnecessarily.

6 unexpected results:
   FAILED  test-ob/org-babel-remove-result--results-list
   FAILED  test-org-clock/clocktable/step
   FAILED  test-org/add-planning-info
   FAILED  test-org/clone-with-time-shift
   FAILED  test-org/deadline
   FAILED  test-org/schedule

-- 
İ. Göktuğ Kayaalp   
 024C 30DD 597D 142B 49AC
 40EB 465C D949 B101 2427

>From b6d2b60730ceed68f46ef839c486e03764defdc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=B0=2E=20G=C3=B6ktu=C4=9F=20Kayaalp?= 
Date: Tue, 15 May 2018 20:34:28 +0300
Subject: [PATCH] Implement edit bindings feature

Enable defining local variable bindings to be applied when editing
source code.

* lisp/org-src.el (org-src--apply-edit-bindings)
(org-src--simplify-edit-bindings)
(org-src--parse-edit-bindings)
(org-src--edit-bindings-string)
(org-src--get-edit-bindings-for-subtree)
(org-src--get-edit-bindings-from-header)
(org-src--collect-global-edit-bindings)
(org-src--collect-edit-bindings-for-element): New functions.
(org-src-apply-risky-edit-bindings): New defcustom.
(org-src--edit-element):
* doc/org.texi (Editing source code): Add edit bindings.

* testing/lisp/test-org-src.el (test-org-src/edit-bindings-parser)
(test-org-src/collect-edit-bindings-for-element)
(test-org-src/edit-bindings-precedence-and-application)
(test-org-src/edit-bindings-use-cases): Add relevant tests.
---
 doc/org.texi |  43 +
 etc/ORG-NEWS |  15 +++
 lisp/org-src.el  | 223 +++
 testing/lisp/test-org-src.el | 172 -
 4 files changed, 436 insertions(+), 17 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 6aab1ba4e..c588152fd 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -15364,6 +15364,7 @@ Source code in the dialect of the specified language identifier.
 
 @vindex org-edit-src-auto-save-idle-delay
 @vindex org-edit-src-turn-on-auto-save
+@vindex org-src-apply-risky-edit-bindings
 @kindex C-c '
 @kbd{C-c '} for editing the current code block.  It opens a new major-mode
 edit buffer containing the body of the @samp{src} code block, ready for any
@@ -15421,6 +15422,48 @@ Emacs-Lisp languages.
 ("python" (:background "#E5FFB8"
 @end lisp
 
+It is possible to define local variable bindings for these buffers using the
+@samp{edit-bindings} element header, the @samp{edit-bindings} buffer
+property, or the @samp{EDIT_BINDINGS} entry property.  All three can be used
+together, the bindings from the header override those of the subtree, and
+they both override the bindings from buffer properties.  The syntax is
+similar to that of @code{let} varlists, but a sole symbol means the
+variable's value is copied from the Org mode buffer.  Multiple uses of
+@samp{edit-bindings} headers and buffer properties are supported, and works
+like @code{let*}.  Entry property @samp{EDIT_BINDINGS} can not be repeated.
+Below is an example:
+
+@example
+# -*- fill-column: 65 -*-
+#+PROPERTY: edit-bindings '(fill-column (lexical-binding t))
+
+* Example section
+:PROPERTIES:
+:EDIT_BINDINGS: '((emacs-lisp-docstring-fill-column 60))
+:END:
+
+#+HEADER: edit-bindings '((lexical-binding nil))
+#+BEGIN_SRC elisp
+(defun hello ()
+  (message "Hello world!"))
+#+END_SRC
+
+* Another section
+#+BEGIN_SRC elisp
+(defun hello ()
+  (message "Byes world!"))
+#+END_SRC
+@end example
+
+In this example, when editing the first block, @code{lexical-binding} will be
+@code{nil}, and @code{emacs-lisp-docstring-fill-column} 60.  With the second
+one, they will be @code{t} and the variable's default value, respectively.
+@code{fill-column} will be 65 for both.
+
+Set @code{org-src-apply-risky-edit-bindings} for how risky local variables in
+these bindings are handled.  The default behaviour is to ask to the user
+whether or not to apply them.
+
 @node Exporting code blocks
 @section Exporting code blocks
 @cindex code block, exporting
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 21eaaece6..879240f31 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -95,6 +95,21 @@ document

Re: [O] General advice beyond Org

2018-05-18 Thread Stefan Monnier
> It is only when we have to collaborate directly that the issue
> arises.  I guess that it's a similar situation as you are having
> (programming? she does not care, I can do whatever I want; publication
> abstract? she wants a DOCX or DOC).

Collaborating on an article does require a fairly "deep" integration of
various people's tools, so some compromise often need to be made.

If she's used to using Word to edit documents, then it's likely going to
be difficult to convince her to use something else, at least during your
tenure as student.  What I do usually in those cases is the following:

- I refuse to install proprietary software, so in the worst case I'll edit
  a .docx document with LibreOffice (I don't see why she'd object to
  that under the imperfect compatibility between LibreOffice and Word
  gets in the way).
  [ BTW, If imperfect compatibility between LibreOffice and Word gets in the
  way, you might try and look for some other version of Word than hers,
  and find other incompatibilities (the various Word versions also
  suffer from imperfect compatibility), so as to show her that the issue
  is not just due to your use of Free Software.  ]

- You can try and get her to install the ODT plugin for Word so she can
  open ODT documents as well as .docx in her Word program.
  I often make the effort to only send ODT documents, even when it's
  a modification of a document that was sent to me in .docx format (on
  the premise that I shouldn't be the only one to bear the brunt of the
  format war).

- Depending on how many changes/annotations she contributes to the
  document, you might be able to keep your original in your favorite
  format (LaTeX, Org, you name it); convert it to ODT or .docx before
  sending it to her; and then integrating her changes/annotations by
  hand into your original document.

Using Git with ODT/.docx documents is about as pleasant as pulling teeth
in my experience, so there's no point trying to convince her to try it
out as long as she sticks to such WYSIWYG thingies.

Of course, the real problems start when she wants to use some *really*
poorly supported format like Apple's Pages.


Stefan