{"id":17069508,"url":"https://github.com/mgalgs/indent-hints-mode","last_synced_at":"2025-03-23T10:43:22.224Z","repository":{"id":138480635,"uuid":"2033415","full_name":"mgalgs/indent-hints-mode","owner":"mgalgs","description":"Emacs minor mode that gives you helpful hints about whether your buffer is space- or tab-loving.","archived":false,"fork":false,"pushed_at":"2022-10-21T20:24:12.000Z","size":20,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-15T07:44:22.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgalgs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-07-12T00:25:07.000Z","updated_at":"2022-10-21T20:23:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d155b23-088a-4881-89f8-933a229560b3","html_url":"https://github.com/mgalgs/indent-hints-mode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalgs%2Findent-hints-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalgs%2Findent-hints-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalgs%2Findent-hints-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalgs%2Findent-hints-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgalgs","download_url":"https://codeload.github.com/mgalgs/indent-hints-mode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090866,"owners_count":20559296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T11:27:03.674Z","updated_at":"2025-03-23T10:43:22.206Z","avatar_url":"https://github.com/mgalgs.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/mgalgs/indent-hints-mode\"\u003e\u003cimg src=\"https://www.gnu.org/software/emacs/images/emacs.png\" alt=\"Emacs Logo\" width=\"80\" height=\"80\" align=\"right\"\u003e\u003c/a\u003e\n## indent-hints.el\n*Get some hints about whether your buffer is space- or tab-loving*\n\n---\n[![License GPLv3](https://img.shields.io/badge/license-GPL_v3-green.svg)](http://www.gnu.org/licenses/gpl-3.0.html)\n\nAs the Eternal Holy War of tabs-versus-spaces rages on, even within\nindividual projects, an emacs minor mode arises from the depths of\ngithub with the goal of easing the burden placed on the programmer\nof trying to maintain consistency in text files.\n\nIf you jump into a file that uses tabs for indentation, you shall\ncontinue using tabs for indentation. If you jump into a file that\nuses spaces for indentation, you shall continue using spaces for\nindentation. That's the idea.\n\n### Installation\n\n\n* For the impatient, here's a quick setup example (after putting\n  indent-hints.el in your load path):\n\n        (require 'indent-hints)\n        (add-hook 'c-mode-common-hook 'indent-hints-activate)\n\n  You should probably at least customize the indent-hints-mode\n  group to use your preferred space/tabs setup, like so:\n\n        M-x customize-group [RET] indent-hints [RET]\n\n* You can set up some \"whitespace profiles\" that get selected\n  automatically when a buffer is detected to be tab-loving or\n  space-loving. To enable this functionality, you should customize\n  the `indent-hints-mode` group and enable\n  indent-hints-profile-switching-enabled, or add to your .emacs:\n\n        (setq indent-hints-profile-switching-enabled t)\n\n* You can also add your own custom functions to the hooks\n  `indent-hints-mode-tab-loving-hook` and\n  `indent-hints-mode-space-loving-hook` which run after a buffer is\n  detected to be tab-loving or space-loving, respectively.\n\n* To disable profile switching for a particular C style, add the style\n  name to `indent-hints-ignore-c-styles`, for example:\n\n        (setq indent-hints-ignore-c-styles '(\"linux\"))\n\n### Use\n\n\nJust check out your mode-line to see whether the buffer you're\nvisiting is space-loving or tab-loving. It also shows the ratio of\nspace-to-tab (or tab-to-space, whichever your buffer loves)\nloving-ness that your current buffer exudes. Here's a \"screenshot\":\n\n    test.el Top -- (Emacs-Lisp \\t:0.53 yas pair)--etc. etc.--\n\nThe file being visited in the \"screenshot\" has more tabs than\nspaces (53% of the lines that start with some sort of indentation\nstart with tabs, to be exact).\n\n\n\n### Customization Documentation\n\n#### `indent-hints-profile-switching-enabled`\n\nNon-nil means switch between spacing profiles depending on the\n  tab- or space-lovingness of buffers\n\n#### `indent-hints-tab-width`\n\nWhen non-nil, the tab-width to use when the tab-loving profile\nis enabled.\n\n#### `indent-hints-c-basic-offset`\n\nWhen non-nil, the c-basic-offset to use when the space-loving\nprofile is enabled.\n\n#### `indent-hints-c-default-space-loving-style`\n\nWhen non-nil, the c-default-style to use when the space-loving\n  profile is enabled.\n\n#### `indent-hints-c-default-tab-loving-style`\n\nWhen non-nil, the c-default-style to use when the tab-loving\n  profile is enabled.\n\n#### `indent-hints-space-loving-modeline-indicator`\n\nModeline indicator to use when the file is space-loving\n\n#### `indent-hints-tab-loving-modeline-indicator`\n\nModeline indicator to use when the file is tab-loving\n\n#### `indent-hints-neither-loving-modeline-indicator`\n\nModeline indicator to use when the file is neither-loving\n\n### Function and Macro Documentation\n\n#### `(ih/activate-space-loving-profile)`\n\nActivate the space-loving profile\n\n#### `(ih/activate-tab-loving-profile)`\n\nActivate the tab-loving profile\n\n#### `(ih/count-line-beginnings)`\n\nThe real meat. Examine the first character of each line in the\nbuffer. This can be used to determine if a buffer is space-loving\nor tab-loving. Returns a list of the\nform: (num-beginning-with-tab num-beginning-with-space\nnum-beginning-with-something-else)\n\n#### `(ih/update-space-loving-ratio RATIO)`\n\nUpdate the of space-loving-ness shown in the mode line\n\n#### `(ih/update-tab-loving-ratio RATIO)`\n\nUpdate the of tab-loving-ness shown in the mode line\n\n#### `(indent-hints-activate)`\n\nActivate indent-hints minor mode for this buffer, if\nappropriate.\n\n#### `(indent-hints-mode-on)`\n\nTurns on indent-hints-mode, if appropriate.\nThis function is intended to be used with define-globalized-minor-mode\n\n#### `(ih/is-temp-buffer THE-BUFFER-NAME)`\n\nReturns true if given buffer name is a temp buffer (starts with \" *\")\n\n-----\n\u003cdiv style=\"padding-top:15px;color: #d0d0d0;\"\u003e\nMarkdown README file generated by\n\u003ca href=\"https://github.com/mgalgs/make-readme-markdown\"\u003emake-readme-markdown.el\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgalgs%2Findent-hints-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgalgs%2Findent-hints-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgalgs%2Findent-hints-mode/lists"}