Emacs 31 में वे बदलाव जिन्हें आप पहले से ही रोज़ इस्तेमाल करेंगे
(rahuljuliato.com)- Emacs 31 अभी औपचारिक रूप से जारी नहीं हुआ है, लेकिन
emacs-31branch औरmasterमें पहले से ही ऐसे बदलाव जमा हो चुके हैं जिन्हें रोज़मर्रा के इस्तेमाल में महसूस किया जा सकता है, और कई settings अब बिना external package सिर्फ Emacs core से हल होने की दिशा में जा रही हैं - Tree-sitter auto switching और grammar installation आने से major modes और grammar sources की manual management का बोझ कम हो जाता है
markdown-ts-mode, Eglot documentation rendering,eldoc-help-at-pt, eager completion,xref-edit-modeediting, navigation और documentation देखने के flow को built-in features के केंद्र में रखकर मज़बूत करते हैं- Speedbar side window, VC auto hide, ERC log conditions,
kill-region-dwim,ielm-history-file-name,native-comp-async-on-battery-powerजैसे छोटे options बार-बार होने वाली friction को कम करते हैं - Emacs 31 के feature names और default values अभी बदल सकते हैं, और
markdown-ts-modeतथा इसका उपयोग करने वाला Eglot documentation rendering experimental features हैं, इसलिए इन्हें explicitly enable करना होगा
Emacs 31 preview की आधारभूमि
- Emacs 31 अभी रिलीज़ नहीं हुआ है, और संदर्भ environment 2026 के मध्य में
emacs-31branch औरmasterको build करके इस्तेमाल करने वाली setup पर आधारित है - यहाँ बताई गई चीज़ें वे बदलाव हैं जो वास्तव में रोज़मर्रा की configuration में शामिल हो चुके हैं, और इनमें से अधिकांश Emacs core में आ चुके हैं या उसके बहुत क़रीब हैं
- feature names और default values अंतिम release से पहले बदल सकते हैं
- configuration examples Emacs Solo के
init.elमें; EMACS-31comment के साथ देखे जा सकते हैं
Tree-sitter configuration में कमी
- Emacs 31 में दो options के साथ Tree-sitter आधारित mode switching और grammar installation का flow सरल हो जाता है
treesit-enabled-modes ttreesit-auto-install-grammar t
treesit-enabled-modesकोtरखने पर जिन major modes के Tree-sitter variants उपलब्ध हैं, वे उसी mode में switch हो जाते हैंtreesit-auto-install-grammargrammar न होने पर सिर्फ error नहीं देता, बल्कि Emacs को grammar fetch और build करने का सुझाव देता है- TypeScript, TSX, Rust, TOML, YAML, Dockerfile जैसी भाषाओं के grammar sources mode के अंदर शामिल होने लगे हैं, इसलिए
treesit-language-source-alistमें URL और path manually डालने वाली configuration कम की जा सकती है - कई architectures में shared Emacs directory इस्तेमाल करते समय सावधानी की ज़रूरत है
- auto-installed grammars architecture के हिसाब से अलग नहीं किए जाते
x86_64के लिए.soऔरarm64के लिए.soएक ही नाम के नीचे रखे जा सकते हैं, इसलिए एक machine पर बना binary दूसरी machine पर load नहीं हो सकता
built-in markdown-ts-mode
- Emacs 31 में experimental
markdown-ts-modeशामिल है - यह mode 2025 की शुरुआत में emacs-devel पर भेजे गए एक proposal से शुरू हुआ था, और बाद में Stéphane Marks ने co-author के रूप में जुड़कर इसे आगे बेहतर बनाया
- यह Markdown को सिर्फ syntax highlighting का target नहीं मानता, बल्कि लिखने और पढ़ने के लिए सुविधाजनक editing environment की तरह लेता है
- Org users के लिए परिचित heading movement, folding और structural elements movement देता है
- fenced code block अब plain fixed-width text नहीं रहते, बल्कि संबंधित भाषा के वास्तविक major mode के साथ font-locking पाते हैं
- Emacs Lisp blocks और दूसरे built-in modes भी असली syntax highlighting पा सकते हैं
- code block editing commands काफ़ी हद तक काम करते हैं, लेकिन block के अंदर completion अभी भी कुछ जगहों पर अधूरा है
- image links buffer के अंदर inline render होते हैं
- यह अभी
auto-mode-alistसे जुड़ा नहीं है, इसलिए.mdfiles अपने-आप इसमें नहीं खुलतींM-x load-library RET markdown-ts-modeसे library load करने के बाद इसे buffer में चालू किया जा सकता है- चाहें तो इसे manually
auto-mode-alistमें भी जोड़ा जा सकता है
- feedback bug list पर
M-x report-emacs-bugके ज़रिए भेजा जा सकता है - अतिरिक्त screenshots markdown-ts-mode-lab demo में हैं
Eglot, Eldoc, completion में सुधार
- Emacs 31 में Eglot, LSP documentation को
markdown-ts-view-modeमें render कर सकता हैeglot-documentation-renderer 'markdown-ts-view-mode- formatted hover docs को external package के बिना देखा जा सकता है
- यह feature
markdown-ts-modeपर निर्भर है, इसलिए यह भी experimental है
eglot-code-action-indicationsसे नए inline code action hints को बंद किया जा सकता है- कुछ language servers में ये hints ज़रूरत से ज़्यादा शोर वाले लग सकते हैं
eglot-events-buffer-sizeकोeglot-events-buffer-configसे replace किया जा रहा हैeldoc-help-at-pt tcursor के नीचे मौजूद item की help बिना अलग से call किए दिखाता हैeldoc-echo-area-prefer-doc-bufferके साथ इसे इस्तेमाल करने पर अनजाने code को explore करते समय ज़्यादा guidance मिलती है
- completion से जुड़ी नई settings input के दौरान UI को ज़्यादा सक्रिय रूप से refresh करती हैं
completion-eager-update tcompletion-eager-display 'autominibuffer-visible-completions 'up-down
completion-eager-updateऔरcompletion-eager-displayuser के explicitly माँगने से पहले भी input के अनुसार completion UI को update करते हैंminibuffer-visible-completionsको'up-downपर set करने से दिख रहे candidates के बीच arrow keys से move किया जा सकता है- icomplete में bug#75784 patch शामिल है, जिससे vertical in-buffer behavior और prefix indicator आता है
icomplete-vertical-in-buffer-adjust-listicomplete-vertical-render-prefix-indicator
window layout और Speedbar
- Emacs 31 में layout बदलने के लिए ऐसे commands जोड़े गए हैं जिनसे windows को manually फिर से split और close करने की ज़रूरत नहीं पड़ती
window-layout-transposewindow-layout-rotate-clockwisewindow-layout-flip-leftrightwindow-layout-flip-topdown
- transpose horizontal और vertical arrangement को बदलता है, rotate पूरे layout को घुमाता है, और flip commands बाएँ-दाएँ या ऊपर-नीचे mirror करते हैं
- buffer को बनाए रखते हुए 3-window setup में सिर्फ editor windows की position बदलनी हो तो यह उपयोगी है
- Emacs 31 में Speedbar को अलग frame के बजाय side window में रखा जा सकता है
speedbar-window-default-widthspeedbar-window-max-widthspeedbar-window
speedbar-windowSpeedbar को आधुनिक file tree की तरह side में dock करता है- tiling environments या single-monitor laptops में यह side window तरीका पुराने floating frame से बेहतर बैठता है
VC और editable xref
- VC में ऐसी settings आई हैं जो रोज़मर्रा के version control flow को हल्का बनाती हैं
vc-auto-revert-mode tvc-allow-rewriting-published-history tvc-dir-auto-hide-up-to-date 'revert
vc-dir-auto-hide-up-to-date,vc-dirbuffer refresh होने पर up-to-date files को अपने-आप छिपा देता है- पहले
vc-dir-refreshके बादvc-dir-hide-up-to-datecall करने वाले key hacks हटाए जा सकते हैं
- पहले
vc-allow-rewriting-published-historyJujutsu या feature branch force-push जैसे flows के लिए ठीक है जहाँ पहले से push हो चुकी history को जानबूझकर rewrite किया जाता है- Emacs 31 में editable xref buffer शामिल है
- पहले xref buffer में
rकाxref-query-replace-in-resultsही था, और वह भी सिर्फ regex-आधारित replacement तक सीमित था - Dired के
wdired-modeया grep buffer केgrep-edit-modeजैसी result buffer को सीधे edit करने वाली workflow, xref में नहीं थी
- पहले xref buffer में
- शुरुआती proposal में
xref-export-to-grepके ज़रिए xref results कोfile:line:contentformat वाले grep-mode buffer में export करके edit करने का तरीका था - xref maintainer Dmitry Gutov ने grep buffer वाले workaround UI के बजाय xref buffer inline editing का सुझाव दिया, और उसके बाद
xref-edit-modeलिखा गया और शामिल किया गया xref-edit-modeअतिरिक्त buffer switching हटाता है और बड़े xref buffers में भी तेज़ चलता है- इसका workflow यह है:
C-x p gसे search करें, फिर*xref*buffer मेंeसे edit mode शुरू करें, और बदलाव के बादC-c C-cसे confirm करें - संबंधित चर्चा bug#80616 में सार्वजनिक है
ERC और छोटे quality improvements
- ERC में
erc-log-insert-log-on-open 'erc-log-new-target-buffer-pके साथ पुराना log सिर्फ नया target buffer खुलने पर insert किया जा सकता है - Emacs 31 में ERC का
scrolltobottommodule अबerc-fill-wrapपर निर्भर नहीं है, इसलिए पुराने versions के लिए conditional configuration हटाई जा सकती है - छोटे configuration values भी usability में सुधार लाते हैं
delete-pair-push-mark t:delete-pairके बाद mark push करता है ताकिC-x C-xसे अंदर का हिस्सा चुना जा सकेibuffer-human-readable-size t: raw bytes की जगह KB/MB display करता हैielm-history-file-name: IELM input history को restart के बाद भी बनाए रखता हैkill-region-dwim 'emacs-word: active region न होने परC-werror देने के बजाय आगे वाला word kill करता हैnative-comp-async-on-battery-power nil: battery पर background native compilation रोकता हैview-lossage-auto-refresh t:C-h lहाल के key inputs को real time में refresh करता हैdisplay-fill-column-indicator-warning nildired-hide-details-hide-absolute-location t:dired-hide-details-modeमें absolute directory path छिपाता हैworld-clock-sort-order "%FT%T": world clock sorting को समायोजित करता हैzone-all-frames tzone-all-windows-in-frame tuniquify-after-kill-buffer-flag t: पुराने-pvariant से इसका नाम बदला गया है
kill-region-dwimC-wपर “the mark is not active” error से बचाता हैview-lossage-auto-refreshscreen sharing या training के दौरान key inputs को live दिखाने में उपयोगी हैnative-comp-async-on-battery-power nilचलते-फिरते, बिना power connection के, background compilation से fan चलने की स्थिति कम करता हैtty-tip-mode-nwसे चलाए गए Emacs में भी tooltips देता है
term, Modus themes, और master इस्तेमाल करने की वजह
- Emacs 31,
termऔरansi-termमें line swallowing या screen corruption जैसी समस्याओं को ठीक करता हैhtop,nethack, और curses-आधारित programs जैसे applications जो cursor addressing और full-screen redraw इस्तेमाल करते हैं, अब Emacs terminal के अंदर सही तरह से redraw होते हैं- इससे external terminal emulator खोलने की एक वजह कम हो जाती है
- Emacs में Protesilaos के Modus 5 themes शामिल हैं
modus-operandi-deuteranopia: white background वाला deuteranopia-optimized thememodus-operandi: white background वाला high-readability thememodus-operandi-tinted: हल्के ओखर background वाला high-readability thememodus-operandi-tritanopia: white background वाला tritanopia-optimized thememodus-vivendi-deuteranopia: black background वाला deuteranopia-optimized thememodus-vivendi: black background वाला high-readability thememodus-vivendi-tinted: रात के आसमान जैसे background वाला high-readability thememodus-vivendi-tritanopia: black background वाला tritanopia-optimized theme
- unreleased Emacs को रोज़ इस्तेमाल करने की वजह यह है कि core में क्या आ रहा है, उसे सीधे देखा जा सके, और हर release के साथ खुद लिखे गए glue code के कम होते जाने की प्रक्रिया को महसूस किया जा सके
- पहले से शामिल सुविधाओं पर एक companion लेख के रूप में Even More Batteries Included with Emacs भी देखा जा सकता है
1 टिप्पणियां
Lobste.rs की राय
tree-sitter बदलाव को लेकर सच में उत्साहित हूँ। इसका सेटअप प्रोसेस हमेशा थोड़ा अटपटा लगा है
eager complete के बारे में भी जिज्ञासा है।
icompleteऔरfido-modeकाफ़ी हद तक वैसा ही हैं जैसा मैं चाहता हूँ, लेकिन अभी भीcorfuजैसे third-party पैकेज जितने इस्तेमाल में आसान नहीं हैंverticoवगैरह के करीब का अनुभव सिर्फ built-in फीचर्स से, वह भी डिफ़ॉल्ट रूप से enabled हालत में मिल जाए, तो अच्छा होगाकुछ tweaks और built-in फीचर्स चालू करने भर से usability काफ़ी बदल जाती है, और
bedrockयाemacs-soloऐसी ही संरचना लेते हैंEmacs शुरू करते समय missing
dylibके बारे में बड़ा सा संदेश हर बार दिखाई देता हैउदाहरण में
(treesit-auto-install-grammar t)और(treesit-enabled-modes t)का syntax function call जैसा दिखता है, लेकिन असल में ये configure किए जाने वाले options हैंअगली रिलीज़ में कुछ छोटे बदलाव भी पसंद आए:
minibuffer-nonselected-modeडिफ़ॉल्ट रूप से enabled है, इसलिए मिनीबफ़र में कोई अधूरा काम छूटा है या नहीं यह ज़्यादा साफ़ दिखता है, औरdiff-modeकाdiff-delete-other-hunksEmacs 29 में आए diff buffer के VC behavior के साथ इस्तेमाल करने पर बहुत उपयोगी हैwith-work-buffer,with-temp-bufferजैसा है, लेकिन buffer pool को reuse करता है। अपनी config में संयोग से उसी buffer naming convention*work*का इस्तेमाल करते हुए इसका पता चलाEmacs 31 में
lua-modeशामिल है, इसलिए अब इसे अलग से install करने की ज़रूरत नहींअपनी पसंद के मुताबिक़ बिल्कुल सही तरह से काम कराने के लिए कुछ adjustments भी करने पड़े:
xterm-mouse-modeडिफ़ॉल्ट रूप से enabled है, इसलिए उसे स्पष्ट रूप से बंद किया, औरmode-lineface अंधेरे theme के हिसाब से बदल जाती है, लेकिन पुराने default रंगों की आदत होने की वजह से उसे वापस कर दियाEmacs 31 source file में
lexical-bindingcookie न होने पर warning देता है। यह परेशान करे तो इसे बंद किया जा सकता है,elisp-enable-lexical-bindingकमांड से आसानी से ठीक भी किया जा सकता है, औरlexical-bindingको global default बनाना भी संभव हैअगर कोई नई bug न आई, तो हमेशा की तरह यह एक मज़बूत रिलीज़ लग रही है
use-packageकी:customसूची से कॉपी किया गया लगता हैइसी वजह से
:customको लेकर थोड़ा असमंजस रहता है। values के साथ प्रयोग करना या उन्हें share करना ज़्यादा झंझट भरा हो जाता हैwith-work-bufferperformance के लिए है? docs में यह नहीं बताया गया किwith-temp-bufferकी जगह इसे क्यों इस्तेमाल करें, बस यह कहा गया है कि इसमें ज़्यादा सावधानी बरतनी चाहिएelpaके अंदर की files पर warning न आए और सिर्फ मेरी files के लिए आए, तो अच्छा होगाऔर मेरे Emacs की 68 warnings में से 64 generated file
-autoloads.elसे आती हैं। यह शायदelpa/melpaकी generation tooling में ठीक किया जाना चाहिएआखिरकार मैं editable xref का इंतज़ार कर रहा था, और यह मेरी ज़िंदगी काफ़ी आसान बना देगा
हैरानी की बात है कि रोज़ इस्तेमाल होने वाली चीज़ों को छूने वाले इतने अच्छे बदलाव हैं
Nvim ने default को vim regex से treesitter पर बदला था, और इससे मेरा writing environment टूट गया
treesitter को Markdown के अंदर HTML comments parse कराने के लिए कुछ configuration चाहिए थी, और सब जोड़ने के बाद भी यह काम नहीं कर रहा था
आखिर में treesitter बंद करके समस्या हल की
editor जैसी बुनियादी infrastructure चीज़ों को लेकर मैं बहुत conservative हूँ। editor changes अक्सर कई सालों से बिना दिक्कत चल रही किसी चीज़ को तोड़ देते हैं