User: emacs show eval history
Assistant: InIn Emacs, when you evaluate expressions using commands like M-: (eval-expression), Emacs keeps a history of the evaluated expressions. There are several ways to view and reuse this eval history:
1. Using M-: (eval-expression) with History Navigation
Press M-: to bring up the minibuffer prompt Eval:.
You can navigate through previous expressions by pressing:
M-p (Meta + p) to go to the previous evaluated expression.
M-n (Meta + n) to go to the next evaluated expression.
This lets you browse through past eval expressions in the minibuffer directly.
2. View Eval History File
Emacs stores the eval-expression history in the variable eval-expression-history during the session. By default, it is not saved between sessions unless you customize Emacs to do so.
If you want to keep eval history persistently, you can save it when Emacs exits or use built-in packages like savehist.
Add the following to your Emacs config to save eval-expression-history automatically:
This will save the eval history and reload it next time you start Emacs.
3. Directly Access Eval History in Emacs Lisp
You can inspect the current eval history by evaluating:
(eval-expression-history)
or just evaluate:
M-: (print eval-expression-history)
This prints the list of previously evaluated expressions to the *Messages* buffer.
Summary
Use M-: then M-p / M-n to browse eval history interactively.
Save eval history persistently with savehist and (setq savehist-additional-variables '(eval-expression-history)).
Inspect the variable eval-expression-history programmatically.
Let me know if you want to see the history in a buffer or have other display preferences!
User: emacs reset package variables all to default,how ?
Assistant: InIn Emacs, if you want to reset package variables back to their default values, there are a few approaches, depending on what exactly you want:
Assistant
Приём протеина перед тренировкой — это вполне нормально и часто применяется, хотя многое зависит от твоих целей, рациона и конкретного времени тренировки.
Вот несколько важных моментов:
Почему можно принимать протеин перед тренировкой
Запас аминокислот: Белок обеспечивает мышцы аминокислотами, которые нужны для поддержания анаболических процессов и предотвращения катаболизма во время нагрузки.
Энергия на тренировке: Хотя белок не основной источник энергии, наличие аминокислот помогает организму лучше справляться с нагрузками.
1. Reload the Package
The simplest way to reset package variables is to reload the package, which usually re-initializes its variables. You can do this with:
M-x package-reload RET
However, this command requires package-reload function, which is available in Emacs 28 and later. Alternatively, you can manually unload and load the package:
;; Replace `some-package` with the actual package name
(unload-feature 'some-package t)
(require 'some-package)
This restarts the package, which usually resets its variables.
2. Reset Variables Manually
If you know the specific variables you want to reset, you can simply set them back to their default values using setq-default or by assigning their default defined values.
For example:
(setq some-package-variable default-value)
Or, if you want to reset a customizable variable to its default:
(customize-reset 'some-package-variable)
You can invoke this interactively with:
M-x customize-variable RET some-package-variable RET
and press the Reset button.
3. Reset All Package Variables on Emacs Restart
If your variables are set in your config file (init.el or .emacs), simply removing or commenting those lines and restarting Emacs will reset variables to package defaults.
4. Programmatic Reset: Use custom-reset-variables
Emacs provides a function custom-reset-variables that resets variables registered with the Customize system to their standard values.
(custom-reset-variables)
This resets all "customized" variables to their default state, which may include package variables.
5. Reset All Variables for a Package (Advanced)
This is more involved because Emacs doesn't track variables on a per-package basis by default. You might:
List all variables defined by a package by checking its source code.
Reset those variables individually.
Or, if the package supports a reset or clear function, use it.
Summary
Method
Description
Reload the package
(unload-feature ...) + (require ...)
Customize system
M-x customize-variable + Reset button
custom-reset-variables
Reset all customized variables
Manual setq
Set variables explicitly
Remove config settings
Restart Emacs without customizations
If you want, I can help you write a function to reset certain variables or automate this process — just let me know the package and variables you want to reset!
User: how to disable emacs ligatures
Assistant: EmEmacs itself does not enable ligatures by default. Ligatures are typically provided by the font you use and the rendering engine, or by enabling ligature support through packages or specific configuration.
If you want to disable ligatures in Emacs, here are some common ways ligatures get enabled, and how to disable them:
1. Using a Ligature-supporting Font
If you use a font that supports ligatures (e.g., Fira Code, JetBrains Mono, Cascadia Code), ligatures will appear by default if your Emacs supports font ligatures (Emacs 28+ has built-in support).
To disable ligatures, you can:
Change your font to one that does not have ligatures.
For example, in your config:
(set-frame-font "DejaVu Sans Mono-12" t t)
Or, configure the font to disable ligatures explicitly (Emacs 29+ supports this feature).
2. Disable Ligatures in Emacs 29+ via composition property
Emacs 29 introduced native ligature support that can be enabled/disabled using the composition font property.
To disable ligatures globally, you can clear the composition rules in the default face:
(set-fontset-font t nil (font-spec :family "Fira Code") nil 'prepend)
;; Remove all composition (ligature) rules
(set-display-table-slot standard-display-table 'composition nil)
However, this method can be intrusive and possibly difficult to manage.
If you tell me your Emacs version and how ligatures are enabled in your setup, I can provide a more tailored solution!
User: чем парка отличается от джекета?
Assistant: ППаркa и джеке́т — оба типа верхней одежды, но между ними есть несколько отличий, связанных с дизайном, назначением и стилем.
Парка
Назначение: Парка — это теплая, обычно зимняя куртка, изначально разработанная для сурового климата (например, для арктических условий).
Материал и утеплитель: Часто имеет плотную, водо- и ветрозащитную ткань, с хорошим утеплителем — натуральным (например, пух) или синтетическим.
Длина: Обычно парка длиннее — достигает середины бедра или даже колен, что обеспечивает дополнительную защиту от холода и ветра.
Капюшон: Часто снабжена капюшоном с меховой или искусственной опушкой, которая защищает лицо от ветра и снега.
Дизайн: Свободный покрой, много карманов, иногда с внутренними утепляющими слоями и дополнительными деталями для защиты от непогоды.
Джекет (жакет)
Назначение: Джекет — это более легкая куртка или пиджак, чаще служит для демисезонного периода или как модный элемент одежды.
Материал и утеплитель: Обычно тоньше, может быть из хлопка, денима, кожзаменителя, кожи или легкой синтетики. Утеплитель, если есть, очень легкий.
Длина: Короткий — обычно до талии или чуть ниже.
Капюшон: Капюшон бывает редко, чаще это просто воротник.
Дизайн: Более приталенный, может иметь декоративные элементы, используется и для повседневной, и для классической одежды (в том числе пиджачные варианты).
Итого
Характеристика
Парка
Джекет
Назначение
Защита от сильного холода
Легкая верхняя одежда, мода
Длина
Средняя или длинная (ниже бедер)
Короткая (до талии)
Утепление
Толстое утепление, мех
Легкое или отсутствует
Капюшон
Обычно есть с меховой отделкой
Очень редко
Стиль
Спортивный, функциональный
Универсальный, бывает и формальный
Если коротко — парка теплее, длиннее и защищает от суровых условий, а джекет — более легкий и короткий, больше подходит для межсезонья и как элемент стиля.
Если хотите, могу помочь подобрать конкретные модели или бренды!
User: marta file manager, как перейти к след кагдидату в поиске
Assistant: В файловом менеджере marta при использовании поиска (функции поиска по имени файла или содержимому) чтобы перейти к следующему совпадению (к следующему кандидату поиска), обычно используется стандартное сочетание клавиш, похожее на другие приложения с поиском:
Как перейти к следующему результату поиска в marta:
Нажмите F3 — в marta это обычно кнопка "следующий" результат поиска.
Или используйте сочетание Ctrl+G — стандартно для "найти дальше" во многих приложениях (в marta это тоже работает).
Также:
Для перехода к предыдущему результату поиска — используйте Shift+F3 или Ctrl+Shift+G.
Резюме:
Действие
Клавиши
Следующее совпадение
F3 или Ctrl+G
Предыдущее совпадение
Shift+F3 или Ctrl+Shift+G
Если у вас нестандартная раскладка или в настройках marta изменены горячие клавиши, посмотрите настройки горячих клавиш через меню:
Options → Keyboard Shortcuts → Search, там можно увидеть и изменить эти сочетания.
Если хотите, могу помочь с более подробной настройкой или скриншотами!
User: how to save src block under cursor on org mode emacs?
Assistant: In Emacs Org mode, to save (export or tangle) the source code block under the cursor, you typically want to "tangle" that specific block. Tangling means extracting code blocks to separate source files.
Here’s how to save the current source block under the cursor:
1. Using org-babel-tangle interactively
Place the cursor inside the source block.
Run the command:
M-x org-babel-tangle RET
By default, org-babel-tangle tangles all code blocks in the buffer.
2. Tangling only the current source block
Org does not provide a built-in single command to tangle only the source block under cursor, but you can write a small helper function to do that.
Here's an example Emacs Lisp function to tangle only the source block at point:
(defun my/org-babel-tangle-current-block ()
"Tangle the current org-mode source block under cursor."
(interactive)
(let* ((info (org-babel-get-src-block-info))
(params (nth 2 info))
(file (cdr (assoc :tangle params))))
(if file
(org-babel-tangle-file file)
;; No :tangle header argument, tangle all blocks in buffer
(org-babel-tangle))))
How it works:
It checks if the current block has a :tangle parameter (e.g., :tangle filename.ext).
If so, it tangles that file only (which means tangling blocks set to tangle into that file).
Otherwise, it tangles everything.
You can call this function with M-x my/org-babel-tangle-current-block.
3. Save the raw contents of the current src block to a file manually
If you want to save the contents of the source block under the cursor into a file manually, you can:
Put your cursor inside the block.
Use:
(defun my/org-save-src-block-to-file (filename)
"Save current org src block contents to FILENAME."
(interactive "FSave src block content to file: ")
(let ((content (org-element-property :value (org-element-at-point))))
(with-temp-file filename
(insert content))))
;; Usage: inside source block, call `M-x my/org-save-src-block-to-file` and specify file.
Summary
To tangle (export) all source blocks: M-x org-babel-tangle.
To tangle selectively or single block: write a custom function or use :tangle header args.
To save only the current source block content to a file, use a custom command like above or copy/paste manually.
If you want, I can help you set up keybindings or more sophisticated workflows!
User: Not tangle, copy to clipboard
Assistant: If you want to copy the current Org mode source block’s content to the clipboard (kill ring) instead of tangling or saving to a file, you can do this with a small Emacs Lisp command.
Copy the current source block content to clipboard
(defun my/org-copy-src-block-to-clipboard ()
"Copy the contents of the current Org source block to the clipboard."
(interactive)
(let* ((element (org-element-at-point))
(type (org-element-type element)))
(if (eq type 'src-block)
(let ((content (org-element-property :value element)))
(kill-new content)
(message "Source block copied to clipboard!"))
(message "Not inside a source block."))))
Usage:
Move point inside the source block.
Run M-x my/org-copy-src-block-to-clipboard.
The content of the source block is now in the kill ring (clipboard), ready to paste.
Now you can press C-c C-k in a source block to copy it.
If you want me to help with copying the block including the header line (like #+BEGIN_SRC ...), or only the code, or adjusting for other requirements — just ask!
User: fish how to edit config.fish file? It's protected
Assistant: If your config.fish file is protected (read-only or you don’t have write permission), you need to edit it with the necessary permissions.
Here’s how to edit your config.fish safely:
1. Locate config.fish
Fish config file is usually at:
~/.config/fish/config.fish
2. Check file permissions
Open a terminal and run:
ls -l ~/.config/fish/config.fish
Example output:
-r--r--r-- 1 user user 1234 Apr 10 12:00 /home/user/.config/fish/config.fish
If you see something like -r--r--r-- (read-only), it means the file is not writable by your user.
3. Make the file writable (if it’s owned by you)
If you own the file but it’s not writable, run:
chmod u+w ~/.config/fish/config.fish
Then open it with your editor, e.g.:
nano ~/.config/fish/config.fish
# or
vim ~/.config/fish/config.fish
4. If you don’t own the file
If the file is owned by another user (e.g., root), you need to use sudo to edit it:
sudo nano ~/.config/fish/config.fish
# or
sudo vim ~/.config/fish/config.fish
Note: Using sudo on files in your home folder is rare and usually not recommended — better fix the ownership instead:
sudo chown $(whoami) ~/.config/fish/config.fish
Then edit normally.
5. Create the config file if it doesn’t exist
If the file is missing or you don’t have write permission in the directory, create it:
Fix permissions with chmod u+w or fix ownership with chown
Edit with your favorite editor
Use sudo only if absolutely necessary, or fix permissions instead
If you want, I can help you with exact commands based on your situation — just provide the output of:
ls -l ~/.config/fish/config.fish
User: how to add alias to fish permoment?
Assistant: To add a permanent alias in Fish shell, you typically create a function with the alias name and save it in your Fish configuration directory, so it persists across sessions.
Here are the ways to create permanent aliases in Fish:
1. Use funcsave to save an alias as a function permanently
In Fish, aliases are generally just functions.
For example, to create a permanent alias ll for ls -l, do this:
function ll
ls -l $argv
end
funcsave ll
funcsave saves the ll function to your Fish configuration directory (~/.config/fish/functions/ll.fish), making it persistent.
After this, the alias ll will work in all new Fish sessions.
2. Add functions directly to your config.fish
You can also define your alias function directly in ~/.config/fish/config.fish by appending:
function ll
ls -l $argv
end
This will work permanently, but funcsave is cleaner because it stores each function in its own file.
3. Using alias function (convenience, but not persistent by itself)
Fish has a helper function sometimes defined called alias, which looks like:
alias ll='ls -l'
But this alias is usually a custom function (not built-in). To make it permanent, you still need to save this alias definition, e.g., put the alias commands inside config.fish or create functions and funcsave them.
Summary
To add a permanent alias named aliasname for command some-command:
Define function:
function aliasname
some-command $argv
end
Save it permanently:
funcsave aliasname
Example: Permanent alias for gs = git status
function gs
git status $argv
end
funcsave gs
Now gs will always run git status.
If you want help automating multiple aliases or converting bash aliases to fish, just let me know!
User: протеин перед тренеровкой, нормально?
Assistant:
Улучшение восстановления: Если ты долго не ел перед тренировкой, прием протеина поможет уменьшить мышечный распад.
Когда приём протеина перед тренировкой особенно полезен
Если ты тренируешься натощак (например, утром).
Если между последним приёмом пищи и тренировкой прошло много времени (3-4 часа и более).
Если твоя цель — нарастить мышечную массу и обеспечить мышцы строительным материалом.
Какой протеин лучше принимать перед тренировкой
Быстроусвояемые белки, например, сывороточный (whey), чтобы аминокислоты быстрее поступили в кровоток.
В разумных дозах — 20–30 граммов достаточно.
Важные нюансы
Если ты поешь полноценный сбалансированный приём пищи за 1,5–2 часа до тренировки, отдельный приём протеина перед тренировкой необязателен.
Главное — общее количество белка за день и равномерное распределение его приёмов.
После тренировки протеин тоже важен для восстановления, и многие эксперты считают послетренировочный приём более приоритетным.
Итог
Приём протеина перед тренировкой — нормальная и часто рекомендуемая практика, особенно если между едой и тренировкой большой промежуток или тренируешься на пустой желудок.
Если хочешь, могу подсказать индивидуальные рекомендации по питанию с учётом твоих целей и режима тренировок!