djangoliv
  • Member for 6 years, 6 months
  • Last seen this week
  • Toulouse, France
How to change the title from emacs@host to file name
Accepted answer
37 votes

The file name as window name (setq-default frame-title-format '("%f")) The file name and the major mode as window name (my conf) (setq-default frame-title-format '("%f [%m]"))

View answer
How to copy text without losing selection?
Accepted answer
12 votes

The best solution is using C-x C-x to reactivate the mark. But if you want to really keep the selection you can use: (defun copy-keep-highlight (beg end) (interactive "r") (prog1 (kill-ring-save ...

View answer
What are my options for scroll bars in terminal emacs?
8 votes

This project is a good alternative: https://github.com/m2ym/yascroll-el because it works with and without GUI. Don't forget the cl require in your .emacs (require 'cl) ;; build-in librairie (require '...

View answer
Colors for different priorities in Org mode
7 votes

Here a example of customization (setq org-priority-faces '((?A . (:foreground "red" :weight 'bold)) (?B . (:foreground "yellow")) (?C . (:...

View answer
Emacs tea-time is supposed to be integrated in org-mode, but apparently, it's not
Accepted answer
7 votes

You need the org-clock-sound variable: (setq org-clock-sound nil) ;; no sound (setq org-clock-sound t) ;; Standard Emacs beep (setq org-clock-sound "/path/to/my/sound") ;; Play this sound file, fall ...

View answer
Keybinding for buffer word count
Accepted answer
6 votes

simply (global-set-key (kbd "<f9>") 'count-words)

View answer
How can I compare two commit diffs in magit?
6 votes

You can do it from the magit-log buffer M-x magit-log E r ref1..ref2

View answer
Is it possible to change the font size in specific buffers?
5 votes

Yes, you can use a hook: (add-hook 'term-mode-hook (lambda () (text-scale-decrease 1)))

View answer
Incrementally replace a given string
5 votes

You can also use cua-mode. Select the rectangle région (all the nn) and then M-x cua-rectangle-mark-mode. Next, M-n and accept the default values.

View answer
Sorting lines with accented characters
5 votes

I use this function for that (defun my-sort-lines () (interactive) (shell-command-on-region (point-min) (point-max) "LC_COLLATE=en_US.UTF-8 sort" (buffer-name) t )) EDIT: To sort region or ...

View answer
How to see which functions are executed
Accepted answer
5 votes

This project is also a good alternative: https://github.com/michael-heerdegen/interaction-log.el

View answer
Quick access to the previous search terms after calling isearch-forward without switching to the minibuffer
Accepted answer
5 votes

With C-s C-s you search the previous word. Then M-p (and M-n) for history.

View answer
Is there a package for semantic refactoring
Accepted answer
4 votes

Python: https://github.com/python-rope/ropemacs https://github.com/jorgenschaefer/elpy (also base on rope) C++: https://github.com/tuhdo/semantic-refactor https://github.com/thoni56/c-xrefactory

View answer
setq and csv-mode variables
Accepted answer
4 votes

Don't use the csv-hook: (setq csv-separators '(";" "\t")) (setq csv-field-quotes '("\"" "'")) (setq csv-align-padding 2) (setq csv-header-lines 1) (require 'csv-mode) (provide 'init-csv-mode) Works

View answer
Hideshow with python hiding only one part
Accepted answer
4 votes

Here a conf that do what you want: (defun py-outline-level () (let (buffer-invisibility-spec) (save-excursion (skip-chars-forward "\t ") (current-column)))) (...

View answer
how to customize the secondary highlighting in searches
Accepted answer
4 votes

You can change the lazy-highlight face: (custom-set-faces `(lazy-highlight ((t (:foreground "white" :background "SteelBlue"))))) But this face is used in other cases.

View answer
Enable python pdb on emacs with virtualenv
4 votes

You can choose the pdb command like this in your .emacs: (setq gud-pdb-command-name "python -m pdb myscript.py") ;;or let you choose the python script (setq gud-pdb-command-name "python -m pdb ")

View answer
Fold the immediate outer section in org-mode
Accepted answer
3 votes

You can try this function. (surely not perfect) (defun org-fold-outer () (interactive) (org-beginning-of-line) (if (string-match "^*+" (thing-at-point 'line t)) (outline-up-...

View answer
Disable whitespace-mode for single mode
3 votes

You can do like that: (define-global-minor-mode my-global-whitespace-mode whitespace-mode (lambda () (unless (derived-mode-p 'rmail-mode 'term-mode) (whitespace-mode)))) (my-global-...

View answer
Syntax highlighting in source blocks in org-mode
3 votes

You can use AWK block with an input file like this: #+BEGIN_SRC awk :in-file file.txt :exports results {print $4} #+END_SRC Don't forget to add awk to org-babel-do-load-languages (org-babel-do-...

View answer
Force web-mode.el Engine
3 votes

Your configuration works for me. You can force the engine like this: (add-hook 'web-mode-hook (lambda () (web-mode-set-engine "django"))

View answer
Display diff output side-by-side
Accepted answer
3 votes

You can try with the diffview package: https://github.com/emacsmirror/diffview configuration (require 'diffview) execution M-x diffview-current

View answer
How to install po-mode?
3 votes

You can get the file here: https://github.com/andialbrecht/emacs-config/blob/master/vendor/po-mode.el Then put the file in your load-path (like ~/.emacs.d/) and add (require 'po-mode) in your .emacs....

View answer
Python remote debugging?
3 votes

You can try qdb https://github.com/quantopian/qdb An emacs interface (qbd.el) is included: https://github.com/quantopian/qdb/tree/master/client/emacs

View answer
How to change the color, or remove, the vertical line next to the scroll bar?
Accepted answer
2 votes

I think, it is the fringe. Try: (custom-set-faces `(fringe ((t (:background "blue")))))

View answer
Shift+Ctrl+arrow to enlarge and shrink windows does not work in org-mode
Accepted answer
2 votes

You can override the org-mode-map like this: (define-key org-mode-map (kbd "S-C-<left>") 'shrink-window-horizontally) (define-key org-mode-map (kbd "S-C-<right>") '...

View answer
Change colours for character differences for diff-mode
Accepted answer
2 votes

With diff-refine faces: (defun update-diff-refine-colors () "update the colors for diff faces" (set-face-attribute 'diff-refine-added nil :foreground "white&...

View answer
How to replace multiple newlines for single one in whole file?
2 votes

You can do it with this function: (defun remove-extra-blank-lines () "replace multiple blank lines with a single one" (interactive) (setq orig (point)) (goto-char (point-min))...

View answer
how to turn off all the formatting and all?
2 votes

You can open your file with M-x find-file-literally. Moreover you can use the vlf package https://github.com/m00natic/vlfi

View answer
How to autoscroll a window to always show the end of a growing buffer?
2 votes

Here the solution a use for my compilation log buffer (let ((buf (get-buffer "*Compile-Log*"))) (set-window-point (get-buffer-window buf) (buffer-size buf)))

View answer