Stefan
  • Member for 7 years, 3 months
  • Last seen more than a week ago
Is there an auto-align package or mode for Emacs?
5 votes

If you'd like to mark a region for auto-alignment, then it's probably not too hard to do with something like: (require 'cl-lib) (defvar my--auto-align-overlays nil) (make-variable-buffer-local 'my--...

View answer
Custom theme only loads changes every second start-up
Accepted answer
4 votes

My crystal ball says: load-theme loads the theme from ~/.emacs.d/elpa/foo-theme-<version> then package-install-file takes your ~/.emacs.d/foo-theme.el and installs it (aka copies it and ...

View answer
How to activate diff-mode from command line?
Accepted answer
4 votes

Command line arguments are processed in-order. So your -f diff-mode will put into diff-mode whichever buffer happens to be current right after Emacs has started (most likely it will be the *scratch* ...

View answer
Create custom "mode-hook" for other programming languages
Accepted answer
4 votes

As far as I know, there's no r-mode in Emacs. Instead, you're probably using ESS's support for R, whose major mode is called ess-r-mode IIRC, so you'd want to use ess-r-mode-hook. But as @phils said:...

View answer
Are `emacs-devel` mailing list archives from prior to the year 2000 available somewhere?
Accepted answer
4 votes

The archives go back to the very beginning of the emacs-devel mailing-list, AFAIK. Before that, development discussions were split between the help-gnu-emacs list and a non-public emacs-core mailing-...

View answer
No comment syntax defined
Accepted answer
4 votes

It means some code somewhere within the execution of org-babel-tangle wants to do something that depends on the syntax of comments (which depends on the language being used) and for some reason Emacs ...

View answer
Regexps: 2 strings without a character in between; 2 chars w/o a string in between - Stack overflow in regexp mapper
Accepted answer
4 votes

You're victim of Emacs's use of a backtracking matcher for the regular expression. You can try and reduce the use of stack in the backtracking with the following: EOOH\([^^LE]*E\)+OOH This will ...

View answer
(interactive "r") can't be used directly after Emacs startup
Accepted answer
4 votes

The use-region-p test should be within the interactive spec. "r" is for functions that always use the region. You probably want to use something like: (defun try-region (&optional begin end) (...

View answer
sh-script alignment issues
Accepted answer
4 votes

For the indentation after the | you should be able to get the right result by going to the incorrect line (i.e. the one that starts with grep) and then do M-x smie-config-set-indent RET before "|" RET ...

View answer
initialization of bibtex package
Accepted answer
4 votes

It's a bug in bibtex.el which only initializes some of its global vars after opening a file. Please M-x report-emacs-bug. While waiting for an actual fix, you can use the following workaround: add a ...

View answer
Unbind all keys from mode
Accepted answer
4 votes

The function yas-minor-mode is not defined in a file named yas-minor-mode.el but in the file named yasnippet.el so you need (eval-after-load "yasnippet" '(define-key yas-minor-mode-map (kbd "C-c") ...

View answer
what are the options to write a language grammar for a new major mode?
4 votes

Besides the SMIE package (which can indeed use a BNF grammar, but will usually not work well with a BNF grammar that was designed for the usual LALR-style parser), there's the wisi package available ...

View answer
Make Emacs short keys work in different language
4 votes

You can add a host of remappings of the form (define-key function-key-map [?\C-ь] [?\C-x]) See also https://stackoverflow.com/questions/10639429

View answer
Scroll vertically while keeping horizontal position
4 votes

I believe you're looking for something like: (setq scroll-preserve-screen-position 'always)

View answer
Symbol's value as variable is void: polymode-mode-map
Accepted answer
4 votes

The error is simple: the polymode package does not define any polymode-mode-map (nor polymode-mode for that matter). Instead it defines polymode-minor-mode and corresponding polymode-minor-mode-map.

View answer
Changing the name of the function key <mouse-1> leads to problems
Accepted answer
4 votes

The issue is the following: (define-key input-decode-map [mouse-1] [jd:m1]) will convert any incoming "event with name mouse-1" into the event jd:m1, whereas you want to convert it to a similar "...

View answer
profile-report doesn't show any report data
4 votes

You need to use M-x profiler-report before you do M-x profilter-stop. The profiling data is not saved in any file, it's kept in memory.

View answer
require vs. package-initialize?
Accepted answer
4 votes

You should be able to use require, yes, but only after running package-initialize (in Emacs≥27, this is done for you before the beginning of the .emacs file). Note that for 99% of the packages ...

View answer
Bind multiple values directly from list without binding the list itself
4 votes

Beside relying on the cl-lib compatibility package, the recommended way in Elisp for that is to use pcase: (defun test-fun (let ((a '(a b)) (b '(c d))) `(,a ,b))) (defun other-test-fun ...

View answer
Allow C-w to kill a region only if it is selected
4 votes

I think you're looking for: (setq mark-even-if-inactive nil)

View answer
How do I keep the cursor from going to the beginning of the line when there's no text on said line?
4 votes

You can try quarter-plane-mode (available from GNU ELPA), but beware. Emacs's underlying engine is basically unable to do what you want; it can only place cursor where there is some text), so the ...

View answer
init.el - setq or defvar
4 votes

I think Basil gave you the best answer, but just for completeness, you can also use let in your example: (let ((my-trash-dir (expand-file-name ".trash" user-emacs-directory)) (if (not (file-...

View answer
Replace certain multibyte characters
4 votes

Most likely your file is actually not using latin-1, yet your Emacs tries to decode it as if it were using latin-1. Try C-x RET r windows-1252 RET to see if it fixes your problem. If it does, you'll ...

View answer
Editing a stored keyboard macro and storing the edited version
Accepted answer
4 votes

This is a bug in Emacs. When saving the macro, Emacs fails to add the kmacro property, so that when you start a new session, Emacs doesn't remember that dhteu-macro-name is actually a keyboard macro. ...

View answer
Is there a way to recognize `-- vim: et:sw=4:ts=8:sts=4:tw=80` in emacs?
Accepted answer
4 votes

I wouldn't be surprised if there's already a package out there that does it, but I couldn't find one. You should be able to cover most of it with something along the lines of the untested code below: ...

View answer
Abbreviation expansion without spaces
Accepted answer
4 votes

I asked the same question recently on emacs-devel and Kenichi Handa told me I could do: (defvar my-TeX-input-method-tweaked nil) (defun my-quail-activate-hook () (when (and (not (member (quail-name)...

View answer
How to determine the initial current directory when emacs is run from command line?
Accepted answer
4 votes

AFAICT, Emacs does not save this info in a standard place. Håkon's solution might work for you, but that completely depends on the program that launches Emacs: some will put the directory in $PWD, ...

View answer
Does package-install do byte-compilation?
Accepted answer
4 votes

package-install does byte-compile the files, yes. Not sure how/why your auctex install doesn't have any .elc files, tho. Maybe a bug, or a pilot error.

View answer
Calling a function with a shorter but unknown argument signature length
4 votes

I generally recommend against doing that (better change the functions to take &optional or &rest arguments that are simply ignored), but if you must, the solution I recommend is: (condition-...

View answer
add a rule to syntax-propertize-rules
Accepted answer
4 votes

The answer is that you can't do it "right". But you can do the following: (defalias 'my/perl-syntax-propertize-function (syntax-propertize-rules ("\\('\\)[bh]" (1 ".")))) (add-hook 'perl-mode-hook ...

View answer
1
3 4
5
6 7
22