1 पॉइंट द्वारा GN⁺ 13 시간 전 | 1 टिप्पणियां | WhatsApp पर शेयर करें
  • Emacs 31 अभी औपचारिक रूप से जारी नहीं हुआ है, लेकिन emacs-31 branch और 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-mode editing, 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-31 branch और master को build करके इस्तेमाल करने वाली setup पर आधारित है
  • यहाँ बताई गई चीज़ें वे बदलाव हैं जो वास्तव में रोज़मर्रा की configuration में शामिल हो चुके हैं, और इनमें से अधिकांश Emacs core में आ चुके हैं या उसके बहुत क़रीब हैं
  • feature names और default values अंतिम release से पहले बदल सकते हैं
  • configuration examples Emacs Solo के init.el में ; EMACS-31 comment के साथ देखे जा सकते हैं

Tree-sitter configuration में कमी

  • Emacs 31 में दो options के साथ Tree-sitter आधारित mode switching और grammar installation का flow सरल हो जाता है
    • treesit-enabled-modes t
    • treesit-auto-install-grammar t
  • treesit-enabled-modes को t रखने पर जिन major modes के Tree-sitter variants उपलब्ध हैं, वे उसी mode में switch हो जाते हैं
  • treesit-auto-install-grammar grammar न होने पर सिर्फ 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 से जुड़ा नहीं है, इसलिए .md files अपने-आप इसमें नहीं खुलतीं
    • 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 t cursor के नीचे मौजूद item की help बिना अलग से call किए दिखाता है
    • eldoc-echo-area-prefer-doc-buffer के साथ इसे इस्तेमाल करने पर अनजाने code को explore करते समय ज़्यादा guidance मिलती है
  • completion से जुड़ी नई settings input के दौरान UI को ज़्यादा सक्रिय रूप से refresh करती हैं
    • completion-eager-update t
    • completion-eager-display 'auto
    • minibuffer-visible-completions 'up-down
  • completion-eager-update और completion-eager-display user के 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-list
    • icomplete-vertical-render-prefix-indicator

window layout और Speedbar

  • Emacs 31 में layout बदलने के लिए ऐसे commands जोड़े गए हैं जिनसे windows को manually फिर से split और close करने की ज़रूरत नहीं पड़ती
    • window-layout-transpose
    • window-layout-rotate-clockwise
    • window-layout-flip-leftright
    • window-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-width
    • speedbar-window-max-width
    • speedbar-window
  • speedbar-window Speedbar को आधुनिक 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 t
    • vc-allow-rewriting-published-history t
    • vc-dir-auto-hide-up-to-date 'revert
  • vc-dir-auto-hide-up-to-date, vc-dir buffer refresh होने पर up-to-date files को अपने-आप छिपा देता है
    • पहले vc-dir-refresh के बाद vc-dir-hide-up-to-date call करने वाले key hacks हटाए जा सकते हैं
  • vc-allow-rewriting-published-history Jujutsu या 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 में नहीं थी
  • शुरुआती proposal में xref-export-to-grep के ज़रिए xref results को file:line:content format वाले 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 का scrolltobottom module अब 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-w error देने के बजाय आगे वाला 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 nil
    • dired-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 t
    • zone-all-windows-in-frame t
    • uniquify-after-kill-buffer-flag t: पुराने -p variant से इसका नाम बदला गया है
  • kill-region-dwim C-w पर “the mark is not active” error से बचाता है
  • view-lossage-auto-refresh screen 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 theme
    • modus-operandi: white background वाला high-readability theme
    • modus-operandi-tinted: हल्के ओखर background वाला high-readability theme
    • modus-operandi-tritanopia: white background वाला tritanopia-optimized theme
    • modus-vivendi-deuteranopia: black background वाला deuteranopia-optimized theme
    • modus-vivendi: black background वाला high-readability theme
    • modus-vivendi-tinted: रात के आसमान जैसे background वाला high-readability theme
    • modus-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 32 रोज़ इस्तेमाल कर रहा हूँ, लेकिन यह कहना मुश्किल है कि treesit बस काम करता है
      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-hunks Emacs 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-line face अंधेरे theme के हिसाब से बदल जाती है, लेकिन पुराने default रंगों की आदत होने की वजह से उसे वापस कर दिया
    Emacs 31 source file में lexical-binding cookie न होने पर warning देता है। यह परेशान करे तो इसे बंद किया जा सकता है, elisp-enable-lexical-binding कमांड से आसानी से ठीक भी किया जा सकता है, और lexical-binding को global default बनाना भी संभव है
    अगर कोई नई bug न आई, तो हमेशा की तरह यह एक मज़बूत रिलीज़ लग रही है

    • यह उदाहरण शायद use-package की :custom सूची से कॉपी किया गया लगता है
      इसी वजह से :custom को लेकर थोड़ा असमंजस रहता है। values के साथ प्रयोग करना या उन्हें share करना ज़्यादा झंझट भरा हो जाता है
    • क्या with-work-buffer performance के लिए है? docs में यह नहीं बताया गया कि with-temp-buffer की जगह इसे क्यों इस्तेमाल करें, बस यह कहा गया है कि इसमें ज़्यादा सावधानी बरतनी चाहिए
    • सोच रहा हूँ इस warning को बंद कैसे किया जाए। आदर्श रूप से 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 अक्सर कई सालों से बिना दिक्कत चल रही किसी चीज़ को तोड़ देते हैं

    • अच्छी बात यह है कि Emacs default को treesitter पर नहीं बदल रहा, यह अब भी पूरी तरह optional enablement है