Barry's Emacs

User's Guide
Extensions Reference
MLisp Programmer's Guide
MLisp Reference

Functions:
! A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
Variables:
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z

! (complement)
!= (notequal)
% (modulus)
& (and)
* (multiply)
+ (plus)
- (minus)
/ (divide)
< (less than)
<< (shift left)
<= (less or equal)
= (equal)
> (greater)
>= (greater or equal)
>> (rightshift)
^ (or)
^X-prefix (command prefix)
| (logical or)

append-region-to-buffer
append-to-file
apply-auto-execute
apply-colour-to-region
apropos
apropos-command
apropos-variable
arg-is-qualifier
arg
argc
argument-prefix
argv
array
auto-execute
autoload

backward-balanced-paren-line
backward-character
backward-paragraph
backward-paren
backward-word
backward-sentence
baud-rate
beginning-of-file
beginning-of-line
beginning-of-window
bind-to-key
bobp
bolp
bounds-of-array
breakpoint
buffer-size

c-mode
c=
case-capitalize
case-invert
case-lower
case-upper
case-region-capitalize
case-region-invert
case-region-lower
case-region-upper
case-string-capitalize
case-string-invert
case-string-lower
case-string-upper
case-word-capitalize
case-word-invert
case-word-lower
case-word-upper
change-directory
char-to-string
checkpoint
checkpoint-buffers
column-to-left-of-window
compile-it
concat
convert-key-string
copy-region-to-buffer
correct-word
current-buffer-name
current-column
current-directory
current-file-name
current-indent
current-line-number
current-process-name
current-syntax-entity
current-time

dabbrev
debug
debug-emacs
declare-buffer-specific
declare-global
decompile-current-line
decompile-mlisp-function
default-emacs-init
default-global-keymap
define-buffer-macro
define-global-abbrev
define-hooked-global-abbrev
define-hooked-local-abbrev
define-keyboard-macro
define-keymap
define-local-abbrev
define-string-macro
defun
delete-buffer
delete-next-character
delete-next-word
delete-other-windows
delete-previous-character
delete-previous-word
delete-region-to-buffer
delete-to-killbuffer
delete-white-space
delete-window
describe-bindings
describe-command
describe-key
describe-variable
describe-word-in-buffer
digit
dot
dot-is-visible
down-window
dump-abbreviation-tables
dump-memory-statistics
dump-stack-trace
dump-syntax-table

edit-macro
emacs-version
end-of-file
end-of-line
end-of-window
enlarge-window
eobp
eolp
erase-buffer
erase-region
ere-looking-at
ere-quote
ere-query-replace-string
ere-replace-search-text
ere-replace-string
ere-search-forward
ere-search-reverse
error-and-exit
error-message
error-message-parser
error-occurred
exchange-dot-and-mark
execute-extended-command
execute-keyboard-macro
execute-mlisp-buffer
execute-mlisp-file
execute-mlisp-line
execute-monitor-command
exit-emacs
expand-and-exit
expand-file-name
expand-file-name-recursive
expand-mlisp-variable
expand-from-string-table
expand-mlisp-word
extend-database-search-list
external-function

fetch-array
fetch-database-entry
file-exists
file-format-string
file-is-a-directory
file-name-expand-and-default
filter-region
following-char
force-exit-process
forward-balanced-paren-line
forward-character
forward-paragraph
forward-paren
forward-sentence
forward-word
fundamental-mode

get-tty-buffer
get-tty-character
get-tty-command
get-tty-directory
get-tty-file
get-tty-string
get-tty-variable
getenv
global-binding-of
goto-character
goto-window-at-x-y

help-and-exit

if
illegal-operation
incremental-search
indent-C-procedure
insert-character
insert-file
insert-string
interactive
interrupt-key
is-bound
is-function

journal-recover
justify-paragraph

kill-buffer
kill-process
kill-to-end-of-line

lambda
last-key-struck
left-marker
left-window
length
line-to-top-of-window
lisp-mode
list-abbreviation-tables
list-auto-executes
list-breakpoints
list-buffers
list-databases
list-images
list-processes
list-syntax-tables
load
local-bind-to-key
local-binding-of
looking-at

mark
match-wild
message
meta-digit
meta-minus
Minibuf-local-map
Minibuf-local-NS-map
minus
modify-syntax-entry
modify-syntax-table
move-to-comment-column

nargs
narrow-region
narrow-window
newline
newline-and-backup
newline-and-indent
next-error
next-line
next-page
next-window
normal-mode
novalue

page-next-window
parse-error-messages-in-region
pause-emacs
pause-process
PC-home-key
pop-to-buffer
preceding-char
prefix-argument
prefix-argument-loop
prepend-region-to-buffer
previous-buffer-name
previous-command
previous-error
previous-line
previous-page
previous-window
print
print-default
process-id
process-key
process-output
process-status
progn
provide-prefix-argument
push-back-character
putenv
put-database-entry

query-replace-string
quietly-read-abbrev-file
quit-process
quote
quote-character

re-quote
re-query-replace-string
re-replace-search-text
re-replace-string
re-search-forward
re-search-reverse
read-abbrev-file
read-file
recursion-depth
recursive-edit
redraw-display
region-around-match
region-to-string
remove-all-local-bindings
remove-binding
remove-database
remove-local-binding
rename-macro
replace-search-text
replace-string
reset-buffer-name-from-filename
resume-process
return-prefix-argument
return-to-monitor
reverse-incremental-search
right-marker
right-window

save-environment
save-excursion
save-restriction
save-window-excursion
schedule-procedure
scroll-one-column-left
scroll-one-column-right
scroll-one-line-down
scroll-one-line-up
search-forward
search-reverse
self-insert
send-eof-to-process
send-string-to-process
send-string-to-terminal
set
set-current-process
set-default
set-mark
set-process-input-procedure
set-process-name
set-process-output-buffer
set-process-output-procedure
set-process-termination-procedure
setq
setq-array
setq-default
shell
show-buffer
shrink-window
sit-for
spell-check-word
split-current-window
split-current-window-vertically
sprintf
start-DCL-process
start-process
start-remembering
stop-remembering
string-extract
string-index-of-first
string-index-of-last
string-index-of-string
string-to-char
substr
switch-to-buffer
synchronise-files
sys$fao
sys$filescan
sys$getdvi
sys$getjpi
sys$getmsg
sys$getsyi
sys$setprn
sys$sndjbc
system-name

temp-use-buffer
test-abbrev-expand
text-mode
to-col
top-level
trace
transpose-characters
type-of-expression

UI-add-menu
UI-add-to-recent-file-list
UI-edit-copy
UI-edit-paste
UI-file-open
UI-file-save-as
UI-find
UI-find-and-replace
UI-frame-maximize
UI-frame-minimize
UI-frame-restore
UI-frame-to-foreground
UI-list-menus
UI-remove-menu
UI-switch-buffer
UI-window-cascade
UI-window-maximize
UI-window-minimize
UI-window-new
UI-window-next
UI-window-restore
UI-window-tile-horizontal
UI-window-tile-vertical
UI-windows-execute-program
UI-windows-shell-execute
UI-windows-help
UI-view-tool-bar
UI-view-scroll-bars
UI-view-status-bar
undo
undo-boundary
undo-more
unlink-file
unset-mark
up-window
use-abbrev-table
use-global-map
use-local-map
use-old-buffer
use-syntax-table
use-variables-of-buffer
users-full-name
users-login-name

view-buffer
view-file
visit-file

wait-for-process-input-request
what-cursor-position
while
widen-region
widen-window
window-dimensions
write-abbrev-file
write-current-file
write-file-exit
write-modified-files
write-named-file

yank-buffer
yank-from-killbuffer

abbrev-expansion
abbrev-mode
activity-indicator
animated-journal-recovery
ask-about-buffer-names
ask-about-synchronise-for-none-modified-buffers
auto-fill-hook
auto-execute-hook
automatic-horizontal-scrolling

backup-file-mode
backup-filename-format
black-on-white
breakpoint-hook
buffer-is-modified
buffer-names
buffer-saved-as-hook
buffer-backup-filename-hook
buffer-backup-filename-hook
buffer-choose-name-hook
buffer-file-loaded-hook

CPU-type
case-fold-search
checkpoint-frequency
checkpoint-hook
cli-name
comment-column
compile-it-command
confirm-expansion-choice
control-string-convert-F-keys
control-string-convert-mouse
control-string-convert-to-8-bit
control-string-convert-to-CSI
control-string-final-characters
control-string-intermediate-characters
control-string-parameters
control-string-parameter-characters
control-string-parameter-separators
control-string-processing
ctlchar-with-^
current-breakpoint
current-buffer-abbrev-table
current-buffer-allocation-size
current-buffer-checkpointable
current-buffer-file-name
current-buffer-journalled
current-buffer-macro-name
current-buffer-name
current-buffer-RMS-record-attribute
current-buffer-end-of-line-style
current-buffer-syntax-table
current-buffer-type
current-function
current-local-keymap
current-windows

DCL-buffer-reduction
debug-it-command
default-auto-fill-hook
default-buffer-RMS-record-attribute
default-buffer-end-of-line-style
default-case-fold-search
default-comment-column
default-display-C1-as-graphics
default-display-end-of-file
default-display-non-printing-characters
default-highlight-region
default-left-margin
default-mode-line-format
default-read-only-buffer
default-replace-mode
default-right-margin
default-syntax-array
default-syntax-colouring
default-tab-size
display-C1-as-graphics
display-end-of-file
display-non-printing-characters
default-wrap-long-lines

elapse-time
enter-emacs-hook
error-file-name
error-hook
error-line-number
error-message
error-messages-buffer
error-message-parser
error-start-position
execute-monitor-command
exit-emacs-hook
expansion-only-completes-unique-choices

false
fetch-help-database-flags
filter-region-command
force-redisplay

global-mode-string

help-on-command-completion-error
highlight-region
highlight-region-graphic-rendition
horizontal-scroll-step

indent-use-tab
input-mode
is-comment
is-dull
is-problem
is-quote
is-string
is-word

journal-frequency
journal-scratch-buffers

keyboard-emulates-lk201-keypad
keyboard-input-available
keystroke-history-buffer

last-expression
last-keys-struck
leave-emacs-hook
left-margin
logical-tab-size

maximum-DCL-buffer-size
maximum-file-read-size
mode-line-format
mode-line-graphic-rendition
mode-string
mouse-enable

not-accessible

omit-file-version-expansion
override-RMS-record-attribute
override-end-of-line-style
operating-system-name
operating-system-version

pop-up-windows
prefix-argument
prefix-argument-provided
prefix-string
previous-directory
process-key-hook

quick-redisplay
query-replace-use-region-for-search

read-only
read-only-buffer
read-write
remove-help-window
replace-case
replace-mode
restored-environment
return-to-emacs-hook
right-margin

scroll-step
search-string
silently-kill-processes
split-height-threshold
stack-maximum-depth
stack-trace-on-error
swap-ctrl-x-char
syntax-array
syntax-colouring
syntax-word-rendition
syntax-string-rendition
syntax-comment-rendition
syntax-keyword1-rendition
syntax-keyword2-rendition
syntax-keyword3-rendition

tab-indents-region
tab-size
terminal-advanced-video-option
terminal-ansi-crt
terminal-application-keypad
terminal-cursor-type
terminal-DEC-CRT-level-1
terminal-DEC-CRT-level-2
terminal-DEC-CRT-level-3
terminal-DEC-CRT-level-4
terminal-does-not-need-null-padding
terminal-edit
terminal-eightbit
terminal-is-terminal
terminal-length
terminal-output-buffer-size
terminal-regis
terminal-soft-chars
terminal-width
this-command
trace-hook
trace-into
trace-mode
track-eol-on-^N-^P
true

UI-filter-file-list
UI-open-file-name
UI-open-file-readonly
UI-save-as-file-name
UI-search-string
UI-replace-string
user-colour-1
user-colour-2
user-colour-3
user-colour-4
user-colour-5
user-colour-6
user-colour-7
user-colour-8
user-interface-hook
unlink-checkpoint-files

visible-bell

window-first-column
window-graphic-rendition
window-size
window-width
wrap-long-lines

xon-mode

(! expression)

An arithmetic operator function that returns the complement of expression. This function cannot be used interactively.

(!= expression-1 expression-2)

An arithmetic operator function that returns 1 if expression-1 is not equal to expression-2. This function cannot be used interactively.

(% expression-1 expression-2 ...)

An arithmetic operator function that returns the modulus of the first argument by the rest of its arguments. This function cannot be used interactively.

(& expression-1 expression-2 ...)

An arithmetic operator function that returns the result of logical-ANDing all its arguments together. This function cannot be used interactively.

(* expression-1 expression-2 ...)

An arithmetic operator function that returns the result of multiplying all its arguments together. This function is cannot be used interactively.

(+ expression-1 expression-2 ...)

An arithmetic operator function that returns the sum of all its arguments. This function cannot be used interactively.

(- expression-1 expression-2 ...)

An arithmetic operator function that returns the first argument minus the sum of the rest of the arguments. This function cannot be used interactively.

(/ expression-1 expression-2 ...)

An arithmetic operator function that returns the result of dividing its first argument by rest of the arguments. This function cannot be used interactively.

(< expression-1 expression-2)

An arithmetic operator function that returns 1 if expression-1 is less than expression-2. This function cannot be used interactively.

(<< expression-1 expression-2 ...)

An arithmetic operator function that returns the result of shifting left its first argument by the number of places which is the sum of the rest of the arguments. This function cannot be used interactively.

(<= expression-1 expression-2)

An arithmetic operator function that returns 1 if expression-1 is less than or equal to expression-2. This function cannot be used interactively.

(= expression-1 expression-2)

An arithmetic operator function that returns 1 if expression-1 is the same as expression-2. This function cannot be used interactively.

(> expression-1 expression-2)

An arithmetic operator function that returns true if expression-1 is greater than expression-2. This function cannot be used interactively.

(>= expression-1 expression-2)

An arithmetic operator function that returns true if expression-1 is greater than or equal to expression-2. This function cannot be used interactively.

(>> expression-1 expression-2 ...)

An arithmetic operator function that returns the result of right-shifting its first argument by the number of places which is the sum of the rest of the arguments. This function cannot be used interactively.

(^ expression-1 expression-2)

An arithmetic operator function that returns all its arguments exclusive or'ed together. This function cannot be used interactively.

(^X-prefix) ^X

^X-prefix is the ^X command prefix keymap.

(| expression-1 expression-2)

Returns the result of logical OR'ing all its arguments together.

(append-region-to-buffer buffer-name)

Appends the region between dot and mark to the buffer buffer-name. Neither the original text in the destination buffer nor the text in the region between dot and mark are disturbed.

Default binding: none

See also:

(append-to-file file-name)

Appends the contents of the current buffer to the file named file-name. If the file does not exist, it is created.

Default binding: none

(apply-auto-execute filename)

Scans the list of file name patterns set up by auto-execute and executes an associated command if the supplied file name matches one of the patterns.

Default binding: none

See also:

(apply-colour-to-region start end colour)

Use the command apply-colour-to-region to define the region in a buffer to which Emacs is to add colour.

Where the region covers the characters between start and end and will take on the colour colour. The valid range for colour is 1 to 8, which selects colours User 1 to User 8. To clear the colouring from a range, use colour 0.

Default binding: none.

Example:

(defun
    (test-0
  (switch-to-buffer "Test rendition regions")
  (apply-colour-to-region 0 999 0)
    )
)
(defun
    (test-1
  (test-0)
  (switch-to-buffer "Test rendition regions")
  (erase-buffer)
  (insert-string " Red Green Blue ")
  
  (apply-colour-to-region 2 5 1)
  (apply-colour-to-region 6 11 2)
  (apply-colour-to-region 12 16 3)
    )
)

(apropos keyword) ESC-?

Prints a list of all the commands and variable whose names contains the word keyword. For example, if you forget which commands and variables deal with windows, you can type ESC-? window ENTER.

Default binding: ESC-?

See also:

(apropos-command keyword)

Prints a list of all the commands whose extended command name contains the word keyword. For example, if you forget which commands deal with windows, you can type ESC-? window ENTER.

(apropos-variable keyword) ^X-?

Prints a list of all the variables whose extended command name contains the word keyword. For example, if you forget which variables deal with windows, you can type ^X-? window ESC.

Default binding: ^X-?

See also:

(arg expression-1 prompt-string)

Evaluates the expression-1th argument of the invoking function or prompts for it if called interactively. The prompt is optional; if it is omitted, the function cannot be called interactively.

Some examples:

(arg 1 "Enter a number: ") 

evaluates to the value of the first argument of the current function, if the current function was called from MLisp. If it was called interactively then the argument is prompted for.

Given:

(defun (foo (+ (arg 1 "Number to increment? ") 1)))

then (foo 10) returns 11, but typing ESC-x foo causes Emacs to ask Number to increment?

Language purists will no doubt cringe at this rather primitive parameter mechanism, but what-the-hell... it's amazingly powerful.

Default binding: none

(arg-is-qualifier expression-1)

When Emacs is invoked it parses the command line into qualifiers and values according to the host operating system conventions. Use arg-is-qualifier to find out if the expression-1th argument if a qualifier.

The MLisp Programmers Guide has furthur information about Command Lines.

If Emacs was invoked on Windows as:

bemacs fred.dat /invert

Then (arg-is-qualifier 1) returns false.

And (arg-is-qualifier 2) returns true.

Default binding: none

See also:

(argc)

Returns the number of arguments that were passed to Emacs when it was invoked from DCL. If argc is called early enough, Emacs' default startup action of visiting the files named on the command line is suppressed.

The MLisp Programmers Guide has furthur information about Command Lines.

Default binding: none

See also:

(argument-prefix)

When followed by a string of digits, cause that string of digits to be interpreted as a numeric prefix argument which is generally a repetition count for the following command.

