Stefan
  • Member for 7 years, 3 months
  • Last seen more than a week ago
Strange encodings in ORG mode with German umlaute
Accepted answer
5 votes

Your problem is not one of encoding but one of decoding. Try C-x RET r utf-8 RET, which should re-decode your file as utf-8 rather than that which was used by default. I recommend you add a -*- ...

View answer
Toggle string and regex replacement
Accepted answer
5 votes

Like Harald, I'm not sure what kind of answer you expect. But FWIW, I think the best way to perform such operations is with: C-s <string1> M-% <string2> RET in which case the answer is ...

View answer
OA and OB inserted by emacs
Accepted answer
5 votes

In text terminals, many keys (like up) work by sending a sequence of bytes, such as ESC O A. Emacs normally recognizes these sequences and turns them into a more meaningful up event, using input-...

View answer
How to change the current working directory?
Accepted answer
5 votes

I think the only way Emacs offers to control the cwd of the process is the --chdir command line argument. Once the process is started, there is currently no way to modify it.

View answer
Is there more than mode line (and header line)?
Accepted answer
5 votes

In general, the fact that every window has only one mode-line is probably difficult to change (would require changes in the C code). Similarly, adding something below the echo-area is going to ...

View answer
Insert a string from eval-expression without the quotes
Accepted answer
5 votes

Rather than ask M-: to insert the output of the Elisp code, just write the Elisp code that inserts the text you want: Try M-: (insert (format-time-string "%m/%d/%Y")) RET

View answer
What is the problem with this yank function in elisp in emacs?
Accepted answer
5 votes

Why mark-end-of-sentence? I'd do it like this: (defun vim-line-yank-func() (interactive) (save-excursion (beginning-of-visual-line) (copy-region-as-kill (point) (...

View answer
Call emacsclient from a program called by Emacs
5 votes

The solution is to run texdoc within an asynchronous process. The best way to do that is probably to use start-file-process instead of shell-command-to-string (which is a handy function for quick&...

View answer
Is there a way to add a new VC mode for a different tool?
Accepted answer
5 votes

Yes, VC is structured so as to be easy to add new backends. The main code is in vc.el, and then each backend has a vc-<backend>.el file. Check all the vc-<backend>.el provided with Emacs ...

View answer
apply partially last arg
5 votes

apply-partially was most useful back when Emacs did not have lexical binding, since it let you build "closures". But for your example, you don't even need a closure: (defalias 'fix-a-c-in-foo (...

View answer
Symbol’s value as variable is void: last-command-char when trying to insert bracket
5 votes

last-command-char was a variable made obsolete in Emacs-19.34 when it was replaced by last-command-event (because in older Emacsen, events were only characters). It was finally removed in Emacs-24. ...

View answer
Highlight current line without changing colours
5 votes

This is the case by default for me: hl-line-mode by default uses a face which only specifies a background color. That face is hl-line which by default just inherits from highlight. So maybe the ...

View answer
How to make *Messages* use visual-line-mode?
Accepted answer
5 votes

None of those hooks will apply because the buffer (and its mode) has already been created long before your add-hook happens. I suggest you add (with-current-buffer "*Messages*" (visual-line-mode)) ...

View answer
Can you intercept a function and return your own value using advice?
Accepted answer
5 votes

Of course you can. You can do it with: (advice-add 'read-from-minibuffer :around #'return-my-name) (defun return-my-name (orig-fun &rest args) (let ((orig-val (apply orig-fun args))) <...

View answer
--debug-init changes emacs behaviour
Accepted answer
5 votes

Visit your ~/.emacs.d/init.el file and do M-x check-parens RET. It should show you the unclosed open paren in that file. As for --debug-init, I guess you could M-x report-emacs-bug indicating that ...

View answer
Clone content in another part of document?
Accepted answer
5 votes

Yes: there's for example text-clone-create which can be used for that (typically used for small chunks of text such as the tag names in XML's tag pairs), as well as the lentic package.

View answer
Prevent abbrev expansion on capitalization
Accepted answer
5 votes

Yes: just put a non-nil value for the :case-fixed property. (define-abbrev my-foo-abbrev-table "r" "EmacsRocks" nil :case-fixed t) See C-h v define-abbrev RET for more details.

View answer
How to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?
Accepted answer
5 votes

Try: (condition-case err (potentially-too-recursive-function) (error (message "error=%S, data=%S" (car err) (cdr err)))) This will not only catch the error but will additionally emit a message ...

View answer
how to use custom-set-variables safely?
Accepted answer
5 votes

When NOW is non-nil, what happens is that EXP is evaluated (and used to set the corresponding variable) only when the variable's defcustom is evaluated. The REQUEST part will always be used right ...

View answer
Why is this function not working properly, when added to a hook?
5 votes

In your problematic case, when you're visiting foobar.el, Emacs does the following in this order: fetch foobar.el into a new buffer. initialize the major mode (including running the hooks). display ...

View answer
Concatenate multiple 'help-echo strings
Accepted answer
5 votes

The help-echo property can be a function that returns the actual string to display, so you could add an additional overlay with higher priority with a special help-echo property which will compute the ...

View answer
Local host's FQDN in Emacs 25?
5 votes

Emacs used to try and set system-name to an FQDN. This has caused a fair bit of bug-reports and frustration over the years, since it caused Emacs to sometimes hang for somewhere between 30s and 2min ...

View answer
Map a function across a property list?
5 votes

To me the answer is to turn the plist into an alist, which is an equivalent data-structure, just half as deep and easier to manipulate.

View answer
rectangle-insert in Emacs 24.4
Accepted answer
5 votes

C-x r t should still work in 24.4 just as in 24.3. You can get the same functionality from C-x SPC by hitting C-t after you've selected the rectangle of interest.

View answer
How to use backspace to erase last character in search string?
Accepted answer
5 votes

You'll want to change (global-set-key (kbd "<backspace>") 'delete-backward-char) either to (global-set-key (kbd "DEL") 'delete-backward-char) or to nothing at all. The definition you use ...

View answer
Why must I set and reset `buffer-multibyte` to correctly view multibyte buffers?
Accepted answer
5 votes

IIUC the problem is that the string you insert is undecoded, i.e. it's a string of bytes you received over the network. So you need to find out what character encoding is used/assumed by the sender (...

View answer
A faster method to obtain `line-number-at-pos` in large buffers
5 votes

nlinum.el uses the following: (defvar nlinum--line-number-cache nil) (make-variable-buffer-local 'nlinum--line-number-cache) ;; We could try and avoid flushing the cache at every change, e.g. with: ;...

View answer
How should comint-derived modes keep track of buffers and processes?
Accepted answer
5 votes

For the reasons you provided, I generally prefer to hold on to the buffer. Then I write a foo-proc function which returns the corresponding process, potentially re-starting it if needed. And I even ...

View answer
Some warnings and unexpected indentation with SMIE
Accepted answer
5 votes

Regarding 2, the problem is simple: your major-mode function needs to set comment-start. This part has nothing to do with SMIE. Regarding 3, I'm not sure exactly what it is you're doing (where is ...

View answer
Why does my *vc-log* buffer start with "Summary:" in Emacs 24.4?
5 votes

Since around Emacs-24, the vc-log buffer supports/expects an RFC822-style format, with some headers handled specially (e.g. Author:, Fixes:, and Summary:). In Emacs-24.4, the default message content ...

View answer
1 2 3
4
5
22