Re: [O] proposal for improved integration of cdlatex
Hello, Federico Beffa be...@ieee.org writes: Do you think it is now a reasonable implementation? Would it be a suitable tiny change to `org-mode'? Yes, applied. Thank you. Regards, -- Nicolas Goaziou
Re: [O] proposal for improved integration of cdlatex
Do you think it is now a reasonable implementation? Would it be a suitable tiny change to `org-mode'? Regards, Federico Thanks for the suggestion. Please find attached the improved patch. Regards, Federico On Wed, Jul 30, 2014 at 10:25 PM, Nicolas Goaziou m...@nicolasgoaziou.fr wrote: Hello, Federico Beffa be...@ieee.org writes: + (save-excursion +(org-mark-element) +(org-indent-region (point) (mark The function shouldn't set the mark. The following should be enough: (let ((element (org-element-at-point))) (when element (org-indent-region (org-element-property :begin element) (org-element-property :end element Regards, -- Nicolas Goaziou
Re: [O] proposal for improved integration of cdlatex
Thanks for the suggestion. Please find attached the improved patch. Regards, Federico On Wed, Jul 30, 2014 at 10:25 PM, Nicolas Goaziou m...@nicolasgoaziou.fr wrote: Hello, Federico Beffa be...@ieee.org writes: + (save-excursion +(org-mark-element) +(org-indent-region (point) (mark The function shouldn't set the mark. The following should be enough: (let ((element (org-element-at-point))) (when element (org-indent-region (org-element-property :begin element) (org-element-property :end element Regards, -- Nicolas Goaziou 0001-org.el-add-function-to-indent-environment-inserted-b.patch Description: Binary data
Re: [O] proposal for improved integration of cdlatex
Please find attached the patch as discussed. Regards, Fede On Tue, Jul 29, 2014 at 4:54 PM, Bastien b...@gnu.org wrote: Federico Beffa be...@ieee.org writes: To be honest, I do not know. But, the original cdlatex-tab function takes those parameters and I thought it would be a good idea to pass on the same parameters, just in case someone uses them. Ah okay, I didn't check that. Please go ahead with the patch then, -- Bastien 0001-org.el-add-function-to-indent-environment-inserted-b.patch Description: Binary data
Re: [O] proposal for improved integration of cdlatex
Hello, Federico Beffa be...@ieee.org writes: + (save-excursion +(org-mark-element) +(org-indent-region (point) (mark The function shouldn't set the mark. The following should be enough: (let ((element (org-element-at-point))) (when element (org-indent-region (org-element-property :begin element) (org-element-property :end element Regards, -- Nicolas Goaziou
Re: [O] proposal for improved integration of cdlatex
Hi, Why those parameters? the parameters are just in case you want to use this function non-interactively in place of cdlatex-tab. I'm not sure it's worth it. You can indent the element with M-h C-\ easily enough, no? Because typing one key combination is faster than typing 3 and there are no disadvantages. Regards, Fede
Re: [O] proposal for improved integration of cdlatex
Hi Federico, Federico Beffa be...@ieee.org writes: the parameters are just in case you want to use this function non-interactively in place of cdlatex-tab. Is there a real use-case for non-interactive use? I'm not sure it's worth it. You can indent the element with M-h C-\ easily enough, no? Because typing one key combination is faster than typing 3 and there are no disadvantages. Fair enough. Please provide a patch against the master branch. See http://orgmode.org/worg/org-contribute.html for details on how to format the changelog entry properly. Thanks, -- Bastien
Re: [O] proposal for improved integration of cdlatex
the parameters are just in case you want to use this function non-interactively in place of cdlatex-tab. Is there a real use-case for non-interactive use? To be honest, I do not know. But, the original cdlatex-tab function takes those parameters and I thought it would be a good idea to pass on the same parameters, just in case someone uses them. Regards, Fede
Re: [O] proposal for improved integration of cdlatex
Federico Beffa be...@ieee.org writes: To be honest, I do not know. But, the original cdlatex-tab function takes those parameters and I thought it would be a good idea to pass on the same parameters, just in case someone uses them. Ah okay, I didn't check that. Please go ahead with the patch then, -- Bastien
Re: [O] proposal for improved integration of cdlatex
Hi Federico, Federico Beffa be...@ieee.org writes: (defun org-cdlatex-environment-indent (optional environment item) Why those parameters? (interactive) (cdlatex-environment environment item) (save-excursion (org-mark-element) (org-indent-region (point) (mark (org-defkey org-cdlatex-mode-map \C-c{ 'org-cdlatex-environment-indent) I'm not sure it's worth it. You can indent the element with M-h C-\ easily enough, no? Best, -- Bastien
[O] proposal for improved integration of cdlatex
Hi, when you enable org-cdlatex and insert a LaTeX environment by pressing M-{, the new environment is inserted ignoring indentation. To correct for that it is not enough to press TAB as TAB is locally bound to cdlatex-tab and moves the cursor to the next interesting part of the environment. For this reason I would like to propose an improved default binding to the org-cdlatex-mode-map M-{ as follows: --- (defun org-cdlatex-environment-indent (optional environment item) (interactive) (cdlatex-environment environment item) (save-excursion (org-mark-element) (org-indent-region (point) (mark (org-defkey org-cdlatex-mode-map \C-c{ 'org-cdlatex-environment-indent) --- Regards, Fede