For example, ^U10^N moves down 10 lines (the 10'th next).

For each ^U typed before a command, the current prefix argument is multiplied by 4. So ^U is 4, ^U-^U is 16 and ^U-^U-^U is 64.

Never call argument-prefix from an MLisp function.

Default binding: ^U

(argv expression-1)

Returns the expression-1th argument that was passed to Emacs when it was invoked from DCL. If Emacs was invoked as Emacs blatto then (argv 1) would return the string blatto. If argv is called early enough, Emacs' default startup action of visiting the files named on the command line is suppressed.

The MLisp Programmers Guide has furthur information about Command Lines.

Default binding: none

See also:

(array low-bound high-bound ...)

Creates an array of up to 10 dimensions. The arguments to the command are pairs of array bounds (first the lower bound, then the upper bound). All elements of the array are initialised to integer value 0.

Example: Create a two dimension array

(setq 2d-array (array -5 5 3 7))

This creates an array where the first index ranges from -5 to +5 and the second index ranges from +3 to +7. The array has a total of 55 elements in it.

Default binding: none

(auto-execute command-name file-pattern)

Sets up a filename-to-command association. When a file is read in, using visit-file or read-file, whose name matches the given pattern, the specified command will be executed. The command is generally one which sets the mode for the buffer.

Filename patterns can be either of the following:

  • *string matches any filename whose suffix is "string"
  • string* matches any filename prefixed by "string".

Example: To enable Lisp Mode for all files with a .ML file type:

(auto-execute  "lisp-mode" "*.ml")

See also:

(autoload command-string file-name)

Specifies that the code that defines the specified command should be automatically loaded from the named file. When an attempt to execute the command is encountered, the file is loaded and then the specified function is executed. You can use autoload to load functions into Emacs only when they are necessary rather than saving them as part of an environment; this saves space in Emacs and speeds Emacs startup.

Use autoload when you have some mlisp code that you do not want to have code loaded until it is needed.

Example:

If you have a function named box-it in a file named boxit.ml, then the following command will define the box-it command, but won't load its definition from boxit.ml. The loading will happen when you try to execute the box-it command.

(autoload  "box-it" "boxit.ml")

(backward-balanced-paren-line expression)

Moves dot backwards until either the beginning of the buffer is reached, or an unmatched open parenthesis is encountered, or the beginning of a line is encountered at parenthesis level zero, that is, a line without an unmatched ")" existing between that position and the starting position of dot).

The definition of a parenthesis is derived from the syntax table for the current buffer.

expression is the number of parentheses to skip before applying the match.

Default binding: none

See also:

(backward-character repeat-count) ^B

Moves dot backwards repeat-count characters. If repeat-count is omitted, 1 is assumed. End-of-line and tab each count as one character. You cannot move back further than the beginning of the buffer.

You can also use prefix-argument to specify how far to move back.

Examples: two ways to move backwards 22 characters

(backward-character 22)

(provide-prefix-argument 22 (backward-character))

See also:

(backward-paragraph)

Loaded from the paragraph.ml package.

Moves to the beginning of the current or previous paragraph. Blank lines, Scribe and DSR/RNO command lines which separate paragraphs are not considered parts of paragraphs.

Paragraphs are defined by the variable paragraph-delimiters.

Default binding: ESC-)

See also:

(backward-paren expression)

Moves dot backward until an unmatched open parenthesis or the beginning of the buffer is found. This can be used to quickly skip over Lisp S-expressions.

The definition of a parenthesis is derived from the syntax table for the current buffer.

expression is the number of parentheses to skip before applying the match.

See also:

(backward-word repeat-count) ESC-f

Moves dot backward to the start of the prefix-argument times repeat-count word. If repeat-count is omitted, 1 is assumed. If dot is not currently in the middle of a word, the command skips all intervening punctuation. It then skips over the words, leaving dot positioned after the last character of the word.

A word is defined by the current syntax table.

See also:

(backward-sentence)

Loaded from the sentence.ml package

Moves dot to the beginning of the current sentence, or if dot is not in a sentence, moves dot to the beginning of the previous sentence.

A sentence is defined by the regular expression search string contained in the variable sentence-delimiters.

Default binding: ESC-a

See also:

(baud-rate)

A function that returns what Emacs thinks is the baud rate of the communication line to the terminal. The baud rate is (usually) 10 times the number of characters transmitted per second.

baud-rate does not return anything reasonable under GUI interfaces.

Default binding: none

(beginning-of-file)

Moves dot to just before the first character of the current buffer.

Default binding: ESC-<

See also:

(beginning-of-line)

Moves dot to the beginning of the line in the current buffer that contains dot; that is, to just after the preceding end-of-line or the beginning of the buffer.

Default binding: ^A

See also:

(beginning-of-window)

Moves dot to just in front of the first character of the first line displayed in the current window.

Default binding: ESC-,

See also:

(bind-to-key "command-name" "key-sequence")

Bind the extended command command-name to a given key sequence. All future hits on the key sequence will cause the extended command to be called.

For example, if you want ESC-= to behave the way ESC-X print does, then typing ESC-x bind-to-key print ESC-= will do it. The binding will be in effect in all buffer except those with an identical local binding. If a key sequence specifies a keymap that does not exist, then the keymap is automatically generated.

The <keys> parameter can use the symbolic key names that Emacs supports:

See the User Guide for details of the symbolic keynames

Default binding: none

See also:

(bobp)

An MLisp function which returns 1 if dot is at the beginning of the buffer.

Default binding: none

See also:

(bolp)

An MLisp function which is 1 if dot is at the beginning of a line.

Default binding: none

See also:

(bounds-of-array)

This command return an output-array describing the bounds of the input-array that is its argument. The output-array is a two dimensional array. Its first index ranges from 1 to 2 and the second from 0 to the number of dimension of the input-array.

Element 1,0 in the output-array is the number of dimension of the input-array. Element 2,0 is the total size of the array.

Elements 1,1 to 1,n are the lower bounds of the input-array, where n is the number of dimensions. Elements 2,1 to 2,n are the high bounds of the input-array.

Example:

The following MLisp code inserts into the current buffer an analysis of the input-array.

(setq output-array (bounds-of-array input-array))
(setq dims (fetch-array output-array 1 0))
(setq i 1)
(insert-string (concat "Array has " dims " dimensions\n"))
(insert-string "low\thigh\n")
(while (> i dims)
    (insert-string
        (concat
            (fetch-array output-array 1 i) "\t"
            (fetch-array output-array 2 i) "\n"
        )
    )
)

Default binding: none

See also:

(breakpoint "function-name" value)

Sets the breakpoint flag on the specified function. If the flag is set non-zero for a particular function, and the variable breakpoint-hook contains the name of a function, just before the function is executed, the breakpoint function will be invoked.

Default binding: none

See also:

(buffer-size)

An MLisp function that returns the number of characters in the current buffer.

Default binding: none

(c-mode)

Invokes C Mode, a major mode which provides help when writing programs in the C programming language.

Set the major mode to C to provide some basic help for writing programs in the C language. For example, ESC-j is bound to the extended command indent-C-procedure which indents the procedure in which dot is located, ESC-` starts a C comment and ESC-' ends a C comment.

Default binding: none

See also:

(c= char-1 char-2)

Returns 1 if char-1 is equal to char-2 taking into account the character translations indicated by variable case-fold-search. If case-fold-search is set, uppercase letters are c=to their lowercase equivalents.

Default binding: none

See also:

(case-region-capitalize)

Capitalizes all the words in the region between dot and mark by making their first characters uppercase and the remaining characters lowercase.

Default binding: none

See also:

(case-region-invert)

Inverts the case of all alphabetic characters in the region between dot and mark. Lowercase characters become uppercase characters, and uppercase characters become lowercase.

Default binding: none

See also:

(case-region-lower)

Changes all alphabetic characters in the region between dot and mark to lowercase.

Default binding: none

See also:

(case-region-upper)

Changes all alphabetic characters in the region between dot and mark to uppercase.

Default binding: none

See also:

(case-string-capitalize string)

Capitalizes each word of string by making the first character of each word uppercase and the remaining characters lowercase. Returns the capitalized string as the result of the function.

Default binding: none

See also:

(case-string-invert string)

Inverts the case of all alphabetic characters in string and returns the inverted string as the result of the function.

Default binding: none

See also:

(case-string-lower string)

Changes the case of all alphabetic characters in string to lowercase and returns the changed string as the result of the function.

Default binding: none

See also:

(case-string-upper string)

Changes the case of all alphabetic characters in string to uppercase and returns the changed string as the result of the function.

Default binding: none

See also:

(case-word-capitalize)

Capitalizes the next prefix-argument words (starting with the word above or to the left of dot) by making their first character uppercase and remaining characters lowercase.

Default binding: none

See also:

(case-word-invert)

Inverts the case of all alphabetic characters in the next prefix-argument words starting with the word above or to the left of dot.

Default binding: ESC-^

See also:

(case-word-lower)

Changes all alphabetic characters in the next prefix-argument words to lowercase, starting with the word above or to the left of dot.

Default binding: ESC-l

See also:

(case-word-upper)

Changes all alphabetic characters in the next prefix-argument words to uppercase, starting with the word above or to the left of dot.

Default binding: ESC-u

See also:

(case-upper)

This function upper cases selected text.

If there is a region all the text in the region is set to upper-case. Otherwise the current word is set to upper-case.

Default binding: ESC-u

See also:

(case-lower)

This function lower cases selected text.

If there is a region all the text in the resion is set to lower-case. Otherwise the current word is set to lower-case.

Default binding: ESC-l

See also:

(case-capitalize)

This function capitalizes the case of the selected text.

If there is a region all the words in the region are capitalized. Otherwise the current word is capitalized.

Default binding: ESC-u

See also:

(case-invert)

This function inverts the case of the selected text.

If there is a region the case of all the text in the region is inverted. Otherwise the case of the current word is inverted.

Default binding: ESC-i

See also:

(change-directory directory-string)

Changes the current directory for Emacs to directory-string. All future calls to commands which access named files will be interpreted relative to the new directory.

If the directory-string is the special value "-" the directory is set to the value in the variable previous-directory.

Default binding: none

See also:

(char-to-string expression)

Takes a numeric argument expression and returns the one-character string that results from considering the number as a member of the ASCII character set.

Default binding: none

See also:

(checkpoint)

Calls the checkpoint function whose name is contained in the variable checkpoint-hook. The checkpoint function should checkpoint Emacs in some way (the default checkpoint function is checkpoint-buffers). This command is executed automatically every checkpoint-frequency key strokes.

Default binding: none

See also:

(checkpoint-buffers)

Writes out all modified buffers to their associated checkpoint files. This function is called as the default checkpoint function.

Default binding: none

See also:

(column-to-left-of-window)

Repositions the current window over the current buffer so that the current column is positioned at the left-hand edge of the window.

Default binding: ESC-@

See also:

(compile-it DCL-command)

Writes out all the modified file buffers and executes a DCL command to compile and link the written files. If no prefix-argument is specified, then the command executed is MMS. Otherwise, the command to executed is requested as a string argument. Output from the command appears in the buffer Error log ready to be parsed for error messages with the next-error command.

Default binding: ^X-^E

See also:

(concat string-expression...)

Takes a set of string arguments and returns their concatenation.

Default binding: None

(convert-key-string string-expression)

Takes a string and processes it according to Emacs' control string processing rules. The result of the function is a string that contains converted control sequences. See the control-string-... variables for details of the processing that is performed.

Default binding: None

See also:

(copy-region-to-buffer buffer-name)

Copies the region between dot and mark to the named buffer. The buffer is erased before the text is copied into it. The region between dot and mark is not disturbed.

Default binding: None

See also:

(correct-word string)

Uses the supplied incorrectly-spelt word and generates a list of possible spelling corrections for it, returning this list as a space-separated string.

Default binding: None

See also:

(current-buffer-name)

An MLisp function that returns the current buffer name as a string.

See also:

(current-column)

Returns the column number of the character immediately following dot.

Default binding: None

See also:

(current-directory)

Returns a string which is the default directory as set by the change-directory command, or set as the default directory when Emacs starts up.

(current-file-name)

Returns the file name associated with the current buffer as a string. If there is no associated file name, the null string is returned.

Default binding: None

See also:

(current-indent)

Returns the amount of white space at the beginning of the line in which dot is located (the column number of the first non-white-space character).

Default binding: None

See also:

(current-line-number)

Returns the current line number, which is the line that dot is in. The first line in the file is line 1.

Default binding: None

See also:

(current-process-name)

Returns the name of the current process. The current process is the last process accessed by any of the process commands or the process which caused the current procedure to be run. If there is no current process, the null string is returned.

Default binding: None

See also:

(current-syntax-entity)

Returns an indication of the type of syntax entity in which dot is currently located, according to the current syntax table. The value returned is the value of one of the is-... named constants.

Default binding: None

See also:

(current-time)

Returns the current time of day as a string in the following format:

Sun Jan 04 15:26:35 1998

Default binding: None

See also:

(dabbrev) ^W

Dynamic abbreviation facility. See extension dabbrev

(debug) ESC-^D

Enters the MLisp debugger. When in the debugger type h to get help on the debugger's key bindings.

(debug-emacs)

The function is used by the Emacs developers for debugging.

(declare-buffer-specific variable-name...)

Declares and allocates storage for each named variable that is not already declared. Buffer-specific bindings outlive all extended command calls. Each buffer will have its own copy of a buffer-specific variable.

See also:

(declare-global variable-name ...)

Globally declares and allocates storage for each named variable that is not already declared. Global bindings outlive all extended command calls.

See also:

(decompile-current-line)

Returns the currently executing line decompiled into an MLisp expression. If called interactively, it returns a null string. If called non-interactively, it returns the decompiled MLisp for the line about to be traced.

See also:

(decompile-mlisp-function function-name)

Decompiles the MLisp function whose name is supplied, and puts the output into the current buffer at dot.

(default-emacs-init user-interface-style-list)

Add this function to your emacsinit.ml to setup the default emacs key bindings, mouse behaviour, variable settings and autoloads.

The User Guide assumes the Emacs configuration setup by default-emacs-init in its discussion.

The user-interface-style-list parameter allows default-emacs-init to setup the user interface in a particular style.

At the moment user-interface-style supports styles:

  • "windows" - windows compatible style
  • "windows-extended" - more windows compatibility
  • "ere-searching" - use extended regular expression searching

The "windows" style will configure Barry's Emacs to operate in a style like other Microsoft Windows Applications.

Further windows like configuration is done when "windows-extended" is added.

In detail (default-emacs-init "windows") does the following:

  • Turns off checkpointing
  • Turns on journaling
  • Sets case-fold-search on
  • Sets replace-case on
  • Sets silently-kill-processes on
  • Sets activity-indicator on
  • Sets display-end-of-file on
  • Sets ctlchar-with-^ on
  • Sets automatic-horizontal-scrolling on
  • Sets horizontal-scroll-step to 8
  • Sets highlight-region on
  • Sets syntax-colouring on
  • Turns off track-eol-on-^N-^P
  • Sets expansion-only-completes-unique-choices on
  • Sets input-mode on
  • Sets keyboard-emulates-vt100-keypad off
  • Loads the pc-keyboard package
  • Loads the pc-mouse package
  • Loads the minibuf-recall package
  • Adds key bindings for the tab handling on Tab and Esc-Tab
  • Adds key bindings for case conversion on Esc-C, Esc-l, Esc-u and Esc-i
  • Adds key binding for goto line on Esc-g
  • Adds key binding for the minibuf function on Esc-Esc
  • Auto executes lisp-mode for *.ml, *.key and *.mlp
  • Auto executes electric-c-mode for *.c, *.cc, *.cpp, *.cxx, *.h, *.hh, *.hpp and *.hxx files
  • Auto executes Python-mode for *.py and *.pyc files
  • Auto executes Java-mode for *.java files
  • Auto executes JavaScript-mode for *.js files
  • Auto executes install-shield-mode for *.rul files
  • Auto executes latex-node for *.tex files
  • Auto executes vbscript-mode for *.vbs files
  • Auto executes electric-pascal-mode for *.pas files
  • Auto executes HTML-mode for *.htm and *.html files
  • Auto executes ntcmd-mode for *.bat and *.cmd files
  • Auto executes sh-mode for *.sh, *.ksh, *.bash, .bashrc, .bash_profile and .profile

In addition (default-emacs-init "windows,windows-extended") adds the following:

  • Adds key bindings for incremental search. Search forward Ctrl-F and search reverse Ctrl-R.
  • Adds key bindings to open, Ctrl-O and save, Ctrl-S files.
  • Adds key binding for dabbrev, Ctrl-W
  • Adds key bindings to change buffers, Ctrl-B and list buffers, Ctrl-L Ctrl-B
  • Adds key bindings to list databases, Ctrl-L Ctrl-D
  • Adds key bindings to list processes, Ctrl-L Ctrl-P
  • Adds key bindings to redraw the screen, Ctrl-L Ctrl-L

Add "ere-searching" style sets up all search and replace keybinding to use the extended regular expression functions:

  • ere-search-forward, ESC-s
  • ere-search-reverse, ESC-r
  • ere-query-replace-string, ESC-q

Example:

Windows compatible initialisation:

;
; emacsinit.ml
; load the default emacs settings
;
(default-emacs-init "windows,windows-extended")
;
; now for my customisations
;

Windows compatible initialisation withe extended regular expression saerching:

;
; emacsinit.ml
; load the default emacs settings
;
(default-emacs-init "windows,windows-extended,ere-searching")
;
; now for my customisations
;

(default-global-keymap)

Returns the global keymap in which Emacs starts. The bindings are those wired into Emacs, as well as any bindings created by the user with bind-to-key.

See also:

(define-buffer-macro)

Takes the contents of the current buffer and defines it as a macro whose name is associated with the buffer. This is how you redefine a macro that has been edited using edit-macro.

See also:

(define-global-abbrev "abbreviation" "expansion")

Defines or redefines an abbreviation with the given name for the given phrase in the global abbreviation table. When you type the abbreviation and then enter a word-completion character, Emacs changes the abbreviation into the expanded form. This is similar to the AutoCorrect feature in Microsoft Word.

Example: Make Emacs convert "adn" into "and"

(define-global-abbrev "adn" "and")

See also:

(define-hooked-global-abbrev "abbrev" "phrase" "procedure")

Defines or redefines an abbreviation with the given name for the given phrase in the global abbreviation table and associates a function with the abbreviation.

When the abbreviation is typed the procedure is called. The variable abbrev-expansion holds the expanded phrase and dot will be at the end of the word.

See also:

(define-hooked-local-abbrev "abbrev" "phrase" "procedure")

Defines or redefines an abbreviation with the given name for the given phrase in the local abbreviation table and associates a procedure with the abbreviation.

When the abbreviation is typed the procedure is called. The variable abbrev-expansion holds the expanded phrase and dot will be at the end of the word.

See also:

(define-keyboard-macro macro-name)

Gives a name to the current keyboard macro. A keyboard macro is defined by using the start-remembering and stop-remembering commands. define-keyboard-macro takes the current keyboard macro, makes a copy of it in a safe place, gives it a name, and erases the keyboard macro.

See also:

(define-keymap keymap)

Defines a new, empty, keymap with the given name.

(define-local-abbrev abbrevexpansion)

Defines or redefines an abbreviation with the given name for the given phrase in the local abbreviation table. A local abbreviation table must have already been set up with use-abbrev-table.

See also:

(define-string-macro macro-name body)

Defines a macro given a name and a body as a string entered in the mini-buffer.

See also:

(defun (function-name local... body))

Defines a new MLisp function with the given name and a body composed of the given expressions. The value of the function is the value of the last expression executed.

(defun function-name (arg...) local-variables... body)
(defun function-name (parameter-list) local-variables body)

Defines a new MLisp function with the given name and a body composed of the given expressions. The value of the function is the value of the last expression executed.

An alternative form of defun has a parameter list. The parameters may have default values, see examples for details.

The advantage of the second form is that the arguments are bound to the parameters before the context of the function is setup. With the first form of defun the arguments are evaluated in the context of the function.

An example of the difference should make things clearer. The first form of defun causes an error for the following:

    (defun
        (function-print
            num
            (message "Number is " num)
        )
    )
    (defun
        (call-print
            num
            (setq num 12)
            (function-print num)
        )
    )

    (call-print) => "Number is 0"

And the same problem solved using the second form of defun:

    (defun
        function-print (num)
        (message "Number is " num)
    )
    (defun
        (call-print
            num
            (setq num 12)
            (function-print num)
        )
    )

    (call-print) => "Number is 12"

(delete-buffer buffer-name)

Removes a buffer from the list of buffers, and discards any text the buffer contains. The function takes one argument, which is the name of the buffer to be deleted.

If you use the delete-buffer command interactive and the target buffer is modified, delete-buffer will ask you if you really want to delete the specified buffer. There is no prompt if delete-buffer is executed from an MLisp program.

Examples:

(delete-buffer "fred")
(delete-buffer (current-buffer-name))

See also:

(delete-next-character repeat-count) ^D

Deletes the next repeat-count characters immediately following dot. If repeat-count is omitted, 1 is assumed. A line break counts as one character.

Examples:

(delete-next-character)       ;delete one character
(delete-next-character 8)     ;delete next 8 characters

;delete next 8 characters
(provide-prefix-argument 8    
    (delete-next-character))

;delete white space
(while (looking-at "[ \t]")   ;while next character is space or tab
    (delete-next-character)
)


(delete-next-word repeat-count) ESC-d

Deletes the next repeat-count words starting with the word that dot is currently in. It does not delete backwards to the start of the word. If repeat-count is omitted, 1 is assumed. If dot is not in a word, all punctuation up to the beginning of the next word is deleted as well as the word itself.

Examples:

(delete-next-word) ;delete 1 word (delete-next-word 2) ;delete 2 words ;delete 4 words (provide-prefix-argument 4 (delete-next-word) )

(delete-other-windows) ^X-1

Deletes all windows on the screen except for the window containing dot.

See also:

(delete-previous-character) Backspace

Deletes prefix-argument characters backwards starting immediately preceding dot; that is, starting with the character to the left of the cursor.

See also:

(delete-previous-word repeat-count) ESC-h

Deletes prefix-argument times repeat-count words backwards starting with the word that dot is in. If repeat-count is omitted, 1 is assumed.

If dot is not in a word, the function deletes all the white-space up to the previous word as well.

The function does not delete any characters in front of dot, not even if dot is in a word.

See also:

(delete-region-to-buffer buffer-name)

Deletes all characters between dot and the mark. The deleted text is saved in the specified buffer. The buffer is emptied before the characters are inserted.

See also:

(delete-to-killbuffer) ^W

Deletes all characters between dot and the mark. The deleted text is moved to the buffer Kill buffer, which is emptied first.

See also:

(delete-white-space)

Deletes all white space characters on the current line on both sides dot. The definition of white-space is derived from the current syntax table.

See also:

(delete-window) ^X-d

Removes the current window from the screen and gives its space to the window below (or above if the current window is the bottom window). The new current window and buffer are those that just gained the extra space.

This function does not delete any text. You can still go the buffer by various methods. For example, you can select it from the list of buffers (on the menu, click Buffer and then Switch Buffer.)

See also:

(describe-bindings)

Places in the Help window a list of all the keys and the names of the extended commands that they are bound to. This listing is a good start if you want to create a quick-reference card for your own, customised version of Emacs.

(describe-command command-name)

Describes the specified extended command.

(describe-key keys)

Prints out a line of information describing the function that the sequence keys is bound to.

See also:

  • The where-is package defines the where-is function, which prompts for a function name and then tells you which key performs that function.

(describe-variable variable-name)

Describes the named variable.

(describe-word-in-buffer) ^X-^D

Takes the word nearest dot and looks it up in a database and displays the information found. This database contains one-line descriptions of many of the C standard functions .

If you supply a prefix-argument, describe-word-in-buffer allows you to edit the selected entry.

(digit)

This function is bound to the digit keys after a call to the argument-prefix command and until a non-digit function is executed. This means that the bindings for the digits changes during prefix argument collection, so that the prefix argument is correctly evaluated.

(dot)

Returns the number of characters to the left of dot plus 1.

(dot-is-visible)

Returns 1 if dot is in a window. Note that this is not the same as asking whether dot is visible to the user.

(down-window repeat-count)

Moves the cursor into the window that is below the current window. This is different to the next-window function, which moves the cursor without regard to the physical position of the windows on the screen.

If the repeat-count is given then the command is repeated that number of times.

down-window reports an error if there is not a window below the current window.

See also:

(dump-abbreviation-tables)

Dumps a readable listing of an abbreviation table into the buffer Abbreviation table and makes the buffer visible.

The listing includes the abbreviation, its expansion and the name of any MLisp hook function associated with the abbreviation.

If there is more than one abbreviation table, the function prompts for the table name.

See also:

(dump-memory-statistics)

This function is used by the Emacs developers to determine the memory usage of Emacs.

(dump-stack-trace)

Dumps an MLisp stack trace to the buffer Stack trace. This can be used to debug MLisp functions. The stack trace consists of an indication of what was executing when the trace occurred, and a line for each function that was active.

See also:

(dump-syntax-table)

Dumps a readable listing of a syntax table into a buffer and makes that buffer visible:

  • Each ASCII character in the range 0 to 127 is listed on consecutive lines. For runs of characters that have the same characteristic, the upper and lower bounds are separated by a dash.
  • Dull characters are indicated by no flag.
  • Word characters are indicated with the `w' flag.
  • Quote characters are indicated with a '\'/ flag.
  • Brackets are indicated with a '(' or ')' and the corresponding bracket character written out.
  • Comment characters are indicated with a '{' or '}' flag. The second character is also displayed.

