instruction stringlengths 38 27.8k | completion stringlengths 2 63.4k | conversations listlengths 2 2 |
|---|---|---|
I struggle to pronounce many computer terms, and to this day still mispronounce latex in my head - it just sounds better rhyming with flex.
How would I pronounce Emacs?
| Emacs is typically pronounced as "EE-macs" (rhyming with "K-macs"). The "E" is pronounced like the letter "E," and "macs" sounds like the word "macs." So it has two syllables: "EE-macs." | [
{
"from": "human",
"value": "I struggle to pronounce many computer terms, and to this day still mispronounce latex in my head - it just sounds better rhyming with flex. \nHow would I pronounce Emacs?\n"
},
{
"from": "gpt",
"value": "Emacs is typically pronounced as \"EE-macs\" (rhyming with \"K-... |
I'd like to load the yaml-mode for any files named *.yml or *.yaml.
| To enable `yaml-mode` for files with the extensions `.yml` or `.yaml` in Emacs, you can add the following lines to your Emacs configuration file, typically located at `~/.emacs` or `~/.emacs.d/init.el`:
```elisp
;; Load yaml-mode
(require 'yaml-mode)
;; Associate .yml and .yaml files with yaml-mode
(add-to-list 'auto... | [
{
"from": "human",
"value": "I'd like to load the yaml-mode for any files named *.yml or *.yaml.\n"
},
{
"from": "gpt",
"value": "To enable `yaml-mode` for files with the extensions `.yml` or `.yaml` in Emacs, you can add the following lines to your Emacs configuration file, typically located at... |
Paraphrasing a question I previously asked on SuperUser because, IMO, the answer found there does not resolve the issue.
Question
For the most part I prefer to disable Emacs' fringe. (I customize fringe-mode to 0 a/k/a no-fringes) But I like to have the left fringe active when debugging elisp code (for the little frin... | Here's a paraphrased version of your question:
---
I usually prefer to have the fringe in Emacs disabled by setting fringe-mode to 0 (which means no fringes). However, when I'm debugging elisp code, I would like to enable the left fringe to display the small arrow pointing to the active line.
Is there a way to conf... | [
{
"from": "human",
"value": "Paraphrasing a question I previously asked on SuperUser because, IMO, the answer found there does not resolve the issue.\nQuestion\nFor the most part I prefer to disable Emacs' fringe. (I customize fringe-mode to 0 a/k/a no-fringes) But I like to have the left fringe active whe... |
Inside org-mode, RETURN is bound to (org-return &optional INDENT). This command apparently ignores C-u numeric prefixes and so if you want to enter 10 newlines, you can't just type C-u 1 0 RET and have it work. You can do C-u 1 0 M-x newline and get expected behavior, but I would like to know if there's a simpler set o... | In org-mode, the `RET` key indeed calls `org-return`, which does not respect numeric prefixes in the way you described. However, you can achieve the desired behavior of inserting multiple newlines with a simpler key combination.
To insert multiple newlines while respecting numeric prefixes, you can use the following c... | [
{
"from": "human",
"value": "Inside org-mode, RETURN is bound to (org-return &optional INDENT). This command apparently ignores C-u numeric prefixes and so if you want to enter 10 newlines, you can't just type C-u 1 0 RET and have it work. You can do C-u 1 0 M-x newline and get expected behavior, but I woul... |
key-chord-mode is useful, but I don't need it to work in the minibuffer. How do I disable it in the minibuffer?
| To disable `key-chord-mode` in the minibuffer in Emacs, you can use a hook to ensure that it is turned off when you're in the minibuffer. Here's how you can do that:
1. Open your Emacs configuration file, usually located at `~/.emacs` or `~/.emacs.d/init.el`.
2. Add the following code to your configuration:
```elisp... | [
{
"from": "human",
"value": "key-chord-mode is useful, but I don't need it to work in the minibuffer. How do I disable it in the minibuffer?\n"
},
{
"from": "gpt",
"value": "To disable `key-chord-mode` in the minibuffer in Emacs, you can use a hook to ensure that it is turned off when you're in ... |
There command-line option -e behaves similar to the --eval option, but yet it is not the same. For example, of these two invocations, only the first one works:
emacs --eval '(global-linum-mode)'
emacs -e '(global-linum-mode)'
And of these two invocations, only the second one works:
emacs --eval 'global-linum-mode... | The behavior you're observing with the `-e` and `--eval` options in Emacs can indeed be confusing. The `-e` option is a shorthand for executing a command in the context of Emacs, but it is not functionally identical to `--eval`.
In general, `--eval` evaluates the given expression as Lisp code, while `-e` is intended t... | [
{
"from": "human",
"value": "There command-line option -e behaves similar to the --eval option, but yet it is not the same. For example, of these two invocations, only the first one works:\nemacs --eval '(global-linum-mode)'\nemacs -e '(global-linum-mode)'\n\nAnd of these two invocations, only the seco... |
In GitHub one can often find, for a given open-source project, the list of issues that have been reported and the estimated time-horizon that is considered for a given fix or enhancement.
Is there an equivalent repository where feature requests and bugs for GNU Emacs are collected and prioritized? Do the developers gro... | Yes, for GNU Emacs, issues, feature requests, and bugs are tracked in the official GNU Emacs repository on the Savannah platform, which is a part of the GNU Project. The issues can be reported and discussed on the Emacs development mailing lists, particularly `emacs-devel`, and there is also a bug tracking system integ... | [
{
"from": "human",
"value": "In GitHub one can often find, for a given open-source project, the list of issues that have been reported and the estimated time-horizon that is considered for a given fix or enhancement.\nIs there an equivalent repository where feature requests and bugs for GNU Emacs are collec... |
When using the shellcheck checker, Flycheck will warn me that the "$@" in the following will be expanded on the client rather than the ssh server. Which is a helpful warning, but yeah I know and I'm good. So is it possible to suppress this warning; better yet if it's for just this one line.
function f(){ ssh foo "$@... | Yes, you can suppress specific warnings from ShellCheck while using Flycheck by adding a directive comment to the line of code that triggers the warning. In your case, if you want to suppress the warning about `"$@"` being expanded on the client side rather than the SSH server, you can use the `shellcheck disable=SC202... | [
{
"from": "human",
"value": "When using the shellcheck checker, Flycheck will warn me that the \"$@\" in the following will be expanded on the client rather than the ssh server. Which is a helpful warning, but yeah I know and I'm good. So is it possible to suppress this warning; better yet if it's for jus... |
I don't like the default M-n and M-p keys for company-select-next and company-select-previous so I was wondering if it's possible to remap those to C-n and C-p without affecting the mappings when company's tooltip is not active.
| Yes, you can remap the `company-select-next` and `company-select-previous` commands to `C-n` and `C-p` while ensuring that these keybindings only apply when the company tooltip is active. You can achieve this by using a hook to check if the company completion is active and then remapping the keys accordingly.
Here's h... | [
{
"from": "human",
"value": "I don't like the default M-n and M-p keys for company-select-next and company-select-previous so I was wondering if it's possible to remap those to C-n and C-p without affecting the mappings when company's tooltip is not active.\n"
},
{
"from": "gpt",
"value": "Yes, ... |
As I use a different language from English often I would like to create some keymaps to avoid changing languages all the time.
I don't know the name of the commands that I have to place in the section interactive-command-here of the keymap:
(define-key KEYMAP (kbd "key-bind-here") 'interactive-command-here)
For instan... | In Emacs, the command for saving a file is typically `save-buffer`. To bind a key combination (like `C-σ`) to the save command, you would define it in a keymap using `define-key`.
Here's how you would do it:
```elisp
(define-key KEYMAP (kbd "C-σ") 'save-buffer)
```
In this snippet, replace `KEYMAP` with the actual k... | [
{
"from": "human",
"value": "As I use a different language from English often I would like to create some keymaps to avoid changing languages all the time.\nI don't know the name of the commands that I have to place in the section interactive-command-here of the keymap: \n(define-key KEYMAP (kbd \"key-bind-... |
I just upgraded to Emacs 24.4 (from 24.3). Now, whenever I run vc-next-action on a modified file, the *vc-log* buffer that comes up starts with the word "Summary:" in log-edit-header face, followed by a line of inverse video.
This wasn't happening in 24.3, but I can't find anything about it in NEWS. What's going on? ... | The behavior you are encountering in Emacs 24.4 with the `vc-next-action` command and the appearance of the "Summary:" header in the `*vc-log*` buffer is related to changes in the version control mode's log-editing interface.
In Emacs 24.4, there were updates that affected the appearance and behavior of the log editin... | [
{
"from": "human",
"value": "I just upgraded to Emacs 24.4 (from 24.3). Now, whenever I run vc-next-action on a modified file, the *vc-log* buffer that comes up starts with the word \"Summary:\" in log-edit-header face, followed by a line of inverse video.\nThis wasn't happening in 24.3, but I can't find a... |
Of course when I am in Terminal and I press the up arrow key, it goes to the previous command. However, when I hit the M-x keys and type shell an integrated shell comes up in Emacs:
However, if I type a command and press up, this happens:
How do I get back to the last command I typed?
| In Emacs, when you are using the integrated shell (which is typically invoked using `M-x shell`), the keybindings can differ from what you might expect in a standard terminal environment.
If you want to navigate through your command history in the Emacs shell, you should use the following key combinations:
- **Press ... | [
{
"from": "human",
"value": "Of course when I am in Terminal and I press the up arrow key, it goes to the previous command. However, when I hit the M-x keys and type shell an integrated shell comes up in Emacs:\n\nHowever, if I type a command and press up, this happens: \n\nHow do I get back to the last com... |
According to fniessen's babel reference I should be able to set :eval yes on a babel header line to make a source block evaluate without confirmation. However, this doesn't seem to work for me on Emacs 24.4 and Org 8.2.10. Is this capability only available in org version 8.3 and beyond? If not, what do I need to do to... | The ability to use `:eval yes` in Org mode Babel header lines to evaluate source blocks without confirmation was introduced in Org mode 8.3. Since you are using Org version 8.2.10, this feature will not be available.
To enable this functionality, you have two options:
1. **Upgrade Org Mode**: The best solution would ... | [
{
"from": "human",
"value": "According to fniessen's babel reference I should be able to set :eval yes on a babel header line to make a source block evaluate without confirmation. However, this doesn't seem to work for me on Emacs 24.4 and Org 8.2.10. Is this capability only available in org version 8.3 an... |
This is cross-post from Stack Overflow
I have a simple widget setup:
(setq gobgen-widget-name
(widget-create 'editable-field
:size 25
:format "Name: %v"
:notify (lambda (widget &rest ignore)
(widget-value-set gobgen-w... | The behavior you’re encountering is a known quirk when using editable fields in Emacs widgets. When you update the value of one widget based on another, the focus can inadvertently shift to the other widget, causing the point to move to the end of the text.
To resolve this and ensure that the focus remains on the "Nam... | [
{
"from": "human",
"value": "This is cross-post from Stack Overflow\nI have a simple widget setup:\n(setq gobgen-widget-name\n (widget-create 'editable-field\n :size 25\n :format \"Name: %v\"\n :notify (lambda (widget &rest ignore)\n ... |
I found this list at the emacswiki:
FFI (foreign function interface). Would be great to have this in GNU.
Enhanced Numerics. We sorely need this too.
Apparently much better multimedia support (Of particular interest to me.)
Doubly-linked lists, skip lists, and some other possibly interesting data structures.
Does Ema... | Yes, Emacs has a couple of places where you can submit feature requests or report issues. The main avenues are:
1. **Emacs Bug Tracker:** You can report bugs and request features through the Emacs issue tracker hosted on GNU Savannah. You can find it at [https://debbugs.gnu.org/](https://debbugs.gnu.org/). To submit a... | [
{
"from": "human",
"value": "I found this list at the emacswiki: \nFFI (foreign function interface). Would be great to have this in GNU.\nEnhanced Numerics. We sorely need this too.\nApparently much better multimedia support (Of particular interest to me.)\nDoubly-linked lists, skip lists, and some other po... |
I am trying out a new major mode, how can I take advantage of Emacs' documentation system to get a listing of key bindings available in that specific buffer?
| In Emacs, you can easily access documentation for key bindings in a specific major mode using the `describe-bindings` command. Here are the steps to view the key bindings available in the current buffer's major mode:
1. **Open the buffer** that is using the new major mode you're interested in.
2. **Run the `describe-... | [
{
"from": "human",
"value": "I am trying out a new major mode, how can I take advantage of Emacs' documentation system to get a listing of key bindings available in that specific buffer?\n"
},
{
"from": "gpt",
"value": "In Emacs, you can easily access documentation for key bindings in a specific... |
Emacs has the function fill-paragraph. Is there any function which will do the opposite of that?
I have a paragraph which is already filled and instead I want it in a plain single line?
| Yes, in Emacs, if you have a paragraph that is filled (i.e., it has been wrapped to a certain width), you can use the function `fill-paragraph` to unfill it. To achieve this, you can use the `unfill-paragraph` function, which is not built-in but can be easily defined.
Here's how you can define `unfill-paragraph`:
1. ... | [
{
"from": "human",
"value": "Emacs has the function fill-paragraph. Is there any function which will do the opposite of that? \nI have a paragraph which is already filled and instead I want it in a plain single line?\n"
},
{
"from": "gpt",
"value": "Yes, in Emacs, if you have a paragraph that is... |
I know that I can look up help for a key sequence using C-h k <key sequence>, but I use Emacs in the terminal, and my terminal emulator doesn't pass all key sequences through to Emacs. Sometimes I'll see the notation for a given key sequence written somewhere without explanation, and I want to look up what it does, but... | Yes, there is an equivalent in Emacs that allows you to look up the documentation for key sequences without needing to type them. You can use the `describe-key` function directly with a key sequence written in a specific format.
To look up a key sequence like `C-x`, you can use the command `M-x describe-key` followed ... | [
{
"from": "human",
"value": "I know that I can look up help for a key sequence using C-h k <key sequence>, but I use Emacs in the terminal, and my terminal emulator doesn't pass all key sequences through to Emacs. Sometimes I'll see the notation for a given key sequence written somewhere without explanation... |
In a buffer in fundamental mode, I type Ctrl-x Ctrl-e at the end of the line
(require 'eclimd)
the minibuffer at the bottom says eclimd. Does it mean I run the command successfully?
If yes, why does require output eclimd?
| When you type `Ctrl-x Ctrl-e` at the end of a line in Emacs, it evaluates the expression before the cursor in the current buffer. In your case, you have the expression `(require 'eclimd)`.
1. **Successful Command**: If the minibuffer shows `eclimd`, it means that the `require` function was successful in loading the `e... | [
{
"from": "human",
"value": "In a buffer in fundamental mode, I type Ctrl-x Ctrl-e at the end of the line \n(require 'eclimd)\n\nthe minibuffer at the bottom says eclimd. Does it mean I run the command successfully?\nIf yes, why does require output eclimd?\n"
},
{
"from": "gpt",
"value": "When y... |
I have the code below:
Hello
There
I am some code
And want to add code in front of it, like:
I said Hello
I said There
I said I am some code
So how would I add a prefix to each line?
| You can add a prefix to each line of text using various programming languages. Below are examples in Python, JavaScript, and Bash.
### Python
Here's how you can do it in Python:
```python
text = """Hello
There
I am some code"""
# Split the text into lines and add the prefix
prefixed_lines = ["I said " + line for lin... | [
{
"from": "human",
"value": "I have the code below:\nHello\nThere\nI am some code\n\nAnd want to add code in front of it, like:\nI said Hello\nI said There\nI said I am some code\n\nSo how would I add a prefix to each line? \n"
},
{
"from": "gpt",
"value": "You can add a prefix to each line of t... |
I have Ubuntu 12.04 running with Emacs 24.3.
On computer startup, emacs --daemon is executed, and I have modified the emacs24.desktop to take emacsclient -c -a "" as exec parameter. However, whenever I try to open a file a new frame opens every time.
Is there a way to make the file appear in a preexisting frame as a ne... | To achieve the behavior you're looking for—having `emacsclient` open files in an existing Emacs frame rather than creating a new frame each time—you can modify how `emacsclient` is invoked.
It seems like your setup is almost correct, but the command `emacsclient -c -a ""` creates a new frame if no existing frame is fo... | [
{
"from": "human",
"value": "I have Ubuntu 12.04 running with Emacs 24.3.\nOn computer startup, emacs --daemon is executed, and I have modified the emacs24.desktop to take emacsclient -c -a \"\" as exec parameter. However, whenever I try to open a file a new frame opens every time.\nIs there a way to make t... |
Is there a built-in command to delete the contents of a cell in a single keystroke within an org-mode table? Note, I don't want to delete the row, just the cell contents.
| some text | ==> | |
If not, how would you write this?
| In Org-mode, there isn't a built-in command specifically for deleting the contents of a cell with a single keystroke. However, you can accomplish this with a combination of commands.
One way to delete the contents of a cell in an Org-mode table is to use the following steps:
1. Navigate to the cell whose contents you... | [
{
"from": "human",
"value": "Is there a built-in command to delete the contents of a cell in a single keystroke within an org-mode table? Note, I don't want to delete the row, just the cell contents.\n | some text | ==> | |\n\nIf not, how would you write this?\n"
},
{
"from": "gpt",
... |
I recently created the alias in eshell:
alias hello 'echo "Hello World"'
So now whenever I type hello:
I am very used to creating temporary alias in the Terminal for more subtle use. And then putting my more permanent alias in the .bashrc file. So how do I remove the alias for hello? Do I have to set another alias ... | In `eshell`, which is the Emacs shell, the way to manage aliases is different from how you would do it in a traditional Bash shell. Here's how you can remove an alias in `eshell`:
### Removing an Alias in Eshell
1. **Using `unalias`**: In `eshell`, you can simply use the `unalias` command to remove an alias. To remov... | [
{
"from": "human",
"value": "I recently created the alias in eshell: \nalias hello 'echo \"Hello World\"'\n\nSo now whenever I type hello: \n\nI am very used to creating temporary alias in the Terminal for more subtle use. And then putting my more permanent alias in the .bashrc file. So how do I remove the ... |
I have this line in my init.el file to set the size of the font in all frames:
(push '(font . "DejaVu Sans Mono-10") default-frame-alist)
It works but i'd like to have a bigger font in all buffers while keeping a smaller one for the mode line (so it could fit more information and be less distracting). The idea is to h... | You can achieve this by customizing the font size for different elements in Emacs. One approach is to set the default font size for buffers and then specify a smaller font size for the mode line. Here’s how you can do this in your `init.el` file:
1. Set the default font size for all frames (which will apply to buffers... | [
{
"from": "human",
"value": "I have this line in my init.el file to set the size of the font in all frames:\n(push '(font . \"DejaVu Sans Mono-10\") default-frame-alist)\n\nIt works but i'd like to have a bigger font in all buffers while keeping a smaller one for the mode line (so it could fit more informat... |
Here is a screenshot showing the difference between sql-interactive-mode (top) and sql-mode (bottom).
Why does the string not get highlighted properly in sql-interactive-mode? (Note - this also happens with no color theme enabled.
| The difference in string highlighting between SQL interactive mode and SQL mode in editors or IDEs typically stems from how each mode parses and interprets the SQL syntax. Here are some possible reasons why string highlighting may not function properly in SQL interactive mode:
1. **Syntax Parsing**: SQL interactive mo... | [
{
"from": "human",
"value": "Here is a screenshot showing the difference between sql-interactive-mode (top) and sql-mode (bottom).\n\nWhy does the string not get highlighted properly in sql-interactive-mode? (Note - this also happens with no color theme enabled.\n"
},
{
"from": "gpt",
"value": "... |
After copying a "rectangle" using C-x r M-w, doing C-x r y yanks or pastes the rectangle. But that inserts the copied rectangle.
How can I paste the copied rectangle so that it overwrites the text?
Example:
a b c d e f g
h i j k▮l m n
o p q r s t u▮
I copied the rectangle enclosed between the cursor positions shown... | To achieve the desired result of pasting a rectangle in Emacs such that it overwrites the existing text instead of inserting it, you can use a combination of rectangle commands to achieve that. Here's how to do it:
1. **Copy the Rectangle**: You already know how to do this. Use `C-x r M-w` or `M-x copy-rectangle-as-ki... | [
{
"from": "human",
"value": "After copying a \"rectangle\" using C-x r M-w, doing C-x r y yanks or pastes the rectangle. But that inserts the copied rectangle.\nHow can I paste the copied rectangle so that it overwrites the text?\nExample:\n a b c d e f g\n h i j k▮l m n\n o p q r s t u▮\n\nI copied the rec... |
I recently had a Sublime Text user try out Emacs for a while, and he was interested in getting the same auto-save behavior in Emacs.
Basically, he wanted all buffers to be saved whenever the frame lost focus (really saved, not just backed-up). This includes when switching windows to a completely different application.... | To achieve the desired behavior of auto-saving all buffers in Emacs when the frame loses focus (such as when switching to a different application), you'll need to rely on Emacs' built-in hooks and possibly utilize the `focus-out` event.
Here's a solution using `focus-out` and a small function that saves all buffers wh... | [
{
"from": "human",
"value": "I recently had a Sublime Text user try out Emacs for a while, and he was interested in getting the same auto-save behavior in Emacs. \nBasically, he wanted all buffers to be saved whenever the frame lost focus (really saved, not just backed-up). This includes when switching wind... |
I would like to wrap kill-ring-save in order to only execute kill-ring-save if text has been highlighted - same as in most text editors.
Sometimes I accidentally hit copy instead of paste and then my clipboard is over written, but I have not selected any text for copying. Personally it's a complete workflow killer.
Som... | You can achieve this by wrapping the `kill-ring-save` function in your custom function and checking if there's any selected text in the active region before performing the copy operation. In Emacs Lisp, you can check if the mark is set and if the point is not equal to the mark to determine if text is highlighted.
Here... | [
{
"from": "human",
"value": "I would like to wrap kill-ring-save in order to only execute kill-ring-save if text has been highlighted - same as in most text editors.\nSometimes I accidentally hit copy instead of paste and then my clipboard is over written, but I have not selected any text for copying. Perso... |
After modifying multiple files, how can I save all their buffers?
| In text editors like Vim, Emacs, or others, there are specific commands to save all modified buffers. Here’s how to do it in some popular text editors:
### Vim
To save all modified buffers in Vim, you can use the following command:
1. Press `Esc` to ensure you are in Normal mode.
2. Type `:wa` and hit `Enter`.
The `... | [
{
"from": "human",
"value": "After modifying multiple files, how can I save all their buffers?\n"
},
{
"from": "gpt",
"value": "In text editors like Vim, Emacs, or others, there are specific commands to save all modified buffers. Here’s how to do it in some popular text editors:\n\n### Vim\nTo s... |
From the Emacs Eclim github page:
Install emacs-eclim. You have two options:
Installation from the MELPA package archive.
Just add the archive to package-archives if you
haven't already, and
then install emacs-eclim with the package-install
command.
Manual installation from GitHub.
(git clone git://github.com/senny/... | The error message you received, "Install package: emacs-eclim [No Match]", indicates that Emacs was unable to find the `emacs-eclim` package in the package repositories you configured. There could be a few reasons for this issue:
1. **Package Archive URL**: The URL for the MELPA repository you provided may be outdated... | [
{
"from": "human",
"value": "From the Emacs Eclim github page:\n\nInstall emacs-eclim. You have two options:\n\nInstallation from the MELPA package archive.\nJust add the archive to package-archives if you\nhaven't already, and\nthen install emacs-eclim with the package-install\ncommand.\n\nManual installat... |
When using ispell to check spelling and encountering an incorrect word, pressing r takes you to the minibuffer where you can enter a replacement for the misspelled word. By default the minibuffer already contains the incorrectly spelled word and so I need to clear the minibuffer first before being able to type in the r... | To add a hook in Emacs that automatically clears the minibuffer when you're in `ispell` and need to input a replacement for a misspelled word, you can customize the behavior using the `ispell` hooks provided by Emacs.
You can achieve this by adding a function to the `ispell-replace-with-word` hook. Here's how to do it... | [
{
"from": "human",
"value": "When using ispell to check spelling and encountering an incorrect word, pressing r takes you to the minibuffer where you can enter a replacement for the misspelled word. By default the minibuffer already contains the incorrectly spelled word and so I need to clear the minibuffer... |
When you set Emacs to recognize 4 spaces as 1 tab, then copy text from an Emacs buffer to another program, will the other program see 4 spaces or interpret it as 1 tab (which may correspond to a different number of spaces, depending on setup)?
| In Emacs, when you set it to recognize 4 spaces as 1 tab (for example, by setting `tab-width` to 4), it affects how text is displayed and how indentation is handled within Emacs itself. However, this setting does not change the actual representation of tabs and spaces when you copy text from an Emacs buffer to another ... | [
{
"from": "human",
"value": "When you set Emacs to recognize 4 spaces as 1 tab, then copy text from an Emacs buffer to another program, will the other program see 4 spaces or interpret it as 1 tab (which may correspond to a different number of spaces, depending on setup)?\n"
},
{
"from": "gpt",
... |
When I write a long line while composing a mail in mu4e, the lines are truncated for viewing (toggle-truncate-lines), but as soon as I hit Enter fixed line breaks (column width seems to be 70 or something) are introduced.
How can I stop mu4e from introducing these line breaks?
| In `mu4e`, the behavior of inserting fixed line breaks when composing emails is influenced by the `fill-column` variable. When you hit Enter, it automatically fills the current paragraph to the `fill-column`, which by default may be set to 70 characters.
To prevent `mu4e` from automatically inserting line breaks when ... | [
{
"from": "human",
"value": "When I write a long line while composing a mail in mu4e, the lines are truncated for viewing (toggle-truncate-lines), but as soon as I hit Enter fixed line breaks (column width seems to be 70 or something) are introduced.\nHow can I stop mu4e from introducing these line breaks?\... |
Is there a gdocs-mode or something I could use to edit Google Docs?
| As of my last knowledge update in October 2023, there isn't a specific "gdocs-mode" for Google Docs that allows direct editing within terminal or command-line interfaces like Emacs or Vim. Google Docs is primarily a web-based application that relies on a graphical user interface.
However, if you're looking for ways to... | [
{
"from": "human",
"value": "Is there a gdocs-mode or something I could use to edit Google Docs?\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in October 2023, there isn't a specific \"gdocs-mode\" for Google Docs that allows direct editing within terminal or command-line inter... |
I'm already used to press C-h f and type a function name to ask for help on that function. But if the function name is already under the cursor (e.g. while visiting the .emacs configuration file), is there a way to avoid typing the whole thing again?
| Yes, in Emacs, you can easily obtain help for a function that is under the cursor without having to type the whole name again. You can use the `C-h f` (which is `describe-function`) command in combination with the built-in functionality to grab the function name at the point (the cursor).
Here's how you can do it:
1... | [
{
"from": "human",
"value": "I'm already used to press C-h f and type a function name to ask for help on that function. But if the function name is already under the cursor (e.g. while visiting the .emacs configuration file), is there a way to avoid typing the whole thing again? \n"
},
{
"from": "g... |
C-e C-j will insert a newline below and jump to it indented.
C-a C-o TAB will insert a newline above and jump to it indented.
Is there a single bind to these or where/how should I bind these commands?
| To create a single binding that inserts a newline below and jumps to it indented (like `C-e C-j`) or inserts a newline above and jumps to it indented (like `C-a C-o TAB`), you can create a custom function in Emacs Lisp that allows you to choose which operation to perform.
You can use the following Emacs Lisp code to d... | [
{
"from": "human",
"value": "C-e C-j will insert a newline below and jump to it indented.\nC-a C-o TAB will insert a newline above and jump to it indented.\nIs there a single bind to these or where/how should I bind these commands?\n"
},
{
"from": "gpt",
"value": "To create a single binding that... |
I'm trying to add some functionality to someone else's package, and so
I'd like to respect their patterns. Unfortunately, one of these
patterns is to not use kbd.
I need to bind a function to C-S-b, but I can't figure out how. I
know how to do this with a single modifier (e.g. "\S-b"), but I
can't get it to work with m... | To bind a key combination like `C-S-b` in Emacs Lisp while avoiding the use of `kbd`, you can use the `vector` construct to specify the key sequence more clearly. Unfortunately, using `C-S-b` directly like that can lead to difficulties since the notation for modifiers can be a bit tricky.
For `C-S-b`, you can define i... | [
{
"from": "human",
"value": "I'm trying to add some functionality to someone else's package, and so\nI'd like to respect their patterns. Unfortunately, one of these\npatterns is to not use kbd.\nI need to bind a function to C-S-b, but I can't figure out how. I\nknow how to do this with a single modifier (e.... |
I want to make it so that org-agenda-mode defaults to always having (org-agenda-follow-mode) toggled on.
| To have `org-agenda-follow-mode` always toggled on by default in `org-agenda-mode`, you can add a custom function to your Emacs configuration (usually your `init.el` or `.emacs` file). This function will enable `org-agenda-follow-mode` whenever `org-agenda` is activated.
Here's how you can do it:
1. Open your Emacs c... | [
{
"from": "human",
"value": "I want to make it so that org-agenda-mode defaults to always having (org-agenda-follow-mode) toggled on.\n"
},
{
"from": "gpt",
"value": "To have `org-agenda-follow-mode` always toggled on by default in `org-agenda-mode`, you can add a custom function to your Emacs c... |
I've added a custom key for the org agenda to show all unscheduled TODO items following Sacha Chua:
(defun sacha/org-agenda-skip-scheduled ()
(org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>"))
(setq org-agenda-custom-commands
'(("u" "Unscheduled tasks" alltodo ""
((org-agenda-skip-function 'sa... | To bind your custom Org agenda command to a single key, you can create a function that runs the agenda command directly. You can achieve this by using the `org-agenda` function with the appropriate arguments for your custom command. Here's how you can do it:
1. First, create a new function that calls your custom agend... | [
{
"from": "human",
"value": "I've added a custom key for the org agenda to show all unscheduled TODO items following Sacha Chua:\n(defun sacha/org-agenda-skip-scheduled ()\n (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp \"\\n]+>\"))\n\n(setq org-agenda-custom-commands\n '((\"u\" \"Unscheduled ta... |
When searching using:
C-s SPC SPC
Also matches single spaces. I want to match exactly two space.
| In many text editors or search utilities, the command you're using (`C-s SPC SPC`) is indeed likely searching for all spaces, including single spaces. If you want to specifically match exactly two spaces, you'll need to adjust your search string.
Here’s how you can do it in various contexts:
### In Emacs
If you are u... | [
{
"from": "human",
"value": "When searching using:\nC-s SPC SPC\n\nAlso matches single spaces. I want to match exactly two space.\n"
},
{
"from": "gpt",
"value": "In many text editors or search utilities, the command you're using (`C-s SPC SPC`) is indeed likely searching for all spaces, includi... |
At times while working on a code, it's useful to quickly open a *scratch* buffer to paste a snippet from that code file.
If I am working on a Perl script, I would like to quickly open a *scratch* buffer with in cperl-mode. It would also be nice to quickly jump back to the code buffer I was originally working in.
| You can achieve this in Emacs by creating a custom function that opens a scratch buffer in `cperl-mode` and allows you to jump back to the original buffer easily. Here’s how you can set this up:
1. **Create the function**: You can define a new function in your Emacs configuration file (usually `~/.emacs` or `~/.emacs.... | [
{
"from": "human",
"value": "At times while working on a code, it's useful to quickly open a *scratch* buffer to paste a snippet from that code file. \nIf I am working on a Perl script, I would like to quickly open a *scratch* buffer with in cperl-mode. It would also be nice to quickly jump back to the code... |
I tried it with the following settings:
(add-hook 'minibuffer-setup-hook
(lambda ()
(make-local-variable 'face-remapping-alist)
(add-to-list 'face-remapping-alist '(default (:background "green")))))
(set-face-background 'minibuffer-prompt "blue")
but they only affected the active minibuffer:
| To make the settings apply to all minibuffer sessions, including those that are not currently active, you need to ensure that the face-remapping takes effect for each new minibuffer session. In Emacs, you can do this by using the `minibuffer-setup-hook`, which runs each time the minibuffer is opened.
Your current code... | [
{
"from": "human",
"value": "\nI tried it with the following settings:\n(add-hook 'minibuffer-setup-hook\n (lambda ()\n (make-local-variable 'face-remapping-alist)\n (add-to-list 'face-remapping-alist '(default (:background \"green\")))))\n\n(set-face-background 'minibuffer-prompt \"blue\... |
I'm trying to understand how syntax tables work, but my minimal major mode doesn't highlight anything.
I've written the following elisp, which is just supposed to highlight comments:
(defconst my-yaml-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?# "<" table)
(modify-syntax-entry ... | It looks like you've set up a basic syntax table for comments in your minimal major mode, which is a good start. However, to enable highlighting for comments, you also need to define some font lock keywords so that Emacs knows to apply specific faces to the text.
Here's how you can extend your `my-yaml-mode` to includ... | [
{
"from": "human",
"value": "I'm trying to understand how syntax tables work, but my minimal major mode doesn't highlight anything.\nI've written the following elisp, which is just supposed to highlight comments:\n(defconst my-yaml-mode-syntax-table\n (let ((table (make-syntax-table)))\n (modify-syntax-... |
I heard that we can view pdf files in emacs. Is it done by converting pdf files to plain texts first?
Can we view pdf files at its fullness in emacs?
can we edit pdf files in emacs?
Thanks.
| Yes, you can view PDF files in Emacs, but it doesn't involve converting them to plain text. Instead, Emacs uses specialized packages to handle PDF files. Here's a breakdown of what you can do with PDFs in Emacs:
1. **Viewing PDF Files**:
- You can view PDF files directly in Emacs using a package called `pdf-tools`... | [
{
"from": "human",
"value": "I heard that we can view pdf files in emacs. Is it done by converting pdf files to plain texts first?\nCan we view pdf files at its fullness in emacs?\ncan we edit pdf files in emacs?\nThanks.\n"
},
{
"from": "gpt",
"value": "Yes, you can view PDF files in Emacs, but... |
From time to time I observe unexpected behavior when editing text. My first recourse is usually to use C-h k to find out what functions are being called by a given key sequence. However, sometimes the documentation is at odds with the observed behavior. In these cases, I usually assume that some other package has ho... | Yes, there are indeed more efficient ways to track down which functions or packages are modifying the behavior of key sequences in Emacs. Here are some strategies you can use to identify hooks and overrides without needing to disable packages one at a time:
1. **Check Active Minor Modes**: Some behavior might be cause... | [
{
"from": "human",
"value": "From time to time I observe unexpected behavior when editing text. My first recourse is usually to use C-h k to find out what functions are being called by a given key sequence. However, sometimes the documentation is at odds with the observed behavior. In these cases, I usua... |
Sometimes describe- or apropos- are not enough. How can I search the Emacs Lisp Reference Manual (C-h i m elisp) from within emacs?
| In Emacs, you can search the Emacs Lisp Reference Manual using the built-in Info system. Here are a few methods to help you search the manual effectively:
1. **Using the Info Search Function**:
- Once you are in the Info buffer for the Emacs Lisp manual (`C-h i m elisp`), you can search for a specific term by press... | [
{
"from": "human",
"value": "Sometimes describe- or apropos- are not enough. How can I search the Emacs Lisp Reference Manual (C-h i m elisp) from within emacs?\n"
},
{
"from": "gpt",
"value": "In Emacs, you can search the Emacs Lisp Reference Manual using the built-in Info system. Here are a fe... |
I want to get onto the #Emacs channel on Freenode. How do I do it?
| To join the #Emacs channel on Freenode, you can use an IRC client. Here's a general guide on how to do it:
1. **Choose an IRC Client**: If you don't have an IRC client installed, you can use a desktop client like HexChat, Irssi, or mIRC. Alternatively, you can use a web-based client like Kiwi IRC or Mibbit.
2. **Conn... | [
{
"from": "human",
"value": "I want to get onto the #Emacs channel on Freenode. How do I do it?\n"
},
{
"from": "gpt",
"value": "To join the #Emacs channel on Freenode, you can use an IRC client. Here's a general guide on how to do it:\n\n1. **Choose an IRC Client**: If you don't have an IRC cli... |
So irony-mode scans include directories through a file called .clang_complete, which looks like something like: -I./include/
However, it does not automatically load this file. Rather, I have to go into the source file and call irony-cdb and then load it manually by hitting l. I tried:
(add-hook 'c++-mode-hook 'irony-c... | To automate the process of loading the `.clang_complete` file in `irony-mode` when you enter C++ mode, you can follow these steps:
1. **Make sure you have installed and set up Irony Mode correctly**: Ensure that you have Irony Mode installed and configured properly in your Emacs. Check that `irony-mode` is enabled for... | [
{
"from": "human",
"value": "So irony-mode scans include directories through a file called .clang_complete, which looks like something like: -I./include/\nHowever, it does not automatically load this file. Rather, I have to go into the source file and call irony-cdb and then load it manually by hitting l. ... |
Is there a way to maximize my window on start-up?
Currently, I hit Control++Up on my keyboard but it is very bothersome to do that every time.
I am using Emacs 24.4 on Ubuntu 12.04.
| To make Emacs maximize its window on startup in Ubuntu, you can modify your Emacs configuration file. Here's how you can do it:
1. **Open your Emacs configuration file**: This is usually located at `~/.emacs` or `~/.emacs.d/init.el`. You can open it in Emacs by using `C-x C-f` and typing `~/.emacs.d/init.el` (or `~/.e... | [
{
"from": "human",
"value": "Is there a way to maximize my window on start-up?\nCurrently, I hit Control++Up on my keyboard but it is very bothersome to do that every time.\nI am using Emacs 24.4 on Ubuntu 12.04.\n"
},
{
"from": "gpt",
"value": "To make Emacs maximize its window on startup in Ub... |
After a recent update eldoc is turned on by default, even for emacs -Q.
I don't appreciate the noise it generates when I'm using eval-expression.
How do I turn it off?
| If `eldoc` is enabled by default and you want to disable it, even when starting Emacs with `-Q`, you can do so by adding a few lines to your Emacs configuration file (`init.el` or `.emacs`). Here’s how you can disable `eldoc`:
1. Open your Emacs configuration file (e.g., `~/.emacs` or `~/.emacs.d/init.el`).
2. Add th... | [
{
"from": "human",
"value": "After a recent update eldoc is turned on by default, even for emacs -Q.\nI don't appreciate the noise it generates when I'm using eval-expression.\nHow do I turn it off?\n"
},
{
"from": "gpt",
"value": "If `eldoc` is enabled by default and you want to disable it, eve... |
I manage packages in Emacs using Cask and Pallet. Yesterday I upgraded to Emacs 24.4; it went well enough, but all of a sudden all my packages were missing. Cask installs packages in separate directories by Emacs version, so everything was in .cask/24.3.1; there was nothing in .cask/24.4.1, and in fact the directory ... | When upgrading Emacs versions and using Cask to manage packages, it's common to encounter the situation where your packages from the previous version are not immediately available due to them being stored in a version-specific directory. While Cask doesn't automatically migrate packages between versions, you can create... | [
{
"from": "human",
"value": "I manage packages in Emacs using Cask and Pallet. Yesterday I upgraded to Emacs 24.4; it went well enough, but all of a sudden all my packages were missing. Cask installs packages in separate directories by Emacs version, so everything was in .cask/24.3.1; there was nothing in... |
I am trying to make the Evil function evil-jump-to-tag, C-] behave like the Emacs binding M-..
The normal behaviour is fine for browsing Tags files, but I want it to work also for Slime's slime-edit-definition, Elisps' elisp-slime-nav-find-elisp-thing-at-point, Clojures cider-jump-to-var, etc...
These major modes and m... | To achieve the desired functionality in Evil mode where the `C-]` keybinding mimics the behavior of `M-.` in various modes (like Slime, Elisp, CIDER, etc.), you can define a custom command that dynamically invokes the corresponding function bound to `M-.` in the major mode you are currently using.
Here’s a way to imp... | [
{
"from": "human",
"value": "I am trying to make the Evil function evil-jump-to-tag, C-] behave like the Emacs binding M-..\nThe normal behaviour is fine for browsing Tags files, but I want it to work also for Slime's slime-edit-definition, Elisps' elisp-slime-nav-find-elisp-thing-at-point, Clojures cider-j... |
I have the following function, adapted slightly from here:
;; Insert text around a region. In this case, it's
;; the LaTeX code environment from the listings package
(defun wrap-code (start end)
"Insert a \begin{code} and \end{code} around a region."
(interactive "r")
(save-excursion
(goto-char start) (inser... | The issue you're encountering arises because the position of `end` shifts after you insert the `\begin{code}`. When you insert text before the end of a region, the end position moves further along, and when you then insert `\end{code}`, it goes in the wrong place.
To fix this, you can adjust the end position by addin... | [
{
"from": "human",
"value": "I have the following function, adapted slightly from here:\n;; Insert text around a region. In this case, it's\n;; the LaTeX code environment from the listings package \n(defun wrap-code (start end)\n \"Insert a \\begin{code} and \\end{code} around a region.\"\n (interactive \... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 12