conao3 / transient-dwim.el

Useful preset transient commands
GNU General Public License v3.0
23 stars 1 forks source link

+author: conao3

+date: <2020-01-20 Mon>

[[https://github.com/conao3/transient-dwim.el][https://raw.githubusercontent.com/conao3/files/master/blob/headers/png/transient-dwim.el.png]] [[https://github.com/conao3/transient-dwim.el/blob/master/LICENSE][https://img.shields.io/github/license/conao3/transient-dwim.el.svg?style=flat-square]] [[https://github.com/conao3/transient-dwim.el/releases][https://img.shields.io/github/tag/conao3/transient-dwim.el.svg?style=flat-square]] [[https://github.com/conao3/transient-dwim.el/actions][https://github.com/conao3/transient-dwim.el/workflows/Main%20workflow/badge.svg]] [[https://app.codacy.com/project/conao3/transient-dwim.el/dashboard][https://img.shields.io/codacy/grade/62a36f4f04524d5e8c758440e8071c45.svg?logo=codacy&style=flat-square]] [[https://twitter.com/conao_3][https://img.shields.io/badge/twitter-@conao__3-blue.svg?logo=twitter&style=flat-square]] [[https://conao3-support.slack.com/join/shared_invite/enQtNjUzMDMxODcyMjE1LWUwMjhiNTU3Yjk3ODIwNzAxMTgwOTkxNmJiN2M4OTZkMWY0NjI4ZTg4MTVlNzcwNDY2ZjVjYmRiZmJjZDU4MDE][https://img.shields.io/badge/chat-on_slack-blue.svg?logo=slack&style=flat-square]]

By installing this package, if you want to know what features exist in major-mode for the first time, or if you want to use a package you can't remember keybindings for, pressing ~M-=~ (if you're using the recommended settings) will be your first step.

You don't have to remember the cumbersome keybindings since now. Just look at the neatly aligned menu and press the key that appears.

Currently, transient menu for below major-mode/minor-mode are available.

Or reference [[https://github.com/magit/transient/blob/master/docs/transient.org#modifying-existing-transients][transient manual]].

+begin_src emacs-lisp

(ppp-list (cl-flet ((get-summary (str) (replace-regexp-in-string "\(.\)\n." "\1" str))) (let (elm info) (with-current-buffer "neotree.el" ; some target package (save-excursion (goto-char (point-min)) (while (setq elm (ignore-errors (read (current-buffer)))) (pcase elm ((,(or 'defun 'cl-defun) ,fn ,args (interactive) . ,body) (push(,fn . "") info)) ((,(or 'defun 'cl-defun) ,fn ,args (interactive . ,_) . ,body) (push(,fn . "") info)) ((,(or 'defun 'cl-defun) ,fn ,args ,docstring (interactive) . ,body) (push(,fn . ,(get-summary docstring)) info)) ((,(or 'defun 'cl-defun) ,fn ,args ,docstring (interactive . ,_) . ,body) (push(,fn . ,(get-summary docstring)) info)))))) (mapcar (lambda (elm) `("" ,(cdr elm) ,(car elm))) (nreverse info)))))

+end_src

Recommend make ~transient-detect-key-conflicts~ non-nil to detect key conflicts easy.

+begin_src emacs-lisp

(leaf transient :doc "Transient commands" :req "emacs-25.1" :tag "bindings" "emacs>=25.1" :url "https://github.com/magit/transient" :added "2020-03-25" :emacs>= 25.1 :ensure t :custom ((transient-detect-key-conflicts . t)))

+end_src

** Community All feedback and suggestions are welcome!

You can use github issues, but you can also use [[https://conao3-support.slack.com/join/shared_invite/enQtNjUzMDMxODcyMjE1LWUwMjhiNTU3Yjk3ODIwNzAxMTgwOTkxNmJiN2M4OTZkMWY0NjI4ZTg4MTVlNzcwNDY2ZjVjYmRiZmJjZDU4MDE][Slack]] if you want a more casual conversation.

** Contribution We welcome PR!

*** Require tools for testing

*** Running test Below operation flow is recommended.

+begin_src shell

make # Install git-hooks in local .git

git branch [feature-branch] # Create branch named [feature-branch] git checkout [feature-branch] # Checkout branch named [feature-branch]

emacs transient-dwim.el # Edit something you want

make test # Test transient-dwim via multi version Emacs git commit -am "brabra" # Commit (auto-run test before commit)

</edit loop>

hub fork # Create fork at GitHub git push [user] [feature-branch] # Push feature-branch to your fork hub pull-request # Create pull-request

+end_src

** Migration

** License

+begin_example

General Public License Version 3 (GPLv3) Copyright (c) Naoya Yamashita - https://conao3.com https://github.com/conao3/transient-dwim.el/blob/master/LICENSE

+end_example

** Author

** Contributors