(edit-macro macro-name)

Takes the body of a named macro and places it in a buffer called Macro edit. The name of the macro is associated with the buffer and appears in the mode line at the bottom of the window. The buffer may be edited just like any other buffer. After the macro body has been edited it may be redefined using define-buffer-macro.

See also:

(emacs-version)

Returns a string describing the version of Emacs that you are running. For V7.0 of Emacs, the string looks something like:

X7.0.81 of Emacs Copyright Barry A. Scott (c) Sun Mar 14 09:30:14 1999

The string contains the version number, the date, time and node where Emacs was made, and who made it.

When reporting bugs or suggestions about Emacs, always quote the version number of Emacs to which the comments refer.

(end-of-file) ESC->

Moves dot to just after the last character in the buffer.

See also:

(end-of-line) ^E

Moves dot to the end of the line in the current buffer. Dot is placed after the last character on the line. If dot is already at the end of the line, it does not move.

See also:

(end-of-window) ESC-.

Moves dot to just after the last character visible in the window.

See also:

(enlarge-window) ^X-z

Makes the current window prefix-argument lines taller, and the window below (or the one above if there is no window below) prefix-argument lines shorter. This function cannot be used if there is only one window on the screen.

Example: Make the current window twice as high as it is currently:

(provide-prefix-argument window-size (enlarge-window))

See also:

(eobp)

Returns 1 if dot is at the end of the buffer.

See also:

(eolp)

Returns 1 if dot is at the end of a line.

Example: Delete next character provided that dot is not already at the end of a line.

        (if (! (eolp))
            (delete-next-character)

        )                               ; if

See also:

(erase-buffer)

Deletes all text from the current buffer and sets the buffer as unmodified. No prompt is given asking for confirmation that the buffer should be erased.

Example: Delete the content of the current buffer provided that the buffer has not been modified:

(if (! buffer-is-modified)
    (erase-buffer)
)

See also:

(erase-region)

Deletes all text between dot and mark in the current buffer. It does not ask to make sure if you really want to do it.

See also:

(ere-looking-at regular-expression)

Returns 1 if the given regular expression search string matches the text immediately following dot. This is for use in packages that want to do limited parsing.

If a negative prefix argument is supplied, characters to the left of dot are checked, rather than those to the right.

For example, if dot is at the beginning of a line then:

(ere-looking-at "\\s*else")

is true if the line starts with any number of spaces or tabs, followed by "else".

See ere-search-forward for more information about regular expression searches.

See also:

(ere-quote string)

Quotes all special ere characters in string so that the string can be searched for literally using ere search functions.

(ere-query-replace-string pattern replacement)

Replaces all occurrences of a pattern with a string, starting at dot and ending at the end of the buffer. For each occurrence of the old string, Emacs requests that the user type a character to indicate whether or not to replace the string. Dot will be positioned just after the found string.

(ere-replace-search-text replacement)

This function performs a regular expression replacement of the text matched by the last search operations.

(ere-replace-string pattern replacement)

Replaces all occurrences of a regular expression with a string, starting at dot and ending and the end of the buffer. See the Barry's Emacs User's Guide for information on how to specify regular expressions and replacement text.

(ere-search-forward pattern)

Searches for a pattern match in the current buffer, moving forwards from dot, stopping at the end of the buffer. Dot is left at the end of the matched string if a match is found, or is unmoved if the string is not found.

(ere-search-reverse string)

Searches for a pattern match in the current buffer, moving backwards from dot, stopping at the beginning of the buffer. Dot is left at the beginning of the matched string if a match is found, or is unmoved if not. See the Barry's Emacs User's Guide for information on how to specify regular expressions.

(error-and-exit) ^G (in the Mini-buffer)

This function is used in the Mini-buffer local keymaps to abort the current input operation. If called directly, this function is the same as exit-emacs.

See also:

(error-message string-expression...)

Concatenates the supplied string expressions and sends them to the screen as an error message where they will appear in the Mini-buffer. Emacs returns to keyboard level and sounds the terminal's bell.

(error-message-parser)

Parses error messages for the parse-error-message-in-region and compile-it commands. This function is the default error message parser supplied with Emacs and is capable of locating error messages for VAX C, PL/I and BLISS.

(error-occurred expression...)

Executes the given expressions and ignores their values. If all expressions execute successfully, it returns 0. Otherwise, it returns 1 and all expressions after the one which encountered the error will not be executed.

The text of any error message is available for processing in the string variable error-message.

See also:

(exchange-dot-and-mark) ^X-^X

Sets dot to the current location of the mark and sets the mark at the old position of dot. This is useful for bouncing back and forth between two points in a file, particularly when the two points delimit a region of text that is going to be operated on by a command such as delete-to-killbuffer.

See also:

(execute-extended-command extended-command) ESC-x, Do

Executes the specified extended command.

If called interactively, it prompts for the command to execute. You can type ESC or space to invoke command completion, or a question mark (?) for a list of valid commands.

(execute-keyboard-macro) ^X-e

Invokes the currently-defined keyboard macro. This is a remembered sequence of keystrokes.

See also:

(execute-mlisp-buffer)

Parses and compiles the current buffer as a single MLisp expression and executes it. This function is useful when you are testing new functions.

See also:

(execute-mlisp-file filename)

Reads the named file as a series of MLisp expressions and executes them.

The file name given is interpreted relative to the EMACS_PATH logical name. EMACS_PATH is defined as a logical name search-list. If the file cannot be located using EMACS_PATH, a search is made in the database search-list MLisp-library.

The default file type is .ML

To modify EMACS_PATH, select Edit, Preferences, Directories.

See also:

(execute-mlisp-line MLisp-expression) ESC-ESC

Prompts for a string in the Mini-buffer, parses it as an MLisp expression, and executes it.

If called from a MLisp program, the command to be executed must be supplied as a string. This provides for dynamic compilation during the execution of a program.

See also:

(execute-monitor-command DCL-command) ^X-!

Passes the command to the operating system and places the command output into a buffer called Command execution, making that buffer visible in a window. The command that is run cannot read from its standard input, so execute-monitor-command cannot be used if the command that is run will prompt for information.

See also:

(exit-emacs) ^C or ESC-^C

Exits Emacs if the current recursion depth is zero. It will ask for confirmation if there are any buffers that have been modified but not written out.

If the recursion depth is not zero, exit-emacs exits the current recursive edit level.

See also:

(expand-and-exit) ESC (in the Mini-buffer)

Causes command completion to occur in the Mini-buffer. If called interactively, this function is the same as exit-emacs.

See also:

(expand-file-name file-name)

Returns the fully-expanded file specification of the file name argument.

Wildcards may be specified to obtain a sequence of file names. Call expand-file-name first with the wildcard file specification. Then call expand-file-name specifying a null filename until an error occurs.

Example: a function to prompt for a file specification and then insert, into the current buffer, the names of all the files that match the specification.

(defun
    (insert-filelist
        spec
        (setq spec (expand-file-name (get-tty-string "Insert names matching: ")))
            (while (!= spec "")
                (insert-string (concat spec "\n"))
                (setq spec (expand-file-name ""))
                
            )
        )
    )
)

See also:

(expand-file-name-recursive file-name)

Returns the fully-expanded file specification of the file name argument.

Wildcards may be specified to obtain a sequence of file names. Call expand-file-name-recursive first with the wildcard file specification. Then call expand-file-name-recursive specifying a null filename until an error occurs.

expand-file-name-recursive starts looking for files in the directory specified in file-name. It then looks in all of the subdirectories under the starting directory.

Example: A function prompts for an mlisp function and executes that function on all files that match the given file specification.

(defun function-on-many-files
    (
        ~files (get-tty-file "do function on these files:  ")
        ~function (get-tty-command "function to execute: ")
        ~recursive (get-tty-string "recursive? (y/n) [N] ")
    )
    
    ~target
    (setq ~function (concat "(" ~function ")"))
    
    
    (if (= ~recursive "y") 
        (setq ~target (expand-file-name-recursive ~files))
        (setq ~target (expand-file-name ~files))
    )                           ; if
    
    (while (!= ~target "")
        (save-excursion
            (visit-file ~target)
            (beginning-of-file)
            (sit-for 0)
            (execute-mlisp-line ~function)
            (if buffer-is-modified
                (write-current-file)
            )           ; if
            (delete-buffer current-buffer-name)
            
            (if (= ~recursive "y")
                (setq ~target (expand-file-name-recursive ""))
                (setq ~target (expand-file-name ""))
            )                   ; if
            
        )                       ; save-excursion
    )                           ; while
    
)                               ; defun - function-on-many-files

See also:

(expand-mlisp-variable variable-name)

Inserts the name of the specified variable in a buffer, using variable name completion.

See also:

(expand-mlisp-word command-name)

Prompts for the name of a command and then inserts the name as text into the current buffer. This is very handy when you are editing an MLisp function. It's useful to bind expand-mlisp-word to a key for easy access.

See also:

(expand-from-string-table prompt word-list-string)

Provides access to the Emacs input expansion mechanism. The function has two parameters: the first is a prompt, the second is a string that contains a space-separated list of words from which the user can select. The result of the function is the selected word. expand-from-string-table allows only one of the words in the list to be returned.

Example: A function that prompt for the name of a fruit to insert into the current buffer

(defun
    (fruit-picker
        (insert-string
            (expand-from-string-table
                "choose a fruit: "
                "strawberry apple banana"
            )
        )
    )
)

Example: Prompt for one of the words "exit", "read", "write", "quit".

(expand-from-string-table "Command: " "exit read write quit")

(expand-mlisp-word command-name)

Inserts the name of the specified function in a buffer using variable name completion.

(extend-database-search-list dbname filename access)

Adds the given database file to the database search list dbname. If the database is already in the search list, it is left there. Otherwise, the new database is added at the beginning of the database list.

Databases are help or macro libraries.

Access is a bit mask that specifies the type of access required and it is optional. The allowable values of access are:

  • Bit 0: force read-only access
  • Bit 1: Keep the file open between database accesses
  • Bit 2: Create database if possible

See also:

(external-function function file routine)

Declares function as being provided by routine in the image file. This image is dynamically linked into the Emacs process when the function is called.

(fetch-array array indices...)

Retrieves a value from an array. The arguments to this function are the array and the indices of the array. fetch-array checks that there are exactly the right number of indices and range-checks them.

Example: Retrieve element 3,5 from array 2d-array.

(setq value (fetch-array 2d-array 3 5))

See also:

(fetch-database-entry dbname key)

Reads the entry in the database corresponding to the given key and inserts it into the current buffer.

See also:

(file-exists file-name)

Returns 1 if the specified file exists and is writeable, -1 if the file exists but is only readable, and 0 otherwise.

See also:

(file-format-string format file-name)

file-format-string is used to create formatted string based on parts of filenames.

