Re: [O] ob-clojure.el is not compatible with new CIDER API

2018-07-30 Thread stardiviner
About 3 days ago, I updated CIDER, seems it can work again now. After 
considering your mentioned problems of managing sessions, seems CIDER 
implemented new middleware called "sesman", have not tried it in details, I 
will dig into it later.

Hmm, because I use ob-clojure to do "Literate Programming", so if can't support 
it well, I will not consider to do it. So to implement one "ob-inf-clojure.el" 
is kind of expensive for me.

-- 
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  



Re: [O] Feature request: Maintaining multiple init files with one org file

2018-07-30 Thread Diego Zamboni
Hi Sven,

Personally, I do not like the idea of having to generate the config files
on every host - I prefer to tangle once, on my main machine, and then
distribute (via git) both the org source and the tangled result to all my
machines. This results in much lower maintenance effort - otherwise I would
need to login to each machine, open Emacs there, and tangle the file (or
automate the process, but still, more work than doing it once). This means
that the logic still needs to be present in the resulting file, but it
doesn't mean the org source needs to be less readable. What I do is use
noweb mode selectively, to indicate the corresponding sections. I use this
for the OS-specific configuration in my Emacs file:
https://github.com/zzamboni/dot-emacs/blob/master/init.org#system-specific-configuration
.

In short, the top-level block includes the necessary logic, plus the
corresponding sections in noweb-style references (the :noweb no-export
makes it so that the tags get expanded only when tangling and not when
exporting, which makes my rendered config files more readable, see the
links below):


