{"id":22901253,"url":"https://github.com/mooerslab/emacsclient-custom-frames","last_synced_at":"2026-04-13T17:08:31.849Z","repository":{"id":266185759,"uuid":"897639189","full_name":"MooersLab/emacsclient-custom-frames","owner":"MooersLab","description":"Customized frames for instances of emacsclient instances.","archived":false,"fork":false,"pushed_at":"2024-12-04T10:00:10.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T03:41:56.853Z","etag":null,"topics":["bash","bash-functions","bash-script","context-switching","customized-frames","emacs","emacs-frame-label","emacs-frames","emacs-lisp","emacsclient","project-management","project-management-tool"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MooersLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-12-03T01:18:54.000Z","updated_at":"2024-12-04T10:00:22.000Z","dependencies_parsed_at":"2025-02-07T03:41:36.462Z","dependency_job_id":"d954725a-1cb8-40cc-bc33-4eaa3645af2f","html_url":"https://github.com/MooersLab/emacsclient-custom-frames","commit_stats":null,"previous_names":["mooerslab/emacsclient-custom-frames"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Femacsclient-custom-frames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Femacsclient-custom-frames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Femacsclient-custom-frames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Femacsclient-custom-frames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MooersLab","download_url":"https://codeload.github.com/MooersLab/emacsclient-custom-frames/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246591782,"owners_count":20801984,"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":["bash","bash-functions","bash-script","context-switching","customized-frames","emacs","emacs-frame-label","emacs-frames","emacs-lisp","emacsclient","project-management","project-management-tool"],"created_at":"2024-12-14T01:32:30.782Z","updated_at":"2025-10-18T16:29:03.504Z","avatar_url":"https://github.com/MooersLab.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Version](https://img.shields.io/static/v1?label=emacsclient-custom-frames\u0026message=0.2\u0026color=brightcolor)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n# Customize emacsclient frames to make them distinguishable\n\n\n## Problem addressed\n\nEmacsclient opens a new frame (aka what non-Emacs users or non-Emacsens call a window).\nIt can be preferable to have multiple frames open rather than multiple panes (Emacsens call these windows) open in a frame, especially when working on multiple projects, each with an independent context.\nThe server can run for days or months, so the frames remain up for days or months.\n\nIt took me too long to grasp the joys of **emacslient**.\nI wish that I had started using them earlier.\n\nThis above bash script `colored-clients.sh` provides 21 functions for calling **emacslient**, each with a unique foreground--background color combination.\nThey enable the opening of 21 uniquely colored frames.\n\nThese functions also take the project's name or index number as a command line argument.\nThe project name appears in the upper lefthand corner of the frame.\nIn the example below, the project index number is `6112`.\nIts full name is `6112MooersLabGitHubLabRepos`, which I could have passed as a command line argument.\nThis label negates memorizing which color scheme is mapped to which project.\n\n\u003cimg width=\"140\" alt=\"Screenshot 2024-12-03 at 6 21 32 AM\" src=\"https://github.com/user-attachments/assets/f64dc9ac-9527-4316-8599-98fe5d8d3d80\"\u003e\n\nThe snapshot below shows the upper lefthand corner of four frames, each with a different label.\n\n\u003cimg width=\"889\" alt=\"Screenshot 2024-12-03 at 6 35 37 AM\" src=\"https://github.com/user-attachments/assets/654f9d12-c62d-4456-83d0-d21ca37d56db\"\u003e\n\n## Further explanation of the problem\n\nEmacs will take progressively longer to start when your initialization file becomes longer.\nA file with a thousand lines may take five seconds to start.\nThis delay will be annoying, especially when the time approaches a minute or a few minutes.\nSome of the delays can sometimes be associated with an over-configured shell.\n\nOne way around this problem is to start an Emacs server (M-x server-start) inside Emacs and then use the binary **emacsclient** to attach it to the server.\nThis binary resides in the same folder as your Emacs binary.\nA new instance of the Emacs frame will open instantly with the configuration of the Emacs profile used to start the profile.\n\nYou can launch one server per profile if you have multiple profiles for distinct workflows.\nYou can name each server to attach it to your desired profile.\n\nYou may wind up with many Emacs frames that look identical.\nYou may have different buffers opened in the other frames, but they all share the same set of buffers.\nThe above script ,`colored-clients.sh`, of bash functions opens emacslient client instances with the project's name taken from the command line as an argument.\nThe bash functions are mapped to 21 foreground and background color combinations.\n11 are dark on light, and 10 are light on dark.\n\n## Easy recovery of the names of the customization functions\n\nA table of the function names and the pairs of colored can be printed to the terminal by entering `efclients`.\nThe function named `efclients` aids in selecting a function that will generate a frame with the desired label and color scheme.\n`ef` is my abbreviation for my Emacs profile, which named `e29fewpackages`.\n`29` is the version number of the Emacs binary.\n\n```bash\nFunctionName     bg color              fg color\n------------  +  -----------------  +  --------------\neflgc            Light Green           Black\neflyc            Light Yellow          Black\nefwc             White                 Black\neflgyc           Light Gray            Black\nefic             Ivory                 Black\nefbec            Biege                 Black\neflac            Lavender              Black\nefmcc            Mint Cream            Black\nefabc            Alice Blue            Black\nefhdc            Honey Drew            Black\nefptc            Pale Turquoise        Black\nefsbtc           Dark Slate Blue       Thistle\nefdglcc          Dark Slate Gray       Light Cyan\nefmbcc           Midnight Blue         Lavender\nefdgpgc          Dark Olive Green      Pale Green\nefsbppc          Saddle Brown          Peach Puff\nefdgpgc          Dark Red              Light Coral\nefdmpc           Dark Magenta          Plum\nefdcac           Dark Cyan             Aquamarin\nefimpc           Indigo                Medium Purple\nefdgmc           Dark Goldenrod        Moccasin\n```\n\n## Usage example\n\nEnter the following command in the terminal after customizing and sourcing the above bash script.\n\n```bash\nefimpc 6112MooersLabGitHubLabRepos\n```\n\n\n## Naming an Emacs server after its profile\n\nGive the server a unique name in the `init.el` file by adding the following line.\nThis server name will be used in the above bash functions to attach to the correct profile.\n\n```elisp\n(setq server-name \"e29f\")\n```\n\nYou could make another set of functions to attach to a different profile, or these could be generalized by passing the profile name as a command line argument.\n\n## Making text visible on highlighted lines\n\nI would like to highlight the line that the cursor is currently on. \nThe color I selected for this highlighting blended too well with light-colored font when using dark backgrounds.\nI had to pick a neutral color that would work against dark and light backgrounds.\n\n\u003cimg width=\"1352\" alt=\"hliine\" src=\"https://github.com/user-attachments/assets/08f8dc41-5c14-42af-bc39-e310e649a8ac\"\u003e\n\nI added the following code to my initialization file.\n\n```elisp\n;; Load hl-line mode\n(require 'hl-line)\n\n;; Set the hl-line face to a neutral color\n(set-face-attribute 'hl-line nil :background \"Gray70\" :foreground nil)\n\n;; Enable global hl-line mode\n(global-hl-line-mode 1)\n```\n\nLikewise, I had a similar problem with selected text that was part of a region.\nThe following code will change the color of the selected text in a region to black.\n\n\u003cimg width=\"1445\" alt=\"region\" src=\"https://github.com/user-attachments/assets/aa574cc4-3472-4c5a-8f62-67f449cb23c1\"\u003e\n\n```elisp\n;; Set the region face to an intermediate color\n(set-face-attribute 'region nil :background \"SlateGray\" :foreground \"black\")\n\n;; Set the cursor color\n(set-cursor-color \"yellow\")\n```\n\n\n## Update history\n\n|Version      | Changes                                                                                                                                  | Date                 |\n|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------|:---------------------|\n| Version 0.1 |   Added badges, funding, and update table.  Initial commit.                                                                              | 2024 December 2      |\n| Version 0.2 |   Very extensive updates to the README.md file. Rewrote the text, added images, and added more code blocks.                              | 2024 December 3      |\n\n## Sources of funding\n\n- NIH: R01 CA242845\n- NIH: R01 AI088011\n- NIH: P30 CA225520 (PI: R. Mannel)\n- NIH: P20 GM103640 and P30 GM145423 (PI: A. West)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooerslab%2Femacsclient-custom-frames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooerslab%2Femacsclient-custom-frames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooerslab%2Femacsclient-custom-frames/lists"}