The format string is made of format specifications and literal characters. literal characters are copied to the output as is. Format specifications are replaced with appropriate text.

The format specification syntax is:

% arg fmt-type

The optional arg is a positive or negative decimal number.

The possible values for fmt-type are shown in the following table. The examples in the table are based on a file specification of:

c:\users\barry\bemacs\emacsinit.ml
Type Description Example Output
% literal % character %% %
fn filename %fn emacsinit
ft filetype %ft .ml
fa filename and filetype %fa emacsinit.ml
pc path character %pc \
pa disk and directory %pa c:\users\barry\bemacs\
ps set path split point %4ps%ph c:\users\barry\bemacs\
ph path head %3ps%ph
%2ps%ph
%1ps%ph
%0ps%ph
%-1ps%ph
%-2ps%ph
c:\users\barry\bemacs\
c:\users\barry\
c:\users\
c:\users\barry\bemacs\
c:\users\barry\
c:\users\
pt path tail %-2ps%pt
%3ps%pt
%2ps%pt
%1ps%pt
%0ps%pt
%-1ps%pt
%-2ps%pt
barry\bemacs\
 
bemacs\
barry\bemacs\
 
bemacs\
barry\bemacs\
pv disk %pv c:
pd directory %pd \users\barry\bemacs\

(file-is-a-directory file-name)

Returns 1 if the specified file-name is a directory and 0 otherwise.

Examples:

(file-is-a-directory "/tmp")

(file-is-a-directory "c:\\temp")

See also:

(file-name-expand-and-default file-name default-file-name)

Returns a string containing a file name. The file name returned is the file-name with any missing part of the file name defaulted from the default-file-name parameter and the current working directory.

(filter-region command)

Takes the region and passes it as input to the given operating system command. The output from the command replaces the region. The contets of the region are saved in Kill buffer.

See also:

(following-char)

Returns the character immediately following dot as an integer. The null character (0) is returned if dot is at the end of the buffer.

See also:

(force-exit-process process-name exit-code)

Forces the image running is the specified subprocess to exit with the specified code. This can be used to stop an image that has run amok. All exit handlers for the image will be run.

If no image is running in the process, the exit request will be queued up and executed next time the target process executes in user mode (the next time an image is run).

See also:

(forward-balanced-paren-line expression-1)

Moves dot forward until either the end of the buffer is reached, or an unmatched closing parenthesis is encountered, or the beginning of a line is encountered at parenthesis level zero, that is, without an unmatched parenthesis existing between the line and the starting position of dot.

The parameter is the number of parentheses to ignore before applying the match.

The definition of parenthesis is derived from the syntax table for the current buffer.

See also:

(forward-character repeat-count) ^F or right-arrow

Moves dot forward prefix-argument times repeat-count characters. If repeat-count is omitted, 1 is assumed. End-of-lines and tabs each count as one character. You cannot move past the end of the buffer.

See also:

(forward-paragraph) ESC-)

Moves dot to the end of the current or following paragraph. Blank lines that separate paragraphs and are not considered parts of paragraphs.

Paragraphs are defined by the variable paragraph-delimiters.

See also:

(forward-paren)

Moves dot forward until an unmatched closing parenthesis, or the end of the buffer is found. This can be used to aid in skipping over Lisp S-expressions.

The argument is the number of parentheses to ignore before applying the match.

The definition of parenthesis is derived from the syntax table for the current buffer.

See also:

(forward-sentence) ESC-e

Moves dot forward to the end of a sentence. A sentence is bounded by the string variable sentence-delimiters.

See also:

(forward-word repeat-count) ESC-f

Moves dot forward to the end of the prefix-argument times repeat-count word. If repeat-count is omitted, 1 is assumed. If dot is not currently in the middle of a word, the command skips all intervening punctuation. It then skips over the words, leaving dot positioned after the last character of the word.

A word is defined by the current syntax table.

See also:

(fundamental-mode)

Turns on a major mode similar to Normal Mode. It provides a natural environment for processing ordinary text, or program sources for which there is no specialised language mode. The main advantage of Fundamental Mode over Normal mode is that it displays parenthesis balancing.

See also:

(get-tty-buffer prompt-string [default-value])

Prompts for a buffer name using command completion and providing help. The function returns the name of the buffer as a string.

The optional default-value parameter provides the default input.

Example To insert a buffer name into the current buffer:

(insert-string (get-tty-buffer "Save buffer: "))

See also:

(get-tty-character)

Reads a single character from the terminal and returns it as an integer. The cursor is not moved to the message area, but is left in the text window; this is useful when writing things like query-replace and incremental search programs in MLisp.

See also:

(get-tty-command command-name [default-value])

Prompts for the name of a declared function (using command completion and providing help) and returns the name of the function as a string.

The optional default-value parameter provides the default input.

Example: The expand-mlisp-word function is simply:

(insert-string (get-tty-command ": expand-mlisp-word "))

See also:

(get-tty-directory prompt [default-value])

Prompts for a directory name using command completion and providing help. The function returns the name of the directory as a string.

The optional default-value parameter provides the default input.

(get-tty-file prompt [default-value])

Prompts for a file name using command completion and providing help. The function returns the name of the file as a string.

The optional default-value parameter provides the default input.

Example: Insert a file name into the buffer:

(insert-string (get-tty-file "Insert file name: "))

See also:

(get-tty-string prompt [default-value])

Reads a string from the terminal using its single string parameter as a prompt. Generally use inside MLisp programs to ask questions.

The optional default-value parameter provides the default input.

See also:

(get-tty-variable prompt [default-value])

Prompts for the name of a declared variable (using command completion and providing help) and returns the name of the variable as a string.

The optional default-value parameter provides the default input.

See also:

(getenv env-name)

Returns the value of the named environment symbol.

See also:

(global-binding-of key-sequence)

Returns the name of the function that the provided key sequence will invoke, using the global keymap.

See also:

(goto-character expression)

Moves dot to the specified character position.

Example:Go to character position 22:

(goto-character 22)

(goto-window-at-x-y X-coordinate Y-coordinate)

This MLisp function is for supporting a mouse-style pointing device. The function takes two arguments, the X and Y co-ordinates of the pointer on the screen.

goto-window-at-x-y performs two operations:

  • It changes the current window to be the one at the X and Y co-ordinates. A window is considered to be the mode line of the window, the vertical dividing line to its right and the content region of the window.
  • If the co-ordinates are in the contents of the window, dot is set to the position nearest the co-ordinates, otherwise dot is left unchanged.

goto-window-at-x-y returns an integer result that tells you which part of a window the co-ordinates are in. The result is one of the following:

  • 0 -- in the content region of the window
  • 1 -- in the mode-line
  • 2 -- in the vertical divider
  • 3 -- in both the mode-line and the vertical divider

(help-and-exit) ? (in the Mini-buffer)

This function is used in the Mini-buffer local keymaps to cause the Help window to pop up and list the options available. If called directly, this function is the same as exit-emacs.

See also:

(if test then-clause else-clause)

Executes and returns the value of then-clause if test is not zero; otherwise it executes else-clause if it is present.

Example: Tab to column 33 if dot is currently at the start of a line:

(if (bolp)
    (to-col 33)
)

You can also have multiple tests, which gives you the equivalent of switch or case statements in other programming languages:

(defun
    (month
        response
        (setq response (get-tty-string "Month number: "))
        (if
            (= response 1)
            (insert-string "January")
            (= response 2)
            (insert-string "February")
            (= response 3)
            (insert-string "March"))
        )                   ; if
    )
)

(illegal-operation) All keys not currently bound

illegal-operation is bound to those keys that do not have a defined interpretation. Executing illegal-operation is an error.

(incremental-search) ^F

Start incremental search in forward search mode. See extension incsearch for details.

(indent-C-procedure) ESC-j

Locates the current C language procedure and passes it as the standard input to the INDENT program. The resulting indented C procedure will replace the initial C procedure. The old text is temporarily stored in Kill buffer.

(insert-character expression)

Inserts its numeric argument into the buffer as a single character prefix-argument times.

Example: Each of the following inserts a zero into the current buffer:

(insert-character 48)

(insert-character '0')

(insert-file file-name) ^X-^I

Inserts the specified file's contents at dot in the current buffer.

See also:

(insert-string expression)

Inserts the string that results from evaluating the given expression. insert-string concatenates multiple string arguments.

Examples:

Insert the current date and time into the current buffer:

(insert-string (current-time))

Insert the current time and buffer name:

(insert-string "Time:   " (current-time) "\nBuffer: " (current-buffer-name) "\n") 

Sample output from this line:

Time:   Tue Sep 28 10:48:41 1999
Buffer: fred

(interactive)

Returns 1 if the invoking MLisp function was called interactively.

(interrupt-key) ^G

When bound to a single key causes any current activity within Emacs to be aborted, and forces Emacs to accept commands from the keyboard when that key is struck.

Binding interrupt-key to a sequence longer than one character does not allow the key sequence to interrupt Emacs. Only single key sequences can be used for interrupting.

(is-bound variable-name...)

Returns 1 if all of its variable name arguments are bound to some storage.

(is-function string)

Checks that its string parameter is a defined function. It returns 1 if it is defined and 0 otherwise.

You can use this function to determine whether a function is defined before attempting to execute it.

(journal-recover journal-filename)

Recovers a file or buffer after a system crash or other disaster.

All the journal files that Emacs write are kept in the directory EMACS_JOURNAL:

There is a journal file for each buffer that has journaling enabled and has not been saved. For buffers with associated files the journal name is based on the name of file. For buffers without associated files the journal has a name that is based on the buffer name.

If no journal filename parameter is supplied, journal-recover prompts for the name of the journal file, which must be in EMACS_JOURNAL:

Emacs checks that the journal file is valid before attempting to apply it.

See also:

(justify-paragraph)

Justifies the text of the current paragraph between the left-margin and right-margin. The right margin will be ragged.

See text-mode for a better text indenter.

See also:

(kill-buffer buffer-name)

kill-buffer has been replaced by delete-buffer. Use delete-buffer in preference to kill-buffer;

kill-buffer removes a buffer from the list of buffers, and discards all the text it contains. It takes one argument which is the name of the buffer to delete.

If you use the kill-buffer interactively and the target buffer is modified, kill-buffer asks for confirmation that you want to delete the specified buffer.

If you delete the current buffer, then dot is moved to one of the other buffers displayed on the screen. If there are no other buffers, then "main" is used (and created if necessary).

See also:

(kill-process process-name)

Kills the specified subprocess. The subprocess is killed by executing a delete process request, so exit handlers for the target process will not be executed.

This does not work on Windows 95 or Windows 98.

See also:

(kill-to-end-of-line repeat-count) ^K

Deletes characters forward from dot to, and including, the next end-of-line (or end of buffer if there is not an end of line). If dot is positioned at the end of a line, just the end-of-line character is deleted.

Text deleted by the ^K command is placed into Kill buffer. A ^K command normally erases the contents of Kill buffer first; subsequent ^Ks in an unbroken sequence append text Kill buffer. The number of lines killed is controlled by prefix-argument times repeat-count. If repeat-count is omitted, 1 is assumed.

(lambda)

Provides a progn block with lamdba binding.

(last-key-struck)

Returns the last command character struck. If you have a function bound to many keys, the function may use last-key-struck to determine which key was used to invoke it.

See also:

(left-marker marker-expression)

Takes a marker as a parameter and returns a new marker. The new marker will be at the same position as the original but with left-hand affinity. This means that text inserted at the position of the marker will not move the marker's position. Right-hand affinity markers move to the right as text is inserted.

Example: Set a left marker:

(setq left-hand-end (left-marker (dot))

See also:

(left-window repeat-count)

Moves the cursor into the window that is to the left of the current window. (Unlike next-window, which moves the cursor without regard to the physical position of the windows on the screen).

If the repeat-count is given then the command is repeated that number of times.

left-window reports an error if there is not a window to the left of the current window.

Example: Move to the window at the extreme left:

(while 1 (left-window)
)                               ; while

See also:

(length string-expression)

Returns the length of its string parameter.

Example:

The length of "time" is 4:
(length "time")

(line-to-top-of-window) ESC-!

Moves the line in which dot resides to the top of the window associated with the current buffer.

(lisp-mode)

Enables Lisp Mode, a major mode for editing programs written in the Lisp language and also MLisp programs for Emacs.

For more information, see the User Guide

(list-abbreviation-tables)

Creates a buffer called Abbreviation table list and inserts a list of the abbreviation tables that have been defined in Emacs.

See also:

(list-auto-executes)

Creates a buffer called Auto Execute list and inserts a list of all the auto-execute patterns and their functions.

(list-breakpoints)

Creates a buffer called Breakpoint list and inserts a list of the functions that have breakpoints set.

See also:

(list-buffers) ^X-^B

Produces a listing of all existing buffers giving their names, the name of the associated file (if there is one), the number of characters in the buffer and an indication of whether or not the buffer has been modified since it was read from or written to the associated file.

(list-databases)

Lists all database search lists and the names of the database files contained in them.

(list-images)

Lists the names of all images referenced by the external-function command. The listing shows the image name, the value of the context and the name of the file that holds the image.

See also:

(list-processes)

Lists the names of all existing subprocesses. The list includes the state in which each process is running, the time at which each process entered that state, and some information about the names of buffers and procedures associated with the process.

Processes that have died appear once in this list before completely disappearing.

See also:

(list-syntax-tables)

Lists all the syntax tables that have been defined.

(load file-name)

Loads the nominated file as a series of MLisp expressions executing each in turn. (This function is exactly the same as execute-mlisp-file).

See also:

(local-bind-to-key function key-sequence)

Binds the specified function to the given key sequence. Unlike bind-to-key, the binding has effect in only the current buffer. If called interactively, the function prompts for the name of the function to bind and also for the key.

See bind-to-key for details of key names.

Examples:

A function to insert the time, followed by a tab character, bound to the key Numlock-t:

(defun
    (time-and-tab
        (insert-string (current-time) "\t")
        )
        
)
(local-bind-to-key "time-and-tab" "\[f1]t")

A single binding to do the same thing:

(local-bind-to-key "(insert-string (current-time) \"\\t\")" "\[f1]t")

See also:

(local-binding-of key-sequence)

Returns the name of the function that the key sequence provided will invoke using the current local keymap.

See also:

(looking-at regular-expression)

Deprecated: Use ere-looking-at for new code.

Returns 1 if the given regular expression search string matches the text immediately following dot. This is for use in packages that want to do limited parsing.

If a negative prefix argument is supplied, characters to the left of dot are checked, rather than those to the right.

For example, if dot is at the beginning of a line then:

(looking-at "[ \t]*else")

is true if the line starts with any number of spaces or tabs, followed by "else".

See re-search-forward for more information about regular expression searches.

See also:

(mark)

Returns the position of the marker in the current buffer. An error is displayed if the marker is not set.

See also:

(match-wild candidate pattern)

match-wild performs MSDOS shell style wildcard matching. The pattern support * and ? as wildcard chars.

match-wild returns 1 if the candidate string matches the pattern.

Example:

(match-wild ~file "*.txt") ; return true if ~file is a .txt file

See also:

(message string...)

Concatenates its string arguments and displays them in the Mini-buffer at the bottom of the screen the next time the screen is updated.

The screen is only updated when an input request needs to pause to obtain characters, or the sit-for function is executed. If you want to display a message then use (sit-for 0) to force a screen update.

See also:

(meta-digit) ESC-0...ESC-9

Provides for quick single-digit prefix arguments. It is bound to all the numeric keys but prefixed with ESC. So to get a prefix of 5, type ESC-5 followed by the command.

See also:

(meta-minus) ESC- -

Converts a meta-collected digit to a negative prefix argument.

See also:

(Minibuf-local-map)

This keymap is used to read commands in the Mini-buffer when spaces are command terminators. For example: reading a command name with expand-mlisp-word.

The following keys are bound in the keymap:

Binding Function
^G error-and-exit
ESC expand-and-exit
? help-and-exit
^C exit-emacs
<CR> exit-emacs
<LF> exit-emacs
^\ ESC-prefix

See also:

(Minibuf-local-NS-map)

This keymap is used to read commands in the mini-buffer when spaces are not command terminators.

The following keys are bound in the keymap:

Binding Function
^G error-and-exit
ESC expand-and-exit
^C exit-emacs
<CR> exit-emacs
<LF> exit-emacs
^\ ESC-prefix
<Space> expand-and-exit
<Tab> expand-and-exit

See also:

(minus) -

This command is bound to the minus key after the argument-prefix command has been executed. It is used to negate the prefix argument.

See also:

(modify-syntax-entry syntax-string)

This function is provided for compatibility with old MLisp code only. Use modify-syntax-table for all new MLisp code.

Modifies a set of entries in the syntax table associated with the current buffer. See the Barry's Emacs Programmer's Guide for more information on how to alter syntax tables.

See also:

(modify-syntax-table type args...)

Modifies a set of entries in the syntax table associated with the current buffer. See the Barry's Emacs Programmer's Guide for more information on how to alter syntax tables.

Syntax tables are associated with buffers by using the use-syntax-table command. Syntax tables are used by commands like forward-paren to do a limited form of parsing for language-dependent routines. They define such things as which characters are parts of words, which quote strings, and which delimit comments.

Syntax colouring and regular expression searches depend on the information in the syntax table.

modify-syntax-table can be called in one of the following ways:

ActionCommand
Define the characters in charset as word characters, as used by such commands as forward-word and case-word-capitalize.
(modify-syntax-table
    "word"
    charset)
Define the characters in charset as having no special meaning.
(modify-syntax-table
    "dull"
    charset)
Define a comment that starts with comment-start-string and ends with comment-end-string.
(modify-syntax-table
    "comment"
    comment-start-string
    comment-end-string)
Define a matching pair of parentheses.
(modify-syntax-table
    "paren"
    open-paren
    close-paren)
Define the characters in charset as being a prefix that prevents the following character being interpreted as a string introducer.
(modify-syntax-table
    "prefix"
    charset)
Define the characters in charset as delimiting a string.
(modify-syntax-table
    "string"
    charset)
Define string as an exact case keyword type 1.
(modify-syntax-table
    "keyword-1"
    string)
Define string as an exact case keyword type 2.
(modify-syntax-table
    "keyword-2"
    string)
Define string as an exact case keyword type 3.
(modify-syntax-table
    "keyword-3"
    string)
Define string as a case blind keyword type 1.
(modify-syntax-table
    "keyword-1,case-fold"
    string)
Define string as a case blind keyword type 2.
(modify-syntax-table
    "keyword-2,case-fold"
    string)
Define string as a case blind keyword type 3.
(modify-syntax-table
    "keyword-3,case-fold"
    string)

charset is a string that contains a list of characters. Ranges of characters can be conveniently entered by giving the first and last characters of the range separated by a "-".

See also:

(move-to-comment-column)

Inserts enough spaces and tabs to move the cursor to the comment column.

See also:

(nargs)

Returns the number of arguments passed to the invoking MLisp function.

For example, within the execution of foo invoked by (foo x y) the value returned by nargs would be 2.

See also:

(narrow-region)

Restricts the amount of a buffer that can be manipulated to the region between dot and mark. widen-region will remove the restriction.

File operations ignore this restriction so, for example, you can save a file after performing narrow-region and the whole file is saved, not just the visible portion.

This function is useful for replacing strings over a small parts of a buffer or for running packages that usually affect the whole of a buffer but a required to operate on a portion of it.

See also:

(narrow-window)

Reduces the width of a vertically-split window. A window has to be at least one column wide.

See also:

(newline) ^M (Return)

Inserts a newline character into the buffer.

See also:

(newline-and-backup) ^O

Inserts an end-of-line immediately after dot, effectively opening up the line. If dot is positioned at the beginning of a line, then ^O will create a blank line preceding the current line and will position dot on that new line.

See also:

(newline-and-indent) ^J

Inserts a newline just as Return does, but also inserts enough tabs and spaces so that the newly-created line has the same indentation as the old line.

This is useful when you are typing in a block of program text all at the same indentation level.

See also:

(next-error) ^X-^N

Takes the next error message (as returned from the ESC-x compile-it command), visits the file in which the error occurred and sets dot to the line in which that error occurred. The error message will be displayed at the top of the window associated with the Error log buffer.

See also:

(next-line repeat-count) ^N

Moves dot down prefix-argument times repeat-count lines. If repeat-count is omitted, 1 is assumed. next-line attempts to keep dot at the same horizontal character position as you move from line to line.

See also:

(next-page) page-down

Repositions the current window on the current buffer so that the page prefix-argument pages forward is visible in the window (where a page is a group of lines 4/5th's the size of the window). If possible, dot is kept where it is, otherwise it is moved to the middle of the new page.

See also:

(next-window) ^X-n

Switches to the window (and associated buffer) that is below the current window. If there is no lower window, moves to the window at the top of the screen.

See also:

(normal-mode)

Turns on Normal Mode -- default major mode which Emacs gives to all new buffers that it creates. It provides a general text manipulating environment with no special features.

See also:

(novalue)

Does nothing. novalue is a complete no-op -- it performs no action and returns no value.

Normally, the value of an MLisp function is the value of the last expression evaluated in the body of the function. If you do not want the function to return a value, use novalueas the last expression in the function.

(page-next-window) ESC-^V

Repositions the window below the current window (or the top window if the current window is the lowest one on the screen) on the displayed buffer so that the next page of the buffer is visible in the window (where a page is a group of lines 4/5th's the size of the window).

If page-next-window is given a prefix argument, it will flip the buffer backwards a page, rather than forwards.

(parse-error-messages-in-region)

Parses the region between dot and mark for error messages (as the generated by the compile-it command) and sets up for subsequent invocations of next-error.

(PC-home-key)

This function is provided as part of the pc-keyboard package.

PC-home-key moves the cursor the start of the text on the current line unless it is already there. In which case it moves the cursor to the beginning of the line.

(pop-to-buffer buffer-name)

Switches to a buffer whose name is provided and ties that buffer to a newly-created window.

(preceding-char)

Returns the character immediately preceding dot as an integer. The null character (0) is returned if dot is at the beginning of the buffer.

(prefix-argument) ^U

A command that, when followed by a string of digits, causes that string of digits to be interpreted as a numeric prefix argument which is generally a repetition count for the following command.

For each ^U typed before a command, the current prefix argument is multiplied by 4. So ^U is 4, ^U-^U is 16 and ^U-^U-^U is 64 (and so on).

Note: prefix-argument should never be called from an MLisp function.

(prefix-argument-loop statements)

Executes statements prefix-argument times. Every function invocation is always prefixed by some argument. If no prefix argument has been provided, 1 is assumed.

(prepend-region-to-buffer buffer-name)

Prepends the region to the buffer specified. Neither the original text in the destination buffer nor the text in the region between dot and mark are disturbed.

(previous-buffer-name)

previous-buffer-name will return the buffer that was current before the Minibuf was entered.

(previous-command)

Returns the last command character struck. If you have a function bound to many keys, the function may use previous-command to tell which key was used to invoke it.

(previous-error)

Take the previous error message (as returned from the compile-it command), visit the file in which the error occurred and set dot to the line on which that error occurred. The error message is displayed at the top of the window associated with the Error log buffer.

Default binding: none

See also:

(previous-line repeat-count) ^P

Moves dot to the prefix-argument times repeat-count previous line. If repeat-count is omitted 1, is assumed. previous-line attempts to keep dot at the same horizontal position as you move from line to line.

(previous-page) ESC-v

Repositions the current window on the current buffer so that the prefix-argumentth previous page of the buffer is visible in the window (where a page is a group of lines 4/5th's the size of the window). If possible, dot is kept where it is, otherwise it is moved to the middle of the new page.

(previous-window) ^X-p

Switches to the window (and associated buffer) that is above the current window. If there is no window above the current window, then the bottom window is used.

(print variable-name)

Prints the value of the named variable. Use this command when you want to inquire about the setting of a variable.

(print-default variable-name)

Prints the default value of the named variable. Use this command when you want to inquire about the default setting of a variable.

(process-id process-name)

Unix only.

Return the process id of the named process.

(process-key key-map)

Causes a key sequence to be read using the provided keymap, and then executes the selected function. It returns the value returned by the selected function.

(process-output process-name)

Returns the next line of output from the specified subprocess. This function is typically used in an MLisp procedure specified using the set-process-output-procedure command.

(process-status process-name)

Unix only.

Returns the status of the named process:

  • -1 - not an active process
  • 0 - a stopped process
  • 1 - a running process

(progn local-declarations... expression ...)

Evaluates the expressions and returns the value of the last expression evaluated. progn is roughly equivalent to a compound statement (begin-end block) in more conventional programming languages.

(provide-prefix-argument value expression)

Provides the prefix argument value to the expression.

(push-back-character string)

Takes the character or string provided as its argument and causes it to be used as the next character(s) read from the keyboard.

(put-database-entry dbname key)

Takes the current buffer and stores it in the named database under the given key. The key and data are written into the first database file in the specified database search list.

(putenv symbol value)

Defines the symbol in the environment with the given value. Any process created by emacs will inherit the variable, so the symbols are available to all new processes you create.

(query-replace-string search replace) ESC-q

Replaces all occurrences of one string with another, starting at dot and ending at the end of the buffer. For each occurrence of the old string, Emacs requests that the user type a character indicating whether or not to replace the string. Dot will be positioned just after the found string.

(quietly-read-abbrev-file file-name)

Reads in and defines abbreviations appearing in a named abbreviations file. Unlike read-abbrev-file, an error message is not printed if the file cannot be found.

(quit-process process-name)

Unix only.

Send signal SIGQUIT to the named process.

(quote expression)

Returns its string argument so that any meta-characters used by regular expression string searching are quoted so that they have no effect. This is useful for MLisp packages that use regular expression search commands.

(quote-character) ^Q

Inserts into the buffer the next character typed without interpreting it as a command. This is how you insert non-printing characters.

(re-query-replace-string pattern replacement)

Deprecated: Use ere-query-replace-string for new code.

Replaces all occurrences of a pattern with a string, starting at dot and ending at the end of the buffer. For each occurrence of the old string, Emacs requests that the user type a character to indicate whether or not to replace the string. Dot will be positioned just after the found string.

(re-quote string)

Deprecated: Use ere-quote for new code.

Quotes all special re characters in string so that the string can be searched for literally using re search functions.

(re-replace-search-text replacement)

Deprecated: Use ere-replace-search-text for new code.

This function performs a regular expression replacement of the text matched by the last search operations.

(re-replace-string pattern replacement)

Deprecated: Use ere-replace-string for new code.

Replaces all occurrences of a regular expression with a string, starting at dot and ending and the end of the buffer. See the Barry's Emacs User's Guide for information on how to specify regular expressions and replacement text.

(re-search-forward pattern)

Deprecated: Use ere-search-forward for new code.

Searches for a pattern match in the current buffer, moving forwards from dot, stopping at the end of the buffer. Dot is left at the end of the matched string if a match is found, or is unmoved if the string is not found.

(re-search-reverse string)

Deprecated: Use ere-search-reverse for new code.

Searches for a pattern match in the current buffer, moving backwards from dot, stopping at the beginning of the buffer. Dot is left at the beginning of the matched string if a match is found, or is unmoved if not. See the Barry's Emacs User's Guide for information on how to specify regular expressions.

(read-abbrev-file file-name)

Reads in and defines abbreviations appearing in a named abbreviations file. An error message is printed if the file cannot be found.

(read-file file-name) ^X-^R

Erases the contents of the current buffer, reads the specified file into the buffer and associates the name with the buffer. Dot is set to the beginning of the buffer.

(recursion-depth)

Returns the current number of active calls to recursive-edit.

(recursive-edit)

Invokes the keyboard processor to obtain input from the user until the exit-emacs function is executed. Then, recursive-edit returns to the MLisp code that invoked it.

See the Barry's Emacs User's Guide for a detailed description of recursive editing levels.

(redraw-display) ^L

Clears the screen and redraws it.

(region-around-match)

Sets dot and mark around the region matched by the last search. An argument of n puts dot and mark around the nth subpattern matched by \( and \). An argument of zero matches the entire string.

(region-to-string)

Returns the region between dot and mark as a string.

(remove-all-local-bindings)

Performs a remove-local-binding command for all possible keys, This effectively undoes all local bindings.

(remove-binding key-sequence)

Removes the global binding of the given key sequence. Actually, it just rebinds the key sequence to illegal-operation.

(remove-database dbsl database-file)

Removes a single database file from the specified database search-list. The database search-list will not be deleted when the last file has been removed.

(remove-local-binding key-sequence)

Removes the local binding of the given key sequence. The global binding will subsequently be used when interpreting the key sequence.

(rename-macro function new-function)

Renames the specified function to a new name. You cannot rename a function to a name used by an already existing wired-in function. If the new-function name exists, the existing code is replaced.

(replace-search-text replacement)

This function performs a replacement of the text matched by the last search operations.

(replace-string search replacement) ESC-r

Replaces all occurrences of one string for another, starting at dot and ending at the end of the buffer.

(reset-buffer-name-from-filename)

Resets the current buffers name using the algorithm used when a new file is first visited.

Useful to call after the buffer-saved-as-hook has been changed.

(resume-process process-name)

Resumes a subprocess that has been paused. The image in the process starts working again. If the process is not paused, an error is generated.

(return-prefix-argument expression)

Causes expression to be considered as the prefix argument to the next command executed (even if the command is initiated from the keyboard). This can be useful for writing alternate prefix argument packages.

(return-to-monitor)

Spawns a new DCL process, allowing the user to enter DCL commands. Return to Emacs by using the LOGOUT DCL command.

(reverse-incremental-search)

Start incremental search in reverse search mode. See extension incsearch for details

(right-marker)

Takes a marker as a parameter and returns a new marker. The new marker will at the same position as the original but with right-hand affinity. This means that text inserted at the position of the marker will move the marker's position to the right. Left-hand affinity markers do not move to the right as text is inserted.

(right-window repeat-count)

Moves the cursor into the window that is to the right of the current window, unlike previous-window which moves the cursor without regard to the physical position of the windows on the screen.

If the repeat-count is given, the command is repeated that number of times.

right-window reports an error of there is not a window to the right of the current window.

(save-environment file-name)

Saves the current state of Emacs into an environment file. The default file type is .Emacs_ENVIRONMENT.

(save-excursion local... expression...)

Evaluates the given expressions and returns the value of the last expression evaluated. It is much like progn except that before any expressions are executed, dot and the current buffer are marked (via the marker mechanism) and the search-string is saved.

(save-restriction locals... expression ...)

Saves the current dot, mark, buffer, search-string and buffer restriction; executes the provided expressions; then restores the saved information.

(save-window-excursion local... expression ...)

Saves the current dot, mark, buffer, search-string and window state; executes the expressions; then restores the saved information. save-window-excursion returns the value of the last expression evaluated. If the mark was not set before calling save-window-excursion, it will not be set afterwards.

(schedule-procedure function seconds)

Executes the given function after the specified number of seconds. If the number of seconds is zero, then any outstanding schedule for the specified function is removed. If a schedule is specified for a procedure that already has a schedule, the old schedule is replaced.

(scroll-one-column-left)

Scrolls the current window one column to the left.

(scroll-one-column-right)

Scrolls the current window one column to the right.

(scroll-one-line-down) ESC-z

Repositions the current window on the current buffer so that the line which is currently the second to the last line in the window becomes the last. This effectively moves the buffer down one line in the window.

(scroll-one-line-up) ^Z

Repositions the current window on the current buffer so that the line which is currently the second line in the window becomes the first. This effectively move the buffer up one line in the window.

(search-forward search-string) ^S

Searches for a match in the current buffer, moving forwards from dot and stopping at the end of the buffer. Dot is left at the end of the matched string if a match is found, or is unmoved if a match is not found.

(search-reverse search-string) ^R

Searches for a match in the current buffer, moving backwards from dot and stopping at the beginning of the buffer. Dot is left at the beginning of the matched string if a match is found, or is unmoved if a match is not found.

(self-insert) All inserting keys

This function is bound to those keys which insert themselves into the current buffer. It is roughly the same as (insert-character (last-key-struck) with the exception that it does not work unless it is bound to a key.

(send-eof-to-process process-name)

Unix only

Sends the special end-of-file (eof) message to the specified subprocess. Use the wait-for-process-input-request command to ensure that the process is ready.

(send-string-to-process process-name text)

Sends the specified string to the specified subprocess. Use the wait-for-process-input-request command to ensure that the process is ready.

(send-string-to-terminal text)

Sends the string to the terminal with no conversion or interpretation. This should only be used for such applications as loading function keys when Emacs starts up. If you disrupt the screen, Emacs will not know about it and will not fix it up automatically -- you will have to use redraw-display to do this.

(set variable-name expression)

Sets the value of a variable.

If you require a value of 1, then from the terminal, you can type the string true or on. If you require a value of 0, then from the terminal, you can type the string false or off.

(set-current-process process-name)

Sets the current subprocess to the specified process. The current subprocess name is used in all of the subprocess commands when a blank process name is specified.

(set-default variable-name expression)

Sets the default value of a variable.

If you require a value of 1, then from the terminal, you can type the string true or on. If you require a value of 0, then from the terminal, you can type the string false or off.

(set-mark) ^@ (NUL)

Sets the mark at the current location of dot.

(set-process-input-procedure process-name function)

Sets the input function for the specified subprocess. Whenever the subprocess asks for input, the specified procedure is run. This procedure may then supply the process with input (using send-string-to-process).

(set-process-name old-name new-name)

Changes the name of a subprocess. If the process is the current process, then the current process name is changed to the new name.

(set-process-output-buffer process-name buffer-name)

Connects a buffer to the output of the specified process. All output from the process appears in this buffer. The buffer is not allowed to grow indefinitely: if it becomes larger than maximum-DCL-buffer-size characters, it will be truncated by DCL-buffer-reduction characters before the next output from the process is inserted into the buffer.

(set-process-output-procedure process-name function)

Defines the name of an MLisp function to be called when a subprocess produces output. This function is called instead of the insertion of any output into an output buffer. Use the process-output function to obtain the latest line of output from the process.

(set-process-termination-procedure process-name function)

Defines an MLisp function to be called after a process has terminated. This function should be used to tidy up any resources or MLisp variables that the process may have used.

(setq variable-name expression)

Assigns a new value to a variable.

(setq-array array index... value)

Stores a value in an array.

(setq-default variable-name expression)

Assigns a new default value to a variable.

(shell)

Starts up an interactive DCL session in an Emacs buffer shell-n (where n is a sequence number used to identify multiple shells).

(show-buffer)

Describes the current buffer in a buffer called Show buffer.

(shrink-window) ^X-^Z

Makes the current window prefix-argument lines shorter, and the window below (or the one above if there is no window below) prefix-argument lines taller. The command cannot be used if there is only one window on the screen.

(sit-for expression)

Updates the display and pauses for expression tenths of a second. (sit-for 10) waits for one second. If an argument of zero is used, then no pause is executed, but the display is still updated.

(spell-check-word word)

Checks the spelling of the supplied word. If the word is spelled correctly then 1 is returned, otherwise 0 is returned.

(split-current-window) ^X-2

Splits the current window into two, dividing the space on the screen equally between the two windows.

(split-current-window-vertically) ^X-3

Takes the current window and splits it into two windows side-by-side, dividing the space on the screen equally between the two windows. An arbitrary number of windows can be created -- the only limit is the width of the screen. Each window must be at least one column wide.

(sprintf format-string args...)

sprintf provides a string formating command modelled after the C runtime library function of the same name.

Formating instructions start with a "%" character in the format-string and has the follow form:

%alignment width.precision type

sprintf support the following types:

  • % - insert a single % in the output
  • c - character
  • s - string
  • d - decimal integer
  • o - octal integer
  • x - hexadecimal integer

(start-DCL-process process-name)

Starts a DCL subprocess. Use the other subprocess commands to attach buffers and MLisp procedures to the process. The new process becomes the current process.

This function is a synonym for the start-process function.

(start-process process-name)

Starts a DCL subprocess. Use the other subprocess commands to attach buffers and MLisp procedures to the process. The new process becomes the current process.

(start-remembering) ^X-(

Causes all following keystrokes to be remembered by Emacs as the current keyboard macro. The functions to which the keys are bound will be executed. The stop-remembering function terminates the keyboard macro definition.

(stop-remembering) ^X-)

Stops remembering keystrokes, as initiated by start-remembering. The remembered keystrokes are not forgotten and may be re-executed with the execute-keyboard-macro command.

(string-to-char string)

Returns the integer value of the first character of its string argument.

(string-extract string start end)

Extract a subpart of the string between positions start and end. The first string position is at 0, zero. Use negative position values to index from the end of the string.

If start is negative and end is zero then the end taken to be the end of the sting.

Any position that is outside of the strings length is set to the start, if its before the string, of the end of the string.

(string-index-of-first string find)

Returns the zero based index into string of the first occurrance of the string find. -1 is returned if the string is not found.

(string-index-of-last string find)

Returns the zero based index into string of the last occurrance of the string find. -1 is returned if the string is not found.

(string-index-of-string string find pos)

Returns the zero based index into string of the first occurrance of the string find start at position pos. -1 is returned if the string is not found.

(substr str pos n)

Returns the substring of string str starting at position pos (numbering from 1) and running for n characters. If pos is less than 0, then the length of the string is added to it; the same is done for n.

(switch-to-buffer buffer-name)^X-b

Changes the buffer association of the current window to the selected buffer.

(system-name)

Returns the name of the system on which Emacs is running. This should be the DECnet or ArpaNet (or whatever) host name of the machine.

(synchronise-files)

Use this command to have Emacs update all file buffers with newer copies of the files from the disk. For each file that has a newer version on the disk Emacs prompts asking you if you wish to read in the newer file.

(system-name)

Returns the name of the system on which Emacs is running. This should be the DECnet or ArpaNet (or whatever) host name of the machine.

(temp-use-buffer buffer-name)

Switches to a named buffer without changing window associations.

(test-abbrev-expand abbreviation)

Returns the abbreviation expansion for the specified string. An error is generated if there is no expansion.

(text-mode)

Enables Text Mode, a major mode for writing justified or filled and justified text.

(to-col expression)

Inserts tabs and spaces to move the following character to printing column expression in the current buffer. Tabs are only used if indent-use-tab is 1.

(top-level)

Takes you back to the top level, exiting all recursive edits.

(trace)

The default trace function. It provides MLisp users with extensive debugging and tracing facilities to help with the development of MLisp code.

(transpose-characters) ^T

Takes the two characters preceding dot and exchanges them.

(type-of-expression expression)

Returns a string describing the type of the expression that is its argument. The string will be one of the following:

integer -- expression is an integer
string -- expression is a string
marker -- expression is a marker
windows -- expression is a set of windows
array -- expression is an array

(UI-add-menu menu-id position name [position name] ...)

UI-add-menu adds a single menu item to the existing menus. The menu-id is the two character string to bind the menu item to. When selected the menu will send the string "\(menu)<menu-id>".

The values of <menu-ID> are restricted to a set of known menu-IDs and a range of user values. There can be 100 user defined values. Any ID that is not one of the built in ones can be used. To avoid picking a built-in value use an upper case letter as the first character of the ID. The known menu IDs correspond to menu actions that require some special support from Emacs The following table lists the known IDs:

Name ID Special Action
Edit Copy "ec" Enabled only if mark is set
Edit Cut "ex" Enabled only if mark is set
Edit Clear "er" Enabled only if mark is set
Edit Paste "ev" Enabled when text in clipboard
Search Find "sf" Enabled if the find dialog can be started
Search Replace "sr" Enabled if the replace dialog can be started
File Open "fo" none
File Save "fs" Enabled only if buffer is modified
File Save As "fa" none

There can be up to 9 pairs of the <position> and <name> parameters. Each pair describes one level of menu hierarchy. A menu item named <name> is inserted at position <position>. The first menu position is numbered 0. Use a large <position> value to insert at the end of a menu when you do not know how many items are in the menu.

You cannot insert a first level menu after the "&Help" menu.

The <name> parameter has one special value, "-", which is will cause a menu separating line to be inserted. Otherwise the <name> parameter can be any string. Place an "&" before the character in name string that you wish to be the menu accelerator character.

Example:

This example adds the Project menu with two items, Make and Debug with a separator line between them.

(UI-add-menu "Pm" 999 "&Project" 999 "&Make")
(UI-add-menu "" 999 "&Project" 999 "-")
(UI-add-menu "Pd" 999 "&Project" 999 "De&bug")

See also:

(UI-add-to-recent-file-list filename)

Add the given filename to the recent file list that emacs maintains under the File menu. Recent files are remembered across runs of emacs.

(UI-edit-copy)

Copy the current buffers region to the clipboard.

See also:

(UI-edit-paste)

Insert the contents of the clipboard into the current buffer at dot.

See also:

(UI-file-open)

Pop up the standard file open dialog and allows the users to select a file. The UI-filter-file-list variable is read to setup the file filters. The UI-open-file-name variable is used to initialise the file name and path parts of the dialog box.

On completion UI-file-open returns 1 if the user clicked "OK" and 0 if the user clicked "Cancel". The file selected by the user is returned in the UI-open-file-name variable. The UI-open-file-readonly variable is true if the readonly check box was set on.

Example:

(setq UI-open-file-name "d:\\fred\\joe.txt")
(if (UI-file-open)
    (progn
        (visit-file UI-open-file-name)
        (setq read-only-buffer UI-open-file-readonly)
    )
)

See also:

  • UI-file-save-as
  • UI-filter-file-list variable
  • UI-open-file-name variable
  • UI-open-file-readonly variable

(UI-file-save-as)

Pop up the standard file save as dialog and allows the users to select where to save the file. The UI-filter-file-list variable is read to setup the file filters. The UI-save-as-file-name variable is used to initialise the file name and path parts of the dialog box.

On completion UI-file-open returns 1 if the user clicked "OK" and 0 if the user clicked "Cancel". The file selected by the user is returned in the UI-save-as-file-name variable.

Example:

(setq UI-save-as-file-name current-buffer-file-name)
(if (UI-file-save-as)
    (write-named-file UI-save-as-file-name)
)

See also:

  • UI-open-file variable
  • UI-save-as-file-name variable
  • UI-filter-file-list variable

(UI-find)

Pop up the find string modeless dialog box. The UI-search-string variable is used to initialise the "Find what" field.

Example:

(setq UI-search-string "find me")
(UI-find)

See also:

(UI-find-and-replace)

Pop up the find and replace modeless dialog box. The UI-search-string variable is used to initialise the "Find what" field. And the UI-replace-string variable is used to initialise the "Replace with" field.

Example:

(setq UI-search-string "find me")
(setq UI-replace-string "new string")
(UI-find-and-replace)

(UI-frame-maximize)

Maximize the frame window.

See also:

(UI-frame-minimize)

Minimize the frame window.

See also:

(UI-frame-restore)

Restore the frame window.

See also:

(UI-frame-to-foreground)

Bring Emacs to the foreground allowing mouse and keybaord input to go to Emacs.

(UI-list-menus)

List the menu structure that is currently in effect.

See also:

(UI-remove-menu)

UI-remove-menu removes a single menu item from the existing menus.

There can be up to 9 <name> parameters, one for each level of menu hierarchy. A menu item named <name> will be removed.

The <name> parameter can be any string. Place an "&" before the character in the name string that is a menu accelerator character.

See also:

(UI-switch-buffer)

Displays a list of the current buffers. You can select, from the list, a buffer to switch to, or you can enter the name of a new buffer to switch to.

See also:

(UI-view-scroll-bars)

Call this command to toggle the scroll bars on and off.

See also:

(UI-view-status-bar)

Call this command to toggle the status bar on and off.

See also:

(UI-view-tool-bar)

Call this command to toggle the tool bar on and off.

(UI-window-cascade)

Cascade the document windows.

See also:

(UI-window-new)

Create a new document windows.

(UI-window-next)

Select the next document windows.

(UI-window-maximize)

Maximize the document window.

See also:

(UI-window-minimize)

Minimize the document window.

See also:

(UI-window-restore)

Restore the document window.

See also:

(UI-window-tile-horizontal)

Horizontally tile the document windows.

See also:

(UI-window-tile-vertical)

Vertically tile the document windows.

See also:

(UI-windows-execute-program command show)

This command will start a windows program executing named in command. The program will be stated in the show state named in show. show can be one of the strings "minimized", "maximized" or "normal".

Example:

Start the windows file manager in a maximized window.

(UI-windows-execute-program "winfile" "maximized")

See also:

(UI-windows-shell-execute operation file parameters directory show)

This command will process file named in file according to the operation.

The program to process the file will be started with the parameters, in the named directory using the show state named in show.

The operation is one of "open", "print" or "explore".

show can be one of the strings "minimized", "maximized" or "normal".

Example:

View an HTML file.

(UI-windows-shell-execute "open" "c:\\website\\index.html" "" "." "normal")

See also:

(UI-windows-help help-file cmd data)

The UI-windows-help command is an interface to the Windows Help system. The help-file parameter is the file name of the help file that will be used. What is done with the help file is determined by the cmd and data parameters. The following table details the cmd values and any required data.

cmd Value Description
"context" Display help for context number data.
"contents" Display the help file contents.
"setcontents" Select contents number data.
"contextpopup" Display in a pop-up window help for context number data.
"key" Display help for topic string data.
"partialkey" Display help for topic string data.If data is the string "" then display the search dialog.
"command" Execute the help macro in string data.
"forcefile" Force Windows Help to display the correct help file.
"helponhelp" Open Window Help Help file
"quit" Quit Windows Help

For more information about these cmd and data values see the documentation for Windows function WinHelp and the Windows Help compiler.

Example: Display the help topic for commands from the Windows help file:

(UI-windows-help "windows.hlp" "key" "commands")

See also:

(undo) ^X-^U

Undoes editing changes made to modified buffers. The command starts off a sequence of undo operations which are continued with the use of the undo-more function. Each undo or undo-more undoes one more series of changes to the next undo-boundary. An undo-boundary is planted before each keyboard key stroke.

(undo-boundary)

All operations between a pair of calls to undo-boundary will be undone by undo and undo-more. undo-boundary is called automatically between key sequences.

(undo-more)

Each time undo-more is called, the state of the buffers is restored to the previous undo-boundary. If called from the keyboard processor, it will simply undo the first call to undo.

(unlink-file file-spec)

Deletes the specified file.

(unset-mark) ^X-^@

Un-sets the mark.

(up-window repeat-count)

Moves the cursor into the window that is above the current window, unlike previous-window, which moves the cursor without regard to the physical position of the windows on the screen.

If the repeat-count is given then the command is repeated that number of times.

up-window reports an error of there is not a window above the current window.

(use-abbrev-table abbrev-table-name)

Sets the current local abbreviation table to the specified table.

(use-global-map keymap-name)

Specifies that the named keymap will be used for the global interpretation of all keystrokes. (use-local-map is used to change the local interpretation of keystrokes.)

(use-local-map keymap-name)

Specifies that the named keymap to be used for the local interpretation of all keystrokes. (use-global-map is used to change the global interpretation of key strokes.)

(use-old-buffer buffer-name) ^X-^O

Associates an existing buffer with the current window.

(use-syntax-table syntax-table-name)

Associates the named syntax table with the current buffer.

(use-variables-of-buffer buffer-name expression)

Allows an MLisp procedure to access the buffer-specific variables of any buffer without switching to it.

The function takes two parameters: the first is a buffer name, the second is an MLisp expression to execute.

This function is useful when writing packages that need to maintain context in the buffer-specific variables of one buffer but use many buffers.

The following example inserts the file name of buffer fred into the buffer joe:

(switch-to-buffer "joe")
(use-variables-of-buffer "fred")
(insert-string current-buffer-file-name)

(users-full-name)

Returns the user's full name as a string.

(users-login-name)

Returns the users login name as a string.

(view-buffer buffer-name)

Switches into View Mode and to examine the specified buffer. If the specified buffer name is blank, View Mode examines the current buffer.

(view-file file-name)

Views the specified file. The file is read into an Emacs buffer, which is removed upon exiting from View Mode.

(visit-file file-name) ^X-^V

Visits the specified file. If the file is already read into a buffer, Emacs pops up a new window and displays the buffer. Otherwise, a new buffer is created, the file is read in and is displayed in a new window.

(wait-for-process-input-request process-name)

Suspends keyboard processing until an input request is made by the target process. The function returns 1 if the process wants input, or 0 if the user typed a key at the keyboard.

(what-cursor-position) ^X-=

Writes out a brief summary of the position of dot in the current window. It reports the co-ordinates of dot with respect to the current window, what the character to the right of dot is, what character number dot is at, the percentage of the file above dot, and what portion of the file is displayed in the window.

(while test expression...)

Executes the given expressions while the test is true (not equal to zero).

(widen-region)

Removes a restriction put on a buffer by narrow-region.

(widen-window)

Increases the width of a vertically-split window. widen-window can only succeed if at least one of the other windows is greater than one column wide.

WIN-edit-copy ^C

Copies the selected text to the Windows clipboard.

See also:

WIN-edit-cut

Cuts the selected text and puts it on the Windows clipboard.

The default emacsinit.ml binds this function to ^X for consistency with normal Windows keys. Historically, emacs uses ^X to begin a command sequence, so the default emacsinit.ml swaps ^X and ^\ so that ^X can be used for WIN-edit-cut.

See also:

WIN-edit-paste ^V

Pastes text from the Windows clipboard.

See also:

(window-dimensions)

This command returns a one dimensional array containing the top, left, bottom and right coordinates of the current window.

Index Description
1 Top Y coordinate
2 Left X coordinate
3 Bottom Y coordinate
4 Right X coordinate

The position values are the same as used by goto-window-at-x-y and returned in control-string-parameters for a mouse click.

(write-abbrev-file file-name)

Writes all defined abbreviations to the named file. This file can be read back into Emacs with read-abbrev-file.

(write-current-file file-name) ^X-^S

Writes the contents of the current buffer to the file whose name is associated with the buffer.

(write-file-exit) ^X-^F

Writes all modified buffers to their associated files and if the command succeeds, Emacs exits.

(write-modified-files) ^X-^M

Writes each modified buffer into the file whose name is associated with the buffer. Emacs generates an error message if a modified buffer does not have an associated file.

(write-named-file file-name) ^X-^W

Writes the contents of the current buffer to the named file and changes the association of the buffer to the specified file name.

(yank-buffer buffer-name) ESC-^Y

Inserts the contents of the specified buffer at the position of dot in the current buffer.

(yank-from-killbuffer) ^Y

Inserts the contents of the Kill buffer at the position of dot in the current buffer.

abbrev-expansion

Holds the expansion of the abbreviation when an abbreviation hook function is called. At all other times it contains a null string.

abbrev-mode « 0

Controls whether abbreviations are expanded. If set to true, abbreviations are checked and expanded as required, otherwise, no expansion takes place. This variable is buffer-specific and its state is displayed in the mode line of each window.

activity-indicator « 0

Controls the activity indicator. The activity indicator is a single letter code that is displayed at the bottom left-hand corner of the screen. The various codes are:

  • x -- indicates that Emacs is initialising
  • i -- indicates that Emacs is waiting for input
  • b -- indicates that Emacs is busy working
  • c -- indicates that Emacs is checkpointing
  • c -- indicates that Emacs is journalling

To make room for the activity indicator, the Mini-buffer is moved over two columns to the right.

animated-journal-recovery « 0

When set to true, the journal-recovercommand will update the screen while recovering the contents of a buffer. If animated-journal-recovery is false, the screen is updated after all the journal has been used to recover the buffer.

ask-about-buffer-names « 1

Controls what the visit-file function does if the buffer name it constructs is already in use. If it is non-zero, Emacs will ask for a new buffer name, or for Return to be typed which will overwrite the old buffer. If the variable is zero, a buffer name will be created by appending n to the buffer name, (where n is a unique sequence number).

ask-about-synchronise-for-none-modified-buffers « 0

Normally the synchronise-files commands always asks the user to confirm any change to a buffer.

If ask-about-synchronise-for-none-modified-buffers is 1 then synchronise-files will not ask for permission to delete or reread the contents of buffers that have not been modified.

auto-fill-hook « default-auto-fill-hook

Controls the calling of a function to fill the current line. The variable is set to the name of the function to be called to fill the line, or the null string if no function is to be called.

automatic-horizontal-scrolling « 0

When automatic-horizontal-scrolling is set to 1 emacs will automatic scroll the current window until dot is visible. Otherwise emacs will allow dot to be horizontally outside of the window.

auto-execute-hook « smart-auto-execute

If none of the auto-execute patterns match the file that has just been loaded then the MLisp function set in auto-execute-hook is called.

See also:

backup-file-mode « "copy"

The value of this variable controls the way that Emacs creates backup files.

Value Description
"none" Do not create backup files
"copy" Create backup file by copying
"rename" Create backup file by renaming

Use backup by "copy" on Unix systems to leave the file protection and symbolic links unchanged.

Use backup by "rename" to speed up file saving.

Use backup "none" to prevent backup files being created.

backup-filename-format « "%pa%fn._%1ft"

This variable controls how emacs names backup files. Emacs bases the backup filename on the buffers file name as directed by the format string.

The syntax of the format string is the same as used by the command file-format-string. The equivilent MLisp would be:

    (setq backup-filename
        (file-format-string
            backup-filename-format 
            current-buffer-file-name))

The default format create backup files in the same director as the original file but with a leading "_" prefixed to the file type. For example c:\docs\readme.txt is backed up as c:\docs\readme._txt.

black-on-white « 0

Records the type of screen on which Emacs is running. If non-zero, text is displayed on the screen as black characters on a white background. If zero, text is displayed as white characters on a black background. This information is used by some terminal interfaces to decide how to display a visible bell.

breakpoint-hook «

Contains the name of the breakpoint function. When a breakpoint occurs, the function whose name is in breakpoint-hook is called.

The breakpoint function may decompile the expression that will be executed by using the decompile-current-line function.

buffer-backup-filename-hook « ""

Emacs calls the function in buffer-backup-filename-hook with the filename being backed up. The function is expected to return a string containing the filename to backup the file to.

    (defun
        my-backup-filename-maker(~filename)
        ; backup to the filename with a "~" appended
        (concat ~filename "~")
    )
    (setq buffer-backup-filename-hook "my-backup-filename-maker")

buffer-choose-name-hook « ""

Emacs calls the function in buffer-choose-name-hook with the filename being loaded into a new buffer. The function is expected to return a string containing the name to use for the new buffer.

    (defun
        my-buffer-name-maker(~filename)
        ; use a buffer name of file.typ in directory
        (file-format-string "%fa in %pa" ~filename)
    )
    (setq buffer-choose-name-hook "my-buffer-name-maker")

buffer-file-loaded-hook « ""

Emacs calls the function in buffer-file-loaded-hook with the filename being loaded into a new buffer. The function is expected to return a string containing the name to use for the new buffer.

    (defun
        my-file-loaded-hook(~buf-name)
	; figure out the mode and settings to use for this buffer
	;...
    )
    (setq buffer-file-loaded-hook "my-file-read-hook")

buffer-is-modified « 0

Is positive if the current buffer has been modified since it was last written out to disk. You may set it to 0 if you want Emacs to ignore the modifications that have been made to a buffer. However, this does not restore the unmodified version of the buffer -- it merely tells Emacs not to write out the buffer with other modified files. Emacs sets buffer-is-modified positive any time the buffer is modified.

buffer-names

A 1-dimensional array which contains all the buffer names currently in use in Emacs. Element 0 of the array is a count of the total number of buffers contained in the array.

buffer-saved-as-hook « 0

Emacs calls the function in buffer-saved-as-hook with the filename being loaded into a new buffer. The function is expected to return a string containing the name to use for the new buffer.

    (defun
        my-saved-as-hook(~filename)
        ; change the buffer name to match the filename used in save as
        (setq buffer-name (file-format-string "%fa in %pa" ~filename))
    )
    (setq buffer-saved-as-hook "my-saved-as-hook")

CPU-type « 0

Contains a string decribing the type of CPU emacs is running on.

The value will be one of:

Value Description
i386 Intel x86 processor

case-fold-search « 0

Controls search case-folding. If non-zero, all searches will ignore the case of alphabetic characters when doing comparisons.

checkpoint-frequency « 0

Contains the number of keystrokes between checkpoints. Every checkpoint-frequency keystrokes, all buffers which have been modified since they were last checkpointed and that have checkpointing enabled are written to disk. If the value is zero, checkpointing is disabled.

checkpoint-hook « checkpoint-buffers

Contains the name of an Emacs function which will be called when the checkpoint function is invoked. The checkpoint function should in some way checkpoint Emacs.

cli-name « The name of the CLI that started Emacs

Indicates the name of the CLI that invoked Emacs. The contents of this variable are used to tell subprocesses which CLI to use. You can alter its value to start a subprocess with a different CLI.

comment-column « 33

Contains the column at which program comments are to start. This is used by the language-dependent commenting features through the move-to-comment-column command.

compile-it-command «

Contains the string which will be used by the compile-it command if you type a null string to its prompt for a command to execute. Also, when you type a command, compile-it saves the command you type in the variable for later re-use.

confirm-expansion-choice « 0

This variable changes the way that Emacs input completion logic works.

When confirm-expansion-choice is true emacs will always prompt once more after expanding a unique input choice. It confirm-expansion-choice is false emacs will take the unique choice and use it with out further prompts.

control-string-convert-F-keys « 1

When control-string-convert-F-keys is true, the keys F6 to F20 and E1 to E6 are converted on input to a compact form. This improves Emacs' performance in a number of ways -- less memory used to store keymaps, and keyboard-handling uses less CPU time.

Before conversion the control sequence is:

CSI number ~

This is converted to CSI followed by one key whose value is 32 plus the above number.

See control-string-processing for general information.

control-string-convert-mouse « 1

When control-string-convert-mouse is true, all control sequences of the form:

CSI event;params... &w

are converted into \201 followed by one character which is the event number plus A.

See control-string-processing for general information.

control-string-convert-to-8-bit « [OP:

All control sequences which start with ESC <char> have an 8-bit equivalent control sequence. The string variable control-string-convert-to-8-bit contains all the <char>s that are to converted to their 8-bit form.

See control-string-processing for general information.

control-string-convert-to-CSI « \217\220\232

Contains a list of characters to be coerced into the single code for CSI. This reduces the number of keymaps that Emacs must maintain.

See control-string-processing for general information.

control-string-final-characters «ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}

Contains all the characters that mark the end of a control sequence. See ISO 2020 for full details.

See control-string-processing for general information.

control-string-intermediate-characters « !"\#$&'()*+,-./

Contains all the characters that follow the parameters and precede the final character of a control sequence. See ISO 2020 for full details.

See control-string-processing for general information.

control-string-parameters

This two dimensional array variable contains the parameters and parameter separators of the last control sequence that was parsed by Emacs. All elements of the array are strings.

Row 1 of the array contains the parameter value and Row 2 contains the value of the separator. The first parameter is in column 0 of the array the second in column 1 and so on.

Use bounds-of-array to find out how many parameters are in control-string-parameters.

control-string-parameters is a read-only variable.

See control-string-processing for general information.

control-string-parameter-characters « 123456789:<=>?

Contains all the characters that can be parameter characters. See ISO 2020 for full details.

See control-string-processing for general information.

control-string-parameter-separators « ;

Contains all the characters that can be parameter separator characters. See ISO 2020 for full details.

See control-string-processing for general information.

control-string-processing « 1

The master control for all the control string functions. Only when control-string-processing is true will any processing be performed.

control-string-processing changes the behaviour of a number of parts of Emacs:

  • All keystrokes are compressed and processed according to the control-string variables.
  • bind-to-key and local-bind-to-key will use the control-string variables to compress their <keys>key sequences.
  • describe-bindings, describe-key and apropos-commands will use the built-in keyname table to print the names of keys.

Note: The values of the control-string...variables must only be changed in the file |emacs_control_strings.ml. If you wish to change any of these variables, do the following:

  1. Make a copy of emacs_library:emacs_control_strings.ml in your emacs_path:
  2. Rebuild your Emacs environment.

ctlchar-with-^ « 0

Controls the way that non-printing characters are displayed. If non-zero, control characters are printed with a leading up-arrow, otherwise they are printed as an octal number.

current-breakpoint «

This read-only variable contains the name of the function that caused the breakpoint function to run. This variable is not altered from MLisp in a trace or breakpoint function.

current-buffer-abbrev-table

Contains the name of te current buffer's abbreviation table. If you attempt to assign a value to it, the current buffer's abbreviation table is changed; the name you supply must be the name of an already-existing abbreviation table.

current-buffer-allocation-size

When read current-buffer-allocation-size returns the size in characters allocated for use in the current buffer.

Assigning a new, larger, value to current-buffer-allocation-size will increase the capacity of the current buffer.

It is not normally nessesary to use this variable. However as a performance enhancement it is sometimes useful.

If you plan to perform a complex set of operations on a buffer. These operations will cause the buffer to slowly grow to a much larger size. Assigning to current-buffer-allocation-size a suitable large value will reduce the CPU overhead of expanding the buffer is many small increments.

current-buffer-checkpointable

Defines whether or not the current buffer is checkpointable. If non-zero, when a checkpoint occurs, the buffer will be checkpointed if it has been modified. Otherwise, the buffer will not be checkpointed.

A buffer can never be checkpointed if the checkpoint-frequency variable is set to zero.

current-buffer-file-name

Contains the full file specification of the file associated with the current buffer. If the file does not already exist, the version number is omitted.

Setting this variable sets the filename to which the buffer is connected, but does not write the file. Also, the buffer is forced to be a File buffer.

If the buffer is not a File buffer, a null string is returned.

current-buffer-journalled

Controls whether the current buffer is journalled. If set to true, the buffer will be journalled.

A buffer will never be journalled if the journal-frequency is set to zero.

current-buffer-macro-name

Contains the macro name associated with the current buffer.

Setting this variable sets the macro to which this buffer is connected. The buffer will be coerced into a Macro buffer.

If this buffer is not a Macro buffer, a null string is returned.

current-buffer-name

Contains the name of the currently selected buffer. You can change the name of the current buffer by assigning a new name to the variable. The new buffer name must not already exist.

current-buffer-end-of-line-style

Contains the end-of-line style of the file associated with the current buffer. The variable is one of variable, "crlf", "lf". The default value for new buffers is taken from the default-buffer-end-of-line-style variable.

current-buffer-RMS-record-attribute

We recommend you use the variable current-buffer-end-of-line-style to set the end-of-line style rather then use the RMS variables.

Contains the RMS record attribute of the file associated with the current buffer. The variable is one of variable, stream, stream-lf, or stream-cr. The default value for new buffers is taken from the default-buffer-RMS-record-attribute variable.

current-buffer-syntax-table «

Contains the name of the current buffer's syntax table. Assigning to this variable changes the current buffer's syntax table. The specified syntax table must already exist.

current-buffer-type

Contains a string describing the type of the current buffer.

current-function

This read-only variable contains the name of the currently executing MLisp function. The value is not changed for functions executed in a trace or breakpoint function.

current-local-keymap

Contains the name of the current buffer's local keymap as set by the use-local-map function. Assigning the variable has the same effect as executing use-local-map. An existing keymap must be specified.

current-windows

Contains the set of windows that are displayed on the screen. If read, current-windows returns a window-ring that represents the windows on the screen. When current-windows is set, the screen is restored from the window ring provided.

DCL-buffer-reduction « 500

Controls how many characters are deleted from a DCL buffer after it contains more than maximum-DCL-buffer-size characters.

debug-it-command «

Used to hold a command that can be used to debug the program built with the compile-it-command

default-auto-fill-hook

Contains the default value of a new buffer's auto-fill-hook variable.

See also:

default-buffer-end-of-line-style

Specifies the default end-of-line style for new buffers. Windows systems default to "crlf" and Unix systems default to "lf".

default-buffer-RMS-record-attribute «"variable"

We recommend you use the variable default-buffer-end-of-line-style to set the end-of-line style rather then use the RMS variables.

Specifies the default RMS record attribute for new buffers. The default is variable, so that new files are created with standard RMS variable length records. Other values that this variable can take are stream, stream-lf and stream-cr.

default-case-fold-search « 0

Provides the default value used to initialise case-fold-search whenever a new buffer is created.

default-comment-column « 33

Provides the default value used to initialise comment-column whenever a new buffer is created.

default-display-C1-as-graphics « 0

Provides the default value used to initialise display-C1-as-graphics whenever a new buffer is created.

default-display-end-of-file « 0

Provides the default value used to initialise display-end-of-file whenever a new buffer is created.

default-display-non-printing-characters « 0

Provides the default value used to initialise display-non-printing-characters whenever a new buffer is created.

default-highlight-region « 0

Provides the default value used to initialise highlight-region whenever a new buffer is created.

default-left-margin « 1

Provides the default value used to initialise left-margin whenever a new buffer is created.

default-mode-line-format

Provides a default mode line format used to initialise mode-line-format whenever a buffer is created. The default value is:

%[%hBuffer: %b%* File: %f %M(%m%c%j%r%a%R) %p%]

default-read-only-buffer « 0

Provides the default value used to initialise read-only-buffer whenever a new buffer is created.

default-replace-mode « 1

Provides the default value used to initialise replace-mode whenever a new buffer is created.

default-right-margin « 10000

Provides the default value used to initialise right-margin whenever a new buffer is created.

default-syntax-array « 1

This variable provides the default value of syntax-array in all new buffers that are created.

default-syntax-colouring « 1

This variable provides the default value of syntax-colouring in all new buffers that are created.

default-tab-size « 8

Provides a default value used to initialise tab-size whenever a buffer is created.

display-C1-as-graphics « 0

Controls the way that C1-space characters are displayed. Setting this variable to 1 tells Emacs to display all the characters in the range 128 to 159 as special graphic characters on terminals with the DECCRT attribute.

display-end-of-file « 0

Controls the end-of-file marker display. Setting this variable to 1 tells Emacs to display a diamond graphic character at the end of the buffer.

display-non-printing-characters « 0

Controls the way Emacs displays non-printing characters. Setting this variable to 1 tells Emacs to display non-printing characters. Emacs can display linefeeds, tabs and the end-of-buffer marker.

A linefeed is displayed as the N/L graphic character and will appear at the end of every line.

A tab is displayed as the H/T graphic character. The rest of the white-space taken up by the tab is displayed as centered dot characters.

The end-of-buffer position is displayed as a diamond graphic character.

default-wrap-long-lines «

Provides the default value of a new buffers wrap-long-lines variable.

elapse-time «

This read-only variable contains the number of milliseconds that have elapsed since emacs started.

elapse-time was added to emacs to allow GUI code to calculate intervals of time as requested for mouse double click detection.

elapse-time's value will overflow after Emacs has been running for 24 days.

enter-emacs-hook «

Contains the name of an Emacs function which will be called when Emacs initially starts up. You can assign the variable in your EmacsINIT.ML file to contain the name of any already existing function.

error-file-name «

A string variable used by error message parsers (as specified in the variable error-message-parser) to indicate to the parse-error-messages-in-region function the file in which the current error is located. If an error message parser sets this variable to a null string, error message parsing is stopped.

error-hook «

Defines the current error function. When an error occurs that would cause an error message to be displayed, the function whose name is contained in this variable is called. The variable error-message will contain the text of the error.

When the error function exits, the error message will be displayed in the usual way unless exit-emacs is used to exit the error function.

error-line-number « 0

A numeric variable used by error message parsers (as specified in the variable error-message-parser) to indicate to the parse-error-messages-in-region function the line in which the current error is located. If an error message parser sets this to zero, error message parsing is stopped.

error-message «

This read-only string variable holds the text of the last error message. The variable will always hold the last error message, even if the error occurred inside an error-occurred block.

error-messages-buffer «

The string variable error-messages-buffer is checked each time Emacs generates an error message. If the value is not a null string then the value is used as the name of a buffer. Emacs will add details of each error message and its context to the buffer. Emacs creates the buffer if nessesary.

Using this variable is often the only way to find out why schedule-procedure functions fail. Its also useful for finding hard to reproduce bugs in long running MLisp.

error-message-parser

A string variable used to specify the name of a function that the parse-error-messages-in-region function should call to locate the next error.

The error parser function should locate the error message, moving dot to its end, and fill the variables error-file-name, error-line-number and error-start-position with suitable information. Parsing is stopped if any of these variables are set to zero or a null string.

error-start-position « 0

A numeric variable used by error message parsers (as specified in the variable error-message-parser) to indicate to the parse-error-messages-in-region function the line in which the current error message starts. If an error message parser sets this to zero, then error message parsing is stopped.

execute-monitor-command

Contains the last string sent to the DCL subprocess executing for execute-monitor-command. If you specify no argument to the command, execute-monitor-command's contents are re-used as the command string.

exit-emacs-hook «

Contains the name of an Emacs function which will be called when Emacs exits to DCL. You can assign the name of any existing function to this variable.

expansion-only-completes-unique-choices «

This variable changes the way that Emacs input completion logic works. It is only applicable is the case where some of the choice are prefixes of some of the other choice.

For example the command "set" is a prefix of the command "set-default". Consider what happens when you have typed "set" and press a key bound to expand-and-exit.

If expansion-only-completes-unique-choices is 0 the choice "set" is made.

If expansion-only-completes-unique-choices is 1 expand-and-exit does not choose anything. It is nessesary to press a key bound to exit-emacs to choose "set" and you need to type more text, atleast a "-" followed by expand-and-exit, to be able to choose "set-default".

false « 0

This constant holds the truth value for false.

fetch-help-database-flags « 7

A variable used to describe to the fetch-help-database-entry command which portions of the information available should be inserted into the buffer. The value is the logical or'ing of the values which indicate that a portion should be included. The bit values available are:

  • 1 -- means include the text of this entry
  • 2 -- means include the key name lines for this entry
  • 4 -- means include the additional information lines.

The default value is 7, which means that all information is included.

filter-region-command

Contains the last command string issued to the DCL subprocessing that the filter-region command uses. If you provide a null string argument to the command, filter-region-command's value will be re-used.

force-redisplay « 0

Controls how the screen is updated when a large quantity of data is generated by a subprocess with an associated output buffer. If non-zero, the screen is updated for every line that arrives; otherwise, the screen is updated less frequently.

global-mode-string «

Contains the global mode active in Emacs. The contents of this variable are displayed in every window's mode line with the use of the %M mode-line format identifier.

help-on-command-completion-error « 1

Controls the help window. If non-zero, Emacs will print a list of possibilities when an ambiguous entity (command, variable, database search-list and so on) is given. Otherwise, Emacs will just ring the bell and wait for you to type more.

highlight-region « 0

Controls the way Emacs displays regions. When set, the region is displayed with graphic rendition defined by the variable highlight-region-graphic-rendition. By default, the region is bolded. If mark is not set, the buffer is displayed normally.

highlight-region-graphic-rendition « 1

Controls the way that the highlighted region is displayed. It is the string of graphic rendition characters which are part of the ANSI SGR sequence.

On VT200 series terminals and terminal emulators, the following renditions are possible:

  • 1 -- bold
  • 4 -- underscore
  • 5 -- blinking
  • 7 -- reverse video.

These renditions can be combined by separating each rendition with a ;.

horizontal-scroll-step « 40

If automatic-horizontal-scrolling is 1 the value of horizontal-scroll-step is used.

horizontal-scroll-step controls how far Emacs will move the window horizontally to ensure that dot is visible.

Set horizontal-scroll-step to the number of columns that emacs will ensure is between dot and the edge of the window.

indent-use-tab « 1

Emacs will only use the TAB character while indenting when indent-use-tab is 1.

input-mode «

Emacs can operate in two different input modes, traditional and GUI.

In GUI mode Emacs operates the highlight region in the style of Windows and Motif, a more intuitive mode.

The region will be set if you move the cursor while holding the shift key.

Typing or otherwise inserting text while the region is set will erase the region first. In effect replacing region with new text.

Using a delete command will erase the region rather then doing the normal delete action. delete commands includes, but is not limited to: delete-next-character, delete-next-word, delete-previous-character, delete-previous-word, erase-region.

Setting the mark manually, using the set-mark command, will temporarily disable the GUI input mode.

is-comment « 4

This constant is returned by the current-syntax-entity function when dot is located in a comment.

is-dull « 0

This constant is returned by the current-syntax-entity function when dot is located in punctuation or white-space.

is-problem « 5

This constant is returned by the current-syntax-entity function when dot is located just after a problem character.

is-quote « 3

This constant is returned by the current-syntax-entity function when dot is located just after a quote character.

is-string « 2

This constant is returned by the current-syntax-entity function when dot is located in a matched quoted string.

is-word « 1

This constant is returned by the current-syntax-entity function when dot is located in a word.

journal-frequency « 0

Sets the time in seconds before any journal files are flushed to disk. A reasonable value for this variable is 30 seconds. To disable journalling, set this variable to 0 or false.

journal-scratch-buffers « 0

By default Emacs will not journal scratch buffers, even when current-buffer-journalled is 1. This is normally a good thing as its improves the performance of Emacs. Many packages use scratch buffers which would be journalled if this variable was set to 1.

Set this variable to 1 will enable journalling on all buffers.

keyboard-input-available

A count of the number of characters in the Emacs keyboard input buffer. Use this function to check if anything has been typed.

keystroke-history-buffer « ""

The string variable keystroke-history-buffer is checked each time Emacs processes a complete key sequence.

If the value is not a null string then the value is used as the name of a buffer. Emacs will add details of each key sequence and the command, if any, it executed. Emacs creates the buffer if nessesary.

Using this variable is often the only way to find out what you actually typed when the wrong command executed or no command gets executed.

last-expression

This variable is used by Emacs debugging packages to pick up the value of the last MLisp expression evaluated by Emacs.

last-keys-struck

Holds the string of characters typed to activate the last command from a keymap.

leave-emacs-hook «

Contains the name of an Emacs function which will be called when Emacs temporarily returns control to DCL (either by pause-emacs or return-to-monitor). You can assign the name of any existing function to the variable.

left-margin « 1

This variable contains the column number of the left margin for automatic text justification. After an automatically generated newline the new line will be indented to the left margin.

logical-tab-size « 8

Contains the number of spaces that make up a tab character for the current buffer.

maximum-DCL-buffer-size « 10000

When a DCL buffer is created, this variable is used to control the maximum amount of text that will be stored in the DCL buffer. If the number of characters is exceeded, the first DCL-buffer-reduction characters in the buffer will be discarded.

maximum-file-read-size « 10485760

Any file that is large then maximum-file-read-size will not be read into Emacs.

This is to prevent accidentally reading very large files that Emacs may struggle to edit.

Set to 0 to disable this limitation.

mode-line-format

Controls the way that the mode line at the bottom of each window is displayed. The variable contains raw text (which is displayed as it is typed), and format effectors.

mode-line-graphic-rendition « 7

Controls the way that the mode line is displayed. It is set to a string of graphic rendition characters which are part of the ANSI SGR sequence. The default value is 7 (reverse video).

mode-string « Normal

Contains the major mode for a buffer. The value of this variable is displayed in the mode line for each window where the format effector %m is used.

mouse-enable «

This variable enables the generation of mouse input to Emacs when set to 1.

This variable does not control the mouse input from terminal emulators like Xterms.

not-accessible «

The value of this constant is returned by the file-exists function to indicate that the target file cannot be accessed.

omit-file-version-expansion « 0

Controls file name expansion. When true, it causes file versions to be omitted when file recognition is used with visit-file, read-file etc.

override-end-of-line-style _ « "none"

Specifies whether the end-of-line style of all buffers should be overridden when writing them out to files. The default value is none, meaning that the buffer-specific attribute settings specified by current-buffer-end-of-line-style are not overridden. If override-RMS-record-attribute is set to one of "crlf" or "lf", then all buffers will be written out with the specified style, regardless of the value of current-buffer-end-of-line-style.

override-RMS-record-attribute _ « "none"

We recommend you use the variable override-end-of-line-style to set the end-of-line style rather then use the RMS variables.

Specifies whether the RMS attributes of all buffers should be overridden when writing them out to files. The default value is none, meaning that the buffer-specific attribute settings specified by current-buffer-RMS-record-attribute are not overridden. If override-RMS-record-attribute is set to one of stream, stream-lf or stream-cr, then all buffers will be written out with the specified attribute, regardless of the value of current-buffer-RMS-record-attribute.

operating-system-name «

This read only variable contains the name of the operating system that Emacs is running on.

Value Description
"Windows" Microsoft Windows NT, Windows 9x or Windows 3.1
"MacOSX" Apple macOS
"Linux" Linux

operating-system-version «

This read only variable contains the version of the operating system that Emacs is running on.

In the case of the Microsoft Windows set of operating systems operating-system-version allows you to tell them apart.

Value Description
V4.0 NT Windows NT 4.0
V3.51 NT Windows NT 3.51
V4.10 Win95 Windows 98
V4.0 Win95 Windows 95

On other operating systems it returns the version in a format compatible with the host operating systems conventions.

pop-up-windows « 1

Controls window pop-ups. If non-zero, Emacs will try to use a window other than the current window when it spontaneously generates a buffer that it wants you to see, or when you visit a file. If set to zero, the current window is always used.

prefix-argument

Every function invocation is always prefixed by a numeric argument, either explicitly with prefix-argument or implicitly with provide-prefix-argument. The value of the variable prefix-argument is the argument prefixed to the invocation of the current MLisp function.

prefix-argument-provided

If non-zero, a prefix argument has been provided for the current function. The value of prefix-argument-provided can be obtained from the prefix-argument variable.

prefix-string «

Contains the string that is inserted after an automatic newline has been generated in response to moving the cursor past the right margin. This is generally used by the language-dependent commenting features.

previous-directory «

This variable is used by Barry's Emacs as part of support its bemacs command line interface to the bemacs_server process.

Each time Barry's Emacs starts to process a new command line the current directory is recorded in the previous-directory variable.

Once the command line process finishes Emacs automatically sets the current directory to the value held in previous-directory.

The command line processing MLisp code can cause Emacs's current directory to change by setting previous-directory to a suitable directory.

The MLisp Programmer's Guide has furthur information about Command Lines. Including how to customise command line handling.

process-key-hook «

This buffer-specific variable holds the name of a function to call after each keymap command. last-keys-struck holds the string of keys that invoked the last command.

quick-redisplay « 0

Controls window updating when you have more than on window open on the same buffer and you make changes to a part of the buffer visible in multiple windows.

If quick-redisplay is non-zero, Emacs will not keep all windows updated as you type -- this makes display updating much faster. All changes will eventually be applied to all windows.

When quick-redisplay it is set to zero, all windows are always accurate.

query-replace-use-region-for-search « 0

Controls how the query replace functions default the search string. When ON and there is a region selected it is used as the search string defualt.

read-only « -1

The value of this constant is returned by the file-exists function to indicate that the target file is readable.

read-only-buffer« 0

Controls whether or not a buffer can be modified. When read-only-buffer is set to true, all attempts to modify the buffer will be ignored and will result in an error.

read-write « 1

The value of this constant is returned by the file-exists function to indicate that the target file can be read and written.

remove-help-window « 1

Controls the removal of the help window. When non-zero, help windows that have been automatically popped up onto the screen are removed. Otherwise, the help window will stay on the screen after the help function has completed.

replace-case « 0

Controls the case of replacement text. If non-zero, Emacs will alter the case of strings substituted with replace-string or query-replace-string to match the case of the original string.

replace-mode « 0

Controls the Replace minor mode. If non-zero, characters inserted into the buffer replace existing characters, rather then inserting (the default). This can be useful when editing diagrams.

restored-environment « 0

This read-only variable is a count of the number of times that the current environment has been saved and restored. If Emacs has not been restored from a saved environment file, restored-environment is zero.

return-to-emacs-hook «

Contains the name of an Emacs function which will be called when Emacs returns from DCL after a pause-emacs or return-to-monitor command. You can assign the name of any existing function to the variable.

right-margin

Controls the right margin setting for automatic text justification. If a character is inserted at the end of a line to the right of right-margin, Emacs will automatically insert at the beginning of the preceding word a newline, tabs and spaces to indent to the left margin, and the prefix string. For example, with right-margin set to 72, you can type in a document without worrying about when to hit the Return key; Emacs will automatically do this for you at exactly the right place.

scroll-step « 7

Controls the number of lines by which a window moves when dot moves out of the window.

search-string

This read-only variable holds the last search string used by any search command. The search-string variable is preserved by the save-... functions.

silently-kill-processes « 0

Controls process termination during Emacs rundown. If non-zero, Emacs will kill processes when it exits without asking any questions. Normally, if you have processes running when Emacs exits, Emacs asks the question You have processes on the prowl, should I chase them down for you?.

split-height-threshold « 7

Controls which windows Emacs considers when it decides to create a new window. Any window with a height that is less than split-height-threshold is a candidate for being split to create space for the new window.

stack-maximum-depth « 100

Emacs will limit the number of nested MLisp calls to stack-maximum-depth calls. Raise this limit if you need run recursive or very complex MLisp.

stack-trace-on-error « 0

Controls automatic stack tracing. If non-zero, Emacs will write an MLisp stack trace to the Stack trace buffer whenever an error is encountered from within an MLisp function (even inside an error-occurred).

swap-ctrl-x-char « 24

This variable allows you to change the way that emacs interprets control keys you type.

The value of this variable is the character code to swap with ^X. Whenever emacs sees a ^X the value of swap-ctrl-x-char is substituted. And whenever the you type the key corrisponding to the value of swap-ctrl-x-char ^x is substituted.

The reason this variable was added to emacs was to make it easy to use ^X as the Windows style Cut action. Without rewritting all the existing MLisp code so that it does not use ^X as a key binding prefix.

The (default-emacs-init) function sets up ^\ (28) and ^] (29) as suitable swap candadates.

syntax-array «

When syntax-array is true Emacs will optimise the operation of commands that depend on syntax data. However maintaining the syntax array will slow down other operations in Emacs.

The following compares commands and features with and without syntax-array:

syntax colouring

Syntax colouring is disabled if syntax-array is turned off. Turning on syntax-colouring will also turn on synatx-array for a buffer.

re-search-forward, re-search-reverse, re-query-replace-string and re-replace-string

The \S, \C, \s, \c regular expression features are only available when syntax-array is true.

backward-paren, forward-paren, backward-balanced-paren-line and forward-balanced-paren-line

When syntax-array is true these commands correctly take into account comments and strings when searching for a parenthesis. When syntax-array is false these commands uses a dead reckoning algorithm that in some situations will not find the correct parenthesis.

current-syntax-entity

When syntax-array is true this command is fast. However when syntax-array is false current-syntax-entity has to calculate the syntax by examining each character from the start of the buffer up to dot.

syntax-colouring «

When syntax-colouring is true Emacs will colour the characters of a buffer depending on the syntax of those characters.

The colours are taken from the variables:

syntax-word-rendition
syntax-string-rendition
syntax-comment-rendition
syntax-keyword1-rendition
syntax-keyword2-rendition

All dull characters are displayed in the window-graphic-rendition colour.

If syntax-colouring is false all characters are displayed in the window-graphic-rendition.

syntax-word-rendition «

Defines the colour that will be used to draw word characters when syntax-colouring is true.

syntax-string-rendition «

Defines the colour that will be used to draw string characters when syntax-colouring is true.

syntax-comment-rendition «

Defines the colour that will be used to draw comment characters when syntax-colouring is true.

syntax-keyword1-rendition «

Defines the colour that will be used to draw keyword type 1 characters when syntax-colouring is true.

syntax-keyword2-rendition «

Defines the colour that will be used to draw keyword type 2 characters when syntax-colouring is true.

syntax-keyword3-rendition «

Defines the colour that will be used to draw keyword type 3 characters when syntax-colouring is true.

tab-indents-region « 1

When tab-indents-region controls what happends when you type a tab and the region is set. If tab-indents-region is 1 the region is indented, if 0 the region is replaced with a tab.

tab-size « 8

Controls how a tab is displayed on the screen. It describes the number of space characters used to display a single tab character.

terminal-is-terminal

The value of this variable is one of:

Value Description
0 Emacs is reading input from a command file
1 Emacs is connected to a terminal. Do not use the UI-xxx family of functions
3 Emacs is connected to Microsoft Windows or X Windows. The UI-xxx family of functions are available.

terminal-length

Holds the length of the terminal in lines. If this variable is set to a new length, Emacs will redraw the screen with the Is set each time Emacs is entered.

If the new size is smaller than the old size, Emacs deletes all other windows on the screen and adjusts the size of the current windows to fill the whole screen.

If the new size is larger than the old size, Emacs will increase the size of the current window to include the extra lines.

The default value for this variable is the terminal page length. When Emacs exits or pauses, it updates the terminal characteristics to include the new length.

terminal-output-buffer-size « 256

Controls the size of the buffer used to output to the terminal from Emacs.

terminal-width

Controls the width of the terminal. If the terminal is capable of showing different screen widths, the appropriate width will be selected when the variable is assigned. The value is specified as a number, and can be in the range from 32 to 145 inclusive.

this-command « Last character struck

This read-only variable contains the ASCII character code of the last character typed in the key sequence used to invoke the current function. It can be used by functions bound to many keys to decide what to do.

trace-hook « trace

Contains the name of the trace function. When trace-mode is enabled, the function whose name is in trace-hook is called just before each complex MLisp expression is executed. Simple expressions (like 45 or Hello or foo)do not cause the trace function to be executed.

trace-into « 1

Controls tracing. If non-zero, tracing will continue into called functions. Otherwise, tracing is temporarily disabled while a call to another function is made.

trace-mode « 0

This variable controls Trace Mode. When non-zero, MLisp execution is traced. When trace-mode is enabled, the function whose name is in trace-hook is called just before each complex MLisp expression is executed.

track-eol-on-^N-^P« 0

Controls the action of the next-line and previous-line functions. If non-zero, next-line and previous-line will stick to the end of a line if they are started there. If zero, the functions will try to stay in the same column as you move up and down, even if you started at the end of a line.

true « 1

This constant holds the truth value for true.

UI-filter-file-list

This variable provides the data for the "List File of Type" part of the Windows File Open and File Save As dialog boxes.

The value is a set of pairs of text lines. The first line of the pair is a description and the second line of the pair is a list of file filters.

For example to have filters for text files (*.txt) and C file (*.c and *.h):

(setq UI-filter-file-list "Text files\n*.txt\nC files\n*.c;*.h")

Default value:

    "C/C++ Source code\n"
    "*.c;*.h;*.cpp;*.rc;*.def\n"
    "MLisp source code\n"
    "*.ml;*.mlp,*.key\n"
    "Text Files\n"
    "*.txt\n"
    "Ini Files\n"
    "*.ini;*.sys;*.bat;*.btm\n"
    "All Files (*.*)\n"
    "*.*\n"

See also:

UI-open-file-name

This variable provides the file name for the Windows File Open dialog boxes.

See also:

UI-open-file-readonly

This variable provides the setting of the Read only check box for the Windows File Open dialog boxes.

Default value: 0

See also:

UI-save-as-file-name

This variable provides the file name for the Windows File Save As dialog box.

Default value: ""

See also:

UI-search-string

This variable provides the initial "Find what" string for the Windows Find and Find and Replace dialog boxes.

When the dialog box is close UI-search-string will hold the last value of the "Find what" field.

Default value: ""

See also:

UI-replace-string

This variable provides the initial "Replace with" string for the Windows Find and Replace dialog box.

When the dialog box is close UI-replace-string will hold the last value of the "Replace with" field.

Default value:

See also:

user-colour-1 «

Graphic rendition for any text coloured as 1 by apply-colour-to-region.

user-colour-2 «

Graphic rendition for any text coloured as 2 by apply-colour-to-region.

user-colour-3 «

Graphic rendition for any text coloured as 3 by apply-colour-to-region.

user-colour-4 «

Graphic rendition for any text coloured as 4 by apply-colour-to-region.

user-colour-5 «

Graphic rendition for any text coloured as 5 by apply-colour-to-region.

user-colour-6 «

Graphic rendition for any text coloured as 6 by apply-colour-to-region.

user-colour-7 «

Graphic rendition for any text coloured as 7 by apply-colour-to-region.

user-colour-8 «

Graphic rendition for any text coloured as 8 by apply-colour-to-region.

user-interface-hook «

This variable is intended for use of the shipped Emacs MLisp code only.

The procedure named in this variable is executed:

  • after restoring the Emacs environment, or executing the emacs_profile.ml
  • before calling the procedure in the enter-emacs-hook.

The user-interface-hook is intended to run a procedure that customises the Emacs user interface based on present environment. This cannot be done and saved in environment file and it is a snapshot taken in the past.

unlink-checkpoint-files « 0

Controls the deletion of checkpoint files. If non-zero, Emacs will unlink the corresponding checkpoint file after the master copy of the file is written. This avoids .CKP files from building up, but it does compromise safety a little.

visible-bell « 0

Controls the bell presentation. If non-zero, Emacs will attempt to use a visible bell (usually a flashing of the screen), instead of the audible terminal bell, when notifying you of some error.

window-first-column

Contains the column number of the first column that is visible in the current window.

window-graphic-rendition «

If syntax-colouring is false all characters are displayed in the window-graphic-rendition. Otherwise all dull characters are displayed in the window-graphic-rendition colour.

window-size

This read only variable contains the height of the current buffer's window.

window-width

Contains the width of the current window. If the window is split vertically, setting this variable will change the width of the window.

wrap-long-lines « 0

Controls the way Emacs displays long lines. If non-zero, Emacs will display long lines by wrapping their continuation onto the next line. If set to zero, long lines are truncated at the right-hand edge of the screen and a $ is displayed to indicate that truncation has occurred.

xon-mode

This variable is no longer used by Emacs, it remains for backwards compatibility.