#+begin_src emacs-lisp :noweb no-export
  (cond ((eq system-type 'darwin)
 <>
 )
((eq system-type 'windows-nt)
 <>
 )
((eq system-type 'gnu/linux)
 <>
 ))
#+end_src


Then, each subsection sets the corresponding section-level properties, so
that they don't have to be specified in each block - then all the blocks
within that section will be automatically inserted in the corresponding
"section" of the cond statement above. For example:

** Mac
:PROPERTIES:
:header-args:emacs-lisp: :tangle no :noweb-ref Mac settings
:END:

First, we set the key modifiers correctly to my preferences: Make Command
(⌘) act as Meta, Option as Alt, right-Option as Super

#+begin_src emacs-lisp
  (customize-set-variable 'mac-command-modifier 'meta)
  (customize-set-variable 'mac-option-modifier 'alt)
  (customize-set-variable 'mac-right-option-modifier 'super)
#+end_src


You can see the real file here:
https://github.com/zzamboni/dot-emacs/blob/master/init.org#system-specific-configuration,
or in a nicer rendering in my blog:
https://zzamboni.org/post/my-emacs-configuration-with-commentary/#system-specific-configuration

Hope this helps - not exactly what you asked, but maybe a useful
alternative?

Best,
--Diego


On Sat, Jul 28, 2018 at 11:25 AM, Sven Bretfeld 
wrote:

> Hi
>
> I don't know how you guys maintain init files for different hosts. I
> have one org-file with the header:
>
> #+PROPERTY: header-args :tangle ~/.emacs
>
> The file is synced to all my machines and produces the local init files
> on each. Most configurations are shared, but some are host-specific
> (e.g. font size).
>
> Sadly export filtering does not work with the tangle function. It would
> be nice to be able to do something like:
>
> ,
> | * Default Frame
> | ** Office Computer:OFFICE:
> | #+begin_src emacs-lisp
> | (setq default-frame-alist '(
> | (font . "-PfEd-DejaVu Sans Mono-normal-normal-normal-*-
> 26-*-*-*-m-0-iso10646-1")
> | (width . 102)
> | (height . 41))
> | #+end_src
> |
> | ** Computer at home   :HOME:
> | #+begin_src emacs-lisp
> | (setq default-frame-alist '(
> | (font . "-PfEd-DejaVu Sans Mono-normal-normal-normal-*-
> 18-*-*-*-m-0-iso10646-1")
> | (width . 150)
> | (height . 50))
> | #+end_src
> |
> | ** Laptop :LAPTOP:
> | #+begin_src emacs-lisp
> | (setq default-frame-alist '(
> | (font . "-PfEd-DejaVu Sans Mono-normal-normal-normal-*-
> 12-*-*-*-m-0-iso10646-1")
> | (width . 80)
> | (height . 30))
> | #+end_src
> `
>
> It should be clear what this is about. On the office computer you would
> prepare the file headers to exclude the tags HOME and LAPTOP from being
> tangled and, after saving/tangling the file, you would have a nice init
> file suiting this computer. At home the same by excluding the other tags
> etc.
>
> This would save a lot of work and you would have a tidy way to maintain
> all your init files without (if (string-equal (system-name) clauses.
>
> If the noexport tag worked, it would also save a lot of time and mess
> when debugging your init file in case of an error.
>
> I don't actually understand why the developers decided not to implement
> export filtering in the tangling operations. I know about the COMMENT
> keyword, but the above example should make clear that this solution is
> far from handy.
>
> Maybe there is another way that escaped me so far?
>
> All best,
>
> Sven
>
>
>


[O] quick copy-to-slack-syntax?

2018-07-30 Thread Matt Price
Does anyone by chance already have a method for quickly copying the region
or subheading to the very simple Slack syntax? ASCII export seems to be
pretty close but not perfect.  If you have a solution I'd love to hear it!
Otherwise I'll try to roll my own sometime soon, will post in this thread
if get something working.

Slack syntax:
https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages

Thanks as always!
m


Re: [O] export org file ignoring presence of :export: tags [SOLVED]

2018-07-30 Thread Julius Müller
I should have used org-export-select-tags instead of
org-export-exclude-tags. Sorry for the noise.

Julius

Am 26.07.2018 um 18:16 schrieb Julius Dittmar:
> Hi,
> 
> I'm still an elisp beginner, so please bear with me.
> 
> I would like to be able to fully export org-mode files which make use of
> the :export: tag.
> 
> Easist solution would be to remove the :export: tag, but usually I want
> it's effect. But from time to time I need the full text exported.
> 
> I tried:
> 
> === file test.org: ===
> * toppic with export tag :export:
> * toppic without export tag
> === end of file test.org ===
> 
> Export via:
> emacs test.org --eval "(let ((org-export-exclude-tags '()))
> (org-latex-export-to-latex nil nil nil nil nil))" --kill
> 
> Contrary to my expectation, only the first toppic appears in the
> resulting TeX file.
> 
> Any help appreciated.
> 
> Julius
> 




Re: [O] generate PDF with matching new-lines in quotation C-u C-c C-e

2018-07-30 Thread Leslie Watter
Hello,

On Mon, Jul 30, 2018 at 11:37 AM Van L  wrote:

> Hello,
>
> Is it possible to produce in PDF the following passage with matching
> new-lines?
>

You can force a newline in LaTeX putting '\\' at the end of the line(as the
last chars on the line).

You can try this:

> #+NAME: page-56-57
> #+BEGIN_SRC latex :export:
>   \begin{quotation}
>   war. The longer a war lasts, the more things tend to depend on
> acci-\\
>   dents. Neither you nor we can see into them: we have to abide their
> \\
>   outcome in the dark. And when people are entering upon a war they\\
>   do things the wrong way round. Action comes first, and it is only\\
>   when they have already suffered that they begin to think. We, how-\\
>   ever, are still far removed from such a mistaken attitude; so, to the
> \\
>   best of our belief, are you. And so we urge you, now, while we are\\
>   both still free to make sensible decisions, do not break the peace,
> \\
>   do not go back upon your oaths; instead let us settle our differences
> \\
>   by arbitration, as is laid down in the treaty. If you will not do
> so, we\\
>   shall have as our witnesses the gods who heard our oaths. You will\\
>   have begun the war, and we shall attempt to meet you in any and\\
>   every field of action that you may choose.\\
>   \end{quotation}
> #+END_SRC
>

Cheers,

LEslie


-- 
Leslie H. Watter


[O] TOC local for specified heading and its subheadings - now broken?

2018-07-30 Thread D. C. Toedt
1. In November 2015, Sacha Chua very kindly put together a patch to allow
the following:

> # = The next line is the desired feature:  Generate a TOC
list (with links) of *all subheadings in the specified heading *
> *#+TOC: headlines 1 local ConfInfoClauses *


2. Nicholas subsequently proposed

modifying the syntax:

  #+toc: headlines 1 :headline #headline
> or
>   *#+toc: headlines 1 :target #headline*
> since TOC keywords always refer to headlines.



3. Sacha's patch appears to have been applied to ox-html.el for a couple of
years now — but it doesn't seem to work anymore, regardless of the syntax
used.

I've tried it on my main file, and also on a small test file, as follows:

#+TITLE: Test of subTOC for specified headline

* Section 1
  :PROPERTIES:
  :CUSTOM_ID: SectionOne
  :END:

** Section 1.1
  :PROPERTIES:
  :CUSTOM_ID: SecOneOne
  :END:


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam interdum
dui eu commodo sodales. Nunc ac pulvinar augue. Suspendisse sagittis tempus
aliquet. Ut placerat, magna quis blandit pretium, risus libero maximus dui,
non sollicitudin ligula orci non massa. Morbi bibendum facilisis elit a
congue. Suspendisse blandit iaculis quam, sed molestie leo. Nulla porttitor
leo eu urna fermentum pretium. In congue nulla laoreet nunc accumsan, vel
malesuada lacus porta. Praesent vulputate arcu lectus, vitae tincidunt elit
laoreet eget. Suspendisse lobortis nibh sed est scelerisque imperdiet.

** Another section: 1.2
  :PROPERTIES:
  :CUSTOM_ID: SecOneTwo
  :END:


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam interdum
dui eu commodo sodales. Nunc ac pulvinar augue. Suspendisse sagittis tempus
aliquet. Ut placerat, magna quis blandit pretium, risus libero maximus dui,
non sollicitudin ligula orci non massa. Morbi bibendum facilisis elit a
congue. Suspendisse blandit iaculis quam, sed molestie leo. Nulla porttitor
leo eu urna fermentum pretium. In congue nulla laoreet nunc accumsan, vel
malesuada lacus porta. Praesent vulputate arcu lectus, vitae tincidunt elit
laoreet eget. Suspendisse lobortis nibh sed est scelerisque imperdiet.

* Next top-level section: Two
  :PROPERTIES:
  :CUSTOM_ID: SecTwo
  :END:

The next portion should be a sub-TOC for Section 1:

#+TOC: headlines 2 :target #SectionOne

But what it produces is a complete table of contents.

So let's try adding "local" as a keyword:

#+TOC: headlines 2 local  :target #SectionOne

But that produces no TOC at all.


I've got GNU Emacs 26.1 (9.0) installed for Mac OS and the 2018-07-23
update of org-mode.

Any suggestions?

D. C. Toedt III   Attorney & neutral arbitrator — tech contracts & IP
*(My last name is pronounced "Tate")  *Houston, Texas, USA
O: +1 (713) 364-6545   C: +1 (713) 516-8968

d...@toedt.com@dctoedt 
Skype: dctoedt

www.OnContracts.com/About 

Unless expressly stated otherwise, this message is not intended to serve
as assent to an agreement or other document, even if attached to this
message.


[O] generate PDF with matching new-lines in quotation C-u C-c C-e

2018-07-30 Thread Van L
Hello,

Is it possible to produce in PDF the following passage with matching new-lines?

#+NAME: page-56-57
#+BEGIN_SRC latex :export:
  \begin{quotation}
  war. The longer a war lasts, the more things tend to depend on acci-
  dents. Neither you nor we can see into them: we have to abide their
  outcome in the dark. And when people are entering upon a war they
  do things the wrong way round. Action comes first, and it is only
  when they have already suffered that they begin to think. We, how-
  ever, are still far removed from such a mistaken attitude; so, to the
  best of our belief, are you. And so we urge you, now, while we are
  both still free to make sensible decisions, do not break the peace,
  do not go back upon your oaths; instead let us settle our differences
  by arbitration, as is laid down in the treaty. If you will not do so, we
  shall have as our witnesses the gods who heard our oaths. You will
  have begun the war, and we shall attempt to meet you in any and
  every field of action that you may choose.
  \end{quotation}
#+END_SRC




[O] repeating timestamps with an end date

2018-07-30 Thread Robert Pluim
Hi,

is there a generic way to specify an end date for a repeating event? I
can do something like

* 10:00-12:00 an event
  <%%(org-class 2018 8 1 2018 8 31 2)>

to have something repeat every Tuesday in August, but that doesnʼt
work for other repeating intervals. Iʼd much rather be able to do
something like

* an event
  <2018-08-01 Wed 10:00-12:00+1w>--<2018-08-14>

but that makes it appear in the agenda every day.

Thanks

Robert



[O] org-drill version 2.4.7 vs 2.6.1

2018-07-30 Thread Janus
Hi  everyone,

Congratulation for the excellent work on org-mode. It is an amazing piece of 
software.

I have encountered some problems using org-drill. At the end I  found that the 
'org-drill.el' version in the repository 
https://code.orgmode.org/bzg/org-mode.git is 2.4.7.
The version on https://bitbucket.org/eeeickythump/org-drill/src/01b05cd7561a is 
2.6.1.

Version 2.4.7 doesn’t work.

Version 2.6.1 work perfectly.

Do I miss something?

Best regards J.



[O] Bug: truncate lines when setupfile [9.0.5 (9.0.5-elpa @ /home/xavier/.emacs.d/elpa/org-20170210/)]

2018-07-30 Thread Xavier Leleu
Hi,
The default truncate-line option turns off when the org-file contains a 
#+SETUPFILE: mysetupfile.setup. M-x toggle-truncate-lines gets truncation back. 



Emacs  : GNU Emacs 24.4.1 (i586-pc-linux-gnu, GTK+ Version 3.14.5)
 of 2017-09-12 on x86-csail-01, modified by Debian
Package: Org mode version 9.0.5 (9.0.5-elpa @ 
/home/xavier/.emacs.d/elpa/org-20170210/)




[O] Bug: Variable comment-start-skip in the function org-agenda-skip is nil but should be a string. [9.1.13 (9.1.13-elpa @ ~/.emacs.d/elpa/org-20180716/)]

2018-07-30 Thread Pierre-Henry F.
Hello dear list and thank you for looking at this stuff down below as
well as org-mode and many other things.

Best,
PHF

I get:

  Debugger entered--Lisp error: (wrong-type-argument stringp nil)

looking-at(nil)

org-agenda-skip()

org-scan-tags(proposition_org/if_proposition_then_get_content_else_nil t 
nil nil)

org-map-entries(proposition_org/if_proposition_then_get_content_else_nil t)

(seq-filter 'not (org-map-entries 
'proposition_org/if_proposition_then_get_content_else_nil t))

proposition_org/list_propositions_in_buffer()

(progn (insert-file-contents file_name) 
(proposition_org/list_propositions_in_buffer))

(unwind-protect (progn (insert-file-contents file_name) 
(proposition_org/list_propositions_in_buffer)) (and (buffer-name temp-buffer) 
(kill-buffer temp-buffer)))

(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn 
(insert-file-contents file_name) (proposition_org/list_propositions_in_buffer)) 
(and (buffer-name temp-buffer) (kill-buffer temp-buffer

(let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer 
(set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents 
file_name) (proposition_org/list_propositions_in_buffer)) (and (buffer-name 
temp-buffer) (kill-buffer temp-buffer)

(cond ((file-exists-p file_name) (let ((temp-buffer (generate-new-buffer " 
*temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn 
(insert-file-contents file_name) (proposition_org/list_propositions_in_buffer)) 
(and (buffer-name temp-buffer) (kill-buffer temp-buffer)) (t 'nil))

(let ((file_name (expand-file-name x))) (cond ((file-exists-p file_name) 
(let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer 
(set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents 
file_name) (proposition_org/list_propositions_in_buffer)) (and (buffer-name 
temp-buffer) (kill-buffer temp-buffer)) (t 'nil)))

proposition_org/extract_posts("~/tmp.org")

(message (proposition_org/extract_posts "~/tmp.org"))

eval((message (proposition_org/extract_posts "~/tmp.org")) nil)

elisp--eval-last-sexp(nil)

eval-last-sexp(nil)

funcall-interactively(eval-last-sexp nil)

call-interactively(eval-last-sexp nil nil)

command-execute(eval-last-sexp)

By executing this program:

  ;; Import

  (require 'seq)

  (require 'cl-lib)

  (require 'org)

  ;; Define

  (defun proposition_org/extract_posts (x)

"file_name → [proposition_org]"

(let ((file_name (expand-file-name x)))

  (cond ((file-exists-p file_name)

 (with-temp-buffer

   (insert-file-contents file_name)

   (proposition_org/list_propositions_in_buffer)))

(t '()

  (defun proposition_org/list_propositions_in_buffer ()

"current_buffer → [proposition_org]"

(seq-filter 'not (org-map-entries 
'proposition_org/if_proposition_then_get_content_else_nil t)))

  (defun proposition_org/if_proposition_then_get_content_else_nil ()

"current_heading → nil | proposition_org"

(cond ((proposition_org/is_publication) (proposition_org/get_content))

  (t nil)))

  (defun proposition_org/get_content ()

"current_heading → string"

(org-narrow-to-subtree)

(let ((content (buffer-string)))

  (widen)

  content))

  (defun proposition_org/is_publication ()

"current_heading → boolean"

(eq (proposition_org/is_proposition_properties (org-entry-properties)) 
'true))

  (defun proposition_org/is_proposition_properties (properties)

"properties ≡ [[key,value]]

 properties → 'true | 'false"

(let ((proposition_properties_pattern

   (list

(cons

 (lambda (x) (equal "PUBLIC" x))

 (lambda (x) (equal "true" x)))

(cons

 (lambda (x) (equal "TARGET_ID" x))

 (lambda (x) (stringp x)))

(cons

 (lambda (x) (equal "PREVIOUS_VERSION" x))

 (lambda (x) (stringp x)))

(cons

 (lambda (x) (equal "AUTHOR" x))

 (lambda (x) (stringp x)))

(cons

 (lambda (x) (equal "TYPE_NAME" x))

 (lambda (x) (equal "proposition_org" x)))

(cons

 (lambda (x) (equal "TYPE_ID" x))

 (lambda (x) (equal "af7658fc-0541-4cbe-8a5c-04fd5cde74ff" x))

  (proposition_org/properties_has_pattern properties 
proposition_properties_pattern)))

  (defun proposition_org/properties_has_pattern (properties patterns  
result)

"properties ≡ [[key,value]]

 patterns ≡ [[predicate,predicate]]

 properties patterns → 'true | 'false"

(proposition_org/to_truth

 (cond ((null result) (proposition_org/properties_has_pattern properties 
patterns 'true))

   ((eq result 'false) result)

   ((null patterns) result)

   (t (proposition_org/properties_has_pattern

  

[O] Bug: Broken link in documentation

2018-07-30 Thread Julien Palard
Hi,

I'm new to Org mode and spotted a broken link at the bottom of 
https://orgmode.org/features.html : mobileorg.ncogni.to

$ curl -s https://orgmode.org/features.html | grep 
http://mobileorg.ncogni.to/
Richard Moreland has developed http://mobileorg.ncogni.to/;>MobileOrg, a free software for iPhone and
$ curl -i mobileorg.ncogni.to
curl: (6) Could not resolve host: mobileorg.ncogni.to

Bests,
​-- 
Julien Palard
https://mdk.fr​





[O] Bug: org-indent-boundary-char doesn't have org-indent face [9.1.9 (release_9.1.9-65-g5e4542 @ c:/Program Files/emacs-26.1-x86_64/share/emacs/26.1/lisp/org/)]

2018-07-30 Thread HIRATA Tadashi
Hello org-mode developers,

I found a bug that org-indent-boundary-char doens't have
org-indent face property in org-indent-mode. This causes an
appearance issue when you use org-mode with whitespace-mode
that you can't control org-indent-boundary-char's face
neither whitespace-space face nor org-indent face.

Here is a quick patch to fix the problem. (though I test it
in 9.1.9, but it should work well in the latest version).

Sincerely,
Tadashi



diff -u org-indent.el_org org-indent.el
--- org-indent.el_org   2018-07-23 14:13:06.045078400 +0900
+++ org-indent.el   2018-07-24 10:00:57.898200400 +0900
@@ -150,10 +150,11 @@
   ;; Text line prefixes.
   (aset org-indent--text-line-prefixes
n
-   (concat (org-add-props (make-string (+ n indentation) ?\s)
-   nil 'face 'org-indent)
-   (and (> n 0)
-(char-to-string org-indent-boundary-char)))
+   (org-add-props 
+   (concat (make-string (+ n indentation) ?\s)
+   (and (> n 0)
+(char-to-string org-indent-boundary-char)))
+   nil 'face 'org-indent)
 
 (defsubst org-indent-remove-properties (beg end)
   "Remove indentations between BEG and END."





Emacs  : GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-31
Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ c:/Program 
Files/emacs-26.1-x86_64/share/emacs/26.1/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-time-stamp-custom-formats '("<%Y/%m/%d>" . "<%Y/%m/%d %H:%M>")
 org-indent-boundary-char 124
 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
 (lambda nil (setq truncate-lines nil)
  (define-key org-mode-map "\346" (quote org-metaright))
  (define-key org-mode-map "\342" (quote org-metaleft))
  (define-key org-mode-map "\360" (quote org-metaup))
  (define-key org-mode-map "\356" (quote org-metadown))
  (define-key org-mode-map "\306" (quote org-shiftmetaright))
  (define-key org-mode-map "\302" (quote org-shiftmetaleft))
  (define-key org-mode-map "\320" (quote org-shiftmetaup))
  (define-key org-mode-map "\316" (quote org-shiftmetadown))
  (set-face-foreground (quote org-level-1) "DeepSkyBlue")
  (set-face-foreground (quote org-level-2) "MediumBlue")
  (set-face-foreground (quote org-level-3) "DodgerBlue")
  (set-face-foreground (quote org-level-4) "SlateBlue")
  (set-face-foreground (quote org-level-5) "LightSeaGreen")
  (set-face-foreground (quote org-level-6) "DarkGreen")
  (set-face-foreground (quote org-level-7) "gray40")
  (set-face-foreground (quote org-level-8) "gray60")
  (set-face-foreground (quote org-indent) "gray100"))
 )
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-startup-indented t
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-hide-leading-stars t
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-separator-lines 0
 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 

Re: [O] Feature request: Maintaining multiple init files with one org file

2018-07-30 Thread Sven Bretfeld
Hi Eric

So all in all I feel that there is a demand for my suggestion. Orgmode
has the power to yield a real good solution for centralized init file
maintenance, but at the moment we have to help ourselves with
workarounds. Tag-filtering for tangling functions would be the best way
to go in the future. I'm not a programmer, otherwise I would try to
implement this. For now I can only hope that somebody competent would do
it.

For the time being, here is my workaround which I developed inspired by
Amin's approach. I describe everything for whoever else is looking for a
similar solution:

, ~/aktuell/emacs/emacs-config.org
|
| * Init File
| ** Hostname Identification
|This section defines variables for all use cases: Some code is needed
|only for one machine, some for a sub-group (e.g. all computers
|running Linux or all computers having large monitors etc.), some for all 
computers.
|
|#+begin_src emacs-lisp :tangle (if allhosts "~/.emacs")
|;; variable for my PC at home
|(defvar homepc nil) ;; variable for my PC at home
|(if (string-match (system-name) "hostname-home") ;<--- set your hostname 
here
|(setq homepc t))
|
|;; variable for my PC at office
|(defvar officepc nil)
|(if (string-match (system-name) "hostname-office") ;<--- set your hostname 
here
|(setq officepc t))
|
|;; variable for my laptop
|(defvar laptop nil)
|(if (string-match (system-name) "hostname-laptop") ;<--- set your hostname 
here
|(setq laptop t))
|
|;; variable for Termux/Android
|(defvar andr nil)
|(if (string-match (system-name) "localhost") ;<--- Termux uses "localhost"
|(setq andr t))
|
|;; variable for all desktop machines together (i.e. home+office in my case)
|(defvar pcs nil)
|(if (string-match (system-name) "hostname-home\|hostname-office") <--- set 
your hostnames here
|(setq pcs t))
|
|;; variable for all GNU/Linux machines together (home+office+laptop)
|(defvar allgnu nil)
|(if (string-match (system-name) 
"hostname-home\|hostname-office\|hostname-laptop") <--- set your hostnames here
|(setq allgnu t))
|
|;; variable for all machines together (home+office+laptop+Android)
|(defvar allhosts nil)
|(if (string-match (system-name) 
"hostname-home\|hostname-office\|hostname-laptop\|localhost")
|(setq allhosts t))
| #+end_src
| ** Startup File
| *** Linux
| The code in this section is needed for the init files on all
| computers running GNU/Linux (variable: allgnu)
|  #+begin_src emacs-lisp :tangle (if allgnu "~/.emacs")
|  (defun tangle-init ()
|"If the current buffer is 'emacs-config.org' the code-blocks are
|  tangled, and the tangled file is compiled."
|(when (equal (buffer-file-name)
|   (expand-file-name "~/aktuell/emacs/emacs-config.org"));<---put 
name of this file here
|  ;; Avoid running hooks when tangling.
|  (let ((prog-mode-hook nil))
|(org-babel-tangle
|
|  (add-hook 'after-save-hook 'tangle-init)
|  #+end_src
| *** Android
| The code in this section is needed only for emacs running on Android
| (variable: andr).
|  #+begin_src emacs-lisp :tangle (if andr "~/.emacs")
|  (defun tangle-init ()
|"If the current buffer is 'emacs-config.org' the code-blocks are
|  tangled, and the tangled file is compiled."
|(when (equal (buffer-file-name)
|   (expand-file-name
|  "/sdcard/Aktuell/emacs/emacs-config.org"));<---put name of this file with 
the Android path here
|  ;; Avoid running hooks when tangling.
|  (let ((prog-mode-hook nil))
|(org-babel-tangle
|
|  (add-hook 'after-save-hook 'tangle-init)
|  #+end_src
|
| * Other configurations whatsoever
|   ...
|
`

Every section of source-code starts with: `#+begin_src emacs-lisp
:tangle' and a lisp expression assigning the following source code
section to one of the defined variables (homepc, officepc, laptop, andr,
pcs, allgnu or allhosts). The code will then end up in the actual init
file (~/.emacs) only if the present machine belongs to the respective
group, i.e. if this variable is non-nil for it. If the variable is nil,
the code section will be ignored on the respective machine. All you have
to do is to sync this file to each machine, visit it on each and save it
again (which triggers the generation of the .emacs file).

Every piece of source code needs to have one of these expressions
(actually "allhosts" could do without, since it is the default case if
you have headline_args set as shown in my initial email). This is a bit
more clumsy than it would be if we could use org tags but it's easier
and clearer than including hundreds of if-conditions to the code itself.

Thank you for all your help,

Sven

Eric S Fraga writes:

> On Sunday, 29 Jul 2018 at 12:42, Sven Bretfeld wrote:
>
> [...]
>
>> At the moment I have a separate .emacs for the tablet and have to

[O] Latex preview foreground color problem

2018-07-30 Thread Jarmo Hurri


Greetings.

Previewing Latex fragments is one cool feature. However, I have one
problem tailoring it to my use.

In my emacs config file I now have:

(plist-put org-format-latex-options :foreground "white")
(plist-put org-format-latex-options :scale 2)

These seem to set the correct properties, because my value of
org-format-latex-options is

(:foreground "white" :background default :scale 2 :html-foreground "Black" 
:html-background "Transparent" :html-scale 1.0 :matchers
 ("begin" "$1" "$" "$$" "\\(" "\\["))

The scale factor property works just fine: I get a larger
preview. Unfortunately changing foreground has no effect. The default
black foreground - which I still get - is pretty useless for me, because
my default background in buffers is dark blue.

Any tips?

Jarmo




Re: [O] Feature request: Maintaining multiple init files with one org file

2018-07-30 Thread Eric S Fraga
On Sunday, 29 Jul 2018 at 12:42, Sven Bretfeld wrote:

[...]

> At the moment I have a separate .emacs for the tablet and have to
> remember changing this file, for ex. whenever I include a new file in
> the org-agenda-files list. This could be much more tidy with an org
> approach.

The approach I take, trying to use the same init file for 4 quite
different systems (including termux on Android at one point), is to have
a very small .emacs for each which sets up system specific variables
(e.g. paths and default face) and then loads the common init file.  The
latter is managed/written in org but the .emacs (or equivalently
.emacs.d/init.el) files for each system are not as they are typically
just a few lines long.

> I'm trying to use customize as little as possible, since AFAIK there is
> no way to let customize use an org file instead of a "real" init file.

I also try to minimize the use of customize but I do use it.  For this,
I make sure that emacs doesn't use the init file for saving
customization information but uses a custom-file I specify.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-753-g2ec5d3