Re: [AUCTeX] Completion in minibuffer
On Fri, Dec 16 2016, Eastern Daylight Time wrote: Hi Denis, On 16 Dec 2016, at 15:07, Denis Bitouzé wrote: Would it be possible to have completion in minibuffer? Or maybe there is a better solution? I use helm to get a sort of minibuffer completion when using AUCTeX. I type until it’s convenient to scroll to the option I want, then highlight it and hit return. The ivy package is an alternative, which some claim is more lightweight. I never compared the two, though. -- Joost Kremers Life has its moments ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] Completion in minibuffer
Hi Denis, > On 16 Dec 2016, at 15:07, Denis Bitouzé wrote: > > Would it be possible to have completion in minibuffer? Or maybe there is > a better solution? I use helm to get a sort of minibuffer completion when using AUCTeX. I type until it’s convenient to scroll to the option I want, then highlight it and hit return. Hope that helps! -- EDT ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
[AUCTeX] Completion in minibuffer
Hi, thanks to completion packages (`auto-complete', `company'), one can save a lot of time and pain while typing text and code. It would be helpfull as well for LaTeX but, with C-c , everything takes place in the mini-buffer where, AFAIK, completion of commands or environments already present in the buffer (current and other ones open) isn't performed. Would it be possible to have completion in minibuffer? Or maybe there is a better solution? Thanks. -- Denis ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
Le 16/12/16 à 15h44, Mosè Giordano a écrit : > 2016-12-16 15:34 GMT+01:00 Denis Bitouzé : >> I see. So you meant `myenv' instead of `foo', don't you? > > Yes, I didn't look back to the name of the environment ;-) Hence my puzzlement :) >> Anyway, regarding your explanation, I couldn't see the point with the >> `\' before `\|myenv' in: >> >> ┌ >> │ (setq LaTeX-document-regexp "document\\|myenv") >> └ > > The plain regexp would actually be > > document\|myenv > > but in Lisp code you have to escape the backslash, so you should use > > document\\|myenv > > See https://www.emacswiki.org/emacs/RegularExpression#RegexpsInEmacs OK, thanks! -- Denis ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
2016-12-16 15:34 GMT+01:00 Denis Bitouzé : > I see. So you meant `myenv' instead of `foo', don't you? Yes, I didn't look back to the name of the environment ;-) > Anyway, regarding your explanation, I couldn't see the point with the > `\' before `\|myenv' in: > > ┌ > │ (setq LaTeX-document-regexp "document\\|myenv") > └ The plain regexp would actually be document\|myenv but in Lisp code you have to escape the backslash, so you should use document\\|myenv See https://www.emacswiki.org/emacs/RegularExpression#RegexpsInEmacs Bye, Mosè ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
Le 16/12/16 à 15h25, Mosè Giordano a écrit : > 2016-12-16 15:17 GMT+01:00 Denis Bitouzé : >> But what's the point with `\\|foo'? AFAICS: >> >> ┌ >> │ (setq LaTeX-document-regexp "myenv") >> └ >> >> does the trick as well. > > \(a\|b\) > > matches "a" or "b" (but in the variable you don't need to put the > outer parentheses, and you have to double escape the backslash), you > have to include both "document" and "myenv" in order to indent both in > the same way. With your setting I'm not sure the "document" > environment will be indented correctly. I see. So you meant `myenv' instead of `foo', don't you? Anyway, regarding your explanation, I couldn't see the point with the `\' before `\|myenv' in: ┌ │ (setq LaTeX-document-regexp "document\\|myenv") └ -- Denis ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
2016-12-16 15:17 GMT+01:00 Denis Bitouzé : > But what's the point with `\\|foo'? AFAICS: > > ┌ > │ (setq LaTeX-document-regexp "myenv") > └ > > does the trick as well. \(a\|b\) matches "a" or "b" (but in the variable you don't need to put the outer parentheses, and you have to double escape the backslash), you have to include both "document" and "myenv" in order to indent both in the same way. With your setting I'm not sure the "document" environment will be indented correctly. Bye, Mosè ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
Le 16/12/16 à 15h09, Mosè Giordano a écrit : >> Regexp? Sigh... why life is to complicated?! ;) > > I don't know why it was conceived as a regexp rather than as a list of > environment names (a regexp can be then built automatically). Good news! :) >> Anyway, I couldn't find any reference concerning >> `LaTeX-document-regexp'. Any pointer? > > There are a number of AUCTeX's features hidden in the source code, > this increases the pleasure of discovering new features every day ;-) I don't like speleology 'cause I'm claustrophobic :) > Jokes apart, > > (setq LaTeX-document-regexp "document\\|foo") > > and you're done. Indeed, thanks! But what's the point with `\\|foo'? AFAICS: ┌ │ (setq LaTeX-document-regexp "myenv") └ does the trick as well. -- Denis ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
2016-12-16 15:00 GMT+01:00 Denis Bitouzé : > Hi Mosè, > > Le 16/12/16 à 14h38, Mosè Giordano a écrit : > >> 2016-12-16 8:17 GMT+01:00 Denis Bitouzé : >> >>> I'd like to achieve for `myenv' environment the same behavior as the >>> `document' environment. For instance, with the following content: >>> >>> ┌ >>> │ \documentclass{article} >>> │ \begin{document} >>> │ Foo. >>> │ \end{document} >>> └ >>> >>> and the cursor is on the line: >>> >>> ┌ >>> │ Foo. >>> └ >>> >>> pressing doesn't indent the line. >> >> The `LaTeX-document-regexp' option should be what you're looking for. > > Regexp? Sigh... why life is to complicated?! ;) I don't know why it was conceived as a regexp rather than as a list of environment names (a regexp can be then built automatically). > Anyway, I couldn't find any reference concerning > `LaTeX-document-regexp'. Any pointer? There are a number of AUCTeX's features hidden in the source code, this increases the pleasure of discovering new features every day ;-) Jokes apart, (setq LaTeX-document-regexp "document\\|foo") and you're done. Bye, Mosè ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
Hi Mosè, Le 16/12/16 à 14h38, Mosè Giordano a écrit : > 2016-12-16 8:17 GMT+01:00 Denis Bitouzé : > >> I'd like to achieve for `myenv' environment the same behavior as the >> `document' environment. For instance, with the following content: >> >> ┌ >> │ \documentclass{article} >> │ \begin{document} >> │ Foo. >> │ \end{document} >> └ >> >> and the cursor is on the line: >> >> ┌ >> │ Foo. >> └ >> >> pressing doesn't indent the line. > > The `LaTeX-document-regexp' option should be what you're looking for. Regexp? Sigh... why life is to complicated?! ;) Anyway, I couldn't find any reference concerning `LaTeX-document-regexp'. Any pointer? -- Denis ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
Le 16/12/16 à 14h27, Tamas Papp a écrit : > An alternative approach is use-package, eg > > (use-package latex > :config (add-to-list 'LaTeX-indent-environment-list >'("myenv" current-indentation))) > > See https://github.com/jwiegley/use-package Interesting package I'll probably... use :) Thanks for the pointer. Best. -- Denis ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
Hi Denis, 2016-12-16 8:17 GMT+01:00 Denis Bitouzé : > I'd like to achieve for `myenv' environment the same behavior as the > `document' environment. For instance, with the following content: > > ┌ > │ \documentclass{article} > │ \begin{document} > │ Foo. > │ \end{document} > └ > > and the cursor is on the line: > > ┌ > │ Foo. > └ > > pressing doesn't indent the line. The `LaTeX-document-regexp' option should be what you're looking for. Bye, Mosè ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] how to disable indentation for tabular-like environment
On Thu, Dec 15 2016, Mosè Giordano wrote: > 2016-12-15 18:37 GMT+01:00 Denis Bitouzé : >> Could you please elaborate the trick? I added: >> >> ┌ >> │ (add-to-list 'LaTeX-indent-environment-list '("myenv" >> current-indentation)) >> └ >> >> to my `.emacs' but the got the error: >> >> ┌ >> │ Warning (initialization): An error occurred while loading >> ‘/home/bitouze/.emacs’: >> │ >> │ Symbol's value as variable is void: LaTeX-indent-environment-list >> └ >> >> despite I'm using the last AUCTeX version: (elpa) auctex-11.89.7. > > When you use `add-to-list' is almost always a good idea to wrap it in > a `with-eval-after-load' (or `eval-after-load' in older Emacsens), > unless you know when the variable is defined in your init file: > > (with-eval-after-load "latex" > (add-to-list 'LaTeX-indent-environment-list '("myenv" current-indentation))) > > This should do the trick. An alternative approach is use-package, eg (use-package latex :config (add-to-list 'LaTeX-indent-environment-list '("myenv" current-indentation))) See https://github.com/jwiegley/use-package Best, Tamas ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex