EmacsWiki: Backspace Key:
"
(global-set-key (kbd "C-?") 'help-command) (global-set-key (kbd "M-?") 'mark-paragraph) (global-set-key (kbd "C-h") 'delete-backward-char) (global-set-key (kbd "M-h") 'backward-kill-word)"
'via Blog this'
Technology, Hardware, Software, Systems, Raspberry Pi, Raspberian, Linux, Video, GPU, framebuffer, API, Emacs, IP Networking Visual Computing, video tracking, Linux system administration, Shell scripting, Natural Language Programming, audio signal control
(global-set-key (kbd "C-?") 'help-command) (global-set-key (kbd "M-?") 'mark-paragraph) (global-set-key (kbd "C-h") 'delete-backward-char) (global-set-key (kbd "M-h") 'backward-kill-word)"
www.cmake.org are Have had an issue w/ using emacs and screen together under Bash on a CentOS Linux host.
Problem
The problem manifests in two ways:
font-lock-mode does not show in color, or in a limited subset of colors Backspace key sends ^H but Emacs recognizes it as the "Help" invocation, and starts up the Help system These problems have been showing up under screen but not when Emacs is started outside screen in the normal Bash shell.
Changing the TERM value and/or the Backspace in either or both of the terminal emulator software (PuTTY) did not fix the problem.
Setting the value of the TERM environment value in Bash had no apparent effect.
The Fix
Use tset to set the backspace character in the Bash shell before screen is started.
tset -e ^H
This works when TERM=vt102 in the Bash environment, and 'VT100+' is checked for the terminal type in PuTTY. Other term types may vary.
Note that for some reason the font-lock-mode problem went away, too.
Put this in your .emacs file...
(global-set-key "\C-h" 'backward-delete-char)
The Visible bell mini-Howto describes the measures necessary to disable audio processing of the ASCII system bell (0x07 – BEL) character as a console "beep" in various shells and applications, including Bash and Emacs. under Linux.
Caveat: For these ideas to work, you might [depending on your system] need to download and install either or both of these Elisp modules:
php-mode css-mode
Presumption [for the purposes of this tip]: IF you are using Emacs to edit PHP and/or CSS, THEN you know about and are using one or the other or both of these modules. If not, then you should probably give up now or seek professional help immediately.
Task: Editing a PHP source file using Emacs can involve working in several source code language formatting modes, since it is common to mix PHP, CSS, (X)HTML, Javascript, and even MySQL query syntax in one PHP source file.
Rationale: Although mixing languages in a single source file may on the face of it seem to violate the kind of *nixish organizational precepts that give us e.g. header (.h) and source (.c) files in C, sometimes painful experience has shown that the object oriented (OOD) precepts of "Encapsulation", "Isolation of Commonality", "Maintainability", and even (in some cases) "Human Readability" are all served by facilitating the mixing of languages within a single source file.
All that to say this: When editing a block of CSS code within a PHP file (using Emacs, of course), I have found it helpful to use the Emacs 'css-mode' Meta-Q key binding to format CSS rule blocks. However, when entering a multi-line CSS comment in the traditional 'C' style, it is useful to ask Emacs to use 'php-mode' Meta-Q to format the comments.
<?php
$str = "example";
>
<style<
body {
/*
* To format this comment block:
* 1. Move the cursor to this line
* 2. Meta-X php-mode
* 3. Meta-Q
*
*/
margin:0;
padding:0;
}
Summary:
Meta-Q keystroke in Emacs formats the text under the cursor in the current buffer into a 'paragraph' [block] conforming to some arbitrary standard established for whatever mode Emacs is running in (assuming, of course, that Meta-Q is mapped for that mode).php-mode formatting works most readably that way.…In order to not show hidden file names in the Emacs dired directory listings, take the following steps:
Customize group (default emacs):’ prompt type ’dired’ Here is the Lisp code to set this option:
(if
(eq system-type 'vax-vms)
"/PROTECTION/SIZE/DATE/OWNER/WIDTH=(OWNER:10)" "-l")
The Lisp code can be placed in the .emacs file manually, if that method of editing and setting the Emacs environment options is preferred.
Scott Hurring's .emacs has some lines of interest:
;; Turn ON mouse wheel support (mouse-wheel-mode)
This mouse-wheel-mode doesn't seem to be available in GNU Emacs 20.4.1 (sparc-sun-solaris2.5.1) - instead a couple functions are defined in the .emacs:
;; Mousewheel
(defun sd-mousewheel-scroll-up (event)
"Scroll window under mouse up by five lines."
(interactive "e")
(let ((current-window (selected-window)))
(unwind-protect
(progn
(select-window (posn-window (event-start event)))
(scroll-up 5))
(select-window current-window))))
(defun sd-mousewheel-scroll-down (event)
"Scroll window under mouse down by five lines."
(interactive "e")
(let ((current-window (selected-window)))
(unwind-protect
(progn
(select-window (posn-window (event-start event)))
(scroll-down 5))
(select-window current-window))))
(global-set-key (kbd "") 'sd-mousewheel-scroll-up)
(global-set-key (kbd "") 'sd-mousewheel-scroll-down)
Seems like quite a lot of code, but this probably is what's obscured by the mwheel and mouse-wheel-mode modules.
According to the Fedora Emacs docs, the following should work with "the older version 20 of Emacs":
;; Enable wheelmouse support by default (require 'mwheel)
However, this doesn't seem to work with the Solaris version - probably because mwheel appears is not installed.
Other items of interest here include:
;; show line numbers at bottom (setq line-number-mode t) (setq column-number-mode t) (line-number-mode t) (column-number-mode t) ;; no crap in *scratch* on startup (setq inhibit-startup-message t) (setq inhibit-startup-echo-area-message t)