Emacs guide update#6692
Conversation
|
Hi there @mhvk 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labelled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here |
| ;; Don't use TABS for indentations. | ||
| (setq-default indent-tabs-mode nil) | ||
|
|
||
| Maximum number of characters in a line |
There was a problem hiding this comment.
This whole setting has no effect, since python-mode ignores this for all but docstrings. Personally, I think one is better off not enabling it.
| ;; Show column number in the mode line. | ||
| (column-number-mode 1) | ||
|
|
||
| Syntax highlighting |
There was a problem hiding this comment.
This is turned on by default, and the command given actually turns it off.
| (add-hook 'text-mode-hook 'turn-on-auto-fill) | ||
|
|
||
| ;; Show line number in the mode line. | ||
| (line-number-mode 1) |
There was a problem hiding this comment.
This is turned on by default, so no need to give it.
| (line-number-mode 1) | ||
|
|
||
| ;; Show column number in the mode line. | ||
| (column-number-mode 1) |
There was a problem hiding this comment.
Doesn't seem particularly useful, so maybe just let people find out?
|
|
||
| .. code-block:: scheme | ||
|
|
||
| (load-library "python") |
There was a problem hiding this comment.
This whole piece is not needed; this just replicates defaults.
| (set-variable 'py-indent-offset 4) | ||
| (set-variable 'indent-tabs-mode nil)))) | ||
|
|
||
| Highlight the column where a line must stop |
There was a problem hiding this comment.
Removed this mostly as it seemed only "nice to have" rather than "recommended".
| Delete trailing white spaces and blank lines | ||
| ============================================ | ||
|
|
||
| To manually delete trailing whitespaces, press ``C-t C-w``, which will run |
There was a problem hiding this comment.
It seems crazy to me to bind this to a key when doing it on safe is so much easier. Also, why bind to a key that already does something like C-t (transpose).
| saved, and hence all trailing whitespaces will be deleted on saving a Python | ||
| file. | ||
|
|
||
| To make sure that all "words" are separated by only one space, type |
There was a problem hiding this comment.
This only works for space between two words that the cursor is on. More work to remember the key combination than to just do it...
| ``M-SPC`` (use the ALT key since ``M-SPC`` sometimes brings up a context | ||
| menu.). | ||
|
|
||
| To collapse a set of blank lines to one blank line, place the cursor on one |
There was a problem hiding this comment.
Similar, just a trick, not something truly recommended.
|
astrobot reminded me about the change log: would it make sense to include a mention that we updated the recommendations? |
There was a problem hiding this comment.
👍 to simplifying.
Not sure if it is worth mentioning, but if you use different Python versions in different conda environments, you need to install flake8 for each env. For example, flake8 installed in Python 3.5 env will not recognize the f-string formatting in Python 3.6, causing false alarm.
| Emacs setup for following coding guidelines | ||
| ******************************************* | ||
|
|
||
| .. _flymake: http://www.emacswiki.org/emacs/FlyMake |
There was a problem hiding this comment.
Do we need to retain a mention to use flymake instead of flycheck for Emacs 23 and older? Do people use Emacs that old?
|
Re: change log -- Doesn't hurt? (Although I realized I also added the "no change log required" label, so feel free to use your judgement.) |
|
My own sense is to keep this simple - the idea mostly is to point people in the right direction; generally, this should be all that's needed, and, if not, the different web sites have more detail. I added a changelog entry - doesn't hurt! |
|
Also, probably no reason not to backport - changed the milestone accordingly. |
|
"Changelog entry section (v3.0) inconsistent with milestone (v2.0.3)" -- bot |
|
@pllim - you're right, the changes were mentioned for the wrong branch. But if I mention them in 2.0.3, it will not be seen by anyone reading the 3.0 release notes... So, instead, I left it as is but added manual backport to move the changelog entry to 2.0.3 section upon backport. @bsipocz - does this make any sense? |
|
@mhvk - I'm not sure if I follow, if we backport then the changelog is moved, not copied over. Would you think anyone would check on this docs though based on reading the changelog? |
|
@bsipocz - my logic for even including a changelog was that for a major version people might actually read the changelog (this is based on generalizing from myself, I fear ;-); but for a minor bug-fix version surely no-one reads the change-log, so I didn't want to put it in the 2.0.3 section. |
|
Then I would just leave it in 3.0. That release will be out in a few months, and anyone wanting to set up their dev environment should really consult the latest docs not LTS. |
|
Other than that, is it ready to be merged? I'm still stuck with the old emacs, but whenever get to the point of upgrading, this will be super useful. Thank you @mhvk! |
|
@pllim - are you happy with the current version? |
fixes #6568.
This PR has two commits, one that directly addresses #6568, and one that greatly simplifies the guide - I think we should stick to things that are actually needed rather than try to give all kinds of tips & tricks (also, quite a few of the things listed were incorrect or not needed; see in-line comments). Instead, I now added a link to instructions on how to use emacs as an IDE.
p.s. I could be convinced to put the "tricks" back in a separate "tips & tricks" section. But at least to me none of them seemed particularly useful...