diff options
| author | Joakim Verona <joakim@verona.se> | 2012-01-23 15:10:06 +0100 |
|---|---|---|
| committer | Joakim Verona <joakim@verona.se> | 2012-01-23 15:10:06 +0100 |
| commit | 0322b140eead7c94de7f0f6d19a90bd15690b4eb (patch) | |
| tree | 950c011783cc896d0450084cb5155e54548bfe5b | |
| parent | d5114bfea3ea4c37c57e2af0f3b095be9fcd8bac (diff) | |
| parent | cb5850f27c1b4d26957d58e2da2314dd12498671 (diff) | |
upstream
68 files changed, 2896 insertions, 2207 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index 597beb60ce2..2178df6caf0 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-01-19 Glenn Morris <rgm@gnu.org> + + * bzrmerge.el (bzrmerge-missing): Allow a definitive "no" answer to the + "skip?" question, since there can be multiple such for any revision. + 2012-01-14 Eli Zaretskii <eliz@gnu.org> * FOR-RELEASE (Check the Emacs Tutorial): Mark TUTORIAL.he as diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index daf8e33d041..f704a3c9397 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -100,10 +100,10 @@ names of the people who have checked it. SECTION READERS ---------------------------------- TUTORIAL cyd -TUTORIAL.bg +TUTORIAL.bg ogi TUTORIAL.cn TUTORIAL.cs -TUTORIAL.de +TUTORIAL.de wl TUTORIAL.eo TUTORIAL.es TUTORIAL.fr @@ -117,7 +117,7 @@ TUTORIAL.pt_BR TUTORIAL.ro TUTORIAL.ru TUTORIAL.sk -TUTORIAL.sl +TUTORIAL.sl Primoz PETERLIN TUTORIAL.sv TUTORIAL.th TUTORIAL.zh @@ -187,25 +187,25 @@ backups.texi buffers.texi commands.texi compile.texi -control.texi +control.texi cyd customize.texi debugging.texi display.texi edebug.texi elisp.texi errors.texi -eval.texi +eval.texi cyd files.texi frames.texi functions.texi -hash.texi +hash.texi cyd help.texi hooks.texi index.texi internals.texi -intro.texi +intro.texi cyd keymaps.texi -lists.texi +lists.texi cyd loading.texi locals.texi macros.texi @@ -214,17 +214,17 @@ markers.texi minibuf.texi modes.texi nonascii.texi -numbers.texi -objects.texi +numbers.texi cyd +objects.texi cyd os.texi package.texi positions.texi processes.texi searching.texi -sequences.texi +sequences.texi cyd streams.texi -strings.texi -symbols.texi +strings.texi cyd +symbols.texi cyd syntax.texi text.texi tips.texi @@ -232,8 +232,7 @@ variables.texi windows.texi * PLANNED ADDITIONS - -** pov-mode (probably not for Emacs-23: waiting for a Free POV-Ray). +* pov-mode (probably not for Emacs-23: waiting for a Free POV-Ray). ** gas-mode ? diff --git a/admin/bzrmerge.el b/admin/bzrmerge.el index 2efb17603cd..cb63d5b16ba 100644 --- a/admin/bzrmerge.el +++ b/admin/bzrmerge.el @@ -133,9 +133,23 @@ are both lists of revnos, in oldest-first order." (setq str (substring str (match-end 0)))) (when (string-match "[.!;, ]+\\'" str) (setq str (substring str 0 (match-beginning 0)))) - (if (save-excursion (y-or-n-p (concat str ": Skip? "))) - (setq skip t)))) - (if skip + (let ((help-form "\ +Type `y' to skip this revision, +`N' to include it and go on to the next revision, +`n' to not skip, but continue to search this log entry for skip regexps, +`q' to quit merging.")) + (case (save-excursion + (read-char-choice + (format "%s: Skip (y/n/N/q/%s)? " str + (key-description (vector help-char))) + '(?y ?n ?N ?q))) + (?y (setq skip t)) + (?q (keyboard-quit)) + ;; A single log entry can match skip-regexp multiple + ;; times. If you are sure you don't want to skip it, + ;; you don't want to be asked multiple times. + (?N (setq skip 'no)))))) + (if (eq skip t) (push revno skipped) (push revno revnos))))) (delete-region (point) (point-max))) diff --git a/admin/grammars/python.wy b/admin/grammars/python.wy index 65f317145a0..f7808fd20b8 100644 --- a/admin/grammars/python.wy +++ b/admin/grammars/python.wy @@ -1,7 +1,8 @@ ;;; python.wy -- LALR grammar for Python ;; Copyright (C) 2002-2012 Free Software Foundation, Inc. -;; Copyright (C) 2001-2010 Python Software Foundation +;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Python Software Foundation; All Rights Reserved ;; Author: Richard Kim <ryk@dspwiz.com> ;; Maintainer: Richard Kim <ryk@dspwiz.com> diff --git a/admin/grammars/wisent-grammar.el b/admin/grammars/wisent-grammar.el index be014a56906..714b5211127 100644 --- a/admin/grammars/wisent-grammar.el +++ b/admin/grammars/wisent-grammar.el @@ -470,13 +470,13 @@ Menu items are appended to the common grammar menu.") "srecode/srt-wy") ("wisent-javascript-jv-wy.el" "semantic/wisent/js-wy" - "Copyright (C) 1998-2011 Ecma International" + "Copyright (C) 1998-2011 Ecma International." ,wisent-make-parsers--ecmascript-license) ("wisent-java-tags-wy.el" "semantic/wisent/javat-wy") ("wisent-python-wy.el" "semantic/wisent/python-wy" - "Copyright (C) 2001-2010 Python Software Foundation" + "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Python Software Foundation; All Rights Reserved." ,wisent-make-parsers--python-license))) (defun wisent-make-parsers () diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 90a7f69ea72..9aa4899e591 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2012-01-23 Chong Yidong <cyd@gnu.org> + + * anti.texi (Antinews): Add Emacs 23 antinews. + 2012-01-16 Volker Sobek <reklov@live.com> (tiny change) * programs.texi (Comment Commands): Typo (bug#10514). diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi index d9f17c91f5e..7bc405e442e 100644 --- a/doc/emacs/anti.texi +++ b/doc/emacs/anti.texi @@ -13,7 +13,100 @@ greater simplicity that results from the absence of many Emacs @itemize @bullet @item -FIXME +Support for displaying and editing ``bidirectional'' text has been +removed. Text is now always displayed on the screen in a single +consistent direction---left to right---regardless of the underlying +script. Similarly, @kbd{C-f} and @kbd{C-b} always move the text +cursor to the right and left respectively. Also, @key{right} and +@key{left} are now equivalent to @kbd{C-f} and @kbd{C-b}, as you might +expect, rather than moving forward or backward based on the underlying +``paragraph direction''. + +Users of ``right-to-left'' languages, like Arabic and Hebrew, may +adapt by reading and/or editing text in left-to-right order. + +@item +The Emacs Lisp package manager has been removed. Instead of using a +``user interface'' (@kbd{M-x list-packages}), additional Lisp packages +must now be installed by hand, which is the most flexible and +``Lispy'' method anyway. Typically, this just involves editing your +init file to add the package installation directory to the load path +and defining some autoloads; see each package's commentary section +and/or README file for details. + +@item +The option @code{delete-active-region} has been deleted. When the +region is active, typing @key{DEL} or @key{delete} no longer deletes +the text in the region; it deletes a single character instead. + +@item +We have reworked how Emacs handles the clipboard and the X primary +selection. Commands for killing and yanking, like @kbd{C-w} and +@kbd{C-y}, use the primary selection and not the clipboard, so you can +use these commands without interfering with ``cutting'' or ``pasting'' +in other programs. The @samp{Cut}/@samp{Copy}/@samp{Paste} menu items +are bound to separate clipboard commands, not to the same commands as +@kbd{C-w}/@kbd{M-w}/@kbd{C-y}. + +Selecting text by dragging with the mouse now puts the text in the +kill ring, in addition to the primary selection. But note that +selecting an active region with @kbd{C-@key{SPC}} does @emph{not} +alter the kill ring nor the primary selection, even though the text +highlighting is visually identical. + +@item +In Isearch, @kbd{C-y} and @kbd{M-y} are no longer bound to +@code{isearch-yank-kill} and @code{isearch-yank-pop} respectively. +Instead, @kbd{C-y} yanks the rest of the current line into the search +string (@code{isearch-yank-line}), whereas @kbd{M-y} does +@code{isearch-yank-kill}. The mismatch with the usual meanings of +@kbd{C-y} and @kbd{M-y} is unintended. + +@item +Various completion features have been simplified. The options +@code{completion-cycle-threshold} and +@code{completion-category-overrides} have been removed. Due to the +latter removal, Emacs uses a single consistent scheme to generate +completions, instead of using a separate scheme for (say) buffer name +completion. Several major modes, such as Shell mode, now implement +their own inline completion commands instead of using +@code{completion-at-point}. + +@item +We have removed various options for controlling how windows are used, +e.g.@: @code{display-buffer-base-action}, @code{display-buffer-alist}, +@code{window-combination-limit}, and @code{window-combination-resize}. + +@item +The command @kbd{M-x customize-themes} has been removed. Emacs no +longer comes with pre-defined themes (you can write your own). + +@item +Emacs no longer adapts various aspects of its display to GTK+ +settings, opting instead for a uniform toolkit-independent look. GTK+ +scroll bars are placed on the left, the same position as non-GTK+ X +scroll bars. Emacs no longer refers to GTK+ to set the default +@code{region} face, nor for drawing tooltips. + +@item +Setting the option @code{delete-by-moving-to-trash} to a +non-@code{nil} now causes all file deletions to use the system trash, +even temporary files created by Lisp programs; furthermore, the +@kbd{M-x delete-file} and @kbd{M-x delete-directory} commands no +longer accept prefix arguments to force true deletion. + +@item +On GNU/Linux and Unix, the default method for sending mail (as +specified by @code{send-mail-function}) is to use the +@command{sendmail} program. Emacs no longer asks for a delivery +method the first time you try to send mail, trusting instead that the +system is configured for mail delivery, as it ought to be. + +@item +Several VC features have been removed, including the @kbd{C-x v +} and +@kbd{C-x v m} commands for pulling and merging on distributed version +control systems, and the ability to view inline log entries in the log +buffers made by @kbd{C-x v L}. @item To keep up with decreasing computer memory capacity and disk space, many diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 0365a3ca174..2a1d018cc26 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog @@ -1,3 +1,12 @@ +2012-01-19 Juanma Barranquero <lekktu@gmail.com> + + * emacs-lisp-intro.texi (count-words-in-defun): + Add missing parenthesis (bug#10544). + +2012-01-17 Glenn Morris <rgm@gnu.org> + + * emacs-lisp-intro.texi (re-search-forward): Fix typo. + 2011-11-24 Juanma Barranquero <lekktu@gmail.com> * makefile.w32-in: Update dependencies. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 0f9b6b906aa..d70ff9f3b44 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -12607,7 +12607,7 @@ four arguments: @enumerate @item The first argument is the regular expression that the function searches -for. The regular expression will be a string between quotations marks. +for. The regular expression will be a string between quotation marks. @item The optional second argument limits how far the function will search; it is a @@ -15012,7 +15012,7 @@ expression for this (@pxref{Syntax}), so the loop is straightforward: @group (while (and (< (point) end) (re-search-forward - "\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" end t) + "\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" end t)) (setq count (1+ count))) @end group @end smallexample diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 4b9531c0e6c..b66f82c5738 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,54 @@ +2012-01-23 Chong Yidong <cyd@gnu.org> + + * strings.texi (Text Comparison): Minor qualification. + + * lists.texi (Cons Cells): Copyedits. + (List Elements): Mention push. + (List Variables): Mention pop. + (Rings): Move to sequences.texi. + + * sequences.texi (Sequence Functions): Don't repeat the + introduction already given in the parent. + (Vectors): Copyedits. + (Rings): Move from lists.texi. Note that this is specific to the + ring package. + + * symbols.texi (Definitions, Symbol Components): Mention variable + scoping issues. + (Plists and Alists): Copyedits. + + * eval.texi (Intro Eval, Symbol Forms): Minor tweaks for + correctness with lexical scoping. + (Eval): Copyedits. + +2012-01-21 Chong Yidong <cyd@gnu.org> + + * intro.texi (A Sample Function Description): Special notation + used for macros too. + + * objects.texi (Ctl-Char Syntax, Other Char Bits): Copyedits. + (Symbol Type): Add xref for keyword symbols. + (Sequence Type): Clarify differences between sequence types. + (Cons Cell Type): Add "linked list" index entry. + (Non-ASCII in Strings): Copyedits. + (Equality Predicates): Symbols with same name need not be eq. + + * numbers.texi (Float Basics): Document isnan, copysign, frexp and + ldexp. Move float-e and float-pi to Math Functions node. + +2012-01-21 Glenn Morris <rgm@gnu.org> + + * modes.texi (Auto Major Mode): + * variables.texi (File Local Variables): + Mention inhibit-local-variables-regexps. + +2012-01-19 Martin Rudalics <rudalics@gmx.at> + + * windows.texi (Window Configurations): Rewrite references to + persistent window parameters. + (Window Parameters): Fix description of persistent window + parameters. + 2012-01-16 Juanma Barranquero <lekktu@gmail.com> * windows.texi (Window Parameters): Use @pxref. diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index e74f3e198bf..0511f21007d 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -8,11 +8,11 @@ @cindex special forms for control structures @cindex control structures - A Lisp program consists of expressions or @dfn{forms} (@pxref{Forms}). -We control the order of execution of these forms by enclosing them in -@dfn{control structures}. Control structures are special forms which -control when, whether, or how many times to execute the forms they -contain. + A Lisp program consists of a set of @dfn{expressions}, or +@dfn{forms} (@pxref{Forms}). We control the order of execution of +these forms by enclosing them in @dfn{control structures}. Control +structures are special forms which control when, whether, or how many +times to execute the forms they contain. @cindex textual order The simplest order of execution is sequential execution: first form diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 0b8d972c1d5..1555b98e7fb 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -326,7 +326,6 @@ Lists * Modifying Lists:: Storing new pieces into an existing list. * Sets And Lists:: A list can represent a finite mathematical set. * Association Lists:: A list can represent a finite relation or mapping. -* Rings:: Managing a fixed-size ring of objects. Modifying Existing List Structure @@ -344,6 +343,7 @@ Sequences, Arrays, and Vectors * Vector Functions:: Functions specifically for vectors. * Char-Tables:: How to work with char-tables. * Bool-Vectors:: How to work with bool-vectors. +* Rings:: Managing a fixed-size ring of objects. Hash Tables diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi index adb4841a82d..fc18e503543 100644 --- a/doc/lispref/eval.texi +++ b/doc/lispref/eval.texi @@ -64,8 +64,8 @@ evaluate a @dfn{function call} form such as @code{(car x)}, Emacs first evaluates the argument (the subform @code{x}). After evaluating the argument, Emacs @dfn{executes} the function (@code{car}), and if the function is written in Lisp, execution works by evaluating the -@dfn{body} of the function. (In this example, however, @code{car} is -not a Lisp function; it is a primitive function implemented in C.) +@dfn{body} of the function (in this example, however, @code{car} is +not a Lisp function; it is a primitive function implemented in C). @xref{Functions}, for more information about functions and function calls. @@ -77,9 +77,8 @@ variables (@pxref{Variables}).@footnote{This definition of that can affect the result of a program.} Whenever a form refers to a variable without creating a new binding for it, the variable evaluates to the value given by the current environment. Evaluating a form may -create a new environment for recursive evaluation, by binding -variables (@pxref{Local Variables}). Such environments are temporary, -and vanish when the evaluation of the form is complete. +also temporarily alter the environment by binding variables +(@pxref{Local Variables}). @cindex side effect Evaluating a form may also make changes that persist; these changes @@ -177,9 +176,9 @@ program. Here is an example: @cindex symbol evaluation When a symbol is evaluated, it is treated as a variable. The result -is the variable's value, if it has one. If it has none (if its value -cell is void), an error is signaled. For more information on the use of -variables, see @ref{Variables}. +is the variable's value, if it has one. If the symbol has no value as +a variable, the Lisp interpreter signals an error. For more +information on the use of variables, see @ref{Variables}. In the following example, we set the value of a symbol with @code{setq}. Then we evaluate the symbol, and get back the value that @@ -602,12 +601,13 @@ functions provides the ability to pass information to them as arguments. @defun eval form &optional lexical -This is the basic function evaluating an expression. It evaluates +This is the basic function for evaluating an expression. It evaluates @var{form} in the current environment and returns the result. How the evaluation proceeds depends on the type of the object (@pxref{Forms}). -@var{lexical} if non-nil means to evaluate @var{form} using lexical scoping -rules (@pxref{Lexical Binding}) instead of the default dynamic scoping used -historically in Emacs Lisp. + +The argument @var{lexical}, if non-@code{nil}, means to evaluate +@var{form} using lexical scoping rules for variables, instead of the +default dynamic scoping rules. @xref{Lexical Binding}. Since @code{eval} is a function, the argument expression that appears in a call to @code{eval} is evaluated twice: once as preparation before diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi index 64c856d3ed4..a68bcfa0fe7 100644 --- a/doc/lispref/intro.texi +++ b/doc/lispref/intro.texi @@ -162,7 +162,7 @@ being described, are formatted like this: @var{first-number}. @cindex @code{nil} @cindex false - In Lisp, the symbol @code{nil} has three separate meanings: it + In Emacs Lisp, the symbol @code{nil} has three separate meanings: it is a symbol with the name @samp{nil}; it is the logical truth value @var{false}; and it is the empty list---the list of zero elements. When used as a variable, @code{nil} always has the value @code{nil}. @@ -396,13 +396,14 @@ Form', respectively. Commands are simply functions that may be called interactively; macros process their arguments differently from functions (the arguments are not evaluated), but are presented the same way. - Special form descriptions use a more complex notation to specify -optional and repeated arguments because they can break the argument -list down into separate arguments in more complicated ways. -@samp{@r{[}@var{optional-arg}@r{]}} means that @var{optional-arg} is -optional and @samp{@var{repeated-args}@dots{}} stands for zero or more -arguments. Parentheses are used when several arguments are grouped into -additional levels of list structure. Here is an example: + The descriptions of macros and special forms use a more complex +notation to specify optional and repeated arguments, because they can +break the argument list down into separate arguments in more +complicated ways. @samp{@r{[}@var{optional-arg}@r{]}} means that +@var{optional-arg} is optional and @samp{@var{repeated-args}@dots{}} +stands for zero or more arguments. Parentheses are used when several +arguments are grouped into additional levels of list structure. Here +is an example: @defspec count-loop (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{} This imaginary special form implements a loop that executes the @@ -485,9 +486,9 @@ giving a prefix argument makes @var{here} non-@code{nil}. @end deffn @defvar emacs-build-time -The value of this variable indicates the time at which Emacs was built -at the local site. It is a list of three integers, like the value -of @code{current-time} (@pxref{Time of Day}). +The value of this variable indicates the time at which Emacs was +built. It is a list of three integers, like the value of +@code{current-time} (@pxref{Time of Day}). @example @group diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index eb9ddf58603..c8433c79b54 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -23,7 +23,6 @@ the whole list. * Modifying Lists:: Storing new pieces into an existing list. * Sets And Lists:: A list can represent a finite mathematical set. * Association Lists:: A list can represent a finite relation or mapping. -* Rings:: Managing a fixed-size ring of objects. @end menu @node Cons Cells @@ -31,61 +30,56 @@ the whole list. @cindex lists and cons cells Lists in Lisp are not a primitive data type; they are built up from -@dfn{cons cells}. A cons cell is a data object that represents an -ordered pair. That is, it has two slots, and each slot @dfn{holds}, or -@dfn{refers to}, some Lisp object. One slot is known as the @sc{car}, -and the other is known as the @sc{cdr}. (These names are traditional; -see @ref{Cons Cell Type}.) @sc{cdr} is pronounced ``could-er.'' +@dfn{cons cells} (@pxref{Cons Cell Type}). A cons cell is a data +object that represents an ordered pair. That is, it has two slots, +and each slot @dfn{holds}, or @dfn{refers to}, some Lisp object. One +slot is known as the @sc{car}, and the other is known as the @sc{cdr}. +(These names are traditional; see @ref{Cons Cell Type}.) @sc{cdr} is +pronounced ``could-er.'' We say that ``the @sc{car} of this cons cell is'' whatever object its @sc{car} slot currently holds, and likewise for the @sc{cdr}. A list is a series of cons cells ``chained together,'' so that each -cell refers to the next one. There is one cons cell for each element of -the list. By convention, the @sc{car}s of the cons cells hold the -elements of the list, and the @sc{cdr}s are used to chain the list: the -@sc{cdr} slot of each cons cell refers to the following cons cell. The -@sc{cdr} of the last cons cell is @code{nil}. This asymmetry between -the @sc{car} and the @sc{cdr} is entirely a matter of convention; at the -level of cons cells, the @sc{car} and @sc{cdr} slots have the same -characteristics. +cell refers to the next one. There is one cons cell for each element +of the list. By convention, the @sc{car}s of the cons cells hold the +elements of the list, and the @sc{cdr}s are used to chain the list +(this asymmetry between @sc{car} and @sc{cdr} is entirely a matter of +convention; at the level of cons cells, the @sc{car} and @sc{cdr} +slots have similar properties). Hence, the @sc{cdr} slot of each cons +cell in a list refers to the following cons cell. @cindex true list - Since @code{nil} is the conventional value to put in the @sc{cdr} of -the last cons cell in the list, we call that case a @dfn{true list}. - - In Lisp, we consider the symbol @code{nil} a list as well as a -symbol; it is the list with no elements. For convenience, the symbol + Also by convention, the @sc{cdr} of the last cons cell in a list is +@code{nil}. We call such a @code{nil}-terminated structure a +@dfn{true list}. In Emacs Lisp, the symbol @code{nil} is both a +symbol and a list with no elements. For convenience, the symbol @code{nil} is considered to have @code{nil} as its @sc{cdr} (and also -as its @sc{car}). Therefore, the @sc{cdr} of a true list is always a -true list. +as its @sc{car}). + + Hence, the @sc{cdr} of a true list is always a true list. The +@sc{cdr} of a nonempty true list is a true list containing all the +elements except the first. @cindex dotted list @cindex circular list - If the @sc{cdr} of a list's last cons cell is some other value, -neither @code{nil} nor another cons cell, we call the structure a -@dfn{dotted list}, since its printed representation would use -@samp{.}. There is one other possibility: some cons cell's @sc{cdr} -could point to one of the previous cons cells in the list. We call -that structure a @dfn{circular list}. + If the @sc{cdr} of a list's last cons cell is some value other than +@code{nil}, we call the structure a @dfn{dotted list}, since its +printed representation would use dotted pair notation (@pxref{Dotted +Pair Notation}). There is one other possibility: some cons cell's +@sc{cdr} could point to one of the previous cons cells in the list. +We call that structure a @dfn{circular list}. For some purposes, it does not matter whether a list is true, -circular or dotted. If the program doesn't look far enough down the +circular or dotted. If a program doesn't look far enough down the list to see the @sc{cdr} of the final cons cell, it won't care. However, some functions that operate on lists demand true lists and signal errors if given a dotted list. Most functions that try to find the end of a list enter infinite loops if given a circular list. @cindex list structure - Because most cons cells are used as part of lists, the phrase -@dfn{list structure} has come to mean any structure made out of cons -cells. - - The @sc{cdr} of any nonempty true list @var{l} is a list containing all the -elements of @var{l} except the first. - - @xref{Cons Cell Type}, for the read and print syntax of cons cells and -lists, and for ``box and arrow'' illustrations of lists. + Because most cons cells are used as part of lists, we refer to any +structure made out of cons cells as a @dfn{list structure}. @node List-related Predicates @section Predicates on Lists @@ -257,6 +251,10 @@ x x @result{} (b c) @end example + +@noindent +For the @code{pop} macro, which removes an element from a list, +@xref{List Variables}. @end defmac @defun nth n list @@ -695,6 +693,10 @@ This macro provides an alternative way to write l @result{} (c a b) @end example + +@noindent +For the @code{pop} macro, which removes the first element from a list, +@xref{List Elements}. @end defmac Two functions modify lists that are the values of variables. @@ -1800,90 +1802,3 @@ often modifies the original list structure of @var{alist}. compares the @sc{cdr} of each @var{alist} association instead of the @sc{car}. @end defun - -@node Rings -@section Managing a Fixed-Size Ring of Objects - -@cindex ring data structure - This section describes functions for operating on rings. A -@dfn{ring} is a fixed-size data structure that supports insertion, -deletion, rotation, and modulo-indexed reference and traversal. - -@defun make-ring size -This returns a new ring capable of holding @var{size} objects. -@var{size} should be an integer. -@end defun - -@defun ring-p object -This returns @code{t} if @var{object} is a ring, @code{nil} otherwise. -@end defun - -@defun ring-size ring -This returns the maximum capacity of the @var{ring}. -@end defun - -@defun ring-length ring -This returns the number of objects that @var{ring} currently contains. -The value will never exceed that returned by @code{ring-size}. -@end defun - -@defun ring-elements ring -This returns a list of the objects in @var{ring}, in order, newest first. -@end defun - -@defun ring-copy ring -This returns a new ring which is a copy of @var{ring}. -The new ring contains the same (@code{eq}) objects as @var{ring}. -@end defun - -@defun ring-empty-p ring -This returns @code{t} if @var{ring} is empty, @code{nil} otherwise. -@end defun - - The newest element in the ring always has index 0. Higher indices -correspond to older elements. Indices are computed modulo the ring -length. Index @minus{}1 corresponds to the oldest element, @minus{}2 -to the next-oldest, and so forth. - -@defun ring-ref ring index -This returns the object in @var{ring} found at index @var{index}. -@var{index} may be negative or greater than the ring length. If -@var{ring} is empty, @code{ring-ref} signals an error. -@end defun - -@defun ring-insert ring object -This inserts @var{object} into @var{ring}, making it the newest -element, and returns @var{object}. - -If the ring is full, insertion removes the oldest element to -make room for the new element. -@end defun - -@defun ring-remove ring &optional index -Remove an object from @var{ring}, and return that object. The -argument @var{index} specifies which item to remove; if it is -@code{nil}, that means to remove the oldest item. If @var{ring} is -empty, @code{ring-remove} signals an error. -@end defun - -@defun ring-insert-at-beginning ring object -This inserts @var{object} into @var{ring}, treating it as the oldest -element. The return value is not significant. - -If the ring is full, this function removes the newest element to make -room for the inserted element. -@end defun - -@cindex fifo data structure - If you are careful not to exceed the ring size, you can -use the ring as a first-in-first-out queue. For example: - -@lisp -(let ((fifo (make-ring 5))) - (mapc (lambda (obj) (ring-insert fifo obj)) - '(0 one "two")) - (list (ring-remove fifo) t - (ring-remove fifo) t - (ring-remove fifo))) - @result{} (0 t one t "two") -@end lisp diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 5d09b79748e..b3aac231d5b 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -588,6 +588,18 @@ Chosen, emacs, The GNU Emacs Manual}. If @code{enable-local-variables} is @code{nil}, @code{set-auto-mode} does not check the @w{@samp{-*-}} line, or near the end of the file, for any mode tag. +@vindex inhibit-local-variables-regexps +There are some file types where it is not appropriate to scan the file +contents for a mode specifier. For example, a tar archive may happen to +contain, near the end of the file, a member file that has a local +variables section specifying a mode for that particular file. This +should not be applied to the containing tar file. Similarly, a tiff +image file might just happen to contain a first line that seems to +match the @w{@samp{-*-}} pattern. For these reasons, both these file +extensions are members of the list @var{inhibit-local-variables-regexps}. +Add patterns to this list to prevent Emacs searching them for local +variables of any kind (not just mode specifiers). + If @var{keep-mode-if-same} is non-@code{nil}, this function does not call the mode command if the buffer is already in the proper major mode. For instance, @code{set-visited-file-name} sets this to diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index 6768ecece9c..77db0f86c26 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi @@ -168,34 +168,37 @@ character codepoint. @node Float Basics @section Floating Point Basics +@cindex @acronym{IEEE} floating point Floating point numbers are useful for representing numbers that are not integral. The precise range of floating point numbers is machine-specific; it is the same as the range of the C data type -@code{double} on the machine you are using. +@code{double} on the machine you are using. Emacs uses the +@acronym{IEEE} floating point standard where possible (the standard is +supported by most modern computers). - The read-syntax for floating point numbers requires either a decimal + The read syntax for floating point numbers requires either a decimal point (with at least one digit following), an exponent, or both. For example, @samp{1500.0}, @samp{15e2}, @samp{15.0e2}, @samp{1.5e3}, and @samp{.15e4} are five ways of writing a floating point number whose -value is 1500. They are all equivalent. You can also use a minus sign -to write negative floating point numbers, as in @samp{-1.0}. +value is 1500. They are all equivalent. You can also use a minus +sign to write negative floating point numbers, as in @samp{-1.0}. + + Emacs Lisp treats @code{-0.0} as equal to ordinary zero (with +respect to @code{equal} and @code{=}), even though the two are +distinguishable in the @acronym{IEEE} floating point standard. -@cindex @acronym{IEEE} floating point @cindex positive infinity @cindex negative infinity @cindex infinity @cindex NaN - Most modern computers support the @acronym{IEEE} floating point standard, -which provides for positive infinity and negative infinity as floating point -values. It also provides for a class of values called NaN or -``not-a-number''; numerical functions return such values in cases where -there is no correct answer. For example, @code{(/ 0.0 0.0)} returns a -NaN. For practical purposes, there's no significant difference between -different NaN values in Emacs Lisp, and there's no rule for precisely -which NaN value should be used in a particular case, so Emacs Lisp -doesn't try to distinguish them (but it does report the sign, if you -print it). Here are the read syntaxes for these special floating -point values: + The @acronym{IEEE} floating point standard supports positive +infinity and negative infinity as floating point values. It also +provides for a class of values called NaN or ``not-a-number''; +numerical functions return such values in cases where there is no +correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN +values can also carry a sign, but for practical purposes there's no +significant difference between different NaN values in Emacs Lisp.) +Here are the read syntaxes for these special floating point values: @table @asis @item positive infinity @@ -206,16 +209,37 @@ point values: @samp{0.0e+NaN} or @samp{-0.0e+NaN}. @end table - To test whether a floating point value is a NaN, compare it with -itself using @code{=}. That returns @code{nil} for a NaN, and -@code{t} for any other floating point value. +@defun isnan number +This predicate tests whether its argument is NaN, and returns @code{t} +if so, @code{nil} otherwise. The argument must be a number. +@end defun + + The following functions are specialized for handling floating point +numbers: + +@defun frexp x +This function returns a cons cell @code{(@var{sig} . @var{exp})}, +where @var{sig} and @var{exp} are respectively the significand and +exponent of the floating point number @var{x}: + +@smallexample +@var{x} = @var{sig} * 2^@var{exp} +@end smallexample + +@var{sig} is a floating point number between 0.5 (inclusive) and 1.0 +(exclusive). If @var{x} is zero, the return value is @code{(0 . 0)}. +@end defun - The value @code{-0.0} is distinguishable from ordinary zero in -@acronym{IEEE} floating point, but Emacs Lisp @code{equal} and -@code{=} consider them equal values. +@defun ldexp sig &optional exp +This function returns a floating point number corresponding to the +significand @var{sig} and exponent @var{exp}. +@end defun - You can use @code{logb} to extract the binary exponent of a floating -point number (or estimate the logarithm of an integer): +@defun copysign x1 x2 +This function copies the sign of @var{x2} to the value of @var{x1}, +and returns the result. @var{x1} and @var{x2} must be floating point +numbers. +@end defun @defun logb number This function returns the binary exponent of @var{number}. More @@ -230,14 +254,6 @@ down to an integer. @end example @end defun -@defvar float-e -The mathematical constant @math{e} (2.71828@dots{}). -@end defvar - -@defvar float-pi -The mathematical constant @math{pi} (3.14159@dots{}). -@end defvar - @node Predicates on Numbers @section Type Predicates for Numbers @cindex predicates for numbers @@ -1122,35 +1138,15 @@ angle in radians between the vector @code{[@var{x}, @var{y}]} and the @end defun @defun exp arg -This is the exponential function; it returns -@tex -@math{e} -@end tex -@ifnottex -@i{e} -@end ifnottex -to the power @var{arg}. -@tex -@math{e} -@end tex -@ifnottex -@i{e} -@end ifnottex -is a fundamental mathematical constant also called the base of natural -logarithms. +This is the exponential function; it returns @math{e} to the power +@var{arg}. @end defun @defun log arg &optional base -This function returns the logarithm of @var{arg}, with base @var{base}. -If you don't specify @var{base}, the base -@tex -@math{e} -@end tex -@ifnottex -@i{e} -@end ifnottex -is used. If @var{arg} is negative, it signals a @code{domain-error} -error. +This function returns the logarithm of @var{arg}, with base +@var{base}. If you don't specify @var{base}, the natural base +@math{e} is used. If @var{arg} is negative, it signals a +@code{domain-error} error. @end defun @ignore @@ -1185,6 +1181,17 @@ This returns the square root of @var{arg}. If @var{arg} is negative, it signals a @code{domain-error} error. @end defun +In addition, Emacs defines the following common mathematical +constants: + +@defvar float-e +The mathematical constant @math{e} (2.71828@dots{}). +@end defvar + +@defvar float-pi +The mathematical constant @math{pi} (3.14159@dots{}). +@end defvar + @node Random Numbers @section Random Numbers @cindex random numbers @@ -1218,7 +1225,6 @@ nonnegative and less than @var{limit}. If @var{limit} is @code{t}, it means to choose a new seed based on the current time of day and on Emacs's process @acronym{ID} number. -@c "Emacs'" is incorrect usage! On some machines, any integer representable in Lisp may be the result of @code{random}. On other machines, the result can never be larger diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 3fb676edcd4..87bcc20daba 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -427,10 +427,10 @@ codes for these non-@acronym{ASCII} control characters include the @ifnottex 2**26 @end ifnottex -bit as well as the code for the corresponding non-control -character. Ordinary terminals have no way of generating non-@acronym{ASCII} -control characters, but you can generate them straightforwardly using X -and other window systems. +bit as well as the code for the corresponding non-control character. +Ordinary text terminals have no way of generating non-@acronym{ASCII} +control characters, but you can generate them straightforwardly using +X and other window systems. For historical reasons, Emacs treats the @key{DEL} character as the control equivalent of @kbd{?}: @@ -501,10 +501,10 @@ character is upper case or lower case. Emacs uses the @end ifnottex bit to indicate that the shift key was used in typing a control character. This distinction is possible only when you use X terminals -or other special terminals; ordinary terminals do not report the -distinction to the computer in any way. The Lisp syntax for -the shift bit is @samp{\S-}; thus, @samp{?\C-\S-o} or @samp{?\C-\S-O} -represents the shifted-control-o character. +or other special terminals; ordinary text terminals do not report the +distinction. The Lisp syntax for the shift bit is @samp{\S-}; thus, +@samp{?\C-\S-o} or @samp{?\C-\S-O} represents the shifted-control-o +character. @cindex hyper characters @cindex super characters @@ -541,9 +541,9 @@ intended. But you can use one symbol in all of these ways, independently. A symbol whose name starts with a colon (@samp{:}) is called a -@dfn{keyword symbol}. These symbols automatically act as constants, and -are normally used only by comparing an unknown symbol with a few -specific alternatives. +@dfn{keyword symbol}. These symbols automatically act as constants, +and are normally used only by comparing an unknown symbol with a few +specific alternatives. @xref{Constant Variables}. @cindex @samp{\} in symbols @cindex backslash in symbols @@ -617,26 +617,28 @@ all symbols; @pxref{Creating Symbols}.) @subsection Sequence Types A @dfn{sequence} is a Lisp object that represents an ordered set of -elements. There are two kinds of sequence in Emacs Lisp, lists and -arrays. Thus, an object of type list or of type array is also -considered a sequence. +elements. There are two kinds of sequence in Emacs Lisp: @dfn{lists} +and @dfn{arrays}. - Arrays are further subdivided into strings, vectors, char-tables and -bool-vectors. Vectors can hold elements of any type, but string -elements must be characters, and bool-vector elements must be @code{t} -or @code{nil}. Char-tables are like vectors except that they are -indexed by any valid character code. The characters in a string can -have text properties like characters in a buffer (@pxref{Text -Properties}), but vectors do not support text properties, even when -their elements happen to be characters. + Lists are the most commonly-used sequences. A list can hold +elements of any type, and its length can be easily changed by adding +or removing elements. See the next subsection for more about lists. - Lists, strings and the other array types are different, but they have -important similarities. For example, all have a length @var{l}, and all -have elements which can be indexed from zero to @var{l} minus one. -Several functions, called sequence functions, accept any kind of -sequence. For example, the function @code{elt} can be used to extract -an element of a sequence, given its index. @xref{Sequences Arrays -Vectors}. + Arrays are fixed-length sequences. They are further subdivided into +strings, vectors, char-tables and bool-vectors. Vectors can hold +elements of any type, whereas string elements must be characters, and +bool-vector elements must be @code{t} or @code{nil}. Char-tables are +like vectors except that they are indexed by any valid character code. +The characters in a string can have text properties like characters in +a buffer (@pxref{Text Properties}), but vectors do not support text +properties, even when their elements happen to be characters. + + Lists, strings and the other array types also share important +similarities. For example, all have a length @var{l}, and all have +elements which can be indexed from zero to @var{l} minus one. Several +functions, called sequence functions, accept any kind of sequence. +For example, the function @code{length} reports the length of any kind +of sequence. @xref{Sequences Arrays Vectors}. It is generally impossible to read the same sequence twice, since sequences are always created anew upon reading. If you read the read @@ -650,24 +652,27 @@ same object, @code{nil}. @cindex decrement field of register @cindex pointers - A @dfn{cons cell} is an object that consists of two slots, called the -@sc{car} slot and the @sc{cdr} slot. Each slot can @dfn{hold} or -@dfn{refer to} any Lisp object. We also say that ``the @sc{car} of -this cons cell is'' whatever object its @sc{car} slot currently holds, -and likewise for the @sc{cdr}. - -@quotation -A note to C programmers: in Lisp, we do not distinguish between -``holding'' a value and ``pointing to'' the value, because pointers in -Lisp are implicit. -@end quotation + A @dfn{cons cell} is an object that consists of two slots, called +the @sc{car} slot and the @sc{cdr} slot. Each slot can @dfn{hold} any +Lisp object. We also say that ``the @sc{car} of this cons cell is'' +whatever object its @sc{car} slot currently holds, and likewise for +the @sc{cdr}. +@cindex list structure A @dfn{list} is a series of cons cells, linked together so that the @sc{cdr} slot of each cons cell holds either the next cons cell or the empty list. The empty list is actually the symbol @code{nil}. -@xref{Lists}, for functions that work on lists. Because most cons -cells are used as part of lists, the phrase @dfn{list structure} has -come to refer to any structure made out of cons cells. +@xref{Lists}, for details. Because most cons cells are used as part +of lists, we refer to any structure made out of cons cells as a +@dfn{list structure}. + +@cindex linked list +@quotation +A note to C programmers: a Lisp list thus works as a @dfn{linked list} +built up of cons cells. Because pointers in Lisp are implicit, we do +not distinguish between a cons cell slot ``holding'' a value versus +``pointing to'' the value. +@end quotation @cindex atoms Because cons cells are so central to Lisp, we also have a word for @@ -1025,40 +1030,40 @@ but the newline is ignored if escaped." @node Non-ASCII in Strings @subsubsection Non-@acronym{ASCII} Characters in Strings - You can include a non-@acronym{ASCII} international character in a string -constant by writing it literally. There are two text representations -for non-@acronym{ASCII} characters in Emacs strings (and in buffers): unibyte -and multibyte. If the string constant is read from a multibyte source, -such as a multibyte buffer or string, or a file that would be visited as -multibyte, then the character is read as a multibyte character, and that -makes the string multibyte. If the string constant is read from a -unibyte source, then the character is read as unibyte and that makes the -string unibyte. + You can include a non-@acronym{ASCII} international character in a +string constant by writing it literally. There are two text +representations for non-@acronym{ASCII} characters in Emacs strings +(and in buffers): unibyte and multibyte (@pxref{Text +Representations}). If the string constant is read from a multibyte +source, such as a multibyte buffer or string, or a file that would be +visited as multibyte, then Emacs reads the non-@acronym{ASCII} +character as a multibyte character and automatically makes the string +a multibyte string. If the string constant is read from a unibyte +source, then Emacs reads the non-@acronym{ASCII} character as unibyte, +and makes the string unibyte. - You can also represent a multibyte non-@acronym{ASCII} character with its -character code: use a hex escape, @samp{\x@var{nnnnnnn}}, with as many -digits as necessary. (Multibyte non-@acronym{ASCII} character codes are all -greater than 256.) Any character which is not a valid hex digit -terminates this construct. If the next character in the string could be -interpreted as a hex digit, write @w{@samp{\ }} (backslash and space) to -terminate the hex escape---for example, @w{@samp{\xe0\ }} represents -one character, @samp{a} with grave accent. @w{@samp{\ }} in a string -constant is just like backslash-newline; it does not contribute any -character to the string, but it does terminate the preceding hex escape. + Instead of writing a non-@acronym{ASCII} character literally into a +multibyte string, you can write it as its character code using a hex +escape, @samp{\x@var{nnnnnnn}}, with as many digits as necessary. +(Multibyte non-@acronym{ASCII} character codes are all greater than +256.) You can also specify a character in a multibyte string using +the @samp{\u} or @samp{\U} Unicode escape syntax (@pxref{General +Escape Syntax}). In either case, any character which is not a valid +hex digit terminates the construct. If the next character in the +string could be interpreted as a hex digit, write @w{@samp{\ }} +(backslash and space) to terminate the hex escape---for example, +@w{@samp{\xe0\ }} represents one character, @samp{a} with grave +accent. @w{@samp{\ }} in a string constant is just like +backslash-newline; it does not contribute any character to the string, +but it does terminate the preceding hex escape. Using any hex escape +in a string (even for an @acronym{ASCII} character) automatically +forces the string to be multibyte. You can represent a unibyte non-@acronym{ASCII} character with its character code, which must be in the range from 128 (0200 octal) to 255 (0377 octal). If you write all such character codes in octal and the string contains no other characters forcing it to be multibyte, -this produces a unibyte string. However, using any hex escape in a -string (even for an @acronym{ASCII} character) forces the string to be -multibyte. - - You can also specify characters in a string by their numeric values -in Unicode, using @samp{\u} and @samp{\U} (@pxref{Character Type}). - - @xref{Text Representations}, for more information about the two -text representations. +this produces a unibyte string. @node Nonprinting Characters @subsubsection Nonprinting Characters in Strings @@ -1922,23 +1927,24 @@ This function returns a symbol naming the primitive type of @section Equality Predicates @cindex equality - Here we describe functions that test for equality between any two -objects. Other functions test equality of contents between objects of specific -types, e.g., strings. For these predicates, see the appropriate chapter -describing the data type. + Here we describe functions that test for equality between two +objects. Other functions test equality of contents between objects of +specific types, e.g.@: strings. For these predicates, see the +appropriate chapter describing the data type. @defun eq object1 object2 This function returns @code{t} if @var{object1} and @var{object2} are -the same object, @code{nil} otherwise. +the same object, and @code{nil} otherwise. -@code{eq} returns @code{t} if @var{object1} and @var{object2} are -integers with the same value. Also, since symbol names are normally -unique, if the arguments are symbols with the same name, they are -@code{eq}. For other types (e.g., lists, vectors, strings), two -arguments with the same contents or elements are not necessarily -@code{eq} to each other: they are @code{eq} only if they are the same -object, meaning that a change in the contents of one will be reflected -by the same change in the contents of the other. +If @var{object1} and @var{object2} are integers with the same value, +they are considered to be the same object (i.e.@: @code{eq} returns +@code{t}). If @var{object1} and @var{object2} are symbols with the +same name, they are normally the same object---but see @ref{Creating +Symbols} for exceptions. For other types (e.g.@: lists, vectors, +strings), two arguments with the same contents or elements are not +necessarily @code{eq} to each other: they are @code{eq} only if they +are the same object, meaning that a change in the contents of one will +be reflected by the same change in the contents of the other. @example @group @@ -1988,6 +1994,7 @@ by the same change in the contents of the other. @end group @end example +@noindent The @code{make-symbol} function returns an uninterned symbol, distinct from the symbol that is used if you write the name in a Lisp expression. Distinct symbols with the same name are not @code{eq}. @xref{Creating @@ -2003,11 +2010,11 @@ Symbols}. @defun equal object1 object2 This function returns @code{t} if @var{object1} and @var{object2} have -equal components, @code{nil} otherwise. Whereas @code{eq} tests if its -arguments are the same object, @code{equal} looks inside nonidentical -arguments to see if their elements or contents are the same. So, if two -objects are @code{eq}, they are @code{equal}, but the converse is not -always true. +equal components, and @code{nil} otherwise. Whereas @code{eq} tests +if its arguments are the same object, @code{equal} looks inside +nonidentical arguments to see if their elements or contents are the +same. So, if two objects are @code{eq}, they are @code{equal}, but +the converse is not always true. @example @group @@ -2059,13 +2066,13 @@ always true. @end example Comparison of strings is case-sensitive, but does not take account of -text properties---it compares only the characters in the strings. Use -@code{equal-including-properties} to also compare text properties. For -technical reasons, a unibyte string and a multibyte string are -@code{equal} if and only if they contain the same sequence of -character codes and all these codes are either in the range 0 through -127 (@acronym{ASCII}) or 160 through 255 (@code{eight-bit-graphic}). -(@pxref{Text Representations}). +text properties---it compares only the characters in the strings. +@xref{Text Properties}. Use @code{equal-including-properties} to also +compare text properties. For technical reasons, a unibyte string and +a multibyte string are @code{equal} if and only if they contain the +same sequence of character codes and all these codes are either in the +range 0 through 127 (@acronym{ASCII}) or 160 through 255 +(@code{eight-bit-graphic}). (@pxref{Text Representations}). @example @group diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 0ea32f99e12..94f1bf666d2 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -8,10 +8,10 @@ @chapter Sequences, Arrays, and Vectors @cindex sequence - Recall that the @dfn{sequence} type is the union of two other Lisp -types: lists and arrays. In other words, any list is a sequence, and -any array is a sequence. The common property that all sequences have is -that each is an ordered collection of elements. + The @dfn{sequence} type is the union of two other Lisp types: lists +and arrays. In other words, any list is a sequence, and any array is +a sequence. The common property that all sequences have is that each +is an ordered collection of elements. An @dfn{array} is a fixed-length object with a slot for each of its elements. All the elements are accessible in constant time. The four @@ -54,19 +54,17 @@ But it is possible to add elements to the list, or remove elements. * Vector Functions:: Functions specifically for vectors. * Char-Tables:: How to work with char-tables. * Bool-Vectors:: How to work with bool-vectors. +* Rings:: Managing a fixed-size ring of objects. @end menu @node Sequence Functions @section Sequences - In Emacs Lisp, a @dfn{sequence} is either a list or an array. The -common property of all sequences is that they are ordered collections of -elements. This section describes functions that accept any kind of -sequence. + This section describes functions that accept any kind of sequence. @defun sequencep object -Returns @code{t} if @var{object} is a list, vector, string, -bool-vector, or char-table, @code{nil} otherwise. +This function returns @code{t} if @var{object} is a list, vector, +string, bool-vector, or char-table, @code{nil} otherwise. @end defun @defun length sequence @@ -149,8 +147,9 @@ This function generalizes @code{aref} (@pxref{Array Functions}) and @defun copy-sequence sequence @cindex copying sequences -Returns a copy of @var{sequence}. The copy is the same type of object -as the original sequence, and it has the same elements in the same order. +This function returns a copy of @var{sequence}. The copy is the same +type of object as the original sequence, and it has the same elements +in the same order. Storing a new element into the copy does not affect the original @var{sequence}, and vice versa. However, the elements of the new @@ -394,8 +393,8 @@ symbol-lookup tables (@pxref{Creating Symbols}), as part of the representation of a byte-compiled function (@pxref{Byte Compilation}), and more. - In Emacs Lisp, the indices of the elements of a vector start from zero -and count up from there. + Like other arrays, vectors use zero-origin indexing: the first +element has index 0. Vectors are printed with square brackets surrounding the elements. Thus, a vector whose elements are the symbols @code{a}, @code{b} and @@ -728,3 +727,96 @@ bv @noindent These results make sense because the binary codes for control-_ and control-W are 11111 and 10111, respectively. + +@node Rings +@section Managing a Fixed-Size Ring of Objects + +@cindex ring data structure + A @dfn{ring} is a fixed-size data structure that supports insertion, +deletion, rotation, and modulo-indexed reference and traversal. An +efficient ring data structure is implemented by the @code{ring} +package. It provides the functions listed in this section. + + Note that several ``rings'' in Emacs, like the kill ring and the +mark ring, are actually implemented as simple lists, @emph{not} using +the @code{ring} package; thus the following functions won't work on +them. + +@defun make-ring size +This returns a new ring capable of holding @var{size} objects. +@var{size} should be an integer. +@end defun + +@defun ring-p object +This returns @code{t} if @var{object} is a ring, @code{nil} otherwise. +@end defun + +@defun ring-size ring +This returns the maximum capacity of the @var{ring}. +@end defun + +@defun ring-length ring +This returns the number of objects that @var{ring} currently contains. +The value will never exceed that returned by @code{ring-size}. +@end defun + +@defun ring-elements ring +This returns a list of the objects in @var{ring}, in order, newest first. +@end defun + +@defun ring-copy ring +This returns a new ring which is a copy of @var{ring}. +The new ring contains the same (@code{eq}) objects as @var{ring}. +@end defun + +@defun ring-empty-p ring +This returns @code{t} if @var{ring} is empty, @code{nil} otherwise. +@end defun + + The newest element in the ring always has index 0. Higher indices +correspond to older elements. Indices are computed modulo the ring +length. Index @minus{}1 corresponds to the oldest element, @minus{}2 +to the next-oldest, and so forth. + +@defun ring-ref ring index +This returns the object in @var{ring} found at index @var{index}. +@var{index} may be negative or greater than the ring length. If +@var{ring} is empty, @code{ring-ref} signals an error. +@end defun + +@defun ring-insert ring object +This inserts @var{object} into @var{ring}, making it the newest +element, and returns @var{object}. + +If the ring is full, insertion removes the oldest element to +make room for the new element. +@end defun + +@defun ring-remove ring &optional index +Remove an object from @var{ring}, and return that object. The +argument @var{index} specifies which item to remove; if it is +@code{nil}, that means to remove the oldest item. If @var{ring} is +empty, @code{ring-remove} signals an error. +@end defun + +@defun ring-insert-at-beginning ring object +This inserts @var{object} into @var{ring}, treating it as the oldest +element. The return value is not significant. + +If the ring is full, this function removes the newest element to make +room for the inserted element. +@end defun + +@cindex fifo data structure + If you are careful not to exceed the ring size, you can +use the ring as a first-in-first-out queue. For example: + +@lisp +(let ((fifo (make-ring 5))) + (mapc (lambda (obj) (ring-insert fifo obj)) + '(0 one "two")) + (list (ring-remove fifo) t + (ring-remove fifo) t + (ring-remove fifo))) + @result{} (0 t one t "two") +@end lisp diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 49199d3e32f..bbb75f1474d 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -410,8 +410,13 @@ in case if @code{case-fold-search} is non-@code{nil}. @defun string= string1 string2 This function returns @code{t} if the characters of the two strings match exactly. Symbols are also allowed as arguments, in which case -their print names are used. -Case is always significant, regardless of @code{case-fold-search}. +the symbol names are used. Case is always significant, regardless of +@code{case-fold-search}. + +This function is equivalent to @code{equal} for comparing two strings +(@pxref{Equality Predicates}). In particular, the text properties of +the two strings are ignored. But if either argument is not a string +or symbol, an error is signaled. @example (string= "abc" "abc") @@ -422,10 +427,6 @@ Case is always significant, regardless of @code{case-fold-search}. @result{} nil @end example -The function @code{string=} ignores the text properties of the two -strings. When @code{equal} (@pxref{Equality Predicates}) compares two -strings, it uses @code{string=}. - For technical reasons, a unibyte and a multibyte string are @code{equal} if and only if they contain the same sequence of character codes and all these codes are either in the range 0 through diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi index 866a63c4cd9..0ee22b905b6 100644 --- a/doc/lispref/symbols.texi +++ b/doc/lispref/symbols.texi @@ -41,62 +41,58 @@ references another object: @table @asis @item Print name @cindex print name cell -The @dfn{print name cell} holds a string that names the symbol for -reading and printing. See @code{symbol-name} in @ref{Creating Symbols}. +The symbol's name. @item Value @cindex value cell -The @dfn{value cell} holds the current value of the symbol as a -variable. When a symbol is used as a form, the value of the form is the -contents of the symbol's value cell. See @code{symbol-value} in -@ref{Accessing Variables}. +The symbol's current value as a variable. @item Function @cindex function cell -The @dfn{function cell} holds the function definition of the symbol. -When a symbol is used as a function, its function definition is used in -its place. This cell is also used to make a symbol stand for a keymap -or a keyboard macro, for editor command execution. Because each symbol -has separate value and function cells, variables names and function names do -not conflict. See @code{symbol-function} in @ref{Function Cells}. +The symbol's function definition. It can also hold a symbol, a +keymap, or a keyboard macro. @item Property list @cindex property list cell -The @dfn{property list cell} holds the property list of the symbol. See -@code{symbol-plist} in @ref{Property Lists}. +The symbol's property list. @end table - The print name cell always holds a string, and cannot be changed. The -other three cells can be set individually to any specified Lisp object. +@noindent +The print name cell always holds a string, and cannot be changed. +Each of the other three cells can be set to any Lisp object. - The print name cell holds the string that is the name of the symbol. -Since symbols are represented textually by their names, it is important -not to have two symbols with the same name. The Lisp reader ensures -this: every time it reads a symbol, it looks for an existing symbol with -the specified name before it creates a new one. (In GNU Emacs Lisp, -this lookup uses a hashing algorithm and an obarray; see @ref{Creating -Symbols}.) + The print name cell holds the string that is the name of a symbol. +Since symbols are represented textually by their names, it is +important not to have two symbols with the same name. The Lisp reader +ensures this: every time it reads a symbol, it looks for an existing +symbol with the specified name before it creates a new one. To get a +symbol's name, use the function @code{symbol-name} (@pxref{Creating +Symbols}). - The value cell holds the symbol's value as a variable -(@pxref{Variables}). That is what you get if you evaluate the symbol as -a Lisp expression (@pxref{Evaluation}). Any Lisp object is a legitimate -value. Certain symbols have values that cannot be changed; these -include @code{nil} and @code{t}, and any symbol whose name starts with -@samp{:} (those are called @dfn{keywords}). @xref{Constant Variables}. + The value cell holds a symbol's value as a variable, which is what +you get if the symbol itself is evaluated as a Lisp expression. +@xref{Variables}, for details about how values are set and retrieved, +including complications such as @dfn{local bindings} and @dfn{scoping +rules}. Most symbols can have any Lisp object as a value, but certain +special symbols have values that cannot be changed; these include +@code{nil} and @code{t}, and any symbol whose name starts with +@samp{:} (those are called @dfn{keywords}). @xref{Constant +Variables}. - We often refer to ``the function @code{foo}'' when we really mean -the function stored in the function cell of the symbol @code{foo}. We -make the distinction explicit only when necessary. In normal -usage, the function cell usually contains a function -(@pxref{Functions}) or a macro (@pxref{Macros}), as that is what the -Lisp interpreter expects to see there (@pxref{Evaluation}). Keyboard -macros (@pxref{Keyboard Macros}), keymaps (@pxref{Keymaps}) and -autoload objects (@pxref{Autoloading}) are also sometimes stored in -the function cells of symbols. + The function cell holds a symbol's function definition. Often, we +refer to ``the function @code{foo}'' when we really mean the function +stored in the function cell of @code{foo}; we make the distinction +explicit only when necessary. Typically, the function cell is used to +hold a function (@pxref{Functions}) or a macro (@pxref{Macros}). +However, it can also be used to hold a symbol (@pxref{Function +Indirection}), keyboard macro (@pxref{Keyboard Macros}), keymap +(@pxref{Keymaps}), or autoload object (@pxref{Autoloading}). To get +the contents of a symbol's function cell, use the function +@code{symbol-function} (@pxref{Function Cells}). The property list cell normally should hold a correctly formatted -property list (@pxref{Property Lists}), as a number of functions expect -to see a property list there. +property list. To get a symbol's function cell, use the function +@code{symbol-plist}. @xref{Property Lists}. The function cell or the value cell may be @dfn{void}, which means that the cell does not reference any object. (This is not the same @@ -104,57 +100,43 @@ thing as holding the symbol @code{void}, nor the same as holding the symbol @code{nil}.) Examining a function or value cell that is void results in an error, such as @samp{Symbol's value as variable is void}. - The four functions @code{symbol-name}, @code{symbol-value}, -@code{symbol-plist}, and @code{symbol-function} return the contents of -the four cells of a symbol. Here as an example we show the contents of -the four cells of the symbol @code{buffer-file-name}: + Because each symbol has separate value and function cells, variables +names and function names do not conflict. For example, the symbol +@code{buffer-file-name} has a value (the name of the file being +visited in the current buffer) as well as a function definition (a +primitive function that returns the name of the file): @example -(symbol-name 'buffer-file-name) - @result{} "buffer-file-name" -(symbol-value 'buffer-file-name) +buffer-file-name @result{} "/gnu/elisp/symbols.texi" (symbol-function 'buffer-file-name) @result{} #<subr buffer-file-name> -(symbol-plist 'buffer-file-name) - @result{} (variable-documentation 29529) @end example -@noindent -Because this symbol is the variable which holds the name of the file -being visited in the current buffer, the value cell contents we see are -the name of the source file of this chapter of the Emacs Lisp Manual. -The property list cell contains the list @code{(variable-documentation -29529)} which tells the documentation functions where to find the -documentation string for the variable @code{buffer-file-name} in the -@file{DOC-@var{version}} file. (29529 is the offset from the beginning -of the @file{DOC-@var{version}} file to where that documentation string -begins---see @ref{Documentation Basics}.) The function cell contains -the function for returning the name of the file. -@code{buffer-file-name} names a primitive function, which has no read -syntax and prints in hash notation (@pxref{Primitive Function Type}). A -symbol naming a function written in Lisp would have a lambda expression -(or a byte-code object) in this cell. - @node Definitions, Creating Symbols, Symbol Components, Symbols @section Defining Symbols @cindex definitions of symbols - A @dfn{definition} in Lisp is a special form that announces your -intention to use a certain symbol in a particular way. In Emacs Lisp, -you can define a symbol as a variable, or define it as a function (or -macro), or both independently. - - A definition construct typically specifies a value or meaning for the -symbol for one kind of use, plus documentation for its meaning when used -in this way. Thus, when you define a symbol as a variable, you can -supply an initial value for the variable, plus documentation for the -variable. + A @dfn{definition} is a special kind of Lisp expression that +announces your intention to use a symbol in a particular way. It +typically specifies a value or meaning for the symbol for one kind of +use, plus documentation for its meaning when used in this way. Thus, +when you define a symbol as a variable, you can supply an initial +value for the variable, plus documentation for the variable. @code{defvar} and @code{defconst} are special forms that define a -symbol as a global variable. They are documented in detail in -@ref{Defining Variables}. For defining user option variables that can -be customized, use @code{defcustom} (@pxref{Customization}). +symbol as a @dfn{global variable}---a variable that can be accessed at +any point in a Lisp program. @xref{Variables}, for details about +variables. To define a customizable variable, use the +@code{defcustom} macro, which also calls @code{defvar} as a subroutine +(@pxref{Customization}). + + In principle, you can assign a variable value to any symbol with +@code{setq}, whether not it has first been defined as a variable. +However, you ought to write a variable definition for each global +variable that you want to use; otherwise, your Lisp program may not +act correctly if it is evaluated with lexical scoping enabled +(@pxref{Variable Scoping}). @code{defun} defines a symbol as a function, creating a lambda expression and storing it in the function cell of the symbol. This @@ -171,15 +153,14 @@ both macro and function definitions are kept in the function cell, and that cell can hold only one Lisp object at any given time. @xref{Macros}. - In Emacs Lisp, a definition is not required in order to use a symbol -as a variable or function. Thus, you can make a symbol a global -variable with @code{setq}, whether you define it first or not. The real -purpose of definitions is to guide programmers and programming tools. -They inform programmers who read the code that certain symbols are -@emph{intended} to be used as variables, or as functions. In addition, -utilities such as @file{etags} and @file{make-docfile} recognize -definitions, and add appropriate information to tag tables and the -@file{DOC-@var{version}} file. @xref{Accessing Documentation}. + As previously noted, Emacs Lisp allows the same symbol to be defined +both as a variable (e.g.@: with @code{defvar}) and as a function or +macro (e.g.@: with @code{defun}). Such definitions do not conflict. + + These definition also act as guides for programming tools. For +example, the @kbd{C-h f} and @kbd{C-h v} commands create help buffers +containing links to the relevant variable, function, or macro +definitions. @xref{Name Help,,, emacs, The GNU Emacs Manual}. @node Creating Symbols, Property Lists, Definitions, Symbols @section Creating and Interning Symbols @@ -254,8 +235,8 @@ not work---only @code{intern} can enter a symbol in an obarray properly. @cindex CL note---symbol in obarrays @quotation -@b{Common Lisp note:} In Common Lisp, a single symbol may be interned in -several obarrays. +@b{Common Lisp note:} Unlike Common Lisp, Emacs Lisp does not provide +for interning a single symbol in several obarrays. @end quotation Most of the functions below take a name and sometimes an obarray as @@ -448,12 +429,13 @@ must be distinct. Property lists are better than association lists for attaching information to various Lisp function names or variables. If your -program keeps all of its associations in one association list, it will +program keeps all such information in one association list, it will typically need to search that entire list each time it checks for an -association. This could be slow. By contrast, if you keep the same -information in the property lists of the function names or variables -themselves, each search will scan only the length of one property list, -which is usually short. This is why the documentation for a variable is +association for a particular Lisp function name or variable, which +could be slow. By contrast, if you keep the same information in the +property lists of the function names or variables themselves, each +search will scan only the length of one property list, which is +usually short. This is why the documentation for a variable is recorded in a property named @code{variable-documentation}. The byte compiler likewise uses properties to record those functions needing special treatment. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index b0a6795021b..a8f75f5a160 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1660,6 +1660,13 @@ Query (once) about all the variables. @end table @end defopt +@defvar inhibit-local-variables-regexps +This is a list of regular expressions. If a file has a name +matching an element of this list, then it is not scanned for +any form of file-local variable. For examples of why you might want +to use this, @pxref{Auto Major Mode}. +@end defvar + @defun hack-local-variables &optional mode-only This function parses, and binds or evaluates as appropriate, any local variables specified by the contents of the current buffer. The variable diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 1bff30e45e1..a0f8b61ddfe 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3104,9 +3104,9 @@ window configuration; see @ref{Frame Configurations}. @defun current-window-configuration &optional frame This function returns a new object representing @var{frame}'s current window configuration. The default for @var{frame} is the selected -frame. This function saves copies of window parameters listed by the -variable @code{window-persistent-parameters}, see @ref{Window -Parameters} for details. +frame. The variable @code{window-persistent-parameters} specifies +whether and which window parameters are saved by this function, see +@ref{Window Parameters} for details. @end defun @defun set-window-configuration configuration @@ -3214,27 +3214,25 @@ to clone the state of a frame into an arbitrary live window (@code{set-window-configuration} effectively clones the windows of a frame into the root window of that very frame only). -@defun window-state-get &optional window ignore +@defun window-state-get &optional window writable This function returns the state of @var{window} as a Lisp object. The argument @var{window} can be any window and defaults to the root window of the selected frame. -If the optional argument @var{ignore} is non-@code{nil}, this means to +If the optional argument @var{writable} is non-@code{nil}, this means to not use markers for sampling positions like @code{window-point} or @code{window-start}. This argument should be non-@code{nil} when the -state shall be written on disk and read back in another session. +state shall be written to disk and read back in another session. -The variable @code{window-persistent-parameters} specifies whether and -which window parameters are saved by this function, see @ref{Window -Parameters} for details. +Together, the argument @var{writable} and the variable +@code{window-persistent-parameters} specify which window parameters are +saved by this function, see @ref{Window Parameters} for details. @end defun -The value returned by @code{window-state-get} can be converted, using -one of the functions defined by Desktop Save Mode (@pxref{Desktop Save -Mode}), to an object that can be written to a file. Such objects can be -read back and converted to a Lisp object representing the state of the -window. That Lisp object can be used as argument for the following -function in order to restore the state window in another window. +The value returned by @code{window-state-get} can be used in the same +session to make a clone of a window in another window. It can be also +written to disk and read back in another session. In either case, use +the function described next to restore the state of the window. @defun window-state-put state &optional window ignore This function puts the window state @var{state} into @var{window}. The @@ -3281,10 +3279,10 @@ states of windows (@pxref{Window Configurations}) do not care about window parameters. This means, that when you change the value of a parameter within the body of a @code{save-window-excursion}, the previous value is not restored upon exit of that macro. It also means -that when you clone via @code{window-state-put} a window state saved -earlier by @code{window-state-get}, the cloned windows come up with no -parameters at all. The following variable allows to override the -standard behavior. +that when you restore via @code{window-state-put} a window state saved +earlier by @code{window-state-get}, all cloned windows have their +parameters reset to @code{nil}. The following variable allows to +override the standard behavior. @defvar window-persistent-parameters This variable is an alist specifying which parameters get saved by @@ -3293,32 +3291,25 @@ subsequently restored by @code{set-window-configuration} and @code{window-state-put}, see @ref{Window Configurations}. The @sc{car} of each entry of this alist is the symbol specifying the -parameter. The @sc{cdr} must be one of the following: +parameter. The @sc{cdr} should be one of the following: @table @asis -@item @code{state} -This value means the parameter is saved by @code{window-state-get} -provided its @var{ignore} argument is @code{nil}. The function -@code{current-window-configuration} does not save this parameter. - @item @code{nil} +This value means the parameter is neither saved by +@code{window-state-get} nor by @code{current-window-configuration}. + +@item @code{t} This value specifies that the parameter is saved by -@code{current-window-configuration} and, provided its @var{ignore} +@code{current-window-configuration} and, provided its @var{writable} argument is @code{nil}, by @code{window-state-get}. -@item @code{t} +@item @code{writable} This means that the parameter is saved unconditionally by both @code{current-window-configuration} and @code{window-state-get}. This value should not be used for parameters whose values do not have a read syntax. Otherwise, invoking @code{window-state-put} in another session may fail with an @code{invalid-read-syntax} error. @end table - -Parameters that have been saved are restored to their previous values by -@code{set-window-configuration} respectively are installed by -@code{window-state-put}. Parameters that have not been saved are left -alone by @code{set-window-configuration} respectively are not installed -by @code{window-state-put}. @end defvar Some functions, notably @code{delete-window}, diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index adb5bbbd669..72ac8b85fc3 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,11 @@ +2012-01-23 Glenn Morris <rgm@gnu.org> + + * pcl-cvs.texi (About PCL-CVS): Refer to vc-dir rather than vc-dired. + +2012-01-19 Eric Hanchrow <eric.hanchrow@gmail.com> + + * tramp.texi (File): Tweak wording for the `scpc' option. + 2012-01-06 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.texi (Group Parameters): Really note precedence. diff --git a/doc/misc/pcl-cvs.texi b/doc/misc/pcl-cvs.texi index 32d2114f5a0..92c309f5e98 100644 --- a/doc/misc/pcl-cvs.texi +++ b/doc/misc/pcl-cvs.texi @@ -6,8 +6,7 @@ @c %**end of header @copying -Copyright @copyright{} 1991-2012 -Free Software Foundation, Inc. +Copyright @copyright{} 1991-2012 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -136,10 +135,9 @@ Customization PCL-CVS is a front-end to CVS versions 1.9 and later. It concisely shows the present status of a checked out module in an Emacs buffer and provides single-key access to the most frequently used CVS -commands. -For Emacs users accustomed to VC, PCL-CVS can be thought of as a replacement -for VC-dired (@pxref{VC Directory Mode, , , emacs, The GNU -Emacs Manual}) specifically designed for CVS. +commands. Note that the @code{vc-dir} command (@pxref{VC Directory +Mode, , , emacs, The GNU Emacs Manual}) provides similar +functionality, but for several version control systems, including CVS. PCL-CVS was originally written many years ago by Per Cederqvist who proudly maintained it until January 1996, at which point he released the diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 41ba6689f13..7fbd11decd7 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -866,13 +866,22 @@ Newer versions of @option{ssh} (for example OpenSSH 4) offer an option @option{ControlMaster}. This allows @option{scp} to reuse an existing @option{ssh} channel, which increases performance. -Before you use this method, you shall check whether your @option{ssh} -implementation does support this option. Try from the command line +Before you use this method, you should check whether your @option{ssh} +implementation supports this option. Try from the command line @example -ssh localhost -o ControlMaster=yes +ssh localhost -o ControlMaster=yes /bin/true @end example +If that command succeeds silently, then you can use @option{scpc}; but +if it fails like + +@example +command-line: line 0: Bad configuration option: ControlMaster +@end example + +then you cannot use it. + This method supports the @samp{-p} argument. diff --git a/etc/ChangeLog b/etc/ChangeLog index b4e22c506a3..60ccded8ad6 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,16 @@ +2012-01-21 Ognyan Kulev <ogi@tower.3.bg> + + * tutorials/TUTORIAL.bg: Updated; synchronize with TUTORIAL. + +2012-01-19 Werner Lemberg <wl@gnu.org> + + * tutorial/TUTORIAL.de: Updated; synchronize with TUTORIAL. + Minor typographical improvements. + +2012-01-17 Primoz PETERLIN <primoz.peterlin@mf.uni-lj.si> + + * tutorials/TUTORIAL.sl: Update. + 2012-01-14 Eli Zaretskii <eliz@gnu.org> * tutorials/TUTORIAL.he: Update to follow changes to TUTORIAL in @@ -84,10 +84,6 @@ longer have any effect. (They were declared obsolete in Emacs 23.) ** New command line option `--no-site-lisp' removes site-lisp directories from load-path. -Q now implies this. ---- -** On Windows, Emacs now warns when the obsolete _emacs init file is used, -and also when HOME is set to C:\ by default. - * Changes in Emacs 24.1 @@ -374,6 +370,13 @@ turn on `whitespace-mode' for *vc-diff* buffers. Modes should call Instead, use "eval: (minor-mode 1)". +++ +*** The variable `inhibit-first-line-modes-regexps' has been renamed +to `inhibit-local-variables-regexps'. As the name suggests, it now +applies to ALL file local variables, not just -*- mode ones. +The associated `inhibit-first-line-modes-suffixes' has been renamed +in the corresponding way. + ++++ ** The variable `focus-follows-mouse' now always defaults to nil. ** New primitive `secure-hash' that supports many secure hash algorithms @@ -427,11 +430,6 @@ These maximize and minimize the size of a window within its frame. These functions allow to navigate through the live buffers that have been shown in a specific window. -+++ -*** New functions `window-state-get' and `window-state-put'. -These functions allow to save and restore the state of an arbitrary -frame or window as an Elisp object. - ** The inactive minibuffer has its own major mode `minibuffer-inactive-mode'. This is handy for minibuffer-only frames, and is also used for the "mouse-1 pops up *Messages*" feature, which can now easily be changed. @@ -1158,6 +1156,11 @@ state before the last buffer display operation in that window. iconifying or deleting a frame when burying a buffer shown in a dedicated frame or quitting a window showing a buffer in a frame of its own. ++++ +*** New functions `window-state-get' and `window-state-put'. +These functions allow to save and restore the state of an arbitrary +frame or window as an Elisp object. + ** Completion *** New variable completion-extra-properties used to specify extra properties @@ -1364,6 +1367,9 @@ This means that the empty symbol can now be read back. Also, #: by itself (when not immediately followed by a possible symbol character) stands for an empty uninterned symbol. ++++ +** New math functions `isnan', `copysign', `frexp', `ldexp'. + ** Obsolete functions and variables *** buffer-substring-filters is obsolete. @@ -1378,17 +1384,20 @@ Use `filter-buffer-substring-functions' instead. * Changes in Emacs 24.1 on non-free operating systems -** New configure.bat option --enable-checking builds Emacs with extra -runtime checks. +--- +** On MS Windows, Emacs warns when using the obsolete init file _emacs, +and also when HOME is set to C:\ by default. + +** New configure.bat options + +*** --enable-checking builds Emacs with extra runtime checks. -** New configure.bat option --distfiles to specify files to be -included in binary distribution. +*** --distfiles specifies files to be included in binary distribution. -** New configure.bat option --without-gnutls to disable automatic -GnuTLS detection. +*** --without-gnutls disables automatic GnuTLS detection. -** New configure.bat option --lib for general library linkage, works -with the USER_LIBS build variable. +*** --lib for general library linkage, works with the USER_LIBS build +variable. ** New make target `dist' to create binary distribution for MS Windows. diff --git a/etc/NEWS.23 b/etc/NEWS.23 index f9dbfa8adef..77ba82c15ad 100644 --- a/etc/NEWS.23 +++ b/etc/NEWS.23 @@ -24,12 +24,22 @@ require version 1.14 or later. See README.W32 and nt/INSTALL for details and pointers to URLs where the latest libpng can be downloaded. - +* Changes in Specialized Modes and Packages in Emacs 23.4 + +** EDE + +*** New variable `ede-project-directories'. +EDE now refuses to automatically load a project file (Project.ede) +unless the file is in one of the directories specified by this +variable. This reduces the risk of inadvertently loading malicious +project files. The commands `M-x ede-new' and `M-x ede' now offer to +save directories to `ede-project-directories'. + * Changes in Emacs 23.4 on non-free operating systems ** The MS-Windows port can now use more than 500MB of heap. Depending on the available virtual memory, Emacs on Windows can now -have up to 2GB of heap space. This allows, e.g., to visit several +have up to 2GB of heap space. This allows, e.g., visiting several large (> 256MB) files in the same session. @@ -71,6 +71,12 @@ things in their .emacs. ** See if other files can use generated-autoload-file (see eg ps-print). +** Write more tests. Pick a fixed bug from the database, write a test +case to make sure it stays fixed. Or pick your favorite programming +major-mode, and write a test for its indentation. Or a version +control backend, and write a test for its status parser. Etc. +See test/automated for examples. + * Small but important fixes needed in existing features: ** Flymake's customization mechanism needs to be both simpler (fewer diff --git a/etc/tutorials/TUTORIAL.bg b/etc/tutorials/TUTORIAL.bg index 22f96f169b9..91198961bff 100644 --- a/etc/tutorials/TUTORIAL.bg +++ b/etc/tutorials/TUTORIAL.bg @@ -1,4 +1,4 @@ -Âúâåäåíèåòî íà Åìàêñ. Óñëîâèÿòà çà êîïèðàíå ñà â êðàÿ íà òåêñòà. +Âúâåäåíèå â Åìàêñ. Óñëîâèÿòà çà êîïèðàíå ñà â êðàÿ íà òåêñòà. Êîìàíäèòå íà Åìàêñ íàé-÷åñòî âêëþ÷âàò êëàâèøèòå CONTROL (ïîíÿêîãà îòáåëÿçâàí ñ CTRL èëè CTL) è META (ïîíÿêîãà îòáåëÿçâàí ñ EDIT èëè @@ -14,14 +14,14 @@ ALT). Âìåñòî äà ñå èçïèñâàò ñ ïúëíî èìå âñåêè ïúò, íèå ùå èçïîëçâàìå êëàâèøà ESC è ñëåä òîâà âúâåäåòå <çíàê>. Íèå çàïèñâàìå <ESC>, çà äà îòáåëåæèì êëàâèøà ESC. -Âàæíà áåëåæêà: â êðàÿ íà Åìàêñ ñåñèÿòà âúâåäåòå äâàòà çíàêà C-x C-c. -Çíàöèòå ">>" îòëÿâî âè äàâàò óêàçàíèå äà èçïúëíèòå êîìàíäà. Íàïðèìåð: +Âàæíà áåëåæêà: â êðàÿ íà Åìàêñ ñåñèÿòà âúâåäåòå C-x C-c. (Äâà çíàêà.) +Çà äà ïðåêúñíåòå ÷àñòè÷íî âúâåäåíà êîìàíäà, èçïîëçâàéòå C-g. +Çíàöèòå „>>“ îòëÿâî âè äàâàò óêàçàíèå äà èçïúëíèòå êîìàíäà. Íàïðèìåð: <<Blank lines inserted here by startup of help-with-tutorial>> ->> Ñåãà âúâåäåòå C-v (Ïîêàæè ñëåäâàùèÿ åêðàí), çà äà ñå ïðèäâèæèòå êúì -ñëåäâàùèÿ åêðàí. - (Íàïðàâåòå ãî ñåãà, çàäðúæòå CONTROL, äîêàòî íàòèñêàòå v). - Îòñåãà íàòàòúê âèå ùå ïðàâèòå òîâà âèíàãè, êîãàòî ïðî÷åòåòå - åêðàíà. +>> Ñåãà âúâåäåòå C-v (Ïîêàçâàíå íà ñëåäâàùèÿ åêðàí), çà äà ñå ïðèäâèæèòå + êúì ñëåäâàùèÿ åêðàí. (Íàïðàâåòå ãî ñåãà, çàäðúæòå CONTROL, + äîêàòî íàòèñêàòå „v“). Îòñåãà íàòàòúê âèå ùå ïðàâèòå òîâà âèíàãè, + êîãàòî ïðî÷åòåòå åêðàíà. Çàáåëåæåòå, ÷å èìà ïðèïîêðèâàíå íà äâà ðåäà, êîãàòî ñå ïðèäâèæâàòå îò åêðàí â åêðàí; òîâà îñèãóðÿâà íÿêàêâà ïðèåìñòâåíîñò, òàêà ÷å äà ìîæåòå @@ -30,8 +30,8 @@ ALT). Âìåñòî äà ñå èçïèñâàò ñ ïúëíî èìå âñåêè ïúò, íèå ùå èçïîëçâàìå Ïúðâîòî íåùî, êîåòî òðÿáâà äà çíàåòå, å êàê äà ñå ïðèäâèæâàòå îò åäíî ìÿñòî íà òåêñòà êúì äðóãî. Âèå âå÷å çíàåòå êàê äà ñå ïðèäâèæâàòå åêðàí íàïðåä, ñ C-v. Çà äà ñå ïðèäâèæèòå åêðàí íàçàä, âúâåäåòå M-v -(çàäðúæòå êëàâèøà META è íàòèñíåòå v, èëè âúâåäåòå <ESC>v, àêî íÿìàòå -êëàâèø META, EDIT èëè ALT). +(çàäðúæòå êëàâèøà META è íàòèñíåòå „v“, èëè âúâåäåòå <ESC> è ïîñëå „v“, +àêî íÿìàòå êëàâèø META, EDIT èëè ALT). >> Îïèòàéòå ñå äà âúâåäåòå M-v è ñëåä òîâà C-v íÿêîëêî ïúòè. @@ -49,7 +49,11 @@ ALT). Âìåñòî äà ñå èçïèñâàò ñ ïúëíî èìå âñåêè ïúò, íèå ùå èçïîëçâàìå >> Íàìåðåòå êóðñîðà è ñè çàïîìíåòå êàêúâ å òåêñòúò îêîëî íåãî. Ñëåä òîâà âúâåäåòå C-l. - Íàìåðåòå ïàê êóðñîðà è âèæòå, ÷å ñúùèÿò òåêñò å ïàê îêîëî êóðñîðà. + Íàìåðåòå ïàê êóðñîðà è âèæòå, ÷å ñúùèÿò òåêñò å ïàê îêîëî êóðñîðà, + íî ñåãà âå÷å â ñðåäàòà íà åêðàíà. + Àêî ïàê íàòèñíåòå C-l, òàçè ÷àñò îò òåêñòà ùå ñå ïðèäâèæè â ãîðíèÿ + êðàé íà åêðàíà. Íàòèñíåòå îòíîâî C-l è òîçè òåêñò ùå îòèäå â äîëíèÿ + êðàé íà åêðàíà. Ìîæå ñúùî äà èçïîëçâàòå êëàâèøèòå PageUp è PageDown çà ïðèäâèæâàíå ïî åêðàíè, àêî âàøèÿò òåðìèíàë ãè ïðèòåæàâà, íî âèå ìîæåòå äà ðåäàêòèðàòå @@ -65,7 +69,7 @@ ALT). Âìåñòî äà ñå èçïèñâàò ñ ïúëíî èìå âñåêè ïúò, íèå ùå èçïîëçâàìå Èìà íÿêîëêî íà÷èíà äà ãî íàïðàâèòå. Ìîæå äà èçïîëçâàòå êëàâèøèòå ñòðåëêè, íî å ïî-åôåêòèâíî äà äúðæèòå ðúöåòå ñè â ñòàíäàðòíî ïîëîæåíèå è äà èçïîëçâàòå êîìàíäèòå C-p, C-b, C-f è C-n. Òåçè çíàöè ñà -åêâèâàëåíòíè íà ÷åòèðèòå êëàâèøè ñòðåëêè, åòî òàêà: +åêâèâàëåíòíè íà ÷åòèðèòå êëàâèøè ñòðåëêè ïî ñëåäíèÿ íà÷èí: Ïðåäèøåí ðåä (Previous), C-p : @@ -76,38 +80,37 @@ ALT). Âìåñòî äà ñå èçïèñâàò ñ ïúëíî èìå âñåêè ïúò, íèå ùå èçïîëçâàìå Ñëåäâàù ðåä (Next), C-n >> Ïðèäâèæåòå êóðñîðà äî ðåäà â ñðåäàòà íà òàçè äèàãðàìà, èçïîëçâàéêè - C-n è C-p. Ñëåä òîâà íàòèñíåòå C-l, çà äà âèäèòå öÿëàòà äèàãðàìà, + C-n è C-p. Ñëåä òîâà íàòèñíåòå C-l è ùå âèäèòå öÿëàòà äèàãðàìà, öåíòðèðàíà íà åêðàíà. Ùå íàìåðèòå, ÷å çàïîìíÿíåòî íà òåçè áóêâè ïî äóìèòå íà àíãëèéñêè íà -äåéñòâèÿòà, êîèòî èçâúðøâàò, å ëåñíî: P çà Previous (ïðåäèøåí), N çà -Next (ñëåäâàù), B çà Backward (íàçàä) è F çà Forward (íàïðåä). Âèå ùå -èçïîëçâàòå òåçè îñíîâíè êîìàíäè çà ïðèäâèæâàíå íà êóðñîðà ïðåç öÿëîòî -âðåìå. +äåéñòâèÿòà, êîèòî èçâúðøâàò, å ëåñíî: „P“ çà Previous (ïðåäèøåí), „N“ +çà Next (ñëåäâàù), „B“ çà Backward (íàçàä) è „F“ çà Forward (íàïðåä). +Âèå ùå èçïîëçâàòå òåçè îñíîâíè êîìàíäè çà ïðèäâèæâàíå íà êóðñîðà ïðåç +öÿëîòî âðåìå. ->> Âúâåäåòå íÿêîëêî C-n, çà äà äîâåäåòå êóðñîðà äî òîçè ðåä. +>> Âúâåäåòå íÿêîëêî ïúòè C-n, çà äà äîâåäåòå êóðñîðà äî òîçè ðåä. ->> Ïðèäâèæåòå ñå â ðåäà ñ íÿêîëêî C-f è ñëåä òîâà ñ íÿêîëêî C-p. +>> Ïðèäâèæåòå ñå âúòðå â ðåäà ñ íÿêîëêî C-f è ñëåä òîâà ñ íÿêîëêî C-p. Âèæòå êàêâî ïðàâè C-p, êîãàòî êóðñîðúò å â ñðåäàòà íà ðåäà. Âñåêè ðåä îò òåêñò çàâúðøâà ñúñ çíàê çà íîâ ðåä, êîéòî ñëóæè çà -îòäåëÿíåòî íà ðåäà îò ñëåäâàùèÿ ðåä. Ïîñëåäíèÿò ðåä âúâ âàøèÿ ôàéë -òðÿáâà äà èìà çíàê çà íîâ ðåä â êðàÿ (íî Åìàêñ íå èçèñêâà òàêúâ, -êîãàòî ïðî÷èòà ôàéëà). +îòäåëÿíåòî íà ðåäà îò ñëåäâàùèÿ ðåä. (Ïîñëåäíèÿò ðåä âúâ âàøèÿ ôàéë +òðÿáâà äà èìà çíàê çà íîâ ðåä â êðàÿ, íî Åìàêñ íå èçèñêâà òàêúâ.) >> Îïèòàéòå C-b â íà÷àëîòî íà ðåä. Òîâà òðÿáâà äà âè ïðèäâèæè â êðàÿ íà ïðåäèøíèÿ ðåä. Òîâà å òàêà, çàùîòî êóðñîðúò ñå ïðèäâèæâà êúì çíàêà çà íîâ ðåä íà ïðåäèøíèÿ ðåä. -C-f ìîæå äà ïðèäâèæâà ïðåç çíàê çà íîâ ðåä òî÷íî êàêòî C-b. +C-f ìîæå äà ïðèäâèæâà ïðåç çíàê çà íîâ ðåä, òî÷íî êàêòî C-b. ->> Íàïðàâåòå íÿêîëêî C-b ïðèäâèæâàíèÿ, òàêà ÷å äà äîáèåòå óñåùàíå êúäå - ñå íàìèðà êóðñîðúò. Ñëåä òîâà íÿêîëêî C-f, çà äà ñå âúðíåòå â êðàÿ - íà ðåäà. Ñëåä òîâà îùå íÿêîëêî C-f, çà äà ñå ïðèäâèæèòå äî +>> Íàïðàâåòå íÿêîëêî ïðèäâèæâàíèÿ ñ C-b, òàêà ÷å äà äîáèåòå óñåùàíå + êúäå ñå íàìèðà êóðñîðúò. Ñëåä òîâà íÿêîëêî C-f, äîêàòî ñå âúðíåòå + â êðàÿ íà ðåäà. Ñëåä òîâà îùå íÿêîëêî C-f, çà äà ñå ïðèäâèæèòå äî ñëåäâàùèÿ ðåä. Êîãàòî ñå ïðèäâèæâàòå ñëåä ãîðíèÿ èëè äîëíèÿ êðàé íà åêðàíà, òåêñòúò -îòâúä êðàÿ ñå èçìåñòâà êúì åêðàíà. Òîâà ñå íàðè÷à "ñêðîëèðàíå". Òî +îòâúä êðàÿ ñå èçìåñòâà êúì åêðàíà. Òîâà ñå íàðè÷à „ñêðîëèðàíå“. Òî ïîçâîëÿâà íà Åìàêñ äà ïðèäâèæâà êóðñîðà êúì çàäàäåíîòî ìÿñòî â òåêñòà, áåç äà ãî èçêàðâà èçâúí åêðàíà. @@ -146,9 +149,8 @@ Control-çíàöèòå äåéñòâàò âúðõó îñíîâíè åäèíèöè, êîèòî ñà íåçàâèñèìè îò êëàâèøíè êîìáèíàöèè íå ñà òî÷íî àíàëîãè÷íè, âñÿêà åäíà îò òÿõ èçãëåæäà åñòåñòâåíà. -Ïîëîæåíèåòî íà êóðñîðà â òåêñòà ñå íàðè÷à ñúùî "òî÷êà". -Ïåðåôðàçèðàíî, êóðñîðúò ïîêàçâà íà åêðàíà êúäå å ðàçïîëîæåíà òî÷êàòà â -òåêñòà. +Ïîëîæåíèåòî íà êóðñîðà â òåêñòà ñå íàðè÷à „òî÷êà“. Ïåðåôðàçèðàíî, +êóðñîðúò ïîêàçâà íà åêðàíà êúäå å ðàçïîëîæåíà òî÷êàòà â òåêñòà. Åòî îáîáùåíèå íà ïðîñòèòå äåéñòâèÿ, äâèæåùè êóðñîðà, âêëþ÷èòåëíî ïðèäâèæâàùèòå ïî äóìà è èçðå÷åíèå: @@ -175,7 +177,7 @@ Control-çíàöèòå äåéñòâàò âúðõó îñíîâíè åäèíèöè, êîèòî ñà íåçàâèñèìè îò êîÿòî ïðèäâèæâà äî íà÷àëîòî íà öåëèÿ òåêñò, è M-> (Meta ïî-ãîëÿìî), êîÿòî ïðåìåñòâà äî êðàÿ íà öåëèÿ òåêñò. -Ïðè ïîâå÷åòî òåðìèíàëè çíàêúò "<" å îòáåëÿçàí íàä çàïåòàÿòà, òàêà ÷å +Ïðè ïîâå÷åòî òåðìèíàëè çíàêúò „<“ å îòáåëÿçàí íàä çàïåòàÿòà, òàêà ÷å òðÿáâà äà èçïîëçâàòå êëàâèøà Shift, çà äà ãî íàïèøåòå. Íà òåçè òåðìèíàëè òðÿáâà äà èçïîëçâàòå Shift, çà äà âúâåäåòå è M-<; áåç êëàâèøà Shift áèõòå âúâåëè M-çàïåòàÿ. @@ -206,17 +208,17 @@ Shift áèõòå âúâåëè M-çàïåòàÿ. (èëè EDIT èëè ALT), èìà äðóã, àëòåðíàòèâåí íà÷èí äà âúâåäåòå ÷èñëîâ àðãóìåíò: âúâåäåòå öèôðèòå, äîêàòî çàäúðæàòå êëàâèøà META. Íèå ïðåïîðú÷âàìå äà íàó÷èòå íà÷èíà ñ C-u, çàùîòî òîé ðàáîòè íà êîéòî è äà -å òåðìèíàë. ×èñëîâèÿò àðãóìåíò ñå íàðè÷à ñúùî "ïðåôèêñåí àðãóìåíò", +å òåðìèíàë. ×èñëîâèÿò àðãóìåíò ñå íàðè÷à ñúùî „ïðåôèêñåí àðãóìåíò“, çàùîòî ãî âúâåæäàòå ïðåäè êîìàíäàòà, çà êîÿòî å ïðåäíàçíà÷åí. -Íàïðèìåð, C-u 8 C-f ïðèäâèæâà îñåì çíàêà íàïðåä. +Íàïðèìåð C-u 8 C-f ïðèäâèæâà îñåì çíàêà íàïðåä. >> Îïèòàéòå èçïîëçâàíåòî íà C-n èëè C-p ñ ÷èñëîâ àðãóìåíò, çà äà ïðèäâèæèòå êóðñîðà äî ðåä, áëèçúê äî òîçè, ñàìî ñ åäíà êîìàíäà. Ïîâå÷åòî êîìàíäè èçïîëçâàò ÷èñëîâèÿ àðãóìåíò êàòî áðîÿ÷ íà ïîâòîðåíèÿòà, íî íÿêîè ãî èçïîëçâàò çà äðóãè öåëè. Íÿêîëêî êîìàíäè -(íî íèêîÿ îò òåçè, êîèòî ñòå íàó÷èëè äîñåãà) ãî èçïîëçâàò êàòî ôëàã -- +(íî íèêîÿ îò òåçè, êîèòî ñòå íàó÷èëè äîñåãà) ãî èçïîëçâàò êàòî ôëàã – ïðèñúñòâèåòî íà ÷èñëîâ àðãóìåíò, íåçàâèñèìî îò ñòîéíîñòà ìó, êàðà êîìàíäàòà äà âúðøè íåùî ðàçëè÷íî. @@ -234,13 +236,8 @@ C-v è M-v ñà äðóã âèä èçêëþ÷åíèå. Êîãàòî èì å äàäåí àðãóìåíò, òå bar), â ëÿâàòà ñòðàíà íà ïðîçîðåöà íà Åìàêñ. Âèå ìîæåòå äà ñêðîëèðàòå òåêñòà, ùðàêàéêè ñ ìèøêàòà â ïëúçãà÷à. ->> Îïèòàéòå äà íàòèñíåòå ñðåäíèÿ áóòîí íà âúðõà íà îñâåòåíàòà îáëàñò - âúòðå â ïëúçãà÷à. Òîâà áè òðÿáâàëî äà ñêðîëèðà òåêñòà êúì - ïîëîæåíèå, îïðåäåëåíî îò òîâà êîëêî âèñîêî èëè íèñêî ñòå ùðàêíàëè. - ->> Îïèòàéòå ñå äà äâèæèòå ìèøêàòà íàãîðå è íàäîëó, äîêàòî ñòå - çàäúðæàëè äåñíèÿ áóòîí íàòèñíàò. Ùå âèäèòå, ÷å òåêñòúò ñå ñêðîëèðà - íàãîðå è íàäîëó, êàòî äâèæèòå ìèøêàòà. +Àêî âàøàòà ìèøêà èìà òúðêàëöå, ìîæåòå è íåãî äà èçïîëçâàòå çà +ñêðîëèðàíå. * ÊÎÃÀÒÎ ÅÌÀÊÑ Å ÁËÎÊÈÐÀË @@ -263,7 +260,7 @@ bar), â ëÿâàòà ñòðàíà íà ïðîçîðåöà íà Åìàêñ. Âèå ìîæåòå äà ñêðîëèðàòå * ÇÀÁÐÀÍÅÍÈ ÊÎÌÀÍÄÈ ------------------- -Íÿêîè êîìàíäè íà Åìàêñ ñà "çàáðàíåíè", òàêà ÷å íà÷èíàåùèòå ïîòðåáèòåëè +Íÿêîè êîìàíäè íà Åìàêñ ñà „çàáðàíåíè“, òàêà ÷å íà÷èíàåùèòå ïîòðåáèòåëè äà íå ìîãàò äà ãè óïîòðåáÿò ïî ïîãðåøêà. Àêî âúâåäåòå íÿêîÿ îò çàáðàíåíèòå êîìàíäè, Åìàêñ èçâåæäà ñúîáùåíèå, @@ -272,16 +269,16 @@ bar), â ëÿâàòà ñòðàíà íà ïðîçîðåöà íà Åìàêñ. Âèå ìîæåòå äà ñêðîëèðàòå Àêî íàèñòèíà èñêàòå äà èçïðîáâàòå êîìàíäàòà, âúâåäåòå êëàâèøà èíòåðâàë â îòãîâîð íà âúïðîñà. Îáèêíîâåíî àêî íå èñêàòå äà èçïúëíèòå -çàáðàíåíàòà êîìàíäà, îòãîâàðÿòå íà âúïðîñà ñ "n". +çàáðàíåíàòà êîìàíäà, îòãîâàðÿòå íà âúïðîñà ñ „n“. >> Âúâåäåòå C-x C-l (êîÿòî å çàáðàíåíà êîìàíäà), è ñëåä òîâà âúâåäåòå - "n" â îòãîâîð íà âúïðîñà. + „n“ â îòãîâîð íà âúïðîñà. * ÏÐÎÇÎÐÖÈ ---------- -Åìàêñ ìîæå äà óïðàâëÿâà íÿêîëêî ïðîçîðåöà, âñåêè èçâåæäàéêè ñâîé +Åìàêñ ìîæå äà óïðàâëÿâà íÿêîëêî „ïðîçîðåöà“, âñåêè èçâåæäàéêè ñâîé ñîáñòâåí òåêñò. Íèå ùå îáÿñíèì ïî-êúñíî êàê äà èçïîëçâàòå íÿêîëêî ïðîçîðåöà. Òî÷íî ñåãà íèå èñêàìå äà îáÿñíèì êàê äà ñå îòúðâåòå îò äîïúëíèòåëíè ïðîçîðöè è äà ñå âúðíåòå êúì îñíîâíîòî ðåäàêòèðàíå ñ åäèí @@ -301,57 +298,52 @@ bar), â ëÿâàòà ñòðàíà íà ïðîçîðåöà íà Åìàêñ. Âèå ìîæåòå äà ñêðîëèðàòå >> Âúâåäåòå C-x 1 è âèæòå êàê ïðîçîðåöúò ñ äîêóìåíòàöèÿòà èç÷åçâà. Òàçè êîìàíäà íå å êàòî äðóãèòå êîìàíäè, êîèòî ñòå íàó÷èëè, â òîâà -îòíîøåíèå, ÷å ñå ñúñòîè îò äâà çíàêà. Çàïî÷âà ñúñ çíàêà C-x. Èìà -öÿëà ðåäèöà îò êîìàíäè, êîèòî çàïî÷âàò ñ C-x; ìíîãî îò òÿõ èìàò íåùî -îáùî ñ ïðîçîðöè, ôàéëîâå, áóôåðè è ñâúðçàíèòå ñ òÿõ íåùà. Òåçè -êîìàíäè ñà îò äâà, òðè èëè ÷åòèðè çíàêà. +îòíîøåíèå, ÷å ñå ñúñòîè îò äâà çíàêà. Çàïî÷âà ñúñ çíàêà CONTROL-x. +Èìà öÿëà ðåäèöà îò êîìàíäè, êîèòî çàïî÷âàò ñ CONTROL-x; ìíîãî îò òÿõ +èìàò íåùî îáùî ñ ïðîçîðöè, ôàéëîâå, áóôåðè è ñâúðçàíèòå ñ òÿõ íåùà. +Òåçè êîìàíäè ñà îò äâà, òðè èëè ÷åòèðè çíàêà. * ÂÌÚÊÂÀÍÅ È ÈÇÒÐÈÂÀÍÅ ---------------------- Àêî èñêàòå äà âìúêíåòå òåêñò, ïðîñòî ãî âúâåäåòå. Çíàöèòå, êîèòî -ìîãàò äà ñå âèæäàò, êàòî À, 7, * è ò.í., ñå âúçïðèåìàò îò Åìàêñ êàòî -òåêñò è ñå âìúêâàò âåäíàãà. Âúâåäåòå <Return> (êëàâèøúò çà âðúùàíå â -íà÷àëîòî íà ðåäà), çà äà âìúêíåòå çíàê çà íîâ ðåä. - -Ìîæå äà èçòðèåòå ïîñëåäíèÿ çíàê, êîéòî ñòå âúâåëè, ñ âúâåæäàíå íà -<Delback>. <Delback> å êëàâèø îò êëàâèàòóðàòà -- ñúùèÿò, êîéòî -îáèêíîâåíî èçïîëçâàòå èçâúí Åìàêñ, çà äà èçòðèåòå ïîñëåäíèÿ âúâåäåí îò -âàñ çíàê. Îáèêíîâåíî å ãîëÿì êëàâèø, íà íÿêîëêî ðåäà ðàçñòîÿíèå îò -êëàâèøà <Return>, è îáèêíîâåíî å îòáåëÿçàí ñ "Delete", "Del" èëè -"Backspace". +ìîãàò äà ñå âèæäàò, êàòî À, 7, * è ò.í., ñå âìúêâàò âåäíàãà. Çà äà +âìúêíåòå çíàê çà íîâ ðåä, íàòèñíåòå <Return> (òîâà å êëàâèøúò, êîéòî +ïîíÿêîãà å îòáåëÿçâàí êàòî „Enter“). -Àêî ãîëåìèÿò êëàâèø òàì å ñ åòèêåò "Backspace", òîãàâà òîé å òîçè, -êîéòî ùå èçïîëçâàòå çà <Delback>. Ìîæå äà èìà îùå åäèí êëàâèø ñ -åòèêåò "Delete" íÿêúäå äðóãàäå, íî òîé íå å <Delback>. +Çà äà èçòðèåòå çíàêà íåïîñðåäñòâåíî ïðåäè òåêóùîòî ïîëîæåíèå íà +êóðñîðà, âúâåäåòå <DEL>. Îáèêíîâåíî òîâà å êëàâèøúò, îòáåëÿçâàí êàòî +„Backspace“ – íîðìàëíèÿò çà òîâà äåéñòâèå è èçâúí Åìàêñ. -Ïî-îáùî êàçàíî, <Delback> èçòðèâà çíàêà òî÷íî ïðåäè òåêóùîòî ìÿñòî íà -êóðñîðà. +Ìîæå äà èìà îùå åäèí êëàâèø ñ åòèêåò <Delete> íÿêúäå äðóãàäå, íî òîé +íå å <DEL>, çà êîéòî ñòàâà âúïðîñ òóê. ->> Íàïðàâåòå òîâà ñåãà -- íàïèøåòå íÿêîëêî çíàêà, ïîñëå ãè èçòðèéòå ñ - âúâåæäàíå íà <Delback> íÿêîëêî ïúòè. Íå ñå áåçïîêîéòå, ÷å òîçè - ôàéë ùå áúäå ïðîìåíåí; âèå íÿìà äà ïðîìåíèòå ïúðâîíà÷àëíîòî - âúâåäåíèå. Òîâà å âàøå ëè÷íî êîïèå. +>> Íàïðàâåòå òîâà ñåãà – íàïèøåòå íÿêîëêî çíàêà, ïîñëå ãè èçòðèéòå ñ + âúâåæäàíå íà <DEL> íÿêîëêî ïúòè. Íå ñå áåçïîêîéòå, ÷å òîçè ôàéë ùå + áúäå ïðîìåíåí; âèå íÿìà äà ïðîìåíèòå ïúðâîíà÷àëíîòî âúâåäåíèå. + Òîâà å âàøå ëè÷íî êîïèå. Êîãàòî ðåä îò òåêñòà ñòàíå òâúðäå äúëúã, çà äà ñå ñúáåðå â ðåä îò -åêðàíà, ðåäúò îò òåêñòà ñå "ïðîäúëæàâà" íà ñëåäâàùèÿ ðåä. Îáðàòíà -íàêëîíåíà ÷åðòà ("\") (èëè, àêî èçïîëçâàòå ãðàôè÷åí èíòåðôåéñ, ìàëêà -èçêðèâåíà ñòðåëêà) â äÿñíàòà ãðàíèöà îòáåëÿçâà ðåä, êîéòî å áèë -ïðîäúëæåí. +åêðàíà, ðåäúò îò òåêñòà ñå „ïðîäúëæàâà“ íà ñëåäâàùèÿ ðåä. Àêî +èçïîëçâàòå ãðàôè÷åí äèñïëåé, â ìàëêîòî ïðîñòðàíñòâî îòñòðàíè íà òåêñòà +(ëåâèÿò è äåñíèÿò „ðúá“) ùå ñå ïîÿâÿò ìàëêè èçâèòè ñòðåëêè çà +îòáåëÿçâàíå êúäå ðåäúò ïðîäúëæàâà. Àêî èçïîëçâàòå òåêñòîâ òåðìèíàë, +ïðîäúëæåíèòå ðåäîâå ñå îòáåëÿçâàò ñ îáðàòíà íàêëîíåíà ÷åðòà („\“) â +íàé-äÿñíàòà êîëîíà íà ïðîçîðåöà. >> Âúâåäåòå òåêñò, äîêàòî ñòèãíåòå äÿñíàòà ãðàíèöà, è ïðîäúëæåòå ñ âìúêâàíåòî. Ùå âèäèòå ïðîäúëæåíèåòî íà ðåäà äà ñå ïîêàçâà. ->> Èçïîëçâàéòå íÿêîëêî <Delback>, çà äà èçòðèåòå òåêñòà, äîêàòî ðåäúò - ñå âìåñòè â åäèí åêðàíåí ðåä. Ïðîäúëæåíèåòî íà ðåäà èç÷åçâà. +>> Èçïîëçâàéòå íÿêîëêî <DEL>, çà äà èçòðèåòå òåêñòà, äîêàòî ðåäúò ñå + âìåñòè â åäèí åêðàíåí ðåä. Ïðîäúëæåíèåòî íà ðåäà èç÷åçâà. Ìîæå äà èçòðèåòå çíàêà çà íîâ ðåä òî÷íî êàêòî âñåêè äðóã çíàê. Èçòðèâàíåòî íà çíàêà çà íîâ ðåä ìåæäó äâà ðåäà ãè ñëèâà â åäèí ðåä. Àêî ïîëó÷åíèÿò êîìáèíèðàí ðåä å òâúðäå äúëúã, çà äà ñå âìåñòè â øèðèíàòà íà åêðàíà, òîé ùå áúäå ïîêàçàí êàòî ïðîäúëæåí ðåä. ->> Ïðèäâèæåòå êóðñîðà â íà÷àëîòî íà ðåä è âúâåäåòå <Delback>. Òîâà ùå +>> Ïðèäâèæåòå êóðñîðà â íà÷àëîòî íà ðåä è âúâåäåòå <DEL>. Òîâà ùå ñëåå òîçè ðåä ñ ïðåäèøíèÿ. >> Âúâåäåòå <Return>, çà äà âìúêíåòå íàíîâî çíàêà çà íîâ ðåä, êîéòî @@ -361,48 +353,52 @@ bar), â ëÿâàòà ñòðàíà íà ïðîçîðåöà íà Åìàêñ. Âèå ìîæåòå äà ñêðîëèðàòå íà ïîâòîðåíèÿòà; òîâà âêëþ÷âà âìúêâàíåòî íà òåêñòîâè çíàöè. Ïîâòàðÿíåòî íà òåêñòîâ çíàê ãî âìúêâà íÿêîëêî ïúòè. ->> Îïèòàéòå òîâà ñåãà -- âúâåäåòå C-u 8 *, çà äà âìúêíåòå ********. +>> Îïèòàéòå òîâà ñåãà – âúâåäåòå C-u 8 *, çà äà âìúêíåòå ********. Ñåãà âèå ñòå íàó÷èëè íàé-îñíîâíèòå íà÷èíè çà âúâåæäàíå íà íåùî â Åìàêñ è ïîïðàâÿíå íà ãðåøêè. Ìîæåòå ñúùî òàêà äà èçòðèâàòå äóìè èëè ðåäîâå. Åòî îáîáùåíèå íà èçòðèâàùèòå äåéñòâèÿ: - <Delback> èçòðèâàíå íà çíàêà òî÷íî ïðåäè êóðñîðà - C-d èçòðèâàíå íà çíàêà òî÷íî ñëåä êóðñîðà + <DEL> Èçòðèâàíå íà çíàêà òî÷íî ïðåäè êóðñîðà + C-d Èçòðèâàíå íà çíàêà òî÷íî ñëåä êóðñîðà - M-<Delback> èçòðèâàíå íà äóìàòà íåïîñðåäñòâåíî ïðåäè êóðñîðà - M-d èçòðèâàíå íà äóìàòà ñëåä êóðñîðà + M-<DEL> Èçòðèâàíå íà äóìàòà íåïîñðåäñòâåíî ïðåäè êóðñîðà + M-d Èçòðèâàíå íà äóìàòà ñëåä êóðñîðà - C-k èçòðèâàíå îò ìÿñòîòî íà êóðñîðà äî êðàÿ íà ðåäà - M-k èçòðèâàíå äî êðàÿ íà òåêóùîòî èçðå÷åíèå + C-k Èçòðèâàíå îò ìÿñòîòî íà êóðñîðà äî êðàÿ íà ðåäà + M-k Èçòðèâàíå äî êðàÿ íà òåêóùîòî èçðå÷åíèå -Çàáåëåæåòå, ÷å <Delback> è C-d, ñðàâíåíè ñ M-<Delback> è M-d, -ðàçøèðÿâàò ïîäîáèåòî, çàïî÷íàòî îò C-f è M-f (äîáðå, <Delback> íå å -íàèñòèíà êîíòðîëèðàù çíàê, íî íåêà íå ñå áåçïîêîèì çà òîâà). C-k è -M-k ñà ïîäîáíè íà C-e è M-e â ñìèñúë, ÷å åäíèòå ñà çà ðåäîâå, à -äðóãèòå -- çà èçðå÷åíèÿ. +Çàáåëåæåòå, ÷å <DEL> è C-d, ñðàâíåíè ñ M-<DEL> è M-d, ðàçøèðÿâàò +ïîäîáèåòî, çàïî÷íàòî îò C-f è M-f (äîáðå, <DEL> íå å íàèñòèíà +êîíòðîëèðàù çíàê, íî íåêà íå ñå áåçïîêîèì çà òîâà). C-k è M-k ñà +ïîäîáíè íà C-e è M-e â ñìèñúë, ÷å åäíèòå ñà çà ðåäîâå, à äðóãèòå – çà +èçðå÷åíèÿ. -Ìîæåòå ñúùî äà ïðåìàõíåòå âñÿêà ÷àñò îò áóôåðà ñ åäèí óíèâåðñàëåí -íà÷èí. Ïðèäâèæåòå ñå äî åäèíèÿ êðàé íà ÷àñòòà è âúâåäåòå C-@ èëè -C-èíòåðâàë (êîåòî è äà å îò äâåòå). Ïðèäâèæåòå ñå äî äðóãèÿ êðàé íà -÷àñòòà è âúâåäåòå C-w. Òîâà ùå èçðåæå öåëèÿ òåêñò ìåæäó òåçè äâà -êðàÿ. +Ìîæåòå ñúùî äà ïðåìàõíåòå âñÿêà ÷àñò îò òåêñòà ïî åäèí óíèâåðñàëåí +íà÷èí. Ïðèäâèæåòå ñå äî åäèíèÿ êðàé è âúâåäåòå C-<SPC> (<SPC> å +èíòåðâàëúò).. Ïðèäâèæåòå ñå äî äðóãèÿ êðàé íà òåêñòà, êîéòî èñêàòå äà +èçòðèåòå. Äîêàòî ãî ïðàâèòå, Åìàêñ îñâåòÿâà òåêñòúò ìåæäó êóðñîðà è +ìÿñòîòî, êúäåòî ñå âúâåëè C-<SPC>. Íàêðàÿ âúâåäåòå C-w. Òîâà ùå +èçðåæå öåëèÿ òåêñò ìåæäó òåçè äâà êðàÿ. ->> Ïðèäâèæåòå êóðñîðà äî çíàêà "Ì" â íà÷àëîòî íà ïðåäèøíèÿ àáçàö. ->> Âúâåäåòå C-èíòåðâàë. Åìàêñ òðÿáâà äà èçâåäå ñúîáùåíèå "Mark set" â +>> Ïðèäâèæåòå êóðñîðà äî çíàêà „Ì“ â íà÷àëîòî íà ïðåäèøíèÿ àáçàö. +>> Âúâåäåòå C-<SPC>. Åìàêñ òðÿáâà äà èçâåäå ñúîáùåíèå „Mark set“ â äîëíèÿ êðàé íà åêðàíà. ->> Ïðèäâèæåòå êóðñîðà äî áóêâàòà "ð" â "êðàé" íà âòîðèÿ ðåä îò àáçàöà. ->> Âúâåäåòå C-w. Òîâà ùå èçðåæå òåêñòà, çàïî÷âàù îò "Ì" è çàâúðøâàù - òî÷íî ïðåäè "ð". +>> Ïðèäâèæåòå êóðñîðà äî áóêâàòà „ð“ â „êðàé“ íà âòîðèÿ ðåä îò àáçàöà. +>> Âúâåäåòå C-w. Òîâà ùå èçðåæå òåêñòà, çàïî÷âàù îò „Ì“ è çàâúðøâàù + òî÷íî ïðåäè „ð“. -Ðàçëèêàòà ìåæäó "èçðÿçâàíå" (kill, cut) è "èçòðèâàíå" (delete) å, ÷å -"èçðÿçàíèÿò" òåêñò ìîæå äà áúäå âìúêíàò íàíîâî, äîêàòî "èçòðèòèòå" -íåùà íå ìîãàò äà ñå âìúêíàò íàíîâî. Ïîñòàâÿíåòî íàíîâî íà èçðÿçàí -òåêñò ñå íàðè÷à "âìúêâàíå" (yank, paste). Îáùî êàçàíî, êîìàíäèòå, -êîèòî îòñòðàíÿâàò ìíîãî òåêñò, ãî èçðÿçâàò (òàêà ÷å òîé äà ìîæå äà -áúäå âìúêíàò), äîêàòî êîìàíäèòå, êîèòî îòñòðàíÿâàò ñàìî åäèí çíàê èëè +Ðàçëèêàòà ìåæäó „èçðÿçâàíå“ (kill, cut) è „èçòðèâàíå“ (delete) å, ÷å +„èçðÿçàíèÿò“ òåêñò ìîæå äà áúäå âìúêíàò íàíîâî, äîêàòî „èçòðèòèòå“ +íåùà íå ìîãàò äà ñå âìúêíàò íàíîâî (îáà÷å ìîæåòå äà îòìåíèòå +èçòðèâàíåòî – âæ. ïî-äîëó). Ïîñòàâÿíåòî íàíîâî íà èçðÿçàí òåêñò ñå +íàðè÷à „âìúêâàíå“ (yank, paste). Îáùî êàçàíî, êîìàíäèòå, êîèòî +îòñòðàíÿâàò ìíîãî òåêñò, ãî èçðÿçâàò (òàêà ÷å òîé äà ìîæå äà áúäå +âìúêíàò), äîêàòî êîìàíäèòå, êîèòî îòñòðàíÿâàò ñàìî åäèí çíàê èëè èçòðèâàò ñàìî ïðàçíè ðåäîâå è çíàöè, èçâúðøâàò èçòðèâàíå (òàêà ÷å íå -ìîæåòå äà âìúêíåòå íàíîâî òîçè òåêñò). +ìîæåòå äà âìúêíåòå íàíîâî òîçè òåêñò). <DEL> è C-d èçòðèâàò â +îáèêíîâåíèÿ ñëó÷àé, êîãàòî íÿìà ïðåôèêñåí àðãóìåíò. Ïðè íàëè÷èå íà +àðãóìåíò òå îòðÿçâàò. >> Ïðèäâèæåòå êóðñîðà äî íà÷àëîòî íà ðåä, êîéòî íå å ïðàçåí. Òîãàâà âúâåäåòå C-k, çà äà èçðåæåòå òåêñòà íà òîçè ðåä. @@ -414,14 +410,16 @@ C-k èçðÿçâà öåëèÿ ðåä è ïðàâè äðóãèòå ðåäîâå äà ñå ïðèäâèæàò íàãîðå. C-k îáðàáîòâà ÷èñëîâèòå àðãóìåíòè ïî ñïåöèàëåí íà÷èí: ïðåìàõâàò ñå òîëêîâà íà áðîé ðåäîâå È òÿõíîòî ñúäúðæàíèå. Òîâà íå å ïðîñòî ïîâòîðåíèå. C-u 2 C-k èçðÿçâà äâà ðåäà è òåõíèòå çíàöè çà íîâ ðåä; -âúâåæäàíåòî íà C-k äâà ïúòè íå ïðàâè òîâà. +âúâåæäàíåòî äâà ïúòè íà C-k íå ïðàâè òîâà. -Âðúùàíåòî îáðàòíî íà òåêñò ñå íàðè÷à "âìúêâàíå". (Ìèñëåòå çà íåãî +Âðúùàíåòî îáðàòíî íà òåêñò ñå íàðè÷à „âìúêâàíå“. (Ìèñëåòå çà íåãî êàòî çà èçâàæäàíå îáðàòíî, èëè äðúïâàíå îáðàòíî, íà òåêñò, êîéòî å áèë èçðÿçàí.) Ìîæåòå äà âìúêâàòå èçðÿçàíèÿ òåêñò èëè íà ñúùîòî ìÿñòî, -îòêúäåòî å áèë ïðåìàõíàò, èëè íà äðóãî ìÿñòî â áóôåðà, äàæå è â +îòêúäåòî å áèë ïðåìàõíàò, èëè íà äðóãî ìÿñòî â áóôåðà, èëè äàæå â ðàçëè÷åí ôàéë. Ìîæåòå äà âìúêâàòå åäèí è ñúù òåêñò íÿêîëêî ïúòè; òîâà -ïðàâè íÿêîëêî êîïèÿ îò íåãî. +ïðàâè íÿêîëêî êîïèÿ îò íåãî. Íÿêîè äðóãè ðåäàêòîðè íàðè÷àò +èçðÿçâàíåòî (kill) è âìúêâàíåòî (yank) ñúîòâåòíî èçðÿçâàíå (cut) è +ïîñòàâÿíå (paste) (âæ. Ðå÷íèêà íà Ðúêîâîäñòâîòî íà Åìàêñ). Êîìàíäàòà çà âìúêâàíå å C-y. Òÿ âìúêâà íàíîâî ïîñëåäíèÿ èçðÿçàí òåêñò â òåêóùîòî ìÿñòî íà êóðñîðà. @@ -466,31 +464,30 @@ C-k îáðàáîòâà ÷èñëîâèòå àðãóìåíòè ïî ñïåöèàëåí íà÷èí: ïðåìàõâàò ñå -------- Àêî íàïðàâèòå ïðîìÿíà â òåêñòà è ñëåä òîâà ðåøèòå, ÷å òîâà å áèëî -ãðåøêà, âèå ìîæåòå äà îòìåíèòå ïðîìÿíàòà ñ êîìàíäàòà çà îòìåíÿíå, C-x -u. +ãðåøêà, âèå ìîæåòå äà îòìåíèòå ïðîìÿíàòà ñ êîìàíäàòà çà îòìåíÿíå, C-/. -Îáèêíîâåíî C-x u îòìåíÿ ïðîìåíèòå, íàïðàâåíè îò åäíà êîìàíäà; àêî -ïîâòàðÿòå C-x u íÿêîëêî ïúòè ïîñëåäîâàòåëíî, âñÿêî ïîâòîðåíèå îòìåíÿ -îùå åäíà êîìàíäà. +Îáèêíîâåíî C-/ îòìåíÿ ïðîìåíèòå, íàïðàâåíè îò åäíà êîìàíäà; àêî +ïîâòàðÿòå C-/ íÿêîëêî ïúòè ïîñëåäîâàòåëíî, âñÿêî ïîâòîðåíèå îòìåíÿ îùå +åäíà êîìàíäà. Íî èìà äâå èçêëþ÷åíèÿ: êîìàíäèòå, êîèòî íå ïðîìåíÿò òåêñòà, íå ñå áðîÿò (òîâà âêëþ÷âà ïðèäâèæâàíåòî íà êóðñîðà è ñêðîëèðàùèòå êîìàíäè), è ñàìîâìúêâàùèòå ñå çíàöè îáèêíîâåíî ñå îáðàáîòâàò íà ãðóïè, âñÿêà äî -20 çíàêà. (Òîâà íàìàëÿâà áðîÿ íà C-x u, êîèòî òðÿáâà äà âúâåäåòå, çà -äà îòìåíèòå âúâåäåí òåêñò.) +20 çíàêà. (Òîâà íàìàëÿâà áðîÿ íà C-/, êîèòî òðÿáâà äà âúâåäåòå, çà äà +îòìåíèòå âúâåäåí òåêñò.) ->> Èçðåæåòå òîçè ðåä ñ C-k, ñëåä òîâà âúâåäåòå C-x u è òîé òðÿáâà äà - ñå ïîÿâè îòíîâî. +>> Èçðåæåòå òîçè ðåä ñ C-k, ñëåä òîâà âúâåäåòå C-/ è òîé òðÿáâà äà ñå + ïîÿâè îòíîâî. -C-_ å àëòåðíàòèâíà îòìåíÿùà êîìàíäà; òÿ ðàáîòè òî÷íî êàòî C-x u, íî å -ïî-ëåñíà çà âúâåæäàíå íÿêîëêî ïúòè ïîñëåäîâàòåëíî. Íåäîñòàòúêúò íà -C_- å, ÷å íà íÿêîè êëàâèàòóðè íå å î÷åâèäíî êàê òðÿáâà äà ñå âúâåäå. -Çàòîâà îñèãóðÿâàìå è C-x u. Íà íÿêîè òåðìèíàëè ìîæå äà âúâåäåòå C-_ ñ -âúâåæäàíå íà /, äîêàòî çàäúðæàòå CONTROL. +C-_ å àëòåðíàòèâíà îòìåíÿùà êîìàíäà; òÿ ðàáîòè òî÷íî êàòî C-/. Íà +íÿêîè òåðìèíàëè âúâåæäàíåòî íà C-/ âñúùíîñò èçïðàùà C-_ íà Åìàêñ. +Êàòî àëòåðíàòèâà, C-x u ðàáîòè òî÷íî êàòî C-/, íî å ïî-íåóäîáíà çà +âúâåæäàíå. -×èñëîâ àðãóìåíò êúì C-_ èëè C-x u äåéñòâà êàòî áðîÿ÷ íà ïîâòîðåíèÿòà. +×èñëîâ àðãóìåíò êúì C-/, C-_ èëè C-x u äåéñòâà êàòî áðîÿ÷ íà +ïîâòîðåíèÿ. -Ìîæå äà îòìåíÿòà èçòðèâàíå íà òåêñò òî÷íî êàêòî îòìåíÿòå èçðÿçâàíå íà +Ìîæå äà îòìåíÿòå èçòðèâàíå íà òåêñò òî÷íî êàêòî îòìåíÿòå èçðÿçâàíå íà òåêñò. Ðàçëè÷èåòî ìåæäó èçðÿçâàíåòî íà íåùî è èçòðèâàíåòî ìó âúçäåéñòâà äàëè ùå ìîæå äà ãî èçâàäèòå ñ C-y; çà îòìåíÿíåòî íÿìà ðàçëèêà ìåæäó äâàòà âèäà. @@ -501,35 +498,35 @@ C_- å, ÷å íà íÿêîè êëàâèàòóðè íå å î÷åâèäíî êàê òðÿáâà äà ñå âúâåäå. Çà äà íàïðàâèòå òåêñòà, êîéòî ðåäàêòèðàòå, ïîñòîÿíåí, òðÿáâà äà ãî ñëîæèòå âúâ ôàéë.  ïðîòèâåí ñëó÷àé òîé ùå èç÷åçíå, êîãàòî Åìàêñ -ïðèêëþ÷è. Çà äà ñëîæèòå âàøèÿ òåêñò âúâ ôàéë, òðÿáâà äà "íàìåðèòå" -ôàéëà ïðåäè äà âúâåæäàòå òåêñò. (Òîâà ñúùî ñå íàðè÷à "ïîñåùàâàíå" íà -ôàéëà.) +ïðèêëþ÷è. Çà äà ñëîæèòå âàøèÿ òåêñò âúâ ôàéë, òðÿáâà äà „íàìåðèòå“ +(find) ôàéëà ïðåäè äà âúâåæäàòå òåêñò. (Òîâà ñúùî ñå íàðè÷à +„ïîñåùàâàíå“ (visit) íà ôàéë.) Íàìèðàíå íà ôàéë îçíà÷àâà, ÷å âèæäàòå ñúäúðæàíèåòî ìó â Åìàêñ.  ìíîãî ñëó÷àè òîâà å êàòî äà ðåäàêòèðàòå ñàìèÿ ôàéë. Îáà÷å ïðîìåíèòå, êîèòî ïðàâèòå, èçïîëçâàéêè Åìàêñ, íå îñòàâàò ïîñòîÿííè, äîêàòî íå -"çàïèøåòå" ôàéëà. Òîâà å òàêà, çà äà ñå ïðåäîòâðàòè îñòàâÿíåòî íà -ïîëóïðîìåíåí ôàéë â ñèñòåìàòà, êîãàòî íå èñêàòå òîâà. Äîðè êîãàòî +„çàïèøåòå“ (save) ôàéëà. Òîâà å òàêà, çà äà ñå ïðåäîòâðàòè îñòàâÿíåòî +íà ïîëóïðîìåíåí ôàéë â ñèñòåìàòà, êîãàòî íå èñêàòå òîâà. Äîðè êîãàòî çàïèñâàòå, Åìàêñ îñòàâÿ íà÷àëíèÿ ôàéë ïîä ïðîìåíåíî èìå, â ñëó÷àé, ÷å ïî-êúñíî ðåøèòå, ÷å âàøèòå ïðîìåíè ñà áèëè ãðåøêà. -Àêî ïîãëåäíåòå â äúíîòî íà åêðàíà, ùå âèäèòå ðåä, êîéòî çàïî÷âà è -çàâúðøâà ñ òèðåòà è çàïî÷âà ñ "-b:-- TUTORIAL.bg" èëè íåùî ïîäîáíî. -Òàçè ÷àñò îò åêðàíà ïîêàçâà èìåòî íà ôàéëà, êîéòî ñòå ïîñåòèëè. Òî÷íî -ñåãà âèå ñòå ïîñåòèëè ôàéë, íàðå÷åí "TUTORIAL.bg", êîéòî å âàøåòî -ëè÷íî êîïèå-÷åðíîâà íà Åìàêñ âúâåäåíèåòî. Êîãàòî íàìåðèòå ôàéë â -Åìàêñ, èìåòî íà òîçè ôàéë ùå ñå ïîÿâè íà ñúùîòî ìÿñòî. +Àêî ïîãëåäíåòå â äúíîòî íà åêðàíà, ùå âèäèòå ðåä, êîéòî çàïî÷âà ñ +òèðåòà – „ b:--- TUTORIAL.bg“ èëè íåùî ïîäîáíî. Òàçè ÷àñò îò åêðàíà +ïîêàçâà èìåòî íà ôàéëà, êîéòî ñòå ïîñåòèëè. Òî÷íî ñåãà âèå ñòå +ïîñåòèëè ôàéë, íàðå÷åí „TUTORIAL.bg“, êîéòî å âàøåòî ëè÷íî +êîïèå-÷åðíîâà íà Åìàêñ âúâåäåíèåòî. Êîãàòî íàìåðèòå ôàéë â Åìàêñ, +èìåòî íà òîçè ôàéë ùå ñå ïîÿâè íà òîâà ìÿñòî. Îñîáåíîñò íà êîìàíäàòà çà íàìèðàíå íà ôàéë å, ÷å òðÿáâà äà êàæåòå -èìåòî íà ôàéëà, êîéòî èñêàòå. Íèå ãî íàðè÷àìå "÷åòåíå íà àðãóìåíò îò -òåðìèíàëà" (â òîçè ñëó÷àé àðãóìåíòúò å èìåòî íà ôàéëà). Ñëåä êàòî +èìåòî íà ôàéëà, êîéòî èñêàòå. Êàçâàìå, ÷å êîìàíäàòà „÷åòå íà +àðãóìåíò“ (â òîçè ñëó÷àé àðãóìåíòúò å èìåòî íà ôàéëà). Ñëåä êàòî âúâåäåòå êîìàíäàòà C-x C-f Íàìèðàíå íà ôàéë Åìàêñ âè ïîäêàíÿ äà âúâåäåòå èìåòî íà ôàéëà. Èìåòî íà ôàéëà, êîåòî íàïèøåòå, ñå ïîÿâÿâà â äúíîòî íà åêðàíà. Ðåäúò â äúíîòî íà åêðàíà ñå -íàðè÷à ìèíèáóôåð, êîãàòî ñå èçïîëçâà çà òîçè âèä âõîä. Ìîæåòå äà +íàðè÷à ìèíèáóôåð, êîãàòî ñå èçïîëçâà çà òîçè âèä âúâåæäàíå. Ìîæåòå äà èçïîëçâàòå îáèêíîâåíèòå êîìàíäè çà ðåäàêòèðàíå íà Åìàêñ, çà äà ðåäàêòèðàòå èìåòî íà ôàéëà. @@ -541,35 +538,36 @@ C_- å, ÷å íà íÿêîè êëàâèàòóðè íå å î÷åâèäíî êàê òðÿáâà äà ñå âúâåäå. Òàêà ÷å íå íàìèðàòå ôàéë. Êîãàòî ïðèêëþ÷èòå ñ âúâåæäàíåòî íà èìåòî íà ôàéëà, âúâåäåòå <Return>, -çà äà ïîêàæåòå òîâà. Òîãàâà C-x C-f òðúãâà äà ðàáîòè è íàìèðà ôàéëà, -êîéòî ñòå èçáðàëè. Ìèíèáóôåðúò èç÷åçâà, êîãàòî êîìàíäàòà C-x C-f -ñâúðøè. +çà äà çàâúðøèòå. Ìèíèáóôåðúò èç÷åçâà è êîìàíäàòà C-x C-f òðúãâà äà +ðàáîòè è íàìèðà ôàéëà, êîéòî ñòå èçáðàëè. Ñëåä ìàëêî ñúäúðæàíèåòî íà ôàéëà ñå ïîÿâÿâà íà åêðàíà è âèå ìîæåòå äà ðåäàêòèðàòå ñúäúðæàíèåòî ìó. Êîãàòî ïîæåëàåòå äà çàïàçèòå âàøèòå ïðîìåíè çà ïîñòîÿííî, âúâåäåòå êîìàíäàòà - C-x C-s Çàïàçâàíå íà ôàéëà + C-x C-s Çàïèñ (save) íà ôàéëà Òîâà êîïèðà òåêñòà îò Åìàêñ âúâ ôàéëà. Ïúðâèÿ ïúò, êîãàòî òîâà ñå íàïðàâè, Åìàêñ ïðåèìåíóâà íà÷àëíèÿ ôàéë ñ íîâî èìå, òàêà ÷å òîé äà íå -ñå èçãóáè. Íîâîòî èìå ñå ïîñòðîÿâà ñ äîáàâÿíå íà "~" â êðàÿ íà èìåòî +ñå èçãóáè. Íîâîòî èìå ñå ïîñòðîÿâà ñ äîáàâÿíå íà „~“ â êðàÿ íà èìåòî íà íà÷àëíèÿ ôàéë. Êîãàòî çàïàçâàíåòî å ñâúðøèëî, Åìàêñ èçâåæäà èìåòî íà ôàéëà, êîéòî å áèë çàïèñàí. Òðÿáâà äà çàïèñâàòå äîñòàòú÷íî ÷åñòî, òàêà ÷å äà íå -èçãóáèòå ìíîãî ðàáîòà, àêî ñèñòåìàòà ñå ñðèíå ïî íÿêàêâà ïðè÷èíà. +èçãóáèòå ìíîãî ðàáîòà, àêî ñèñòåìàòà ñå ñðèíå ïî íÿêàêâà ïðè÷èíà +(âæ. ðàçäåëà „Àâòîìàòè÷åí çàïèñ“ ïî-äîëó). ->> Âúâåäåòå C-x C-s, çàïàçâàéêè âàøåòî êîïèå îò âúâåäåíèåòî. - Òîâà òðÿáâà äà èçâåäå "Wrote ...TUTORIAL.bg" â äúíîòî íà åêðàíà. +>> Âúâåäåòå C-x C-s TUTORIAL.bg <Return>. + Òîâà ùå çàïèøå âúâåäåíèåòî âúâ ôàéë ñ èìå TUTORIAL.bg è ùå ïîêàæå + „Wrote ...TUTORIAL.bg“ â äúíîòî íà åêðàíà. Ìîæå äà íàìåðèòå ñúùåñòâóâàù ôàéë, äà ãî ðàçãëåäàòå è äà ãî ðåäàêòèðàòå. Ìîæåòå ñúùî äà íàìåðèòå ôàéë, êîéòî íå ñúùåñòâóâà. Òîâà å íà÷èíúò çà ñúçäàâàíå íà íîâè ôàéëîâå â Åìàêñ: íàìèðàòå ôàéëà, êîéòî ùå áúäå â íà÷àëîòî ïðàçåí, è òîãàâà çàïî÷âàòå âìúêâàíåòî íà òåêñòà çà -ôàéëà. Êîãàòî ãîâîðèòå çà "çàïèñâàíå" íà ôàéë, Åìàêñ âñúùíîñò ùå -ñúçäàäå ôàéëà ñ òåêñòà, êîéòî ñòå âúâåëè. Îòòàì íàòàòúê ìîæå äà -ñ÷èòàòå, ÷å ðåäàêòèðàòå âå÷å ñúùåñòâóâàù ôàéë. +ôàéëà. Êîãàòî èñêàòå „çàïèñ“ íà ôàéë, Åìàêñ âñúùíîñò ùå ñúçäàäå ôàéëà +ñ òåêñòà, êîéòî ñòå âúâåëè. Îòòàì íàòàòúê ìîæå äà ñ÷èòàòå, ÷å +ðåäàêòèðàòå âå÷å ñúùåñòâóâàù ôàéë. * ÁÓÔÅÐÈ @@ -579,53 +577,50 @@ C_- å, ÷å íà íÿêîè êëàâèàòóðè íå å î÷åâèäíî êàê òðÿáâà äà ñå âúâåäå. Ìîæåòå äà ïðåâêëþ÷èòå îáðàòíî êúì íåãî, êàòî ãî íàìåðèòå ïàê ñ C-x C-f. Ïî òîçè íà÷èí ìîæå äà ïîëó÷èòå äîñòà íà áðîé ôàéëîâå â Åìàêñ. ->> Ñúçäàéòå ôàéë ñ èìå "foo", âúâåæäàéêè C-x C-f foo <Return>. - Âìúêíåòå ìàëêî òåêñò, ðåäàêòèðàéòå ãî è çàïàçåòå "foo" ñ âúâåæäàíå - íà C-x C-s. - Íàêðàÿ âúâåäåòå C-x C-f TUTORIAL.bg <Return>, çà äà ñå âúðíåòå - îáðàòíî âúâ âúâåäåíèåòî. - -Åìàêñ çàïàçâà òåêñòà íà âñåêè ôàéë â îáåêò, íàðè÷àí "áóôåð". -Íàìèðàíåòî íà ôàéë ïðàâè íîâ áóôåð â Åìàêñ. Çà äà âèäèòå ñïèñúê íà -áóôåðèòå, êîèòî â ìîìåíòà ñúùåñòâóâàò âúâ âàøèÿ Åìàêñ, âúâåäåòå +Åìàêñ ñúõðàíÿâà òåêñòà íà âñåêè ôàéëà â îáåêò, íàðè÷àí „áóôåð“. +Íàìèðàíåòî íà ôàéë ñúçäàâà íîâ áóôåð âúòðå â Åìàêñ. Çà äà âèäèòå +ñïèñúê ñ âñè÷êè ñúùåñòâóâàùè áóôåðè, âúâåäåòå - C-x C-b Ïîêàçâàíå íà áóôåðèòå + C-x C-b Ñïèñúê íà áóôåðèòå ->> Îïèòàéòå C-x C-b ñåãà. +>> Îïèòàéòå C-x C-b îùå ñåãà. -Âèæòå êàê âñåêè áóôåð èìà èìå, à ïîíÿêîãà è èìå íà ôàéë çà ôàéëà, -÷èåòî ñúäúðæàíèå äúðæè. ÂÑÅÊÈ òåêñò, êîéòî âèæäàòå â Åìàêñ ïðîçîðåö, -å âèíàãè ÷àñò îò íÿêàêúâ áóôåð. +Çàáåëåæåòå, ÷å âñåêè áóôåð èìà èìå, à ñúùî ìîæå äà èìà è èìå íà ôàéë, +÷èåòî ñúäúðæàíèå ñå ïàçè â áóôåðà. ÂÑÅÊÈ òåêñò, êîéòî âèæäàòå â +ïðîçîðåö íà Åìàêñ, âèíàãè å ÷àñò îò íÿêîé áóôåð. ->> Âúâåäåòå C-x 1, çà äà ìàõíåòå ñïèñúêà ñ áóôåðèòå. +>> Âúâåäåòå C-x 1, çà äà ìàõíåòå ñïèñúêà íà áóôåðè. -Êîãàòî èìàòå íÿêîëêî áóôåðà, ñàìî åäèí îò òÿõ å "òåêóù" â äàäåí ìîìåíò +Êîãàòî èìàòå íÿêîëêî áóôåðà, ñàìî åäèí îò òÿõ å „òåêóù“ â äàäåí ìîìåíò îò âðåìå. Òîâà å áóôåðúò, êîéòî ðåäàêòèðàòå. Àêî èñêàòå äà -ðåäàêòèðàòå äðóã áóôåð, ñå íóæäàåòå îò "ïðåâêëþ÷âàíå" êúì íåãî. Àêî +ðåäàêòèðàòå äðóã áóôåð, ñå íóæäàåòå îò „ïðåâêëþ÷âàíå“ êúì íåãî. Àêî èñêàòå äà ñå ïðåâêëþ÷èòå êúì áóôåð, êîéòî ñúîòâåòñòâà íà ôàéë, ìîæåòå äà ãî íàïðàâèòå, êàòî ïðîñòî ïîñåòèòå ôàéëà îòíîâî ñ C-x C-f. Íî èìà è ïî-ëåñåí íà÷èí: èçïîëçâàíåòî íà êîìàíäàòà C-x b.  òàçè êîìàíäà òðÿáâà äà âúâåäåòå èìåòî íà áóôåðà. ->> Âúâåäåòå C-x b foo <Return>, çà äà ñå âúðíåòå êúì áóôåðà "foo", - êîéòî äúðæè òåêñòà íà ôàéëà "foo". Òîãàâà âúâåäåòå C-x b TUTORIAL - <Return>, çà äà ñå âúðíåòå â òîâà âúâåäåíèå. +>> Ñóçäàéòå ôàéë ñ èìå „foo“ ÷ðåç âúâåæäàíå íà C-x C-f foo <Return>. + Òîãàâà âúâåäåòå C-x b TUTORIAL.bg <Return>, çà äà ñå âúðíåòå â òîâà + âúâåäåíèå.  ïîâå÷åòî ñëó÷àè èìåòî íà áóôåðà å ñúùîòî êàòî èìåòî íà ôàéëà (áåç ÷àñòòà â êîÿ äèðåêòîðèÿ ñå íàìèðà). Îáà÷å òîâà íå âèíàãè å âÿðíî. -Ñïèñúêúò ñ áóôåðèòå, êîéòî ïðàâèòå ñ C-x C-b, âèíàãè âè ïîêàçâà èìåòî -íà âñåêè áóôåð. +Ñïèñúêúò ñ áóôåðèòå, êîéòî ïðàâèòå ñ C-x C-b, âèíàãè âè ïîêàçâà è +èìåòî íà áóôåðà, è èìåòî íà ôàéëà. ÂÑÅÊÈ òåêñò, êîéòî âèæäàòå â Åìàêñ ïðîçîðåö, å âèíàãè ÷àñò îò íÿêàêúâ -áóôåð. Íÿêîè áóôåðè íå ñúîòâåòñòâàò íà ôàéëîâå. Íàïðèìåð áóôåðúò, -èìåíóâàí "*Buffer List*", íå ñúîòâåòñòâà íà ôàéë. Òîâà å áóôåðúò, -êîéòî ñúäúðæà ñïèñúêà ñ áóôåðèòå, êîèòî ñòå íàïðàâèëè ñ C-x C-b. -Áóôåðúò, èìåíóâàí "*Messages*", ñúùî íå ñúîòâåòñòâà íà ôàéë; òîé +áóôåð. Íÿêîè áóôåðè íå ñúîòâåòñòâàò íà ôàéëîâå. Áóôåðúò, èìåíóâàí +„*Buffer List*“, êîèòî ñòå íàïðàâèëè ñ C-x C-b, íå ñúîòâåòñòâà íà +ôàéë. Òîâà å áóôåðúò, êîéòî ñúäúðæà ñïèñúêà ñ áóôåðèòå. Òîçè áóôåð +TUTORIAL.bg îòíà÷àëî íå å áèë êúì ôàéë, íî âå÷å å, çàùîòî â ïðåäèøíèÿ +ðàçäåë âúâåäîõòå C-x C-s è ãî çàïèñàõòå âúâ ôàéë. + +Áóôåðúò, èìåíóâàí „*Messages*“, ñúùî íå ñúîòâåòñòâà íà ôàéë; òîé ñúäúðæà ñúîáùåíèÿòà, êîèòî ñå ïîÿâÿâàò â äúíîòî íà åêðàíà ïî âðåìå íà Åìàêñ ñåñèÿòà. >> Âúâåäåòå C-x b *Messages* <Return>, çà äà âèäèòå áóôåðà ñúñ - ñúîáùåíèÿòà. Ñëåä òîâà âúâåäåòå C-x b TUTORIAL <Return>, çà äà + ñúîáùåíèÿòà. Ñëåä òîâà âúâåäåòå C-x b TUTORIAL.bg <Return>, çà äà ñå âúðíåòå êúì òîâà âúâåäåíèå. Àêî íàïðàâèòå ïðîìåíè â òåêñòà íà åäèí ôàéë è òîãàâà íàìåðèòå äðóã @@ -636,14 +631,15 @@ C-f. Ïî òîçè íà÷èí ìîæå äà ïîëó÷èòå äîñòà íà áðîé ôàéëîâå â Åìàêñ. áóôåðà íà ïúðâèÿ ôàéë. Ùå å íåóäîáíî äà ïðåâêëþ÷èòå îáðàòíî ñ C-x C-f, çà äà ãî çàïàçèòå ñ C-x C-s. Òàêà ÷å èìàìå - C-x s Çàïàçâà íÿêîè áóôåðè + C-x s Çàïèñ íà íÿêîè (some) áóôåðè C-x s ïèòà çà âñåêè áóôåð, êîéòî ñúäúðæà ïðîìåíè, êîèòî íå ñòå -çàïàçèëè. Âúïðîñúò çà âñåêè òàêúâ áóôåð å äàëè äà áúäå çàïàçåí. +çàïàçèëè. Êîìàíäàòà çàäàâà âúïðîñ çà âñåêè òàêúâ áóôåð äàëè äà áúäå +çàïàçåí. ->> Âìúêíåòå ðåä â òåêñòà, ñëåä òîâà âúâåäåòå C-x s. - Òðÿáâà äà áúäåòå ïîïèòàí äàëè äà çàïàçèòå áóôåðà, èìåíóâàí "TUTORIAL". - Îòãîâîðåòå ñ "äà" íà âúïðîñà, êàòî âúâåäåòå "y". +>> Âìúêíåòå ðåä ñ òåêñò, ñëåä òîâà âúâåäåòå C-x s. + Òðÿáâà äà áúäåòå ïîïèòàí äàëè äà çàïàçèòå áóôåðà, èìåíóâàí „TUTORIAL.bg“. + Îòãîâîðåòå ñ „äà“ íà âúïðîñà, êàòî âúâåäåòå „y“ (yes). * ÐÀÇØÈÐßÂÀÍÅ ÍÀ ÍÀÁÎÐÀ ÊÎÌÀÍÄÈ @@ -659,53 +655,47 @@ C-x s ïèòà çà âñåêè áóôåð, êîéòî ñúäúðæà ïðîìåíè, êîèòî íå ñòå Òåçè êîìàíäè ñà îáùî âçåòî ïîëåçíè, íî ïî-ìàëêî, îòêîëêîòî êîìàíäèòå, êîèòî äîñåãà ñòå íàó÷èëè. Âå÷å âèäÿõòå äâå îò òÿõ: êîìàíäèòå âúðõó -ôàéëîâå C-x C-f çà íàìèðàíå (Find) è C-x C-s çà çàïàçâàíå (Save). -Äðóã ïðèìåð å êîìàíäàòà çà êðàé íà Åìàêñ ñåñèÿòà -- òîâà å êîìàíäàòà -C-x C-c. (Íå ñå áåçïîêîéòå, ÷å ìîæå äà èçãóáèòå âñè÷êè ïðîìåíè, êîèòî -ñòå íàïðàâèëè; C-x C-c ïðåäëàãà äà çàïàçè âñåêè ïðîìåíåí ôàéë, ïðåäè -äà ïðåìàõíå Åìàêñ.) - -C-z å êîìàíäàòà çà èçëèçàíå îò Åìàêñ *âðåìåííî* -- òàêà ÷å äà ìîæåòå -äà ñå âúðíåòå êúì ñúùàòà Åìàêñ ñåñèÿ ïî-êúñíî. +ôàéëîâå C-x C-f çà íàìèðàíå (Find) è C-x C-s çà çàïèñ (Save). Äðóã +ïðèìåð å êîìàíäàòà çà êðàé íà Åìàêñ ñåñèÿòà -- òîâà å êîìàíäàòà C-x +C-c. (Íå ñå áåçïîêîéòå, ÷å ìîæå äà èçãóáèòå âñè÷êè ïðîìåíè, êîèòî ñòå +íàïðàâèëè; C-x C-c ïðåäëàãà äà çàïàçè âñåêè ïðîìåíåí ôàéë, ïðåäè äà +ïðåìàõíå Åìàêñ.) -Íà ñèñòåìè, êîèòî ïîçâîëÿâàò òîâà, C-z "èçîñòàâÿ" (suspend) Åìàêñ, -ò.å. âðúùà êúì îáâèâêàòà, íî íå ðàçðóøàâà Åìàêñ.  ïîâå÷åòî îáâèâêè -ìîæåòå äà ïðîäúëæèòå Åìàêñ ñåñèÿòà ñ êîìàíäàòà "fg" èëè ñ "%emacs". +Àêî ñòå íà ãðàôè÷åí äèñïëåé, íå å íóæíà ñïåöèàëíà êîìàíäà çà +ïðèäâèæâàíå îò Åìàêñ êúì äðóãî ðàáîòåùî ïðèëîæåíèå. Ìîæåòå äà +èçâúðøèòå òîâà ñ ìèøêàòà èëè ñ êîìàíäè êúì óïðàâëåíèåòî íà ïðîçîðöè. +Íî àêî ñòå íà òåêñòîâ òåðìèíàë, êîéòî ìîæå äà ïîêàçâà ñàìî åäíî +ïðèëîæåíèå â äàäåí ìîìåíò, ñå íóæäàåòå îò íà÷èí çà „èçîñòàâÿíå“ +(suspend) íà Åìàêñ è ïðèäâèæâàíå êúì äðóãè ïðîãðàìè. -Íà ñèñòåìè, êîèòî íå ïîçâîëÿâàò èçîñòàâÿíå, C-z ñúçäàâà íîâà -ïîäîáâèâêà, êîÿòî âúðâè ïîä Åìàêñ, çà äà âè äàäå øàíñ äà ñòàðòèðàòå -äðóãè ïðîãðàìè è äà ñå âúðíåòå êúì Åìàêñ ñëåä òîâà; òîâà íå å èñòèíñêî -"èçëèçàíå" îò Åìàêñ.  òîçè ñëó÷àé êîìàíäàòà íà îáâèâêàòà "exit" å -îáèêíîâåíèÿò íà÷èí äà ñå âúðíåòå îáðàòíî êúì Åìàêñ îò ïîäîáâèâêàòà. - -Ìîìåíòúò äà èçïîëçâàòå C-x C-c å, êîãàòî èñêàòå äà èçëåçåòå îò -ñèñòåìàòà. Òîâà å è ïðàâèëíàòà êîìàíäà çà èçëèçàíå, êîãàòî Åìàêñ å -èçâèêàí îò ïîùåíñêà ïðîãðàìà èëè äðóãè ñòðàíè÷íè ïðîãðàìè, òúé êàòî òå -ìîæå è äà íå çíàÿò êàê äà ñå ñïðàâÿò ñ èçîñòàâÿíåòî íà Åìàêñ. Ïðè -îáèêíîâåíè îáñòîÿòåëñòâà, îáà÷å, àêî íå ñòå òðúãíàëè äà èçëèçàòå îò -ñèñòåìàòà, ïî-äîáðå å äà èçîñòàâèòå Åìàêñ ñ C-z, âìåñòî äà èçëèçàòå îò -Åìàêñ. +C-z å êîìàíäàòà çà èçëèçàíå îò Åìàêñ *âðåìåííî* – òàêà ÷å äà ìîæåòå äà +ñå âúðíåòå êúì ñúùàòà Åìàêñ ñåñèÿ ïî-êúñíî. Êîãàòî Åìàêñ âúðâè íà +òåêñòîâ òåðìèíàë, C-z „èçîñòàâÿ“ Åìàêñ, ò.å. âðúùà ñå êúì îáâèâêàòà, +íî íå óíèùîæàâà çàäà÷àòà (job) íà Åìàêñ.  ïîâå÷åòî ïîïóëÿðíè îáâèâêè +ìîæåòå äà ïðîäúëæèòå Åìàêñ ñ êîìàíäàòà „fg“ èëè ñ „%emacs“. Èìà ìíîãî êîìàíäè C-x. Åòî ñïèñúê íà òåçè, êîèòî ñòå íàó÷èëè: - C-x C-f Íàìèðàíå íà ôàéë. - C-x C-s Çàïàçâàíå íà ôàéë. - C-x C-b Ñïèñúê íà áóôåðèòå. - C-x C-c Èçëèçàíå îò Åìàêñ. - C-x 1 Èçòðèâàíå íà âñè÷êè ïðîçîðöè îñâåí åäèí. - C-x u Îòìÿíà. + C-x C-f Íàìèðàíå íà ôàéë + C-x C-s Çàïèñ íà ôàéë + C-x s Çàïèñ íà íÿêîè áóôåðè + C-x C-b Ñïèñúê íà áóôåðèòå + C-x b Ïðåâêëþ÷âàíå êúì áóôåð + C-x C-c Èçëèçàíå îò Åìàêñ + C-x 1 Èçòðèâàíå íà âñè÷êè ïðîçîðöè îñâåí åäèí + C-x u Îòìÿíà -Èìåíóâàíèòå ðàçøèðåíè êîìàíäè ñà êîìàíäè, êîèòî ñå èçïîëçâàò äàæå îùå -ïî-ðÿäêî, èëè êîìàíäè, êîèòî ñå èçïîëçâàò ñàìî â îïðåäåëåíè ðåæèìè. -Ïðèìåð å êîìàíäàòà replace-string, êîÿòî çàìåíÿ ãëîáàëíî åäèí íèç ñ -äðóã. Êîãàòî âúâåäåòå M-x, Åìàêñ âè ïîäñêàçâà â äúíîòî íà åêðàíà ñ -M-x è âèå òðÿáâà äà âúâåäåòå èìåòî íà êîìàíäàòà, â òîçè ñëó÷àé -"replace-string". Ïðîñòî âúâåäåòå "repl s<TAB>" è Åìàêñ ùå çàâúðøè -èìåòî. (<TAB> å êëàâèøúò Tab, îáèêíîâåíî íàìèðàù ñå íàä êëàâèøà -CapsLock èëè êëàâèøà Shift áëèçî äî ëåâèÿ êðàé íà êëàâèàòóðàòà.) -Çàâúðøåòå èìåòî íà êîìàíäàòà ñ <Return>. +Èìåíóâàíèòå ðàçøèðåíè (X) êîìàíäè ñà êîìàíäè, êîèòî ñå èçïîëçâàò äàæå +îùå ïî-ðÿäêî, èëè êîìàíäè, êîèòî ñå èçïîëçâàò ñàìî â îïðåäåëåíè +ðåæèìè. Ïðèìåð å êîìàíäàòà replace-string, êîÿòî çàìåíÿ ãëîáàëíî åäèí +íèç ñ äðóã. Êîãàòî âúâåäåòå M-x, Åìàêñ âè ïîäñêàçâà â äúíîòî íà +åêðàíà ñ M-x è âèå òðÿáâà äà âúâåäåòå èìåòî íà êîìàíäàòà, â òîçè +ñëó÷àé „replace-string“. Ïðîñòî âúâåäåòå „repl s<TAB>“ è Åìàêñ ùå +çàâúðøè èìåòî. (<TAB> å êëàâèøúò Tab, îáèêíîâåíî íàìèðàù ñå íàä +êëàâèøà CapsLock èëè êëàâèøà Shift áëèçî äî ëåâèÿ êðàé íà +êëàâèàòóðàòà.) Çàâúðøåòå èìåòî íà êîìàíäàòà ñ <Return>. -Êîìàíäàòà replace-string èçèñêâà äâà àðãóìåíòà -- íèçúò, êîéòî ùå áúäå +Êîìàíäàòà replace-string èçèñêâà äâà àðãóìåíòà – íèçúò, êîéòî ùå áúäå çàìåíÿí, è íèçúò, êîéòî ùå ãî çàìåíè. Òðÿáâà äà çàâúðøèòå âúâåæäàíåòî íà âñåêè àðãóìåíò ñ <Return>. @@ -713,28 +703,26 @@ CapsLock èëè êëàâèøà Shift áëèçî äî ëåâèÿ êðàé íà êëàâèàòóðàòà.) Òîãàâà âúâåäåòå M-x repl s<Return>ïðîìåíÿ<Return>èçìåíÿ<Return> Çàáåëåæåòå êàê òîçè ðåä ñå ïðîìåíÿ: âèå çàìåíèõòå äóìàòà - ï-ð-î-ì-å-í-ÿ ñ "èçìåíÿ", êúäåòî è äà ñå íàìèðà ñëåä íà÷àëíîòî + ï-ð-î-ì-å-í-ÿ ñ „èçìåíÿ“, êúäåòî è äà ñå íàìèðà ñëåä íà÷àëíîòî ìÿñòî íà êóðñîðà. -ÇÀÁÅËÅÆÊÀ: Ïðåâêëþ÷âàíåòî êúì âúâåæäàíå íà êèðèëñêè áóêâà ñòàâà ñ C-\. - * ÀÂÒÎÌÀÒÈ×ÍÎ ÇÀÏÀÇÂÀÍÅ ----------------------- Êîãàòî ñòå íàïðàâèëè ïðîìåíè âúâ ôàéë, íî îùå íå ñòå ãî çàïàçèëè, òå ìîãàò äà áúäàò çàãóáåíè, àêî êîìïþòúðúò âíåçàïíî ñå èçêëþ÷è. Çà äà âè -ïðåäïàçè îò òàêèâà ñèòóàöèè, Åìàêñ ïåðèîäè÷íî çàïàçâà "àâòîìàòè÷íî -çàïàçâàí" ôàéë çà âñåêè ôàéë, êîéòî ðåäàêòèðàòå. Èìåòî íà àâòîìàòè÷íî +ïðåäïàçè îò òàêèâà ñèòóàöèè, Åìàêñ ïåðèîäè÷íî çàïàçâà „àâòîìàòè÷íî +çàïàçâàí“ ôàéë çà âñåêè ôàéë, êîéòî ðåäàêòèðàòå. Èìåòî íà àâòîìàòè÷íî çàïàçâàíèÿ ôàéë èìà # â íà÷àëîòî è â êðàÿ; íàïðèìåð, àêî âàøèÿò ôàéë å -ñ èìå "hello.c", èìåòî íà íåãîâèÿ àâòîìàòè÷íî çàïàçâàí ôàéë ùå áúäå +ñ èìå „hello.c“, èìåòî íà íåãîâèÿ àâòîìàòè÷íî çàïàçâàí ôàéë ùå áúäå "#hello.c#". Êîãàòî çàïàçâàòå ôàéë ïî îáèêíîâåíèÿ íà÷èí, Åìàêñ èçòðèâà íåãîâèÿ àâòîìàòè÷íî çàïèñâàí ôàéë. Àêî êîìïþòúðúò çàâèñíå, ìîæå äà âúçñòàíîâèòå âàøàòà àâòîìàòè÷íî çàïàçâàíà ðåäàêöèÿ, êàòî íàìåðèòå ôàéëà êàêòî îáèêíîâåíî (ôàéëúò, êîéòî ñòå ðåäàêòèðàëè, íå àâòîìàòè÷íî çàïàçâàíèÿ) è ñëåä òîâà âúâåäåòå -M-x recover file<Return>. Êîãàòî êîìàíäàòà èçèñêà ïîòâúðæäåíèå, +M-x recover-file <Return>. Êîãàòî êîìàíäàòà èçèñêà ïîòâúðæäåíèå, âúâåäåòå yes<Return>, çà äà ïðîäúëæèòå è äà âúçñòàíîâèòå àâòîìàòè÷íî çàïàçâàíèòå äàííè. @@ -743,28 +731,28 @@ M-x recover file<Return>. Êîãàòî êîìàíäàòà èçèñêà ïîòâúðæäåíèå, -------------- Àêî Åìàêñ âèäè, ÷å âúâåæäàòå ìíîãîçíàêîâè êîìàíäè áàâíî, ùå âè ãè -ïîêàæå â äúíîòî íà åêðàíà, â îáëàñò, íàðè÷àíà "åõî îáëàñò". Åõî +ïîêàæå â äúíîòî íà åêðàíà, â îáëàñò, íàðè÷àíà „åõî îáëàñò“. Åõî îáëàñòòà îáõâàùà ïîñëåäíèÿ ðåä îò åêðàíà. * ÐÅÄ ÍÀ ÐÅÆÈÌÀ ---------------- -Ðåäúò òî÷íî íàä åõî îáëàñòòà ñå íàðè÷à "ðåä íà ðåæèìà" (mode line). +Ðåäúò òî÷íî íàä åõî îáëàñòòà ñå íàðè÷à „ðåä íà ðåæèìà“ (mode line). Òîé ïîêàçâà íåùî êàòî: --b:** TUTORIAL.bg (Fundamental)--L670--58%---------------- + b:**- TUTORIAL.bg 63% L744 (Fundamental) Òîçè ðåä äàâà ïîëåçíà èíôîðìàöèÿ çà ñúñòîÿíèåòî íà Åìàêñ è òåêñòà, êîéòî ðåäàêòèðàòå. -Âå÷å çíàåòå êàêâî îçíà÷àâà èìåòî íà ôàéëà -- òîâà å ôàéëúò, êîéòî ñòå -íàìåðèëè. -NN%-- ïîêàçâà âàøàòà òåêóùà ïîçèöèÿ â òåêñòà; òîâà -îçíà÷àâà, ÷å NN ïðîöåíòà îò òåêñòà å íàä âúðõà íà åêðàíà. Àêî -íà÷àëîòî íà ôàéëà å íà åêðàíà, ùå ñå ïîêàçâà --Top-- (âðúõ) âìåñòî ---00%--. Àêî êðàÿ íà ôàéëà å íà åêðàíà, ùå ñå ïîêàçâà --Bot-- (äúíî). -Àêî ãëåäàòå òåêñò, êîéòî å òîëêîâà ìàëúê, ÷å ñå ïîêàçâà èçöÿëî íà -åêðàíà, ðåäúò íà ðåæèìà ùå èçâåäå --All--. +Âå÷å çíàåòå êàêâî îçíà÷àâà èìåòî íà ôàéëà – òîâà å ôàéëúò, êîéòî ñòå +íàìåðèëè. NN% ïîêàçâà âàøàòà òåêóùà ïîçèöèÿ â òåêñòà; òîâà îçíà÷àâà, +÷å NN ïðîöåíòà îò òåêñòà å íàä âúðõà íà åêðàíà. Àêî íà÷àëîòî íà ôàéëà +å íà åêðàíà, ùå ñå ïîêàçâà „Top“ (âðúõ) âìåñòî „ 0%“. Àêî êðàÿ íà +ôàéëà å íà åêðàíà, ùå ñå ïîêàçâà „Bot“ (bottom – äúíî). Àêî ãëåäàòå +òåêñò, êîéòî å òîëêîâà ìàëúê, ÷å ñå ïîêàçâà èçöÿëî íà åêðàíà, ðåäúò íà +ðåæèìà ùå èçâåäå „All“ (âñè÷êî). Çíàêúò L è öèôðèòå ïîêàçâàò ìÿñòîòî ïî äðóã íà÷èí: òîâà å íîìåðúò íà òåêóùèÿ ðåä íà òî÷êàòà. @@ -776,13 +764,13 @@ M-x recover file<Return>. Êîãàòî êîìàíäàòà èçèñêà ïîòâúðæäåíèå, ×àñòòà îò ðåäà íà ðåæèìà âúòðå â ñêîáèòå å, çà äà âè ïîêàæå â êàêúâ ðåæèì íà ðåäàêòèðàíå ñå íàìèðàòå. Ïîäðàçáèðàùèÿò ñå ðåæèì å Fundamental (Îñíîâåí), êîéòî èçïîëçâàòå â ìîìåíòà. Òîâà å ïðèìåð çà -"ãëàâåí ðåæèì" (major mode). +„ãëàâåí ðåæèì“ (major mode). Åìàêñ èìà ìíîãî ãëàâíè ðåæèìè. Íÿêîè îò òÿõ ñà ïðåäâèäåíè çà ðåäàêòèðàíå íà ðàçëè÷íè åçèöè è/èëè âèäîâå òåêñò, êàòî íàïðèìåð ðåæèì -Ëèñï, ðåæèì Òåêñò è äðóãè. Âúâ âñåêè åäèí ìîìåíò îò âðåìå òî÷íî åäèí -ãëàâåí ðåæèì å àêòèâåí è íåãîâîòî èìå ìîæå âèíàãè äà áúäå íàìåðåíî â -ðåäà íà ðåæèìà, òî÷íî êàêòî "Fundamental" ñåãà. +Lisp (Ëèñï), ðåæèì Text (òåêñò) è äðóãè. Âúâ âñåêè åäèí ìîìåíò îò +âðåìå òî÷íî åäèí ãëàâåí ðåæèì å àêòèâåí è íåãîâîòî èìå ìîæå âèíàãè äà +áúäå íàìåðåíî â ðåäà íà ðåæèìà, òî÷íî êàêòî „Fundamental“ ñåãà. Âñåêè ãëàâåí ðåæèì ïðàâè íÿêîè êîìàíäè äà ñå äúðæàò ïî ðàçëè÷åí íà÷èí. Íàïðèìåð, èìà êîìàíäè çà ðåäàêòèðàíå íà êîìåíòàðè â ïðîãðàìè, è òúé @@ -793,9 +781,9 @@ Fundamental (Îñíîâåí), êîéòî èçïîëçâàòå â ìîìåíòà. Òîâà å ïðèìåð çà êîìàíäà çà ïðåâêëþ÷âàíå êúì ðåæèì Fundamental. Êîãàòî ðåäàêòèðàòå òåêñò íà åñòåñòâåí åçèê, êàòî òîçè ôàéë, -íàé-âåðîÿòíî òðÿáâà äà èçïîëçâàòå ðåæèì Òåêñò (text). +íàé-âåðîÿòíî òðÿáâà äà èçïîëçâàòå ðåæèì Text (òåêñò). ->> Âúâåäåòå M-x text mode<Return>. +>> Âúâåäåòå M-x text-mode <Return>. Íå ñå áåçïîêîéòå, íèêîÿ îò Åìàêñ êîìàíäèòå, êîèòî ñòå íàó÷èëè, íÿìà äà ñå ïðîìåíè ïî íÿêàêúâ ñúùåñòâåí íà÷èí. Íî ìîæå äà çàáåëåæèòå, ÷å M-f @@ -804,13 +792,13 @@ Fundamental (Îñíîâåí), êîéòî èçïîëçâàòå â ìîìåíòà. Òîâà å ïðèìåð çà ðàçäåëèòåëè íà äóìè. Ãëàâíèòå ðåæèìè îáèêíîâåíî ïðàâÿò ìàëêè ïðîìåíè êàòî òàçè: ïîâå÷åòî -êîìàíäè âúðøàò "ñúùàòà ðàáîòà" âúâ âñåêè ãëàâåí ðåæèì, íî ðàáîòÿò ïî +êîìàíäè âúðøàò „ñúùàòà ðàáîòà“ âúâ âñåêè ãëàâåí ðåæèì, íî ðàáîòÿò ïî ìàëêî ïî-ðàçëè÷åí íà÷èí. Çà äà âèäèòå äîêóìåíòàöèÿòà íà âàøèÿ òåêóù ãëàâåí ðåæèì, âúâåäåòå C-h m. ->> Óïîòðåáåòå C-u C-v âåäíúæ èëè ïîâå÷å ïúòè, çà äà äîêàðàòå òîçè ðåä +>> Óïîòðåáåòå C-l C-l âåäíúæ èëè ïîâå÷å ïúòè, çà äà äîêàðàòå òîçè ðåä áëèçî äî âúðõà íà åêðàíà. >> Âúâåäåòå C-h m, çà äà âèäèòå êàê òåêñòîâèÿò ðåæèì ñå ðàçëè÷àâà îò îñíîâíèÿ ðåæèì. @@ -824,20 +812,20 @@ m. ìàëêè ðåæèìè, äà èçïîëçâàòå åäèí ìàëúê ðåæèì, èëè äà èçïîëçâàòå íÿêàêâà êîìáèíàöèÿ îò íÿêîëêî ìàëêè ðåæèìà. -Åäèí ãëàâåí ðåæèì, êîéòî å ìíîãî ïîëåçåí, îñîáåíî çà ðåäàêòèðàíå íà +Åäèí ìàëúê ðåæèì, êîéòî å ìíîãî ïîëåçåí, îñîáåíî çà ðåäàêòèðàíå íà òåêñò íà åñòåñòâåí åçèê, å ðåæèìúò íà àâòîìàòè÷íî çàïúëâàíå (Auto Fill mode). Êîãàòî òîçè ðåæèì å âêëþ÷åí, Åìàêñ àâòîìàòè÷íî ðàçäåëÿ ðåäà ïðè ìÿñòîòî ìåæäó äóìèòå, êîãàòî âìúêâàòå òåêñò è íàïðàâèòå ðåä, êîéòî å òâúðäå äúëúã. Ìîæå äà âêëþ÷èòå ðåæèìà íà àâòîìàòè÷íî çàïúëâàíå, êàòî èçïúëíèòå M-x -auto fill mode<Return>. Êîãàòî ðåæèìúò å âêëþ÷åí, ìîæå äà ãî -èçêëþ÷èòå ñ M-x auto fill mode<Return>. Àêî ðåæèìúò å èçêëþ÷åí, òàçè +auto-fill-mode <Return>. Êîãàòî ðåæèìúò å âêëþ÷åí, ìîæå äà ãî +èçêëþ÷èòå ñ M-x auto-fill-mode<Return>. Àêî ðåæèìúò å èçêëþ÷åí, òàçè êîìàíäà ãî âêëþ÷âà, à àêî å âêëþ÷åí, ãî èçêëþ÷âà. Êàçâàìå, ÷å -êîìàíäàòà "îáðúùà ðåæèìà". +êîìàíäàòà „ïðåâêëþ÷âà (toggle) ðåæèìà“. ->> Âúâåäåòå M-x auto fill mode<Return> ñåãà. Ñëåä òîâà âìúêíåòå ðåä - îò "asdf " îòíîâî è îòíîâî, äîêàòî íå âèäèòå, ÷å òåêñòúò ñå ðàçäåëÿ +>> Âúâåäåòå M-x auto-fill-mode <Return> ñåãà. Ñëåä òîâà âìúêíåòå ðåä + îò „asdf “ îòíîâî è îòíîâî, äîêàòî íå âèäèòå, ÷å òåêñòúò ñå ðàçäåëÿ íà äâà ðåäà. Òðÿáâà äà ñëàãàòå èíòåðâàëè ìåæäó äóìèòå, çàùîòî àâòîìàòè÷íîòî çàïúëâàíå ðàçäåëÿ ðåäîâåòå ñàìî ïðè èíòåðâàëèòå. @@ -866,51 +854,42 @@ auto fill mode<Return>. Êîãàòî ðåæèìúò å âêëþ÷åí, ìîæå äà ãî íà íèç å ïðèäâèæâàùà êóðñîðà êîìàíäà; òÿ ïðåìåñòâà êóðñîðà íà ñëåäâàùîòî ìÿñòî, êúäåòî ñå ñðåùà íèçúò. -Êîìàíäàòà çà òúðñåíå íà Åìàêñ ñå ðàçëè÷àâà îò êîìàíäàòà çà òúðñåíå íà -ïîâå÷åòî ðåäàêòîðè ïî òîâà, ÷å òÿ å "ïîñòúïêîâà". Òîâà îçíà÷àâà, ÷å +Êîìàíäàòà çà òúðñåíå íà Åìàêñ å „ïîñòúïêîâà“. Òîâà îçíà÷àâà, ÷å òúðñåíåòî ñå èçâúðøâà îùå äîêàòî âúâåæäàòå òåêñòà, êîéòî òúðñèòå. Êîìàíäàòà çà çàïî÷âàíå íà òúðñåíå å C-s çà òúðñåíå íàïðåä, è C-r çà òúðñåíå íàçàä. ÍÎ ÏÎ×ÀÊÀÉÒÅ! Íå ãè ïðîáâàéòå ñåãà. -Êîãàòî âúâåäåòå C-s, ùå çàáåëåæèòå, ÷å íèçúò "I-search" ñå ïîÿâÿâà +Êîãàòî âúâåäåòå C-s, ùå çàáåëåæèòå, ÷å íèçúò „I-search“ ñå ïîÿâÿâà êàòî ïîäñêàçêà â åõî îáëàñòòà. Òîâà âè êàçâà, ÷å Åìàêñ å â òîâà, êîåòî ñå íàðè÷à ïîñòúïêîâî òúðñåíå, ÷àêàéêè âè äà âúâåæäàòå òåêñòà, êîéòî èñêàòå äà òúðñèòå. <Return> ïðèêëþ÷âà òúðñåíåòî. >> Ñåãà âúâåäåòå C-s, çà äà çàïî÷íåòå òúðñåíåòî. ÁÀÂÍÎ, áóêâà ïî - áóêâà, âúâåäåòå äóìàòà "òúðñåíå", èç÷àêâàéêè ñëåä âúâåæäàíåòî íà + áóêâà, âúâåäåòå äóìàòà „êóðñîð“, èç÷àêâàéêè ñëåä âúâåæäàíåòî íà âñåêè çíàê, çà äà ìîæå äà çàáåëåæèòå êàêâî ñòàâà ñ êóðñîðà. Ñåãà - èçâúðøèõòå òúðñåíå íà "òúðñåíå" âåäíúæ. ->> Âúâåäåòå îòíîâî C-s, çà äà òúðñèòå äðóãî ñúâïàäåíèå ñ "òúðñåíå". ->> Ñåãà âúâåäåòå <Delback> òðè ïúòè è âèæòå êàê ñå ïðèäâèæâà êóðñîðà. + èçâúðøèõòå òúðñåíå íà „êóðñîð“ âåäíúæ. +>> Âúâåäåòå îòíîâî C-s, çà äà òúðñèòå äðóãî ñúâïàäåíèå ñ „êóðñîð“. +>> Ñåãà âúâåäåòå <DEL> ÷åòèðè ïúòè è âèæòå êàê ñå ïðèäâèæâà êóðñîðà. >> Âúâåäåòå <Return>, çà äà ïðåêðàòèòå òúðñåíåòî. Çàáåëÿçàõòå ëè êàêâî ñòàíà? Åìàêñ, êîãàòî òúðñè ïîñòúïêîâî, ñå îïèòâà äà íàìåðè ñëåäâàùîòî ñúâïàäåíèå íà íèçà, êîéòî ñå âúâåæäà. Çà äà -îòèäåòå íà ñëåäâàùîòî ñúâïàäåíèå íà "òúðñíå", ïðîñòî îòíîâî âúâåäåòå +îòèäåòå íà ñëåäâàùîòî ñúâïàäåíèå íà „êóðñîð“, ïðîñòî îòíîâî âúâåäåòå C-s. Àêî íÿìà òàêîâà ñúâïàäåíèå, Åìàêñ áèáèïâà è âè êàçâà, ÷å -òúðñåíåòî å "ïðîâàëåíî" (failing). C-g ñúùî ïðåêðàòÿâà òúðñåíåòî. +òúðñåíåòî å „ïðîâàëåíî“ (failing). C-g ñúùî òàêà ïðåêðàòÿâà +òúðñåíåòî. -ÇÀÁÅËÅÆÊÀ: Íà íÿêîè ñèñòåìè âúâåæäàíåòî íà C-s ùå çàìðàçè åêðàíà è âèå -íÿìà äà ìîæå äà âèäèòå ïîâå÷å ðåàêöèÿ îò Åìàêñ. Òîâà ïîêàçâà, ÷å -"ñïîñîáíîñò" íà îïåðàöèîííàòà ñèñòåìà, íàðå÷åíà "óïðàâëåíèå íà ïîòîêà" -(flow control), å ïðèõâàíàëà C-s è íå ãî ïðîïóñêà äî Åìàêñ. Çà äà -ðàçìðàçèòå åêðàíà, âúâåäåòå C-q. Òîãàâà âèæòå ñåêöèÿòà "Ñïîíòàííî -âêëþ÷âàíå íà ïîñòúïêîâîòî òúðñåíå" (Spontaneous Entry to Incremental -Search) â ðúêîâîäñòâîòî íà Åìàêñ çà ñúâåò êàê äà ñå ñïðàâèòå ñ òàçè -"ñïîñîáíîñò". - -Àêî ñòå â ñðåäàòà íà ïîñòúïêîâî òúðñåíå è âúâåäåòå <Delback>, ùå +Àêî ñòå â ñðåäàòà íà ïîñòúïêîâî òúðñåíå è âúâåäåòå <DEL>, ùå çàáåëåæèòå, ÷å ïîñëåäíèÿò çíàê â òúðñåíèÿ íèç ñå èçòðèâà è òúðñåíåòî ñå âðúùà êúì ïîñëåäíîòî ìÿñòî íà òúðñåíå. Íàïðèìåð, ïðåäïîëîæåòå, ÷å -ñòå âúâåëè "ò", çà äà íàìåðèòå ïúðâîòî ñúâïàäåíèå ñ "ò". Ñåãà, àêî -âúâåäåòå "ú", êóðñîðúò ùå ñå ïðèäâèæè êúì ïúðâîòî ñúâïàäåíèå íà "òú". -Ñåãà âúâåäåòå <Delback>. Òîâà èçòðèâà çíàêà "ú" îò íèçà çà òúðñåíå è -êóðñîðúò ñå ïðåìåñòâà íàçàä, äî ïúðâîòî ñúâïàäåíèå ñ "ò". +ñòå âúâåëè „ê“, çà äà íàìåðèòå ïúðâîòî ñúâïàäåíèå ñ „ê“. Ñåãà, àêî +âúâåäåòå „ó“, êóðñîðúò ùå ñå ïðèäâèæè êúì ïúðâîòî ñúâïàäåíèå íà „êó“. +Ñåãà âúâåäåòå <DEL>. Òîâà èçòðèâà çíàêà „ó“ îò íèçà çà òúðñåíå è +êóðñîðúò ñå ïðåìåñòâà íàçàä, äî ïúðâîòî ñúâïàäåíèå ñ „ê“. Àêî ñòå â ñðåäàòà íà òúðñåíå è âúâåäåòå êîíòðîëåí èëè ìåòà çíàê (ñ -íÿêîëêî èçêëþ÷åíèÿ -- çíàöèòå, êîèòî ñà ñïåöèàëíè ïî âðåìå íà òúðñåíå, +íÿêîëêî èçêëþ÷åíèÿ – çíàöèòå, êîèòî ñà ñïåöèàëíè ïî âðåìå íà òúðñåíå, êàòî C-s è C-r), òúðñåíåòî ñå ïðåêðàòÿâà. C-s çàïî÷âà òúðñåíå, êîåòî ãëåäà çà ñúâïàäåíèå ñ íèçà, äàäåí çà @@ -924,9 +903,11 @@ C-s çàïî÷âà òúðñåíå, êîåòî ãëåäà çà ñúâïàäåíèå ñ íèçà, äàäåí çà Åäíà îò ïðèâëåêàòåëíèòå ñïîñîáíîñòè íà Åìàêñ å òàçè, ÷å ìîæå äà ãëåäàòå ïîâå÷å îò åäèí ïðîçîðåö íà åêðàíà â äàäåí ìîìåíò îò âðåìå. +(Îáúðíåòå âíèìàíèå, ÷å Åìàêñ èçïîëçâà äóìàòà „ðàìêè“, îïèñàíà â +ñëåäâàùèÿ ðàçäåë, çà òîâà, êîåòî äðóãè ïðèëîæåíèÿ íàðè÷àò „ïðîçîðåö“. +Ðúêîâîäñòâîòî íà Åìàê ñúäúðæà ðå÷íèêà íà òåðìèíèòå íà Åìàêñ.) ->> Ïðèäâèæåòå êóðñîðà äî òîçè ðåä è âúâåäåòå C-u 0 C-l (òîâà å - CONTROL-L, íå CONTROL-1). +>> Ïðèäâèæåòå êóðñîðà äî òîçè ðåä è âúâåäåòå C-l C-l. >> Ñåãà âúâåäåòå C-x 2, êîåòî ùå ðàçäåëè åêðàíà íà äâà îòäåëíè ïðîçîðåöà. Äâàòà ïðîçîðåöà ïîêàçâàò òîâà âúâåäåíèå. Êóðñîðúò @@ -935,7 +916,7 @@ C-s çàïî÷âà òúðñåíå, êîåòî ãëåäà çà ñúâïàäåíèå ñ íèçà, äàäåí çà >> Âúâåäåòå C-M-v, çà äà ñêðîëèðàòå äîëíèÿ ïðîçîðåö. (Àêî íÿìàòå èñòèíñêè êëàâèø META, âúâåäåòå ESC C-v.) ->> Âúâåäåòå C-x o ("o" îò "other" -- "äðóã"), çà äà ïðèäâèæèòå +>> Âúâåäåòå C-x o („o“ îò „other“ – „äðóã“), çà äà ïðèäâèæèòå êóðñîðà â äîëíèÿ ïðîçîðåö. >> Èçïîëçâàéòå C-v è M-v â äîëíèÿ ïðîçîðåö, çà äà ãî ñêðîëèðàòå. Ïðîäúëæåòå ÷åòåíåòî íà òåçè íàñîêè îò âúâåäåíèåòî â ãîðíèÿ @@ -946,32 +927,32 @@ C-s çàïî÷âà òúðñåíå, êîåòî ãëåäà çà ñúâïàäåíèå ñ íèçà, äàäåí çà ïðåäè. Ìîæå äà ïðîäúëæèòå äà èçïîëçâàòå C-x o, çà äà ïðåâêëþ÷âàòå ìåæäó -ïðîçîðöèòå. Âñåêè ïðîçîðåö èìà ñîáñòâåíî ìÿñòî íà êóðñîðà, íî ñàìî -åäèí ïðîçîðåö ïîêàçâà êóðñîð. Âñè÷êè îáèêíîâåíè êîìàíäè çà -ðåäàêòèðàíå ñå ïðèëàãàò â ïðîçîðåöà, â êîéòî å êóðñîðúò. Íèå íàðè÷àìå -òîçè ïðîçîðåö "òåêóù ïðîçîðåö". +ïðîçîðöèòå. „Òåêóùèÿò ïðîçîðåö“, êúäåòî ñå èçâúðøâà ðåäàêòèðàíåòî, å +òîçè ñ ÿâåí êóðñîð, êîéòî ìèãà, êîãàòî íå âúâåæäàòå. Äðóãèòå ïðîçîðöè +èìàò ñîáñòâåíè ïîëîæåíèÿ íà êóðñîðà. Àêî Åìàêñ å íà ãðàôè÷åí äèñïëåé, +òåçè êóðñîðè ùå ñà èç÷åðòàíè êàòî íåìèãàùè ïðàçíè êóòèè. Êîìàíäàòà C-M-v å ìíîãî ïîëåçíà, êîãàòî ðåäàêòèðàòå òåêñò â åäèí ïðîçîðåö è èçïîëçâàòå äðóãèÿ ïðîçîðåö ïðîñòî çà ñïðàâêà. Ìîæå äà äúðæèòå êóðñîðà âèíàãè â ïðîçîðåöà, êúäåòî ðåäàêòèðàòå, è äà íàïðåäâàòå ïîñëåäîâàòåëíî â äðóãèÿ ïðîçîðåö ÷ðåç C-M-v. -C-M-v å ïðèìåð çà çíàê CONTROL-META. Àêî èìàòå èñòèíñêè êëàâèø META, -ìîæå äà âúâåæäàòå C-M-v, çàäúðæàéêè åäíîâðåìåííî CONTROL è META, -äîêàòî âúâåæäàòå v. Íÿìà çíà÷åíèå äàëè CONTROL èëè META "å íàòèñíàò -ïúðâè", çàùîòî è äâàòà êëàâèøà äåéñòâàò, ìîäèôèöèðàéêè çíàêà, êîéòî -ñòå âúâåëè. +C-M-v å ïðèìåð çà çíàê CONTROL-META. Àêî èìàòå èñòèíñêè êëàâèø META +(èëè Alt), ìîæå äà âúâåæäàòå C-M-v, çàäúðæàéêè åäíîâðåìåííî CONTROL è +META, äîêàòî âúâåæäàòå „v“. Íÿìà çíà÷åíèå äàëè CONTROL èëè META „å +íàòèñíàò ïúðâè“, çàùîòî è äâàòà êëàâèøà äåéñòâàò, ìîäèôèöèðàéêè çíàêà, +êîéòî íàòèñêàòå. -Àêî íÿìàòå èñòèíñêè êëàâèø META è èçïîëçâàòå ESC âìåñòî òîâà, ðåäúò -èìà çíà÷åíèå: òðÿáâà äà âúâåæäàòå ESC, ïîñëåäâàí îò CONTROL-v, çàùîòî -CONTROL-ESC v íÿìà äà ðàáîòè. Òîâà å òàêà, çàùîòî ESC å ñîáñòâåí -çíàê, à íå ìîäèôèêàòîð. +Àêî íÿìàòå èñòèíñêè êëàâèø META è èçïîëçâàòå <ESC> âìåñòî òîâà, ðåäúò +âå÷å èìà çíà÷åíèå: òðÿáâà äà âúâåæäàòå <ESC>, ïîñëåäâàí îò CONTROL-v, +çàùîòî CONTROL-<ESC> v íÿìà äà ðàáîòè. Òîâà å òàêà, çàùîòî <ESC> å +ñîáñòâåí çíàê, à íå ìîäèôèêàòîð. >> Âúâåäåòå C-x 1 (â ãîðíèÿ ïðîçîðåö), çà äà ìàõíåòå äîëíèÿ ïðîçîðåö. (Àêî ñòå âúâåëè C-x 1 â äîëíèÿ ïðîçîðåö, òîâà ùå ìàõíå ãîðíèÿ. -Ìèñëåòå çà òàçè êîìàíäà êàòî "Çàäðúæ òî÷íî åäèí ïðîçîðåö -- òîçè, â -êîéòî ñúì ñåãà".) +Ìèñëåòå çà òàçè êîìàíäà êàòî „Çàäðúæ òî÷íî åäèí ïðîçîðåö – òîçè, â +êîéòî ñúì ñåãà“.) Íÿìà íóæäà äà èçâåæäàòå åäèí è ñúùè áóôåð â äâàòà ïðîçîðåöà. Àêî èçïîëçâàòå C-x C-f, çà äà íàìåðèòå ôàéë â åäèíèÿ ïðîçîðåö, äðóãèÿò @@ -989,22 +970,47 @@ CONTROL-ESC v íÿìà äà ðàáîòè. Òîâà å òàêà, çàùîòî ESC å ñîáñòâåí èçòðèåòå äîëíèÿ. +* ÌÍÎÆÅÑÒÂÎ ÐÀÌÊÈ +----------------- + +Åìàêñ ìîæå äà ñúçäàâà è „ðàìêè“. Ðàìêàòà (frame) å òîâà, êîåòî +íàðè÷àìå åäèí íàáîð îò ïðîçîðöè, çàåäíî ñ òåõíèòå ìåíþòà, ïëúçãà÷è, +åõî îáëàñòè è ò.í.  ãðàôè÷åí äèñïëåé Åìàêñ íàðè÷à „ðàìêà“ òîâà, +êîåòî ïîâå÷åòî äðóãè ïðèëîæåíèÿ íàðè÷àò „ïðîçîðåö“. Íà åêðàíà ìîãàò +äà áúäàò ïîêàçâàíè íÿêîëêî ãðàôè÷íè ðàìêè åäíîâðåìåííî.  òåêñòîâ +òåðìèíàë ìîæå äà ñå ïîêàçâà ñàìî åäíà ðàìêà â äàäåí ìîìåíò îò âðåìå. + +>> Âúâåäåòå M-x make-frame <Return>. + Âèæòå êàê ñå ïîÿâÿâà íîâà ðàìêà íà åêðàíà. + + íîâàòà ðàìêà ìîæåòå äà ïðàâèòå âñè÷êî, êîåòî ïðàâèòå è â +îðèãèíàëíàòà ðàìêà. Íÿìà íèùî ñïåöèàëíî â ïúðâàòà ðàìêà. + +>> Âúâåäåòå M-x delete-frame <Return> + Èçáðàíàòà ðàìêà ñå ïðåìàõâà. + +Ìîæåòå äà ïðåìàõâàòå ðàìêè è ïî íîðìàëíèÿ çà òîâà íà÷èí â ãðàôè÷íàòà +ñèñòåìà, íàé-÷åñòî ñ íàòèñêàíå íà áóòîíà, îòáåëÿçàí êàòî „X“ â ãîðåí +úãúë íà ðàìêàòà. Àêî ïðåìàõíåòå è ïîñëåäíàòà ðàìêà íà ðàáîòåù Åìàêñ, +òîâà ùå èçëåçå îò Åìàêñ. + + * ÂËÎÆÅÍÈ ÍÈÂÀ ÍÀ ÐÅÄÀÊÒÈÐÀÍÅ ----------------------------- -Ïîíÿêîãà ùå ñå îçîâåòå â òîâà, êîåòî ñå íàðè÷à "âëîæåíî íèâî íà -ðåäàêòèðàíå" (recursive editing level). Òîâà ñå îòáåëÿçâà îò +Ïîíÿêîãà ùå ñå îçîâåòå â òîâà, êîåòî ñå íàðè÷à „âëîæåíî íèâî íà +ðåäàêòèðàíå“ (recursive editing level). Òîâà ñå îòáåëÿçâà îò êâàäðàòíè ñêîáè â ðåäà íà ðåæèìà, êîèòî îãðàæäàò ñêîáèòå îêîëî èìåòî íà ãëàâíèÿ ðåæèì. Íàïðèìåð, ìîæå äà âèäèòå [(Fundamental)] âìåñòî (Fundamental). -Çà äà ñå ìàõíåòå îò âëîæåíîòî íèâî íà ðåäàêòèðàíå, âúâåäåòå ESC ESC -ESC. Òîâà å îáùà êîìàíäà çà "èçëèçàíå". Ìîæå è äà ÿ èçïîëçâàòå çà -ìàõàíå (ñêðèâàíå) íà äîïúëíèòåëíè ïðîçîðöè, êàêòî è çà äà ñå ìàõíåòå -îò ìèíèáóôåðà. +Çà äà ñå ìàõíåòå îò âëîæåíîòî íèâî íà ðåäàêòèðàíå, âúâåäåòå <ESC> +<ESC> <ESC>. Òîâà å îáùà êîìàíäà çà „èçëèçàíå“. Ìîæå è äà ÿ +èçïîëçâàòå çà ìàõàíå (ñêðèâàíå) íà äîïúëíèòåëíè ïðîçîðöè, êàêòî è çà +äà ñå ìàõíåòå îò ìèíèáóôåðà. ->> Âúâåäåòå M-x, çà äà âëåçåòå â ìèíèáóôåð; òîãàâà âúâåäåòå ESC ESC - ESC, çà äà èçëåçåòå. +>> Âúâåäåòå M-x, çà äà âëåçåòå â ìèíèáóôåð; òîãàâà âúâåäåòå <ESC> + <ESC> <ESC>, çà äà èçëåçåòå. Íå ìîæåòå äà èçïîëçâàòå C-g, çà äà èçëåçåòå îò âëîæåíî íèâî íà ðåäàêòèðàíå. Òîâà å òàêà, çàùîòî C-g ñå èçïîëçâà çà ïðåêðàòÿâàíå íà @@ -1028,13 +1034,10 @@ CONTROL-h, êîéòî ñå íàðè÷à "çíàêúò çà ïîìîù". ïîìîãíå. Àêî ñòå âúâåëè C-h è ðåøèòå, ÷å íå ñå íóæäàåòå îò ïîìîù, ïðîñòî âúâåäåòå C-g, çà äà ÿ ïðåêðàòèòå. -(Íÿêîè êîìïþòðè ïðîìåíÿò çíà÷åíèåòî íà çíàêà C-h. Òå íàèñòèíà íå -òðÿáâà äà ïðàâÿò òîâà êàòî ñëÿïà ìÿðêà çà âñè÷êè ïîòðåáèòåëè, òàêà ÷å -èìàòå îñíîâàíèå äà ñå îïëà÷åòå íà ñèñòåìíèÿ àäìèíèñòðàòîð. Ìåæäó -äðóãîòî, àêî C-h íå èçâåæäà ñúîáùåíèå çà ïîìîù â äúíîòî íà åêðàíà, -îïèòàéòå êëàâèøà F1 èëè M-x help <Return> âìåñòî òîâà.) +(Àêî C-h íå èçâåæäà ñúîáùåíèå çà ïîìîù â äúíîòî íà åêðàíà, îïèòàéòå +êëàâèøà F1 èëè M-x help <Return> âìåñòî òîâà.) -Íàé-îñíîâíîòî ïîìîùíî ñðåäñòâî å C-h c. Âúâåäåòå C-h, çíàêà c è +Íàé-îñíîâíîòî ïîìîùíî ñðåäñòâî å C-h c. Âúâåäåòå C-h, çíàêà „c“ è êîìàíäåí çíàê èëè ïîñëåäîâàòåëíîñò îò çíàöè, îáðàçóâàùè êîìàíäà; òîãàâà Åìàêñ ùå èçâåäå ìíîãî êðàòêî îïèñàíèå íà êîìàíäàòà. @@ -1045,10 +1048,10 @@ CONTROL-h, êîéòî ñå íàðè÷à "çíàêúò çà ïîìîù". C-p runs the command previous-line (C-p èçïúëíÿâà êîìàíäàòà ïðåäèøåí-ðåä) -Òîâà âè êàçâà "èìåòî íà ôóíêöèÿòà". Èìåíàòà íà ôóíêöèèòå ñå èçïîëçâàò +Òîâà âè êàçâà „èìåòî íà ôóíêöèÿòà“. Èìåíàòà íà ôóíêöèèòå ñå èçïîëçâàò íàé-âå÷å çà íàñòðîéâàíå è ðàçøèðÿâàíå íà Åìàêñ. Íî òúé êàòî èìåíàòà íà ôóíêöèèòå ñà èçáðàíè òàêà, ÷å äà ïîêàçâàò êàêâî ïðàâè êîìàíäàòà, òå -ìîãàò äà ñëóæàò è çà ìíîãî êðàòêà äîêóìåíòàöèÿ -- äîñòàòú÷íà, çà äà âè +ìîãàò äà ñëóæàò è çà ìíîãî êðàòêà äîêóìåíòàöèÿ – äîñòàòú÷íà, çà äà âè ïðèïîìíè êîìàíäè, êîèòî âå÷å ñòå ó÷èëè. Ìíîãîçíàêîâè êîìàíäè, êàòî C-x C-s è (àêî íÿìàòå êëàâèø META èëè EDIT @@ -1070,7 +1073,7 @@ c. C-h f Îïèñâà ôóíêöèÿ. Òðÿáâà äà âúâåäåòå èìåòî íà ôóíêöèÿòà. ->> Îïèòàéòå ñ âúâåæäàíå íà C-h f previous-line<Return>. +>> Îïèòàéòå ñ âúâåæäàíå íà C-h f previous-line <Return>. Òîâà èçâåæäà öÿëàòà èíôîðìàöèÿ, êîÿòî Åìàêñ çíàå çà ôóíêöèÿòà, êîÿòî îñúùåñòâÿâà êîìàíäàòà C-p. @@ -1086,11 +1089,12 @@ c. äâóçíàêîâà ïîñëåäîâàòåëíîñò îò êëàâèøè, êîÿòî ïóñêà ñúùàòà êîìàíäà. ->> Âúâåäåòå C-h a file<Return>. +>> Âúâåäåòå C-h a file <Return>. Òîâà èçâåæäà â äðóã ïðîçîðåö ñïèñúê íà âñè÷êè M-x êîìàíäè, êîèòî -ñúäúðæàò "file" â òÿõíîòî èìå. Ùå âèäèòå çíàêîâè êîìàíäè êàòî C-x -C-f, èçáðîåíè èçìåæäó ñúîòâåòíèòå èìåíà íà êîìàíäè, êàòî find-file. +ñúäúðæàò „file“ (ôàéë) â òÿõíîòî èìå. Ùå âèäèòå çíàêîâè êîìàíäè êàòî +C-x C-f, èçáðîåíè èçìåæäó ñúîòâåòíèòå èìåíà íà êîìàíäè, êàòî +find-file. >> Âúâåäåòå C-M-v, çà äà ñêðîëèðàòå ïîìîùíèÿ ïðîçîðåö. Íàïðàâåòå ãî íÿêîëêî ïúòè. @@ -1098,7 +1102,7 @@ C-f, èçáðîåíè èçìåæäó ñúîòâåòíèòå èìåíà íà êîìàíäè, êàòî find-file. >> Âúâåäåòå C-x 1, çà äà èçòðèåòå ïîìîùíèÿ ïðîçîðåö. C-h i ×åòåíå íà ðúêîâîäñòâà (Info). Òàçè êîìàíäà âè ïðàùà â - ñïåöèàëåí áóôåð, íàðè÷àí "*info*", êúäåòî ìîæå äà + ñïåöèàëåí áóôåð, íàðè÷àí „*info*“, êúäåòî ìîæå äà ÷åòåòå ðúêîâîäñòâàòà íà èíñòàëèðàíèòå âúâ âàøàòà ñèñòåìà ïàêåòè. Âúâåäåòå m emacs <Return>, çà äà ÷åòåòå ðúêîâîäñòâîòî íà Åìàêñ. Àêî íèêîãà ïðåäè òîâà @@ -1113,8 +1117,8 @@ C-f, èçáðîåíè èçìåæäó ñúîòâåòíèòå èìåíà íà êîìàíäè, êàòî find-file. ----------------- Ìîæå äà íàó÷èòå ïîâå÷å çà Åìàêñ ñ ÷åòåíå íà íåãîâîòî ðúêîâîäñòâî, èëè -êàòî êíèãà, èëè â Èíôî (èçïîëçâàéòå ìåíþòî ïîìîù (Help) èëè âúâåäåòå -F10 h r). Äâå âúçìîæíîñòè, êîèòî ìîæå äà æåëàåòå â íà÷àëîòî, ñà +êàòî êíèãà, èëè â Èíôî (èçïîëçâàéòå ìåíþòî Ïîìîù (Help) èëè âúâåäåòå +C-h r). Äâå âúçìîæíîñòè, êîèòî ìîæå äà æåëàåòå â íà÷àëîòî, ñà äîâúðøâàíå (completion), êîåòî ñïåñòÿâà ïèñàíå, è dired, êîéòî îïðîñòÿâà áîðàâåíåòî ñ ôàéëîâå. @@ -1122,8 +1126,8 @@ F10 h r). Äâå âúçìîæíîñòè, êîèòî ìîæå äà æåëàåòå â íà÷àëîòî, ñà èñêàòå äà ïðåâêëþ÷èòå êúì áóôåðà *Messages*, ìîæå äà âúâåäåòå C-x b *M<Tab> è Åìàêñ ùå çàïúëíè îñòàíàëàòà ÷àñò îò èìåòî íà áóôåðà, äîêîëêîòî ìîæå äà ñå îïðåäåëè îò òîâà, êîåòî ñòå âúâåëè. Äîâúðøâàíåòî -å îïèñàíî â Èíôî-ðúêîâîäñòâîòî íà Åìàêñ â ñòðàíèöàòà "Äîâúðøâàíå" -("Completion"). +å îïèñàíî â Èíôî-ðúêîâîäñòâîòî íà Åìàêñ â ñòðàíèöàòà „Äîâúðøâàíå“ +(„Completion“). Dired âè ïîçâîëÿâà äà ãëåäàòå ñïèñúêà îò ôàéëîâå â äèðåêòîðèÿ (è êàòî âúçìîæíîñò: íåéíèòå ïîääèðåêòîðèè), äà ñå ïðèäâèæâàòå â òîçè ñïèñúê, @@ -1138,13 +1142,11 @@ Dired âè ïîçâîëÿâà äà ãëåäàòå ñïèñúêà îò ôàéëîâå â äèðåêòîðèÿ (è êàòî * ÇÀÊËÞ×ÅÍÈÅ ------------ -Çàïîìíåòå: çà äà èçëåçåòå áåçâúçâðàòíî îò Åìàêñ, èçïîëçâàéòå C-x C-c. -Çà äà èçëåçåòå âðåìåííî â îáâèâêà, òàêà ÷å äà ñå âúðíåòå â Åìàêñ -ïî-êúñíî, èçïîëçâàéòå C-z. +Çà äà èçëåçåòå áåçâúçâðàòíî îò Åìàêñ, èçïîëçâàéòå C-x C-c. Òîâà âúâåäåíèå å ïðåäâèäåíî äà áúäå ðàçáèðàåìî çà âñè÷êè íîâè -ïîòðåáèòåëè, òàêà ÷å àêî íàìèðàòå íåùî íåÿñíî, íå ñå ñàìîîáâèíÿâàéòå --- îïëà÷åòå ñå! +ïîòðåáèòåëè, òàêà ÷å àêî íàìèðàòå íåùî íåÿñíî, íå ñå ñàìîîáâèíÿâàéòå – +îïëà÷åòå ñå! * ÊÎÏÈÐÀÍÅ @@ -1160,26 +1162,28 @@ Dired âè ïîçâîëÿâà äà ãëåäàòå ñïèñúêà îò ôàéëîâå â äèðåêòîðèÿ (è êàòî This version of the tutorial, like GNU Emacs, is copyrighted, and comes with permission to distribute copies on certain conditions: -Copyright (C) 1985, 1996, 1998, 2001-2012 Free Software Foundation, Inc. + Copyright (C) 1985, 1996, 1998, 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - Permission is granted to anyone to make or distribute verbatim copies - of this document as received, in any medium, provided that the - copyright notice and permission notice are preserved, - and that the distributor grants the recipient permission - for further redistribution as permitted by this notice. + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - Permission is granted to distribute modified versions - of this document, or of portions of it, - under the above conditions, provided also that they - carry prominent notices stating who last altered them. + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. -Óñëîâèÿòà çà êîïèðàíå íà ñàìèÿ Åìàêñ ñà ïî-ñëîæíè, íî â ñúùèÿ äóõ. Ìîëÿ, ïðî÷åòåòå ôàéëà COPYING è òîãàâà äàâàéòå êîïèÿ íà ÃÍÓ Åìàêñ íà ñâîè ïðèÿòåëè. Ïîìîãíåòå äà ñïðåì çàòâîðåíîñòòà íà ïðîãðàìèòå -("ïðèòåæàíèåòî"), êàòî èçïîëçâàìå, ïèøåì è ñïîäåëÿìå ñâîáîäåí ñîôòóåð! +(„ïðèòåæàíèåòî“), êàòî èçïîëçâàìå, ïèøåì è ñïîäåëÿìå ñâîáîäåí ñîôòóåð! -Ïðåâîäúò íà áúëãàðñêè å èçâúðøåí îò Îãíÿí Êóëåâ -<ogi@fmi.uni-sofia.bg>. +Ïðåâîäúò íà áúëãàðñêè å èçâúðøåí îò Îãíÿí Êóëåâ <ogi@tower.3.bg>. ;;; Local Variables: ;;; coding: windows-1251 diff --git a/etc/tutorials/TUTORIAL.de b/etc/tutorials/TUTORIAL.de index 2908203b391..3e6927441c8 100644 --- a/etc/tutorials/TUTORIAL.de +++ b/etc/tutorials/TUTORIAL.de @@ -15,7 +15,7 @@ EDIT oder ALT genannt). Folgende Abkürzungen werden verwendet: M-f Halten Sie die META-Taste gedrückt und geben Sie den Buchstaben (klein) f ein. -`>>' am linken Rand ist ein Hinweis, einen Befehl auszuprobieren: +»>>« am linken Rand ist ein Hinweis, einen Befehl auszuprobieren: <<Blank lines inserted here by startup of help-with-tutorial>> [Leerzeilen befinden sich hier aus didaktischen Gründen. Fortsetzung unten.] >> Drücken Sie C-v, um zur nächsten Bildschirmseite vorzublättern. @@ -32,7 +32,7 @@ Wichtig: Sie können Emacs mit der Befehlsfolge C-x C-c beenden. Im weiteren wird die ESC-Taste mit <ESC> bezeichnet. [Falls die deutschen Umlaute nicht korrekt auf dem Bildschirm -erscheinen, lesen Sie bitte den Abschnitt `MULE' kurz vor Ende dieser +erscheinen, lesen Sie bitte den Abschnitt »MULE« kurz vor Ende dieser Einführung.] Zunächst müssen Sie wissen, wie man sich innerhalb eines Dokuments @@ -43,9 +43,9 @@ Sie zuerst <ESC> und anschließend v). >> Probieren Sie einige Male M-v und C-v aus. -[Auf den meisten Tastaturen bewirkt die PgUp-Taste (`page up', auch -mit `Bild' und einem Aufwärtspfeil beschriftet) dasselbe wie M-v bzw. -die PgDn-Taste (`page down', `Bild' mit Abwärtspfeil) dasselbe wie +[Auf den meisten Tastaturen bewirkt die PgUp-Taste (»page up«, auch +mit »Bild« und einem Aufwärtspfeil beschriftet) dasselbe wie M-v bzw. +die PgDn-Taste (»page down«, »Bild« mit Abwärtspfeil) dasselbe wie C-v.] @@ -60,13 +60,14 @@ betrachten: C-l lösche den Bildschirm und stelle den ganzen Text erneut dar, wobei der Text rund um den Cursor zur Mitte des Bildschirms bewegt wird. - (`l' ist der Buchstabe `klein L', nicht die Ziffer 1.) + (»l« ist der Buchstabe »klein L«, nicht die Ziffer 1.) ->> Lokalisieren Sie den Cursor und merken sich den Text in dessen - Umgebung. Drücken Sie C-l. Der Cursor ist jetzt ungefähr in der - (vertikalen) Bildschirmmitte, und er hat seine Position relativ zum - Text nicht geändert. +>> Finden Sie den Cursor und merken sich den Text in dessen Umgebung. + Drücken Sie C-l. Der Cursor ist jetzt ungefähr in der (vertikalen) + Bildschirmmitte, und er hat seine Position relativ zum Text nicht + geändert. Wiederholtes Drücken von C-l bewegt den Text zum oberen + Bildschirmrand, dann zum unteren, und dann wieder zur Mitte. * KONTROLLE DES CURSORS @@ -91,7 +92,7 @@ Befehl den Cursor wohin bewegt: [Die Buchstaben p, b, f und n stehen für die englischen Wörter -`previous', `backward', `forward' und `next'.] +»previous«, »backward«, »forward« und »next«.] >> Bewegen Sie den Cursor zur Zeile in der Mitte des Diagramms mittels C-n oder C-p. Geben Sie dann C-l ein, und das ganze Diagramm ist @@ -113,8 +114,10 @@ unterstützen). Beobachten Sie, was C-p tut, wenn der Cursor sich in der Zeilenmitte befindet. -Jede Textzeile endet mit einem Zeilenvorschub-Zeichen (`newline'), das -sie von der folgenden Zeile trennt. +Jede Textzeile endet mit einem Zeilenvorschub-Zeichen (»newline«), das +sie von der folgenden Zeile trennt. Die letzte Zeile in einer Datei +hat normalerweise ebenfalls einen Zeilenvorschub am Schluss, Emacs +benötigt ihn aber nicht. >> Probieren Sie C-b am Anfang einer Zeile. Der Cursor sollte zum Ende der vorigen Zeile springen: C-b überspringt @@ -132,7 +135,7 @@ C-f überspringt Zeilenvorschub-Zeichen analog zu C-b. Wenn Sie den Cursor entweder nach oben oder nach unten über den Bildschirmrand hinaus bewegen wollen, dann wird statt dessen Text in -den Bildschirm hineingeschoben. Dies nennt man `scrolling'. Auf +den Bildschirm hineingeschoben. Dies nennt man »scrolling«. Auf diese Weise verhindert Emacs, dass der Cursor je den sichtbaren Bereich verlässt. @@ -155,7 +158,7 @@ analog, aber in die entgegengesetzte Richtung. zwischen Wörtern zu beobachten. Beachten Sie die Parallele zwischen C-f und C-b einerseits und M-f und -M-b andererseits. Sehr oft werden mit `META-' beginnende Befehle für +M-b andererseits. Sehr oft werden mit »META-« beginnende Befehle für Operationen verwendet, die mit Sprache zu tun haben (Wörter, Sätze, Absätze), während CONTROL-Befehle mit den Text-Basiseinheiten operieren, unabhängig davon, was Sie gerade editieren (Zeichen, @@ -181,26 +184,26 @@ lassen. Dadurch ermöglichen Sie u.a., dass Emacs zwischen Abkürzungspunkten und dem Satzende unterscheiden kann, was für Textsuche in wissenschaftlichen Texten oft vorteilhaft ist.] -[Anmerkung 2: Die Tasten `Home' (Pos1) und `End' (Ende) verhalten sich +[Anmerkung 2: Die Tasten »Home« (Pos1) und »End« (Ende) verhalten sich standardmäßig wie C-a und C-e, wie wohl die meisten Benutzer annehmen.] -Die aktuelle Position des Cursors wird im Englischen auch `point' -(Punkt) genannt. Beachten Sie bitte, dass sich `point' stets +Die aktuelle Position des Cursors wird im Englischen auch »point« +(Punkt) genannt. Beachten Sie bitte, dass sich »point« stets *zwischen* zwei Zeichen befindet, nämlich genau vor dem Cursor-Kästchen. Hier ist eine Zusammenfassung von einfachen Bewegungsbefehlen für den Cursor einschließlich der Wort- und Satzbewegungsbefehle: - C-f ein Zeichen vorwärts (auch `Pfeil rechts'-Taste) - C-b ein Zeichen zurück (auch `Pfeil links'-Taste) + C-f ein Zeichen vorwärts (auch »Pfeil rechts«-Taste) + C-b ein Zeichen zurück (auch »Pfeil links«-Taste) M-f ein Wort vorwärts M-b ein Wort zurück - C-n eine Zeile vorwärts (auch `Pfeil hinunter'-Taste) - C-p eine Zeile zurück (auch `Pfeil hinauf'-Taste) + C-n eine Zeile vorwärts (auch »Pfeil hinunter«-Taste) + C-p eine Zeile zurück (auch »Pfeil hinauf«-Taste) C-a zum Zeilenanfang C-e zum Zeilenende @@ -215,7 +218,7 @@ Zwei weitere wichtige Befehle für die Cursorbewegung sind M-< (META Kleiner-als) und M-> (META Größer-als), welche zum Anfang bzw. zum Ende des ganzen Textes springen. -Bei den meisten Terminal-Tastaturen befindet sich `<' über dem Komma, +Bei den meisten Terminal-Tastaturen befindet sich »<« über dem Komma, d.h., Sie müssen zusätzlich die SHIFT-Taste verwenden (der Umschalter ist auf deutschen Tastaturen normalerweise mit einem dicken Aufwärtspfeil markiert). Ohne SHIFT-Taste würden Sie M-Komma @@ -224,17 +227,17 @@ eingeben. >> Testen Sie nun M-<, um an den Anfang der Einführung zu gelangen. Verwenden Sie dann C-v, um wieder hierher zu kommen. -[Anmerkung: Die Tastenkombinationen `C-Home' (Pos1) und `C-End' (Ende) +[Anmerkung: Die Tastenkombinationen »C-Home« (Pos1) und »C-End« (Ende) verhalten sich standardmäßig wie M-< und M->.] Ein weiteres, oft benütztes Konzept in Emacs ist die Markierung -(`mark'). Der Grundbefehl dazu ist C-SPC (oder gleichwertig C-@, -`SPC' bezeichnet die Leertaste, engl. `space key'); mit ihm kann eine +(»mark«). Der Grundbefehl dazu ist C-SPC (oder gleichwertig C-@, +»SPC« bezeichnet die Leertaste, engl. »space key«); mit ihm kann eine Markierung gesetzt werden. Mit C-u C-SPC kommt man zu dieser Markierung zurück, falls man den Cursor inzwischen weiterbewegt hat. Viele Befehle, die große Sprünge in einem Text ausführen (so auch M-> und M-<) setzen eine Markierung implizit, was in der untersten Zeile -(dem Echobereich, s.u.) als `Mark set' angezeigt wird. +(dem Echobereich, s.u.) als »Mark set« angezeigt wird. >> Verwenden Sie jetzt M->, um zum Ende der Einführung zu springen und benützen Sie C-u C-SPC, um hierher zurückzukehren. @@ -257,7 +260,7 @@ Ziffern und dann der Befehl selbst. Alternativ können Sie die META-Taste (bzw. EDIT- oder ALT-Taste) gedrückt halten und dann die Ziffern des Wiederholungszählers eingeben. Wir empfehlen allerdings, die C-u-Methode zu lernen, da sie mit jedem Terminal funktioniert. -Das numerische Argument wird auch `Präfix-Argument' genannt, da man es +Das numerische Argument wird auch »Präfix-Argument« genannt, da man es vor dem zugehörigen Befehl eingibt. Beispiel: C-u 8 C-f bewegt den Cursor acht Zeichen vorwärts. @@ -268,7 +271,7 @@ Beispiel: C-u 8 C-f bewegt den Cursor acht Zeichen vorwärts. Wie gesagt, die meisten Befehle verwenden das numerische Argument als Wiederholungszähler, jedoch nicht alle. Einige davon, die allerdings -noch nicht besprochen wurden, benützen es als Flag (`Flagge'), d.h., +noch nicht besprochen wurden, benützen es als Flag (»Flagge«), d.h., allein das Vorhandensein eines Präfix-Arguments, unabhängig von seinem Wert, signalisiert dem Befehl, etwas anderes zu tun. @@ -283,27 +286,20 @@ Der Bildschirminhalt sollte jetzt um acht Zeilen nach oben verschoben sein. Wollen Sie ihn nach unten verschieben, dann geben Sie M-v mit einem numerischen Argument ein. -Wenn Sie eine graphische Oberfläche wie X11 oder MS-Windows verwenden, -dann befindet sich ein schmaler, langgezogener rechteckiger Bereich auf -der linken oder rechten Seite des Emacs-Fensters. Dieser Bereich -wird Scrollbar genannt (`Verschiebungsbalken'). Sie können Text +Wenn Sie eine graphische Oberfläche wie X oder MS-Windows verwenden, +dann befindet sich ein schmaler, langgezogener rechteckiger Bereich +auf der linken oder rechten Seite des Emacs-Fensters. Dieser Bereich +wird Scrollbar genannt (»Verschiebungsbalken«). Sie können Text verschieben, indem Sie mit der Maus auf den Scrollbar klicken. ->> Drücken Sie die mittlere Taste (oder die linke und rechte Taste - gleichzeitig, falls Sie eine Zwei-Tasten-Maus verwenden) innerhalb - des Scrollbar-Bereichs. Das sollte den Text zu einer Position - verschieben, die davon abhängt, wie weit oben oder unten Sie - geklickt haben. - ->> Bewegen Sie nun die Maus auf und ab, während Sie die mittlere Taste - gedrückt halten. Sie werden sehen, dass der Text entsprechend der - Mausbewegungen nach oben oder unter verschoben wird. +Hat Ihre Maus ein Mausrad, können Sie damit ebenfalls Text +verschieben. * WENN EMACS NICHT MEHR REAGIERT -------------------------------- -Wenn Emacs `hängt', also auf keine Ihrer Eingaben reagiert, drücken +Wenn Emacs »hängt«, also auf keine Ihrer Eingaben reagiert, drücken Sie C-g. Sie können C-g auch dazu benützen, einen Befehl zu stoppen, der zu lange braucht. @@ -323,13 +319,13 @@ mit C-g rückgängig machen. * DEAKTIVIERTE BEFEHLE ---------------------- -Ein paar Befehle von Emacs sind deaktiviert (`disabled'), damit +Ein paar Befehle von Emacs sind deaktiviert (»disabled«), damit Anfänger sie nicht unabsichtlich benutzen. Wenn Sie einen solchen Befehl eingeben, dann gibt Emacs eine Meldung aus und fragt Sie, ob Sie ihn wirklich ausführen wollen. -Antworten Sie mit y (für `yes') oder drücken Sie die Leertaste, wenn +Antworten Sie mit y (für »yes«) oder drücken Sie die Leertaste, wenn Sie den Befehl ausführen wollen, sonst mit n. >> Geben Sie C-x C-l ein (das ist ein deaktivierter Befehl) und @@ -339,7 +335,7 @@ Sie den Befehl ausführen wollen, sonst mit n. * FENSTER --------- -Emacs kann mehrere Fenster (`windows') haben, von denen jedes seinen +Emacs kann mehrere Fenster (»windows«) haben, von denen jedes seinen eigenen Text darstellt. Später erklären wir, wie man mit Fenstern umgeht. Hier wollen wir nur erklären, wie man ein (vielleicht irrtümlich erzeugtes) Fenster wieder entfernt und zum normalen @@ -351,14 +347,14 @@ Das ist C-x gefolgt von der Ziffer 1. C-x 1 expandiert das Fenster, in dem der Cursor sich befindet, sodass es den ganzen Bildschirm erfasst. Alle anderen Fenster werden gelöscht. -[Anmerkung: Emacs verwendet das Wort Fenster (`windows') in einem +[Anmerkung: Emacs verwendet das Wort Fenster (»windows«) in einem anderen Sinn, als Sie es vielleicht gewöhnt sind. Wenn Sie einen Textbildschirm vor sich haben, dann ist die Terminologie eindeutig. Wenn Sie allerdings eine graphische Oberfläche benutzen, dann bezeichnet ein Emacs-Fenster einen Teilbereich des Fensters (von Ihrer graphischen Oberfläche erzeugt), in dem Emacs läuft, in völliger Analogie zum Textmodus. Für (graphische) Fenster im herkömmlichen -Sinn verwenden die Emacs-Entwickler den Ausdruck Rahmen (`frame').] +Sinn verwenden die Emacs-Entwickler den Ausdruck »Rahmen« (»frame«).] >> Bewegen Sie den Cursor zu dieser Zeile und geben Sie C-u 0 C-l ein. @@ -376,38 +372,32 @@ Sinn verwenden die Emacs-Entwickler den Ausdruck Rahmen (`frame').] Wenn Sie Text einfügen wollen, dann geben Sie ihn einfach ein. Sichtbare Zeichen, z.B. A, 7, * usw. werden als Text von Emacs sofort eingefügt. Drücken Sie <Return> (die Zeilenvorschubtaste, meistens -mit `Enter' oder nur mit einem Rückwärts-Hakenpfeil beschriftet), um +mit »Enter« oder nur mit einem Rückwärts-Hakenpfeil beschriftet), um ein Zeilenvorschubzeichen einzufügen. -Sie können das zuletzt eingegebene Zeichen löschen, indem Sie <Delete> -drücken. <Delete> ist einer Taste auf der Tastatur zugeordnet, die -mit `Del' oder `Entf' beschriftet ist. In manchen Fällen dient die -Backspace-Taste (oft auch nur als Rückwärtspfeil beschriftet) als -<Delete>, aber nicht immer! +Sie können das zuletzt eingegebene Zeichen löschen, indem Sie <DEL> +drücken. <DEL> ist der Backspace-Taste zugeordnet (oft auch nur als +Rückwärtspfeil beschriftet). -Allgemein gesprochen löscht <Delete> das Zeichen unmittelbar vor der +Allgemein gesprochen löscht <DEL> das Zeichen unmittelbar vor der aktuellen Cursorposition. -[Beachten Sie, dass <Delete> ein logischer Befehlsname ist, der auf -die jeweilige Tastatur abgebildet wird. Lesen Sie im Abschnitt `Init -Rebinding' des Emacs-Handbuches nach, wie Sie gegebenenfalls die -Tastaturbelegung verändern können.] - >> Probieren Sie das jetzt aus: Geben Sie ein paar Zeichen ein und - löschen Sie sie wieder mit <Delete>. Sie brauchen sich keine - Sorgen zu machen, dieses Dokument zu verändern: Was Sie hier lesen, - ist nur eine (persönliche) Kopie des originalen Dokuments. + löschen Sie sie wieder mit <DEL>. Sie brauchen sich keine Sorgen + zu machen, dieses Dokument zu verändern: Was Sie hier lesen, ist + nur eine (persönliche) Kopie des originalen Dokuments. -Wenn eine Textzeile zu lang wird für eine Bildschirmzeile, dann wird -sie auf einer zweiten Bildschirmzeile `fortgesetzt'. Ein -`Backslash'-Zeichen (`\') bzw. ein kleiner gebogener Pfeil (bei -graphischen Oberflächen) am rechten Rand verdeutlicht das. +Wenn eine Textzeile zu lang für eine Bildschirmzeile ist, wird sie auf +einer zweiten Bildschirmzeile »fortgesetzt«: Bei graphischen +Oberflächen erscheinen zwei kleine gebogene Pfeile links und rechts +vom Textbereich (diese schmalen Spalten werden »fringe« genannt), bei +Terminals ein »Backslash«-Zeichen (»\«) am rechten Rand. >> Fügen Sie Text ein, bis Sie den rechten Rand erreicht haben. Fügen Sie weiter Text ein. Beobachten Sie, wie eine Fortsetzungszeile erscheint. ->> Verwenden Sie <Delete> so oft, bis die Textzeile wieder auf eine +>> Verwenden Sie <DEL> so oft, bis die Textzeile wieder auf eine Bildschirmzeile passt. Die Fortsetzungszeile verschwindet wieder. Sie können das Zeilenvorschubzeichen wie jedes andere Zeichen löschen: @@ -415,7 +405,7 @@ Die Zeilen vor und nach ihm werden dann zu einer zusammengehängt. Ist diese länger als die Bildschirmbreite, erscheint eine Fortsetzungszeile. ->> Bewegen Sie den Cursor zum Anfang der Zeile und geben Sie <Delete> +>> Bewegen Sie den Cursor zum Anfang der Zeile und geben Sie <DEL> ein: Die momentane Zeile wird an die vorige angehängt. >> Geben Sie <Return> ein, um wieder ein Zeilenvorschubzeichen @@ -432,10 +422,10 @@ Bis jetzt kennen Sie die Grundbefehle, um Text in Emacs einzugeben und Fehler zu korrigieren -- fast analog zu den Bewegungsbefehlen ist es möglich, ganze Wörter, Sätze oder Zeilen zu löschen: - <Delete> lösche ein Zeichen vor dem Cursor + <DEL> lösche ein Zeichen vor dem Cursor C-d lösche das Zeichen unter dem Cursor - M-<Delete> lösche bis zum (nächsten) Wortanfang unmittelbar + M-<DEL> lösche bis zum (nächsten) Wortanfang unmittelbar vor dem Cursor M-d lösche bis zum (nächsten) Wortende nach (bzw. unter) dem Cursor @@ -445,42 +435,40 @@ möglich, ganze Wörter, Sätze oder Zeilen zu löschen: M-k lösche bis zum nächsten Satzende nach (bzw. unter) dem Cursor -Beachten Sie bitte, dass <Delete> je nach Tastaturbelegung die Del- -(Entf-) oder die Backspace- (Rückwärtspfeil-) Taste sein kann. - Eine andere, einheitliche Methode zum Löschen von Text ist das Befehlspaar C-@ (oder C-SPC) und C-w. Gehen sie zum Anfang des zu löschenden Textes und drücken Sie C-@ oder C-SPC. Gehen Sie dann zum Ende des zu löschenden Textes und drücken Sie C-w, um ihn zu entfernen. ->> Bewegen Sie den Cursor zum Buchstaben `E' am Anfang des letzten +>> Bewegen Sie den Cursor zum Buchstaben »E« am Anfang des letzten Absatzes. ->> Drücken Sie C-SPC. Emacs sollte die Meldung `Mark set' am unteren +>> Drücken Sie C-SPC. Emacs sollte die Meldung »Mark set« am unteren Bildschirmrand zeigen. ->> Bewegen Sie den Cursor zum Buchstaben `A' in der zweiten Zeile des +>> Bewegen Sie den Cursor zum Buchstaben »A« in der zweiten Zeile des letzten Absatzes. ->> Geben Sie C-w ein. Der ganze Text, beginnend mit dem `E' und - endend vor dem `A', ist nun gelöscht. +>> Geben Sie C-w ein. Der ganze Text, beginnend mit dem »E« und + endend vor dem »A«, ist nun gelöscht. Löschen Sie mehr als ein Zeichen auf einmal, speichert Emacs den gelöschten Text, damit Sie ihn bei Bedarf wieder zurückholen können. Einfügen von bereits gelöschtem Text wird im englischen Dokumentation -von Emacs als `yanking' (wörtlich `herausreißen') bezeichnet. Sie +von Emacs als »yanking« (wörtlich »herausreißen«) bezeichnet. Sie können den gelöschten Text an einer beliebigen Stelle wieder einzufügen. Solange Sie nichts neues löschen, steht Ihnen dieser gelöschte Textteil immer wieder zu Verfügung. Der Befehl dazu ist C-y -(das Ypsilon steht für `yank'). +(das Ypsilon steht für »yank«). Emacs unterscheidet zwei Klassen von Löschbefehlen (was man im -Deutschen leider nicht gut wiedergeben kann): `killing' (umbringen) -und `deleting' (löschen). Wenn man sich vorstellt, dass `yanking' den -Begriff `von den Toten erwecken' darstellt, dann hat man ungefähr eine -Vorstellung von der Metapher -- Von einem `kill'-Befehl gelöschter -Text wird gespeichert und kann bei Bedarf mit C-y zurückgeholt -werden. Von einem `delete'-Befehl entfernter Text (in der Regel -einzelne Zeichen, leere Zeilen und Zwischenräume) wird nicht extra -gespeichert und kann daher auch nicht zurückgeholt werden. +Deutschen leider nicht gut wiedergeben kann): »killing« (umbringen) +und »deleting« (löschen). Wenn man sich vorstellt, dass »yanking« den +Begriff »von den Toten erwecken« darstellt, dann hat man ungefähr eine +Vorstellung von der Metapher -- Von einem »kill«-Befehl gelöschter +Text wird gespeichert und kann bei Bedarf mit C-y zurückgeholt werden. +Von einem »delete«-Befehl entfernter Text (in der Regel einzelne +Zeichen, leere Zeilen und Zwischenräume) wird nicht extra gespeichert +und kann daher auch nicht zurückgeholt werden. Allerdings besteht die +Möglichkeit zum »Undo«, siehe weiter unten. >> Bringen Sie den Cursor an den Anfang einer nicht-leeren Zeile und geben Sie C-k ein, um die Zeile zu löschen. @@ -495,12 +483,16 @@ behandelt: es löscht die angegebene Anzahl von Zeilen UND die Zeilenvorschübe: C-u 2 C-k löscht zwei Zeilen komplett; zweimal C-k löscht dagegen nur eine Zeile. -Wie schon erwähnt, bringt C-y den zuletzt gelöschten (`gekillten') +Wie schon erwähnt, bringt C-y den zuletzt gelöschten (»gekillten«) Text zurück -- man kann diesen Text einfügen, wo man will: an der ursprünglichen Stelle, an einer anderen Stelle, oder sogar in einer anderen Datei. Mehrmaliges Ausführen von C-y fügt den Text mehrmals ein. +In anderen Editoren wird »kill« und »yank« oft als »cut« +(ausschneiden) und »paste« (einfügen) bezeichnet. Näheres dazu findet +sich im Abschnitt »Glossary« des Emacs-Handbuchs. + >> Probieren Sie jetzt C-y, um diesen Effekt zu sehen. Führen Sie C-k mehrmals hintereinander aus, dann wird der so @@ -509,14 +501,14 @@ Text zurück. >> Drücken Sie mehrmals C-k. -Holen Sie jetzt den Text `von den Toten' zurück: +Holen Sie jetzt den Text »von den Toten« zurück: >> Drücken Sie C-y. Bewegen Sie dann den Cursor ein paar Zeilen nach unten und drücken Sie C-y erneut. Der eben eingefügte Text wird noch einmal an anderer Stelle kopiert. Wie können Sie gelöschten Text wieder einfügen, wenn Sie in der -Zwischenzeit noch etwas anderes `gekillt' haben? C-y würde das +Zwischenzeit noch etwas anderes »gekillt« haben? C-y würde das zuletzt gelöschte Textstück zurückholen, was aber nicht das gewünschte ist. Verwenden Sie nun M-y (unmittelbar nach der erstmaligen Ausführung von C-y), um den gerade mit C-y eingefügten Textteil durch @@ -546,7 +538,7 @@ durchgesehen. Die meisten graphischen Oberflächen bieten auch die Möglichkeit, mit der linken Maustaste einen Textteil zu markieren (er erscheint dann normalerweise grau unterlegt). Der Befehl C-w löscht diesen -markierten Textteil (in Emacs auch `Region' genannt) und fügt ihn in +markierten Textteil (in Emacs auch »Region« genannt) und fügt ihn in den Löschring ein. Dasselbe geht auch ohne Maus: Bewegen Sie den Cursor zum Beginn des zu @@ -562,54 +554,48 @@ man Befehle mit langen Namen ausführen kann). ------ Wenn Sie etwas am Text geändert haben und nachträglich bemerken, dass -das ein Fehler war, so können Sie den Fehler mit dem Befehl C-x u -ungeschehen machen (`undo'). +das ein Fehler war, so können Sie den Fehler mit dem Befehl C-/ +ungeschehen machen (»undo«). -Normalerweise macht C-x u das Verhalten von einem Befehl ungeschehen; -führen Sie C-x u mehrmals hintereinander aus, werden die jeweiligen +Normalerweise macht C-/ das Verhalten von einem Befehl ungeschehen; +führen Sie C-/ mehrmals hintereinander aus, werden die jeweiligen vorigen Befehle widerrufen. Es gibt jedoch zwei Ausnahmen: Befehle, die den Text nicht ändern, werden nicht gezählt (z.B. Cursorbewegungen und Blättern im Text). -Und Befehle, die sich selbst einfügen (`self-inserting': Drücken Sie -zum Beispiel die `u'-Taste, dann wird der Buchstabe u eingefügt) +Und Befehle, die sich selbst einfügen (»self-inserting«: Drücken Sie +zum Beispiel die »u«-Taste, dann wird der Buchstabe u eingefügt) werden in Gruppen von bis zu 20 Zeichen wiederhergestellt, um die -Anzahl der notwendigen C-x u-Befehle zu reduzieren. +Anzahl der notwendigen C-/-Befehle zu reduzieren. >> Löschen Sie diese Zeilen mit C-k und drücken Sie anschließend - mehrmals C-x u, und die Zeilen erscheinen wieder. - -C-_ ist ein alternativer Undo-Befehl; er arbeitet genauso wie C-x u, -ist jedoch einfacher zu tippen, wenn Sie den Befehl mehrmals -hintereinander ausführen möchten. Der Nachteil von C-_ ist, dass bei -manchen Tastaturen nicht sofort einsichtig ist, wie man das eingibt. + mehrmals C-/, und die Zeilen erscheinen wieder. -Eine weitere Eingabemöglichkeit bei vielen Terminals ist C-/. - -Ein numerisches Argument für C-_, C-x u oder C-/ wird als +Alternative Tastenkombinationen für C-/ sind C-_ und C-x u. Ein +numerisches Argument für C-/, C-_ oder C-x u wird als Wiederholungszähler interpretiert. Der Unterschied zwischen der Undo-Funktion und dem oben erklärten C-y ist, dass erstere gelöschten Text an exakt der gleichen Position wie vorher wiederherstellt, wohingegen C-y den gelöschten Text an der -momentanen Cursorposition einfügt. Im übrigen kann auch `gekillter' -Text wieder hergestellt werden; der Unterschied zwischen `killing' und -`yanking' betrifft nur C-y, aber nicht die Undo-Funktion. +momentanen Cursorposition einfügt. Im übrigen kann auch »gekillter« +Text wieder hergestellt werden; der Unterschied zwischen »killing« und +»yanking« betrifft nur C-y, aber nicht die Undo-Funktion. * DATEIEN --------- -Um editierten Text zu sichern, muss man ihn in einer Datei (`file') -speichern (`save'). Wird Emacs beendet, ohne dass man vorher den Text +Um editierten Text zu sichern, muss man ihn in einer Datei (»file«) +speichern (»save«). Wird Emacs beendet, ohne dass man vorher den Text gespeichert hat, dann ist der Text verloren. Will man andererseits bereits gesicherten Text mit Emacs editieren, so muss die entsprechende Datei in Emacs geladen werden (im Englischen -wird das als `finding' (finden) bzw. als `visiting' (besuchen) +wird das als »finding« (finden) bzw. als »visiting« (besuchen) bezeichnet). -Eine Datei `finden' bedeutet, dass man den Inhalt dieser Datei mit +Eine Datei »finden« bedeutet, dass man den Inhalt dieser Datei mit Emacs bearbeitet -- es ist fast so, als ob man die Datei selbst editiert. Jedoch werden Änderungen an dieser Datei erst dann dauerhaft, wenn man sie speichert; auf diese Weise wird vermieden, @@ -621,9 +607,9 @@ die Änderungen ein Fehler sind. Wenn Sie die untere Bildschirmkante genauer betrachten, dann werden Sie eine Zeile finden, die mit einem oder mehreren Bindestrichen beginnt und endet; sie enthält unter anderem die Zeichenkette -`TUTORIAL.de'. An dieser Position befindet sich immer der Name der -Datei, die Sie momentan bearbeiten (`visit'). Gerade in diesem -Augenblick bearbeiten Sie eine Datei mit dem Namen `TUTORIAL.de' +»TUTORIAL.de«. An dieser Position befindet sich immer der Name der +Datei, die Sie momentan bearbeiten (»visit«). Gerade in diesem +Augenblick bearbeiten Sie eine Datei mit dem Namen »TUTORIAL.de« (genauer gesagt, Emacs hat eine identische Kopie geladen). Die Befehle für das Laden und Speichern von Dateien bestehen aus zwei @@ -634,14 +620,14 @@ drei oder vier Zeichen lang -- Sie haben bereits C-x u und C-x 1 kennengelernt. Um eine Datei in Emacs laden zu können, muss man dem Lade-Befehl den -Namen der Datei mitteilen. Der Befehl `liest ein Argument vom -Terminal' (in diesem Fall ist das der Name der Datei). Nachdem Sie +Namen der Datei mitteilen. Der Befehl »liest ein Argument« (in diesem +Fall ist das der Name der Datei). Nachdem Sie C-x C-f (lade Datei) eingegeben haben, werden Sie von Emacs nach dem Dateinamen gefragt. Die Zeichen, die Sie eingeben, werden in der untersten Bildschirmzeile -dargestellt, dem sogenannten Minipuffer (`minibuffer'). Sie können +dargestellt, dem sogenannten Minipuffer (»minibuffer«). Sie können ganz normale Emacs-Editierfunktionen verwenden, um den Dateinamen zu ändern. @@ -653,39 +639,42 @@ Minipuffer benutzen) mit C-g abbrechen. ab (Sie haben also keine Datei geladen). Wenn Sie den Dateinamen fertig eingegeben haben, drücken Sie <Return>, -um den Befehl abzuschließen; C-x C-f wird ausgeführt und lädt die von -Ihnen ausgesuchte Datei. Der Minipuffer verschwindet wieder, sobald -C-x C-f beendet ist. +um den Befehl abzuschließen. Der Minipuffer verschwindet wieder, und +C-x C-f lädt die von Ihnen ausgesuchte Datei. -Ein paar Augenblicke später erscheint der Dateiinhalt auf dem -Bildschirm, und Sie können den Text editieren. Wenn Sie Ihre -Änderungen permanent speichern wollen, dann drücken Sie +Der Dateiinhalt erscheint jetzt auf dem Bildschirm, und Sie können den +Text editieren. Wenn Sie Ihre Änderungen permanent speichern wollen, +dann drücken Sie C-x C-s (sichere Datei) und Emacs kopiert den Text in die Datei. Beim ersten Mal benennt Emacs die Originaldatei um, damit sie nicht verloren ist. Der neue -Name besteht aus dem Originalnamen plus einer angehängten Tilde `~' +Name besteht aus dem Originalnamen plus einer angehängten Tilde »~« [unter einigen Betriebssystemen wird statt dessen die -Namenserweiterung durch `.bak' ersetzt]. +Namenserweiterung durch ».bak« ersetzt]. Emacs schreibt den Namen der gesicherten Datei in die unterste Zeile, sobald C-x C-s fertig ausgeführt ist. Sie sollten den editierten Text oft speichern, damit nicht allzuviel bei einem etwaigen Systemabsturz -verloren geht. +verloren geht (siehe auch den Abschnitt »AUTOMATISCHES SPEICHERN« +weiter unten). + +>> Geben Sie + + C-x C-s TUTORIAL.de <Return> ->> Geben Sie C-x C-s ein, um Ihre Kopie der Einführung zu sichern. - Die Ausgabe am unteren Bildschirmrand sollte `Wrote ...TUTORIAL.de' - sein. + ein, um Ihre Kopie der Einführung zu sichern. Die Ausgabe am + unteren Bildschirmrand sollte »Wrote ...TUTORIAL.de« sein. [Manche Terminals werden durch C-s angehalten und müssen durch C-q -wieder `entsperrt' werden. Eine erste Abhilfe zur Umschiffung dieses -C-s-Problems schafft die Befehlsfolge `M-x save-buffer', welche exakt +wieder »entsperrt« werden. Eine erste Abhilfe zur Umschiffung dieses +C-s-Problems schafft die Befehlsfolge »M-x save-buffer«, welche exakt das gleiche wie C-x C-s bewirkt. Mehr Hilfe dazu finden Sie im -Abschnitt `Spontaneous Entry to Incremental Search' im +Abschnitt »Spontaneous Entry to Incremental Search« im Emacs-Handbuch.] -Sie können eine existierende Datei anschauen (`view') oder editieren. +Sie können eine existierende Datei anschauen (»view«) oder editieren. Sie können aber auch eine Datei laden, die noch gar nicht existiert, um so eine neue Datei zu erzeugen: Sie öffnen dazu die (nicht-existente) Datei, die natürlich leer ist, und beginnen dann @@ -703,18 +692,8 @@ laden, dann bleibt die erste in Emacs. Sie können zur ersten zurückschalten, indem Sie noch einmal C-x C-f eingeben. Auf diese Weise lassen sich eine ganze Reihe von Dateien laden und bearbeiten. ->> Erzeugen Sie eine Datei mit dem Namen `foo', indem Sie - - C-x C-f foo <Return> - - eingeben. Tippen Sie etwas Text ein, editieren Sie ihn und - speichern Sie ihn abschließend mit C-x C-s. Kehren Sie - anschließend zu dieser Einführung zurück mit - - C-x C-f TUTORIAL.de <Return> - Emacs speichert jeden Text, der aus einer Datei in Emacs geladen wird, -in einem `Puffer'-Objekt. Um eine Liste der momentan existierenden +in einem »Puffer«-Objekt. Um eine Liste der momentan existierenden Puffer zu sehen, geben Sie C-x C-b (liste Puffer auf) @@ -726,7 +705,7 @@ ein. Beachten Sie, dass jeder Puffer einen Namen hat und manche auch mit dem Namen einer Datei assoziiert sind, dessen Inhalt sie enthalten. Manche Puffer aber haben keinen zugehörige Datei, z.B. der mit dem -Namen `*Buffer List*'. Er wurde von dem Befehl C-x C-b erzeugt, um +Namen »*Buffer List*«. Er wurde von dem Befehl C-x C-b erzeugt, um die Pufferliste darzustellen. JEDER Text, den Sie innerhalb Emacs in einem Fenster sehen, ist immer ein Ausschnitt eines Puffers. @@ -734,28 +713,39 @@ einem Fenster sehen, ist immer ein Ausschnitt eines Puffers. zu lassen. Wieviele Puffer auch in Emacs geladen sind, nur ein einziger ist der -`momentane' Puffer, nämlich derjenige, den Sie gerade editieren. Will +»momentane« Puffer, nämlich derjenige, den Sie gerade editieren. Will man einen anderen Puffer editieren, muss man zuerst zu diesem Puffer -wechseln (`switch'). Wie schon weiter oben erklärt, kann man mittels +wechseln (»switch«). Wie schon weiter oben erklärt, kann man mittels C-x C-f zu einem Puffer wechseln, der zu einer Datei gehört. Emacs hat jedoch einen einfacheren Befehl, C-x b, um einen beliebigen Puffer namentlich auszuwählen. ->> Geben Sie C-x b foo <Return> ein, um zurück zum Puffer `foo' zu - schalten, der den Text der Datei `foo' enthält. Anschließend geben - Sie C-x b TUTORIAL.de <RETURN> ein, um wieder zu dieser Einführung - zu gelangen. +>> Geben Sie + + C-x C-f foo <Return> + + ein, um eine Datei mit dem Namen »foo« zu erzeugen. Mittels + + C-x b TUTORIAL.de <RETURN> + + gelangen Sie wieder zu dieser Einführung. In der Regel ist der Puffername identisch zu einem Dateinamen (ohne den Verzeichnispräfix), jedoch nicht immer. Die von C-x C-b erzeugte -Pufferliste zeigt stets die Namen aller Puffer. +Pufferliste zeigt stets die Namen aller Puffer mit den +korrespondierenden Dateinamen. JEDER Text in Emacs ist Teil eines Puffers, aber nicht jeder Puffer -entspricht einer Datei. So ist z.B. der Puffer `*Buffer List*' mit +entspricht einer Datei. So ist z.B. der Puffer »*Buffer List*« mit keiner Datei assoziiert -- er wurde direkt von dem Befehl C-x C-b -erzeugt. Genauso hat der Puffer `*Messages*' keine Entsprechung als -Datei; er enthält alle Mitteilungen, die in der untersten Zeile -während des Arbeitens mit Emacs erscheinen. +erzeugt. Auch dieser »TUTORIAL.de«-Puffer war anfangs keiner Datei +zugeordnet, jetzt allerdings schon, denn Sie haben im letzten +Abschnitt den Befehl C-x C-s eingegeben und so den Pufferinhalt als +Datei gespeichert. + +Der Puffer »*Messages*« hat ebenfalls keine Entsprechung als Datei; er +enthält alle Mitteilungen, die in der untersten Zeile während des +Arbeitens mit Emacs erscheinen. >> Geben Sie C-x b *Messages* <Return> ein, um sich den Mitteilungspuffer anzuschauen. @@ -778,7 +768,7 @@ Sie ihn speichern wollen. >> Fügen Sie eine Textzeile ein und drücken Sie dann C-x s. Emacs fragt Sie jetzt, ob Sie einen Puffer mit dem Namen - TUTORIAL.de speichern wollen. Bejahen Sie, indem Sie `y' drücken. + TUTORIAL.de speichern wollen. Bejahen Sie, indem Sie »y« drücken. [Anmerkung: Sie verändern nicht die Originaldatei, sondern eine persönliche Kopie.] @@ -793,7 +783,7 @@ sie trotzdem alle benutzen zu können, gibt es zwei Erweiterungen: C-x Zeichenerweiterung. Gefolgt von einem Zeichen. M-x Befehlserweiterung. Gefolgt von einem (langen) Namen. -[Das `x' steht für das englische Wort `extension'.] Diese beiden +[Das »x« steht für das englische Wort »extension«.] Diese beiden Befehle sind prinzipiell sehr nützlich, werden aber weniger oft benötigt als die bisher vorgestellten. Sie haben bereits mehrere Befehle aus der ersten Kategorie kennengelernt; unter anderem C-x C-f, @@ -804,31 +794,25 @@ vielleicht vergessen haben, Daten oder Text zu sichern -- Emacs fragt bei jedem geändertem Puffer (bzw. Datei), ob er gespeichert werden soll. -C-z ist der Befehl um Emacs *zeitweise* zu verlassen; es ist also -möglich, später an der unterbrochenen Stelle nahtlos weiterzuarbeiten. - -Auf den meisten Systemen wie Linux oder FreeBSD wird Emacs -`suspendiert', wenn Sie C-z drücken, d.h., Sie kehren zurück zur -Eingabezeile des Betriebssystems, ohne Emacs zu beenden. In der Regel -können Sie dann mittels des Befehls `fg' bzw. `%emacs' wieder zu Emacs -umschalten. Unter graphischen Oberflächen wie X11 bewirkt C-z in der -Regel, dass Emacs ikonofiziert wird, also als Ikone (`Icon') darauf -wartet, mit einem Mausklick bei Bedarf wieder vergrößert zu werden. +Unter graphischen Oberflächen wie X bewirkt C-z in der Regel, dass +Emacs ikonofiziert wird, also als Ikone (»Icon«) darauf wartet, mit +einem Mausklick bei Bedarf wieder vergrößert zu werden. Auf einem +Textterminal dagegen wird Emacs »suspendiert«, wenn Sie C-z drücken, +d.h., Sie kehren zurück zur Eingabezeile des Terminals, ohne Emacs zu +beenden, und können beliebige andere Befehle ausführen. In der Regel +können Sie später mittels des Befehls »fg« bzw. »%emacs« wieder zu +Emacs umschalten. Bei Betriebssystemen bzw. Shells, die Suspension von Programmen nicht implementiert haben (z.B. MS-DOS), startet C-z einen -System-Befehlsinterpreter innerhalb von Emacs (`subshell'). -Normalerweise müssen Sie dann `exit' in die Befehlszeile schreiben, um +System-Befehlsinterpreter innerhalb von Emacs (»subshell«). +Normalerweise müssen Sie dann »exit« in die Befehlszeile schreiben, um zu Emacs zurückzukehren. Der beste Zeitpunkt für C-x C-c ist, wenn Sie sich ausloggen (bzw. Ihren Computer ausschalten); Sie sollten Emacs ebenfalls beenden, wenn Sie Emacs von einem anderen Programm aus aufgerufen -haben (z.B. einem Programm, das E-mails liest), da solche Programme -oft nicht wissen, wie sie mit Emacs im Suspend-Modus umgehen sollen. -In allen anderen Fällen ist es meistens günstiger, C-z zu benutzen und -Emacs nicht zu beenden, damit man im Bedarfsfalle sofort an der -gleichen Stelle weiterarbeiten kann. +haben (z.B. einem Programm, das E-mails liest). Hier ist eine Liste aller C-x-Befehle, die Sie bereits kennengelernt haben: @@ -846,19 +830,19 @@ Ein Beispiel für einen Befehl mit langen Namen ist replace-string, der global (also in der ganzen Datei bzw. Puffer) eine Zeichenkette durch eine andere ersetzt. Wenn Sie M-x drücken, dann fragt Sie Emacs in der untersten Bildschirmzeile nach dem Namen des Befehls (in diesem -Fall `replace-string'). Geben Sie jetzt `repl s<TAB>' ein und Emacs +Fall »replace-string«). Geben Sie jetzt »repl s<TAB>« ein und Emacs vervollständigt den Namen. Schließen Sie die Eingabe mit <Return> ab. [<TAB> bezeichnet die Tabulatortaste.] >> Bewegen Sie den Cursor zu der leeren Zeile sechs Zeilen unter dieser. Geben Sie dann - M-x repl s<Return>Bildschirm<Return>Text<Return> + M-x repl s <Return> Bildschirm <Return> Text <Return> ein und kehren Sie mit C-u C-SPC an diese Position zurück. Beachten Sie wie diese Bildschirmzeile jetzt aussieht: Sie haben - den Wortteil B-i-l-d-s-c-h-i-r-m durch `Text' ersetzt (und zwar im + den Wortteil B-i-l-d-s-c-h-i-r-m durch »Text« ersetzt (und zwar im ganzen Dokument beginnend von der Cursorposition). >> Drücken Sie jetzt C-x u, um diese Änderungen auf einmal rückgängig @@ -872,17 +856,17 @@ Haben Sie Änderungen an einem Dokument vorgenommen, sie jedoch nicht gespeichert, dann können sie verloren gehen, falls der Computer abstürzt. Um Sie davor zu schützen, sichert Emacs in bestimmten Zeitintervallen jede von Ihnen editierte Datei in sogenannten -`auto save'-Dateien. Sie sind daran zu erkennen, dass sie mit einem # -beginnen und enden; z.B. ist `#hello.c#' der Name der Auto-Save-Datei -von `hello.c'. Wenn Sie Ihren Text auf normalem Wege speichern, wird +»auto save«-Dateien. Sie sind daran zu erkennen, dass sie mit einem # +beginnen und enden; z.B. ist »#hello.c#« der Name der Auto-Save-Datei +von »hello.c«. Wenn Sie Ihren Text auf normalem Wege speichern, wird die Auto-Save-Datei gelöscht. Stürzt der Rechner einmal wirklich ab, können Sie die Änderungen, die beim letzten Auto-Save gespeichert worden sind, folgendermaßen wiederherstellen: Laden Sie die Datei auf normalem Wege (die Datei, die Sie bearbeitet haben, nicht die Auto-Save-Datei) und geben Sie -dann `M-x recover-file<Return>' ein. Wenn Emacs Sie um Bestätigung -fragt, antworten Sie mit `yes<Return>', um den Inhalt der +dann »M-x recover-file <Return>« ein. Wenn Emacs Sie um Bestätigung +fragt, antworten Sie mit »yes <Return>«, um den Inhalt der Auto-Save-Datei zu übernehmen. @@ -890,8 +874,8 @@ Auto-Save-Datei zu übernehmen. ------------------ Geben Sie Befehle langsam ein, dann zeigt Ihnen Emacs Ihre eigene -Eingabe am unteren Bildschirmrand im sogenannten Echo-Bereich (`echo -area'). Der Echo-Bereich enthält die unterste Bildschirmzeile. +Eingabe am unteren Bildschirmrand im sogenannten Echo-Bereich (»echo +area«). Der Echo-Bereich enthält die unterste Bildschirmzeile. [Mini-Puffer und Echo-Bereich fallen normalerweise zusammen, sind aber nicht das gleiche, da innerhalb des Echo-Bereiches nichts eingegeben @@ -902,30 +886,30 @@ werden kann.] ------------------ Die Bildschirmzeile unmittelbar über dem Echo-Bereich ist die -Statuszeile (`mode line'). Sie schaut ungefähr so aus: +Statuszeile (»mode line«). Sie schaut ungefähr so aus: --1:** TUTORIAL.de 59% L905 (Fundamental)---------------------- +-1:**- TUTORIAL.de 58% L891 (Fundamental) Diese Zeile gibt nützliche Hinweise über den momentanen Zustand von Emacs und den Text, den Sie gerade editieren. -Sie wissen bereits, was der Dateiname bedeutet. `--NN%--' zeigt die -momentane Position innerhalb des Textes an: NN Prozent davon sind -oberhalb des Bildschirms. Ist der Dateianfang zu sehen, dann -erscheint `Top' anstelle von `00%'. Analog dazu erscheint `Bot' (für -das englische Wort `bottom'), wenn das Dateiende sichtbar ist. Wenn -Sie einen Text betrachten, der komplett auf den Bildschirm passt, dann -erscheint `All'. +Sie wissen bereits, was der Dateiname bedeutet. »NN%« zeigt die +momentane Position innerhalb des Puffertextes an: NN Prozent davon +sind oberhalb des Bildschirms. Ist der Dateianfang zu sehen, dann +erscheint »Top« anstelle von »00%«. Analog dazu erscheint »Bot« (für +das englische Wort »bottom«), wenn das Dateiende sichtbar ist. Wenn +Sie einen Puffer betrachten, der komplett auf den Bildschirm passt, +dann erscheint »All«. -Das `L' und die nachfolgenden Ziffern geben die aktuelle Zeilennummer +Das »L« und die nachfolgenden Ziffern geben die aktuelle Zeilennummer an, in der sich der Cursor befindet. -Am Anfang der Zeile sehen Sie `-1:**'. Die Zeichen vor dem +Am Anfang der Zeile sehen Sie »-1:**-«. Die Zeichen vor dem Doppelpunkt geben an, in welcher Kodierung der Text ist und welche Eingabemethode verwendet wird. Dazu mehr weiter unten im Abschnitt -`MULE'. +»MULE«. -[Anstelle des Doppelpunktes können auch ein `\' und `/' stehen, falls +[Anstelle des Doppelpunktes können auch ein »\« und »/« stehen, falls Sie Dateien editieren, die der MS-DOS- bzw. der Macintosh-Textkonvention folgen: MS-DOS verwendet als Zeilenvorschubzeichen CR-LF (Carriage Return gefolgt von Linefeed), @@ -938,24 +922,24 @@ Prozentzeichen nach dem Doppelpunkt stehen für eine Datei, die nur gelesen, aber nicht editiert werden kann. Der eingeklammerte Teil gibt an, in welchem Editiermodus Sie sich -befinden. Der Standardmodus heißt `Fundamental' (Sie verwenden ihn -gerade); er ist ein Beispiel für einen Hauptmodus (`major mode'). +befinden. Der Standardmodus heißt »Fundamental« (Sie verwenden ihn +gerade); er ist ein Beispiel für einen Hauptmodus (»major mode«). Emacs hat viele Hauptmodi implementiert. Manche davon werden für verschiedene (Computer-)Sprachen und/oder Textarten verwendet, z.B. Lisp-Modus, Text-Modus usw. Es kann immer nur ein Hauptmodus aktiviert sein, und der Name befindet sich dort, wo jetzt gerade -`Fundamental' steht. +»Fundamental« steht. Einige Befehle verhalten sich jeweils in verschiedenen Hauptmodi anders. Es gibt zum Beispiel einen Befehl, um einen Kommentar in den Quellcode eines Computerprogramm einzufügen -- die Tastenfolge dafür ist zwar (in der Regel) die gleiche, doch wird ein Kommentar mit der für die aktuelle Programmiersprache gültigen Syntax eingefügt -(z.B. `// ...' für ein Programm in C++ oder `; ...' für Lisp). Um in +(z.B. »// ...« für ein Programm in C++ oder »; ...« für Lisp). Um in einen Hauptmodus zu schalten, hängen Sie einfach das englische Wort -`-mode' an den (kleingeschriebenen) Namen des Modus an und führen den -Befehl mittels M-x aus. Beispiel: `M-x fundamental-mode' schaltet in +»-mode« an den (kleingeschriebenen) Namen des Modus an und führen den +Befehl mittels M-x aus. Beispiel: »M-x fundamental-mode« schaltet in den Fundamental-Modus. Weitere wichtige Modi sind c-mode, perl-mode, lisp-mode, text-mode u.a. Die meisten davon werden automatisch aktiviert, und zwar entsprechend der Namenserweiterung der zu ladenden @@ -965,30 +949,30 @@ C-Modus aktiviert. Wenn Sie deutschen oder englischen Text bearbeiten, dann sollten Sie den Textmodus verwenden. [Falls Ihre Tastatur keine Umlaut-Tasten hat, müssen Sie noch einen weiteren Nebenmodus aktivieren. Lesen Sie -dazu den Abschnitt `MULE' weiter unten.] +dazu den Abschnitt »MULE« weiter unten.] ->> Geben Sie `M-x text mode<Return>' ein. +>> Geben Sie »M-x text-mode <Return>« ein. Sie brauchen keine Angst zu haben, dass sich die bisher dargestellte Tastaturbelegung von Emacs stark ändert. Beobachten Sie z.B. die Befehle M-f und M-b: Apostrophe werden nun als Teil eines Wortes betrachtet (wie man's leicht an diesem Beispiel ausprobieren kann), wohingegen im Fundamentalmodus Apostrophe als Worttrenner -(`word-separator') behandelt werden. +(»word-separator«) behandelt werden. Normalerweise ist das eben genannte Beispiel die Methode von -Hauptmodi: Die meisten Befehle tun `das gleiche', arbeiten aber +Hauptmodi: Die meisten Befehle tun »das gleiche«, arbeiten aber jeweils ein bisschen anders. Dokumentation zum derzeit aktuellen Hauptmodus bekommen Sie mit C-h m. ->> Drücken Sie C-u C-v ein- oder mehrmals, um diese Zeile in die Nähe - des oberen Bildschirmrands zu bringen. +>> Drücken Sie C-l C-l, um diese Zeile an den oberen Bildschirmrand zu + bringen. >> Lesen Sie nun mittels C-h m die englische Dokumentation zum Textmodus. >> Entfernen Sie schließlich das Dokumentationsfenster mit C-x 1. -Neben den Hauptmodi gibt es auch Nebenmodi (`minor modes'). Nebenmodi +Neben den Hauptmodi gibt es auch Nebenmodi (»minor modes«). Nebenmodi sind keine Alternativen zu Hauptmodi, sondern stellen Ergänzungen zur Verfügung, die (normalerweise) in allen Hauptmodi funktionieren (z.B. der Überschreibmodus: Zeichen werden nicht eingefügt, sondern @@ -998,20 +982,20 @@ Sie können zu Ihrem Hauptmodus keinen, einen oder sogar mehrere Nebenmodi haben. Ein Nebenmodus, welcher äußerst nützlich ist, besonders für das -Editieren von Text, ist der automatische Zeilenumbruch (`Auto Fill -mode'). Ist dieser Modus aktiviert, dann bricht Emacs die laufende +Editieren von Text, ist der automatische Zeilenumbruch (»Auto Fill +mode«). Ist dieser Modus aktiviert, dann bricht Emacs die laufende Zeile selbsttätig zwischen Wörtern um, sobald sie zu lang wird. -Sie können den Zeilenumbruchmodus einschalten mittels `M-x auto fill -mode<Return>'. Wenn der Modus aktiviert ist, können Sie ihn mit dem -gleichen Befehl wieder ausschalten. Mit anderen Worten, der Befehl -verhält sich wie ein Lichttaster, der bei Betätigung entweder das -Licht ein- oder ausschaltet, je nachdem, ob das Licht vorher +Sie können den Zeilenumbruchmodus mittels »M-x auto-fill-mode +<Return>« einschalten. Wenn der Modus aktiviert ist, können Sie ihn +mit dem gleichen Befehl wieder ausschalten. Mit anderen Worten, der +Befehl verhält sich wie ein Lichttaster, der bei Betätigung entweder +das Licht ein- oder ausschaltet, je nachdem, ob das Licht vorher ausgeschaltet bzw. eingeschaltet war. Wir sagen, dass dieser Befehl -den Modus umschaltet (`toggle'). +den Modus umschaltet (»toggle«). ->> Geben Sie nun M-x auto fill mode<Return> ein. Fügen Sie - anschließend eine Zeile ein, die aus lauter `asdf ' besteht, und +>> Geben Sie nun M-x auto-fill-mode <Return> ein. Fügen Sie + anschließend eine Zeile ein, die aus lauter »asdf « besteht, und zwar so lange, bis die Zeile automatisch umgebrochen wird. Vergessen Sie nicht, Leerzeichen einzugeben, da nur dort ein Umbruch erfolgt. @@ -1038,56 +1022,56 @@ Absatzes stehen muss. * SUCHEN -------- -Emacs kann Zeichenketten (`strings') entweder in Richtung Pufferende -(vorwärts, `forward') oder in Richtung Pufferanfang (rückwärts, -`backward') suchen. Gleichzeitig wird der Cursor an die nächste -Stelle bewegt, wo diese Zeichenkette erscheint. +Emacs kann Zeichenketten (»strings«, eine Folge von zusammenhängenden +Zeichen) entweder in Richtung Pufferende (vorwärts, »forward«) oder in +Richtung Pufferanfang (rückwärts, »backward«) suchen. Gleichzeitig +wird der Cursor an die nächste Stelle bewegt, wo diese Zeichenkette +erscheint. -Hier unterscheidet sich Emacs von vielen anderen Editoren, da nämlich -die Standard-Suchoperation inkrementelles Suchen ist, d.h., die Suche -beginnt dann, wenn Sie die Zeichen eingeben. +Die Standard-Suchoperation von Emacs ist inkrementelles Suchen, d.h., +die Suche beginnt dann, wenn Sie die Zeichen eingeben. Der Befehl für Vorwärtssuchen ist C-s und C-r für Rückwärtssuchen. ABER HALT! Probieren Sie bitte diese Befehle noch nicht. -Wenn Sie C-s eingeben, dann erscheint die Zeichenkette `I-search:' als +Wenn Sie C-s eingeben, dann erscheint die Zeichenkette »I-search:« als Eingabeaufforderung im Echobereich. Das bedeutet, dass Emacs jetzt eine inkrementellen Suche ausführt und darauf wartet, dass Sie die zu suchende Zeichenkette eingeben. <Return> beendet die Suche. >> Geben Sie jetzt C-s ein, um einen Suchvorgang zu starten. Schreiben - Sie LANGSAM, einen Buchstaben nach dem anderen, das Wort `Cursor', + Sie LANGSAM, einen Buchstaben nach dem anderen, das Wort »Cursor«, und warten Sie jeweils ab, was mit dem Cursor passiert. Sie haben - jetzt das Wort `Cursor' einmal gefunden. + jetzt das Wort »Cursor« einmal gefunden. >> Drücken Sie C-s noch einmal, um die nächste Stelle zu suchen, wo das - Wort `Cursor' vorkommt. ->> Drücken Sie nun <Delete> viermal und beobachten Sie, wie der Cursor + Wort »Cursor« vorkommt. +>> Drücken Sie nun <DEL> viermal und beobachten Sie, wie der Cursor zurückspringt. >> Beenden Sie die Suche mit <Return>. Verstehen Sie, was gerade vorgegangen ist? Emacs versucht während einer inkrementellen Suche zu der Stelle zu gehen, wo die Zeichenkette steht, die Sie bis jetzt eingegeben haben. Um die darauffolgende -Position zu suchen, wo `Cursor' steht, genügt es, noch einmal C-s zu +Position zu suchen, wo »Cursor« steht, genügt es, noch einmal C-s zu betätigen. Wenn es keine nächste Position gibt, dann ertönt ein kurzer Ton, und Emacs sagt Ihnen, dass die Suche im Augenblick -fehlschlägt (`failing'). C-g beendet ebenfalls einen Suchvorgang. +fehlschlägt (»failing«). C-g beendet ebenfalls einen Suchvorgang. Wenn Sie sich mitten in einer inkrementellen Suche befinden und -<Delete> drücken, wird das letzte Zeichen im Suchstring gelöscht, und +<DEL> drücken, wird das letzte Zeichen im Suchstring gelöscht, und der Cursor springt zurück auf die letzte Suchposition. Angenommen, -Sie haben `c' eingegeben, um das erste Auftreten von `c' zu suchen. -Geben Sie jetzt `u' ein, dann springt der Cursor zu dem ersten -Auftreten der Zeichenkette `cu'. Wenn Sie jetzt mit <Delete> das `u' -vom Suchstring löschen, dann springt der Cursor zurück zum ersten `c'. -Drücken Sie dagegen ein paar mal C-s, um weitere `cu'-Zeichenketten zu -finden, dann bewirkt <Delete>, dass Sie zum letzten Auftreten von `cu' -zurückspringen, und erst wenn es kein weiteres `cu' mehr gibt, springt -der Cursor zum ersten `c' zurück. +Sie haben »c« eingegeben, um das erste Auftreten von »c« zu suchen. +Geben Sie jetzt »u« ein, dann springt der Cursor zu dem ersten +Auftreten der Zeichenkette »cu«. Wenn Sie jetzt mit <DEL> das »u« +vom Suchstring löschen, dann springt der Cursor zurück zum ersten »c«. +Drücken Sie dagegen ein paar mal C-s, um weitere »cu«-Zeichenketten zu +finden, dann bewirkt <DEL>, dass Sie zum letzten Auftreten von »cu« +zurückspringen, und erst wenn es kein weiteres »cu« mehr gibt, springt +der Cursor zum ersten »c« zurück. Die Suche wird ebenfalls beendet, wenn Sie ein CONTROL- oder -META-Zeichen eingeben (mit ein paar Ausnahmen -- Zeichen, die -bei einer Suche speziell gehandhabt werden wie C-s oder C-r). +META-Zeichen eingeben (mit ein paar Ausnahmen -- Zeichen, die bei +einer Suche speziell gehandhabt werden wie C-s oder C-r). C-s versucht, die Zeichenkette NACH der aktuellen Cursorposition zu finden. Wollen Sie etwas davor suchen, müssen Sie C-r verwenden. Das @@ -1101,7 +1085,11 @@ Suchrichtung. Eine weitere, nützliche Fähigkeit von Emacs ist die Möglichkeit, mehr als ein Fenster zur gleichen Zeit auf dem Bildschirm darzustellen. ->> Bewegen Sie den Cursor zu dieser Zeile und geben Sie C-u 0 C-l ein. +[Der Unterschied zu graphischen Fenstern im herkömmlichen Sinn +(»frame« in der Emacs-Terminologie) wurde bereits weiter oben +besprochen.] + +>> Bewegen Sie den Cursor zu dieser Zeile und geben Sie C-l C-l ein. >> Drücken Sie nun C-x 2, um den Bildschirm in zwei Fenster zu teilen. Beide Fenster zeigen diese Einführung an, und der Cursor bleibt im @@ -1111,8 +1099,8 @@ als ein Fenster zur gleichen Zeit auf dem Bildschirm darzustellen. statt dessen auch ESC C-v verwenden, falls Sie keine META-Taste haben; siehe auch weiter unten). ->> Mittels C-x o (das `o' steht für das englische Wort `other', `das - andere') können Sie den Cursor in das untere Fenster bewegen. +>> Mittels C-x o (das »o« steht für das englische Wort »other«, »das + andere«) können Sie den Cursor in das untere Fenster bewegen. >> Benützen Sie C-v und M-v, um im unteren Fenster zu blättern. Lesen Sie die Emacs-Einführung jedoch im oberen Fenster weiter. @@ -1122,16 +1110,16 @@ als ein Fenster zur gleichen Zeit auf dem Bildschirm darzustellen. C-x o ist der Befehl, um zwischen (Emacs-)Fenstern hin- und herzuschalten. Jedes Fenster hat eine eigene Cursorposition, aber nur -das aktuelle Fenster zeigt den Cursor an (unter X11 wird die -nicht-aktuelle Cursorposition durch ein leeres Rechteck dargestellt). -Alle normalen Editierbefehle betreffen das Fenster, in dem sich der -Cursor befindet. Wir nennen dieses Fenster `ausgewählt' (`selected -window'). +das aktuelle Fenster zeigt den Cursor an (auf einer graphischen +Oberfläche wird die nicht-aktuelle Cursorposition durch ein leeres +Rechteck dargestellt). Alle normalen Editierbefehle betreffen das +Fenster, in dem sich der Cursor befindet. Wir nennen dieses Fenster +»ausgewählt« (»selected window«). Der Befehl M-C-v ist sehr nützlich, wenn man Text in einem Fenster -editiert und das andere Fenster als Referenz verwendet. Der Cursor -bleibt stets im gleichen Arbeitsfenster, und mit M-C-v kann man bequem -vorwärtsblättern. +editiert und das andere Fenster als Referenz verwendet. Ohne das +momentante Arbeitsfenster verlassen zu müssen, kann man mit M-C-v im +anderen Fenster bequem vorwärtsblättern. M-C-v ist ein Beispiel eines CONTROL-META-Zeichens. Haben Sie eine META-Taste, dann kann man M-C-v erzeugen, indem man CTRL und META @@ -1147,24 +1135,24 @@ META oder CTRL. Der umgekehrte Befehl zu M-C-v ist M-C-S-v, um im anderen Fenster rückwärts zu blättern (d.h., Sie müssen die META-Taste sowie die -CONTROL- und SHIFT-Taste zusammen mit `v' betätigen) -- jetzt werden +CONTROL- und SHIFT-Taste zusammen mit »v« betätigen) -- jetzt werden Sie wahrscheinlich verstehen, warum manche Kritiker das Wort Emacs als Abkürzung von Escape-Meta-Alt-Control-Shift betrachten. Leider funktioniert diese Befehlsfolge normalerweise nur mit graphischen -Oberflächen wie X11, da C-v von C-S-v auf den meisten Textterminals -nicht unterschieden werden kann. +Oberflächen, da C-v von C-S-v auf den meisten Textterminals nicht +unterschieden werden kann. -[Unter X11 kann man außerdem in der Regel mit den bequemeren -Tastenkombinationen META-`Bild mit Aufwärtspfeil' bzw. META-`Bild mit -Abwärtspfeil' ebenfalls im anderen Fenster rück- bzw. vorwärts -blättern.] +[Auf graphischen Oberflächen kann man außerdem in der Regel mit den +bequemeren Tastenkombinationen META-»Bild mit Aufwärtspfeil« +bzw. META-»Bild mit Abwärtspfeil« ebenfalls im anderen Fenster rück- +bzw. vorwärts blättern.] >> Entfernen Sie mit C-x 1 (eingegeben im oberen Fenster) das untere Fenster. (Hätten Sie C-x 1 im unteren Fenster eingegeben, dann wäre das obere -Fenster geschlossen worden -- eine Eselsbrücke für C-x 1 ist `ich will -nur das *eine* Fenster, in dem ich mich gerade befinde.') +Fenster geschlossen worden -- eine Eselsbrücke für C-x 1 ist »ich will +nur das *eine* Fenster, in dem ich mich gerade befinde.«) Sie müssen nicht den gleichen Puffer in beiden Fenstern darstellen. Wenn Sie C-x C-f verwenden, um in einem Fenster eine Datei zu laden, @@ -1184,11 +1172,42 @@ Texte darzustellen: Sie C-x 1 ein, um das untere Fenster zu schließen. +* MEHRFACHE RAHMEN +------------------ + +Emacs kann auch mehrfache Rahmen erzeugen, sobald das Programm auf +einer graphischen Oberfläche ausgeführt wird. In der +Emacs-Terminologie bezeichnet ein »Rahmen« eine Gruppe von Fenstern, +gemeinsam mit deren Menus, Scrollbars, Echo-Bereichen, usw. Auf einem +Textterminal kann genau ein Rahmen dargestellt werden. + +>> Geben Sie + + M-x make-frame <Return> + + ein, um einen neuen Rahmen zu erzeugen. + +Alles, was Sie im ursprünglichen, ersten Rahmen tun können, +funktioniert genauso im neuen Rahmen. Beide Rahmen sind also völlig +gleichwertig. + +>> Geben Sie + + M-x delete-frame <Return> + + ein, um den ausgewählten Rahmen zu entfernen. + +Ein Rahmen kann auch mit der normalen Methode der graphischen +Oberfläche entfernt werden; meistens gibt es dafür einen Knopf mit +einem »X« in der linken oder rechten oberen Ecke des Rahmens. Wird +der letzte Rahmen geschlossen, beendet man Emacs, wie erwartet. + + * REKURSIVE EDITIER-EBENEN -------------------------- Manchmal kann es passieren, dass Sie in eine sogenannte rekursive -Editier-Ebene geraten (`recursive editing level'). Sie können das an +Editier-Ebene geraten (»recursive editing level«). Sie können das an den eckigen Klammern in der Statuszeile erkennen, welche den derzeitigen Hauptmodus zusätzlich umschließen, z.B. [(Fundamental)] anstelle von (Fundamental). @@ -1211,91 +1230,49 @@ dargestellt. Details finden Sie im Emacs-Handbuch beschrieben. * MULE ------ -Mule ist die Abkürzung für `Multi-lingual Enhancement to GNU Emacs'. +Mule ist die Abkürzung für »Multi-lingual Enhancement to GNU Emacs«. Früher wurde damit eine spezielle Emacs-Variante bezeichnet, die allerdings seit der Version 20 mit Emacs verschmolzen ist. Emacs unterstützt eine große Anzahl von internationalen Zeichensätzen, z.B. verschiedene europäische Varianten des lateinischen Alphabets, Chinesisch, Russisch oder Thai, um nur einige zu nennen. In dieser -Einführung wird jedoch nur auf den deutschen Zeichensatz sowie +Einführung wird jedoch nur auf Unicode und Latin-1 sowie Eingabemöglichkeiten für Deutsch näher eingegangen. -Der Standard-Zeichensatz für Deutsch ist Latin-1 (auch bekannt unter -dem Namen ISO-8859-1), obwohl Unicode -- und da besonders die -Kodierungsvariante UTF-8 -- sich immer mehr durchzusetzt. Wenn -anstelle der deutschen Umlaute unansehnliche Konstrukte wie `\201ä' -dargestellt werden, dann ist die sogenannte -Multibyte-Zeichenunterstützung deaktiviert (intern werden in Emacs -Nicht-ASCII-Zeichensätze durch mehr als ein Byte repräsentiert). Der -Befehl `M-x toggle-enable-multibyte-characters' aktiviert die -Multibyte-Zeichenunterstützung. Denken Sie daran, die Tabulatortaste -zur Vervollständigung von Befehlsnamen zu benützen, z.B. `M-x -toggle-e<TAB><Return>'. - -Wenn anstelle der Umlaute `ä', `ö' oder `ü' die Zeichen `d', `v' und -`|' erscheinen (also `kleines D', `kleines V' und ein senkrechter -Strich), dann wird das achte Bit von jedem Byte abgeschnitten, sodass -nur ASCII-Zeichen dargestellt werden können. In der Regel gibt es -zwei Ursachen für dieses Problem: Sie haben sich nicht `8-bit clean' -(z.B. mittels `telnet -8 ...') eingeloggt oder Ihr -Telekommunikationsprogramm ist nicht für 8-bit konfiguriert. Beides -ist heutzutage eher unwahrscheinlich, daher wird hier nicht weiter -darauf eingegangen. - ->> Geben Sie `M-x toggle-enable-multibyte-characters' ein. Die - deutschen Umlaute (so sie von Ihrem Terminal darstellbar sind) - verschwinden und werden durch Zahlenkonstrukte ersetzt. So wird - zum Beispiel Umlaut a (`ä') dargestellt als `\201ä'. - ->> Aktivieren Sie wieder die Multibyte-Zeichenunterstützung mittels - `M-x toggle-enable-multibyte-characters'. - -Sehen Sie anstelle der Umlaute leere Kästchen (unter X11 oder anderen -graphischen Oberflächen), sollten Sie Emacs mit C-x C-c beenden und -folgendermaßen neu starten: - - emacs -fn fontset-standard - -Sie können auch probieren, Emacs mit der `--unibyte'-Option zu -starten, um Latin-1-Zeichen direkt darzustellen. +Lesen Sie im Emacs-Handbuch unter dem Stichwort »International« nach, +welche weitere Optionen es bezüglich Zeichensätze gibt. -Falls das alles nichts nützt oder Sie Fragezeichen anstelle der -Umlaute auf ihrem Textterminal sehen, sollten Sie sich an Ihren -Systemadministrator wenden und sich beschweren, dass kein -Latin-1-Zeichensatz installiert ist (was heutzutage eigentlich eine -Selbstverständlichkeit sein sollte). Falls statt der Umlaute andere -Zeichen auf ihrem Textterminal erscheinen (z.B. kyrillische -Buchstaben), dann erkundigen Sie sich, wie sie auf Latin-1 umschalten -können. +Die Standard-Zeichensätze für Deutsch sind Latin-1 (auch bekannt unter +dem Namen ISO-8859-1) und Unicode -- und da besonders dessen +Kodierungsvariante UTF-8. Werden anstelle der deutschen Umlaute +unansehnliche Konstrukte wie »\374« dargestellt, hat Emacs die +Kodierung nicht richtig erkannt. Sie können die Anwendung einer +Kodierung auf einen Befehl erzwingen, indem Sie diesen mit der Sequenz +»C-x <Return> c KODIERUNG« einleiten. Das Laden einer Datei »foo« mit +der Kodierung »UTF-8« ist beispielsweise -Lesen Sie im Emacs-Handbuch nach unter dem Stichwort `International', -welche weitere Optionen es bezüglich Zeichensätze gibt. + C-x <Return> c utf-8 <Return> C-x C-f foo -Ist die Sprachumgebung (`locale') Ihres Betriebssystems korrekt auf -Deutsch gesetzt, verwendet Emacs diese Einstellungen automatisch. -Anderenfalls empfiehlt es sich, Latin-1 als Standardkodierung zu -aktivieren, wenn Sie primär Deutsch verwenden. Benutzen Sie zu diesem -Zweck die Befehlsfolge +Ist die Sprachumgebung (»locale«) Ihres Betriebssystems korrekt auf +Deutsch gesetzt, verwendet Emacs diese Einstellungen automatisch +(inklusive einer Standard-Kodierung). Wollen Sie andere Einstellungen +verwenden, geben Sie »C-x <Return> l« ein (ein Tastenkürzel für die +Funktion set-language-environment). Mittels - C-x <Return> l latin-1 <Return> + C-x <Return> l latin-1 <Return> -(C-x <Return> l führt die Funktion set-language-environment aus), um -in einer laufenden Emacs-Sitzung auf Latin-1 umzuschalten. Dadurch -wird erreicht, dass Emacs beim Laden einer Datei (und Speichern -derselben) standardmäßig die Latin-1-Zeichenkodierung verwendet. Sie -können an der Ziffer 1 unmittelbar vor dem Doppelpunkt links unten in -der Statuszeile erkennen, dass Sie Latin-1 aktiviert haben. Beachten -Sie allerdings, dass set-language-environment keinen Einfluss auf die -Kodierung bereits existierender Puffer hat! Haben Sie eine Datei mit -deutschem Text in Latin-1-Kodierung irrtümlicherweise in einer -falschen Kodierung geladen, dann müssen Sie diesen Puffer aus Emacs -mit dem Befehl C-x k (kill-buffer) entfernen und die Datei erneut -laden, nachdem Sie mit set-language-environment auf Latin-1 -umgeschaltet haben. +können Sie z.B. in einer laufenden Emacs-Sitzung auf Latin-1 +umzuschalten. Dadurch wird erreicht, dass Emacs beim Laden einer +Datei (und Speichern derselben) standardmäßig die +Latin-1-Zeichenkodierung verwendet. Sie können an der Ziffer 1 +unmittelbar vor dem Doppelpunkt links unten in der Statuszeile +erkennen, dass Sie Latin-1 aktiviert haben. Beachten Sie allerdings, +dass set-language-environment keinen Einfluss auf die Kodierung +bereits existierender Puffer hat! >> Führen Sie jetzt C-x <Return> l latin-1 <Return> aus und öffnen Sie - anschließend eine (neue) Datei mit dem Namen `bar' in einem anderen + anschließend eine (neue) Datei mit dem Namen »bar« in einem anderen Fenster mittels C-x 4 C-f bar <Return>. In der Statuszeile des zweiten Fensters sehen Sie die Ziffer 1 unmittelbar vor dem Doppelpunkt. @@ -1305,10 +1282,10 @@ umgeschaltet haben. Wie können Sie nun deutsche Umlaute eingeben? Es gibt prinzipiell zwei unterschiedliche Fälle: Sie besitzen eine deutsche Tastatur mit Tasten für die Umlaute oder Sie haben eine nicht-deutsche Tastatur. -Im ersteren Fall sollten Sie die Eingabemethode `german' auswählen, +Im ersteren Fall sollten Sie die Eingabemethode »german« auswählen, welche direkt die Umlaute auf die entsprechenden Tasten abbildet. Im letzteren Fall gibt es mehrere Möglichkeiten, wovon zwei hier erklärt -werden sollen, nämlich `latin-1-prefix' und `latin-1-postfix'. Die +werden sollen, nämlich »latin-1-prefix« und »latin-1-postfix«. Die Präfix-Methode erwartet zuerst den Akzent und dann den Basisbuchstaben ('a wird zu á, "s zu ß etc.), während bei der Postfix-Methode zuerst der Basisbuchstabe und dann der Akzent einzugeben ist (a" wird zu ä, @@ -1326,8 +1303,8 @@ angezeigt. Ist der Eingabemodus einmal gewählt, kann man mit C-\ ihn ein- und ausschalten. >> Geben Sie C-u C-\ latin-1-postfix <Return> ein. Beobachten Sie, - wie links unten in der Statuszeile die Anzeige von `1:**' auf - `1<1:**' springt. Probieren Sie ä einzugeben mittels a". + wie links unten in der Statuszeile die Anzeige von »1:**-« auf + »1<1:**-« springt. Probieren Sie ä einzugeben mittels a". >> Deaktivieren Sie den Eingabemodus wieder mit C-\. @@ -1338,9 +1315,9 @@ beschriebenen Eingabemethoden: 1< latin-1-postfix 1> latin-1-prefix -So bedeutet die Angabe `DE@1:**', dass Sie die Eingabemethode `german' -in einem Puffer mit Latin-1-Kodierung verwenden, und dass die Datei -bereits modifiziert wurde. +So bedeutet die Angabe »DE@1:**-«, dass Sie die Eingabemethode +»german« in einem Puffer mit Latin-1-Kodierung verwenden, und dass die +Datei bereits modifiziert wurde. [Arbeitet Emacs in einem Terminal, werden noch zwei zusätzliche Spalten zwischen Eingabemethode und Pufferkodierung eingefügt, und @@ -1356,7 +1333,7 @@ jedoch so mächtig und umfangreich, dass es den Rahmen einer Einführung spränge, an dieser Stelle mehr zu erklären. Um Sie im weiteren Lernverlauf zu unterstützen, stellt Emacs eine Reihe von Hilfe-Funktionen zu Verfügung, die alle mit dem Präfix C-h (dem -Hilfe-Zeichen, `Help character') beginnen. +Hilfe-Zeichen, »Help character«) beginnen. Nach dem Drücken von C-h geben Sie ein weiteres Zeichen ein, um Emacs zu sagen, worüber Sie mehr Informationen brauchen. Sollten Sie @@ -1364,11 +1341,7 @@ WIRKLICH verloren sein, geben Sie C-h ? ein, und Emacs sagt Ihnen, welche Art von Hilfe er Ihnen zu Verfügung stellen kann. Haben Sie C-h versehentlich gedrückt, können Sie mit C-g sofort abbrechen. -(Es kann vorkommen, dass bei manchen Computern bzw. Terminals C-h -etwas anderes bedeutet. Da erfahrungsgemäß C-h eine der -meistbenötigten Emacs-Befehle ist, haben Sie einen wirklichen Grund, -sich in diesem Fall beim Systemadministrator zu beschweren. -Alternativen zu C-h sind die F1-Taste und der lange Befehl M-x help +(Alternativen zu C-h sind die F1-Taste und der lange Befehl M-x help <Return>.) Die elementarste Hilfestellung gibt C-h c. Drücken Sie C-h, dann das @@ -1380,11 +1353,10 @@ Beschreibung des Befehls an. C-p runs the command previous-line -Somit wissen Sie den `Namen der Funktion'. Funktionsnamen werden -hauptsächlich benutzt, um Emacs anzupassen bzw. zu erweitern. Aber da -Namen in der Regel beschreiben, was die jeweilige Funktion tut, können -sie auch als sehr kurze Beschreibung dienen -- ausreichend, um Sie an -Befehle zu erinnern, die Sie bereits gelernt haben. +Somit wissen Sie den »Namen der Funktion«. Da Namen in der Regel +beschreiben, was die jeweilige Funktion tut, können sie auch als sehr +kurze Beschreibung dienen -- ausreichend, um Sie an Befehle zu +erinnern, die Sie bereits gelernt haben. Aus mehr als einem Zeichen bestehende Befehle, z.B. C-x C-s oder <ESC>v, sind ebenfalls erlaubt nach C-h c. @@ -1406,20 +1378,20 @@ Hier einige weitere nützliche Optionen von C-h: C-h f Beschreibt eine Funktion. Sie müssen den Namen der Funktion eingeben. ->> Probieren Sie C-h f previous-line<Return>. +>> Probieren Sie C-h f previous-line <Return>. Alle Information über den C-p-Befehl wird angezeigt. Sie können die Tabulator-Taste stets benützen, um den Namen des -jeweiligen Befehls zu vervollständigen. Geben Sie z.B. `C-h f -previous<TAB>' ein, dann werden alle Befehle angezeigt, deren Namen -mit `previous-' beginnen. Ergänzen Sie die Zeichenkette auf -`previous-l' und drücken Sie dann <TAB>, bleibt nur noch der Befehl -`previous-line' übrig, und Sie können mit <Return> abschließen. +jeweiligen Befehls zu vervollständigen. Geben Sie z.B. »C-h f +previous<TAB>« ein, dann werden alle Befehle angezeigt, deren Namen +mit »previous-« beginnen. Ergänzen Sie die Zeichenkette auf +»previous-l« und drücken Sie dann <TAB>, bleibt nur noch der Befehl +»previous-line« übrig, und Sie können mit <Return> abschließen. Ein ähnlicher Befehl ist C-h v. Er zeigt den Wert und die -Dokumentation von Variablen, deren Werte man ändern kann (um Emacs an -persönliche Bedürfnisse anzupassen). Auch hier kann man die -Tabulator-Taste zur Vervollständigung benutzen. +Dokumentation von Variablen, deren Werte man ändern kann (um +beispielsweise Emacs an persönliche Bedürfnisse anzupassen). Auch +hier kann man die Tabulator-Taste zur Vervollständigung benutzen. C-h a Ein Befehls-Apropos. Gibt man ein Schlüsselwort ein, zeigt Emacs alle Befehle, die dieses Schlüsselwort @@ -1429,9 +1401,9 @@ Tabulator-Taste zur Vervollständigung benutzen. einem oder zwei Zeichen) aufgelistet, welche den gleichen Befehl startet. ->> Geben Sie C-h a file<Return> ein. +>> Geben Sie C-h a file <Return> ein. -Alle M-x-Befehle, die das Wort `file' in ihrem Namen enthalten, werden +Alle M-x-Befehle, die das Wort »file« in ihrem Namen enthalten, werden angezeigt. Beachten Sie, dass auch C-x C-f aufgelistet wird neben dem zugehörigen langen Namen, find-file. @@ -1440,30 +1412,26 @@ zugehörigen langen Namen, find-file. >> Schließen Sie das Hilfefenster mit C-x 1. C-h i Dieser Befehl öffnet einen speziellen Puffer, um - Online-Handbücher zu lesen (im `Info'-Format), die auf - dem verwendeten Computersystem installiert sind. - Geben Sie z.B. m emacs <Return> ein, um das - Emacs-Handbuch zu lesen. Haben Sie `Info' noch nie - benutzt, tippen Sie ?, und Emacs führt Sie Schritt für - Schritt durch die Möglichkeiten des Info-Modus. Wenn - Sie diese Einführung fertiggelesen haben, sollten Sie - das Info-Handbuch für Emacs als primäre Dokumentation + Handbücher zu lesen (im »Info«-Format), die auf dem + verwendeten Computersystem installiert sind. Geben + Sie z.B. m emacs <Return> ein, um das Emacs-Handbuch + zu lesen. Haben Sie »Info« noch nie benutzt, tippen + Sie ?, und Emacs führt Sie Schritt für Schritt durch + die Möglichkeiten des Info-Modus. Wenn Sie diese + Einführung fertiggelesen haben, sollten Sie das + Info-Handbuch für Emacs als primäre Dokumentation benutzen. * SCHLUSSBEMERKUNG ------------------ -Das Wichtigste: Emacs wird mit C-x C-c beendet und mit C-z temporär -unterbrochen. +Das Wichtigste: Emacs wird mit C-x C-c beendet. Diese Einführung soll für alle neuen Benutzer von Emacs verständlich sein. Wenn daher etwas unklar sein sollte, hadern Sie nicht mit sich -selbst. Schreiben Sie an die Free Software Foundation oder an den -Autor und erläutern Sie, was für Sie unklar geblieben ist. Eine -weitere Kontaktadresse ist die Mailing-Liste `de@li.org', in der -Probleme mit der Adaption von GNU-Programmen an das Deutsche -diskutiert werden. +selbst. Schreiben Sie an die Free Software Foundation, den Autor oder +den Übersetzer und erläutern Sie, was für Sie unklar geblieben ist. * RECHTLICHES diff --git a/etc/tutorials/TUTORIAL.sl b/etc/tutorials/TUTORIAL.sl index ef1fecbc86a..804fe366d50 100644 --- a/etc/tutorials/TUTORIAL.sl +++ b/etc/tutorials/TUTORIAL.sl @@ -1,41 +1,42 @@ -Prvo berilo za Emacs. Pogoji uporabe in raz¹irjanja so navedeni na koncu. +Prvo berilo za Emacs. Pogoji uporabe in razÅ¡irjanja so navedeni na koncu. -Ukazi v Emacsu v splo¹nem vkljuèujejo tipki CONTROL (vèasih oznaèeni -CTRL ali CTL) in META (vèasih oznaèena EDIT ali ALT). Namesto, da bi ju -vedno izpisali s celim imenom, bomo uporabili naslednji okraj¹avi: +Ukazi v Emacsu v sploÅ¡nem vkljuÄujejo tipki CONTROL (vÄasih oznaÄeni +CTRL ali CTL) in META (vÄasih oznaÄena EDIT ali ALT). Namesto, da bi ju +vedno izpisali s celim imenom, bomo uporabili naslednji okrajÅ¡avi: - C-<znak> pomeni, da moramo dr¾ati pritisnjeno tipko CONTROL, ko - vtipkamo <znak>. Oznaka C-f tako pomeni: dr¾imo pritisnjeno + C-<znak> pomeni, da moramo držati pritisnjeno tipko CONTROL, ko + vtipkamo <znak>. Oznaka C-f tako pomeni: držimo pritisnjeno tipko CONTROL in pritisnemo tipko f. - M-<znak> pomeni, da moramo dr¾ati pritisnjeno tipko META, EDIT ali - ALT, ko vtipkamo <znak>. Èe na tipkovnici ni tipk META, EDIT + M-<znak> pomeni, da moramo držati pritisnjeno tipko META, EDIT ali + ALT, ko vtipkamo <znak>. ÄŒe na tipkovnici ni tipk META, EDIT ali ALT, pritisnemo tipko ESC, jo spustimo in zatem - pritisnemo tipko <chr>. Tipko ESC bomo oznaèevali z <ESC>. + pritisnemo tipko <chr>. Tipko ESC bomo oznaÄevali z <ESC>. Pomembno: Emacs zapustimo z ukazom C-x C-c (dva znaka). -V uèbeniku so vaje, s katerimi preskusite nove ukaze. Oznaèujeta jih -znaka ,>>` ob levem robu. Zgled: +Delno vneÅ¡en ukaz prekinete s C-g. +V uÄbeniku so vaje, s katerimi preskusite nove ukaze. OznaÄujeta jih +znaka »>>« ob levem robu. Zgled: <<Blank lines inserted here by startup of help-with-tutorial>> -[Sredina strani je iz didaktiènih razlogov prazna. Besedilo se nadaljuje spodaj] ->> Vtipkajte zdaj ukaz C-v (View next screen, Prika¾i naslednji zaslon), +[Sredina strani je iz didaktiÄnih razlogov prazna. Besedilo se nadaljuje spodaj] +>> Vtipkajte zdaj ukaz C-v (View next screen, Prikaži naslednji zaslon), da se premaknete na naslednji zaslon (kar poskusite, pritisnite hkrati tipko CONTROL in V). Od zdaj naprej boste morali to - napraviti sami vsakiè, ko pridete do konca zaslona. + napraviti sami vsakiÄ, ko pridete do konca zaslona. -Ste opazili, da sta se dve vrstici s prej¹njega zaslona ponovili? Ta -kontinuiteta olaj¹a branje pri skakanju s strani na stran. +Ste opazili, da sta se dve vrstici s prejÅ¡njega zaslona ponovili? Ta +kontinuiteta olajÅ¡a branje pri skakanju s strani na stran. Prva stvar, ki si jo morate zapomniti, je, kako se premikate po -datoteki. Zdaj ¾e veste, da se premaknete za cel zaslon naprej z +datoteki. Zdaj že veste, da se premaknete za cel zaslon naprej z ukazom C-v. Za cel zaslon nazaj pa se premaknete z ukazom M-v -(pritisnite tipko META in jo dr¾ite ter pritisnite tipko v, ali pa -pritisnite in spustite <ESC> ter zatem pritisnite tipko v, èe tipke -META, EDIT ali ALT na va¹i tipkovnici ni). +(pritisnite tipko META in jo držite ter pritisnite tipko v, ali pa +pritisnite in spustite <ESC> ter zatem pritisnite tipko v, Äe tipke +META, EDIT ali ALT na vaÅ¡i tipkovnici ni). >> Nekajkrat pritisnite M-v in C-v, da vidite, kako ukaza delujeta. -* POVZETEK +* povzetek ---------- Za pregled celega zaslona besedila so uporabni naslednji ukazi: @@ -43,110 +44,113 @@ Za pregled celega zaslona besedila so uporabni naslednji ukazi: C-v Premik se za cel zaslon naprej M-v Premik se za cel zaslon nazaj C-l Cel zaslon premaknemo tako, da je zdaj po vertikali - osredninjen okoli besedila, kjer se nahaja kazalèek - (znak v C-l je èrka L, ne ¹tevka 1) + osredninjen okoli besedila, kjer se nahaja kazalÄek + (znak v C-l je Ärka L, ne Å¡tevka 1) ->> Poi¹èite kazalèek na zaslonu in si zapomnite besedilo okoli njega. - Vtipkajte C-l. - Ponovno poi¹èite kazalèek. Besedilo okoli njega je ostalo isto. +>> PoiÅ¡Äite kazalÄek na zaslonu in si zapomnite besedilo okoli njega. + Zatem vtipkajte C-l. Ponovno poiÅ¡Äite kazalÄek. Opazili boste, da + je besedilo okoli njega ostalo isto, vendar se je pomaknilo na sredo + zaslona. ÄŒe Å¡e enkrat pritisnite C-l, se bo ta vrstica pomaknila na + vrh zaslona. Pritisnite C-l Å¡e enkrat, in vrstica se bo pomaknila + na dno zaslona. Za premikanje za cel zaslon naprej ali nazaj lahko tipkovnicah, ki imajo ti tipki, uporabljate tudi PageUp in PageDown. Opisan postopek s C-v in M-v pa deluje povsod. -* PREMIKANJE KAZALÈKA +* PREMIKANJE KAZALÄŒKA --------------------- Premiki za celo stran naprej in nazaj so sicer uporabni, ampak kako pa pridemo do izbranega mesta na zaslonu? -Naèinov je veè. Najosnovnej¹i je uporaba ukazov C-p, C-b, C-f in -C-n. Ti po vrsti premaknejo kazalèek v prej¹njo vrstico, znak nazaj, -znak naprej, in v naslednjo vrstico. Ti ¹tirje ukazi so enakovredni +NaÄinov je veÄ. NajosnovnejÅ¡i je uporaba ukazov C-p, C-b, C-f in +C-n. Ti po vrsti premaknejo kazalÄek v prejÅ¡njo vrstico, znak nazaj, +znak naprej, in v naslednjo vrstico. Ti Å¡tirje ukazi so enakovredni kurzorskim tipkam: - prej¹nja vrstica, C-p + prejÅ¡nja vrstica, C-p : : - nazaj, C-b .... trenutni polo¾aj kazalèka .... naprej, C-f + nazaj, C-b .... trenutni položaj kazalÄka .... naprej, C-f : : naslednja vrstica, C-n ->> S pritiski na C-n ali C-p premaknite kazalèek v sredinsko vrstico +>> S pritiski na C-n ali C-p premaknite kazalÄek v sredinsko vrstico na diagramu zgoraj. Zatem pritisnite C-l. S tem diagram postavite na sredino zaslona. -V angle¹èini ima izbor tipk nazoren pomen. P kot ,previous` -(prej¹nji), N kot ,next` (naslednji), B kot ,backward` (nazaj) in F -kot ,forward` (naprej). Te osnovne ukaze za premikanje kazalèka boste -uporabljali ves èas. +V angleÅ¡Äini ima izbor tipk nazoren pomen. P kot »previous« +(prejÅ¡nji), N kot »next« (naslednji), B kot »backward« (nazaj) in F +kot »forward« (naprej). Te osnovne ukaze za premikanje kazalÄka boste +uporabljali ves Äas. ->> Nekajkrat pritisnite C-n, da pride kazalèek do te vrstice. +>> Nekajkrat pritisnite C-n, da pride kazalÄek do te vrstice. >> Z nekaj C-f se pomaknite na desno na sredo vrstice, nato pa nekajkrat - pritisnite C-p. Opazujte, kaj se dogaja s kazalèkom na sredini + pritisnite C-p. Opazujte, kaj se dogaja s kazalÄkom na sredini vrstice. -Vsaka vrstice v besedilu je zakljuèena z znakom za novo vrstico -(angl. Newline). Ta loèuje vrstico v besedilu od naslednje. Tudi -zadnja vrstica v datoteki mora biti zaljuèena z znakom za novo vrstico -(èeprav tega Emacs ne zahteva). +Vsaka vrstice v besedilu je zakljuÄena z znakom za novo vrstico +(angl. Newline). Ta loÄuje vrstico v besedilu od naslednje. (Tudi +zadnja vrstica v datoteki je po navadi zakljuÄena z znakom za novo +vrstico, Äeprav Emacs tega ne zahteva.) ->> Poskusite ukaz C-b, ko je kazalèek na zaèetku vrstice. Kazalèek se - mora premakniti na konec prej¹nje vrstice. To je zato, ker se je +>> Poskusite ukaz C-b, ko je kazalÄek na zaÄetku vrstice. KazalÄek se + mora premakniti na konec prejÅ¡nje vrstice. To je zato, ker se je ravnokar premaknil prek znaka za konec vrstice. -Ukaz C-f premika kazalèek prek znaka za novo vrstico enako kot C-b. +Ukaz C-f premika kazalÄek prek znaka za novo vrstico enako kot C-b. ->> Poskusite ¹e nekajkrat pritisniti C-b, da dobite obèutek za - premikanje kazalèka. Potem nekajkrat poskusite C-f, da pridete do konca - vrstice. ©e enkrat pritisnite C-f, da skoèite v naslednjo vrstico. +>> Poskusite Å¡e nekajkrat pritisniti C-b, da dobite obÄutek za + premikanje kazalÄka. Potem nekajkrat poskusite C-f, da pridete do konca + vrstice. Å e enkrat pritisnite C-f, da skoÄite v naslednjo vrstico. -Ko s kazalèkom dose¾ete zgornji ali spodnji rob zaslona, se besedilo -toliko premakne, da kazalèek ostane na zaslonu. V angle¹èini se temu -pravi ,,scrolling``. To omogoèa, da lahko premaknemo kazalèek na +Ko s kazalÄkom dosežete zgornji ali spodnji rob zaslona, se besedilo +toliko premakne, da kazalÄek ostane na zaslonu. V angleÅ¡Äini se temu +pravi »scrolling«. To omogoÄa, da lahko premaknemo kazalÄek na katerokoli mesto v besedilu, a vseeno ostanemo na zaslonu. ->> Poskusite kazalèek pripeljati s C-n èisto do dna zaslona in si oglejte, +>> Poskusite kazalÄek pripeljati s C-n Äisto do dna zaslona in si oglejte, kaj se zgodi. -Èe se vam zdi premikanje po en znak prepoèasno, se lahko premikate za -celo besedo. M-f (META-f) premakne kazalèek za eno besedo naprej, M-b +ÄŒe se vam zdi premikanje po en znak prepoÄasno, se lahko premikate za +celo besedo. M-f (META-f) premakne kazalÄek za eno besedo naprej, M-b pa za besedo nazaj. >> Poskusite nekajkrat M-f in M-b. -Èe je kazalèek sredi besede, ga M-f prestavi na konec besede. Èe je v +ÄŒe je kazalÄek sredi besede, ga M-f prestavi na konec besede. ÄŒe je v belini med besedami, ga M-f premakne na konec naslednje besede. M-b deluje podobno, a v nasprotni smeri. ->> Nekajkrat poskusite M-f in M-b, vmes pa ¹e nekaj C-f in - C-b. Opazujte uèinke M-f in M-b, ko je kazalèek sredi besede ali +>> Nekajkrat poskusite M-f in M-b, vmes pa Å¡e nekaj C-f in + C-b. Opazujte uÄinke M-f in M-b, ko je kazalÄek sredi besede ali med besedami. Ste opazili paralelo med C-f in C-b na eni strani ter M-f in M-b na -drugi? V Emacsu se dostikrat ukazi Meta nana¹ajo na operacije nad +drugi? V Emacsu se dostikrat ukazi Meta nanaÅ¡ajo na operacije nad enotami jezika (besede, stavki, odstavki), medtem ko se ukazi Control -nana¹ajo na operacije, neodvisne od zvrsti besedila (znaki, vrstice +nanaÅ¡ajo na operacije, neodvisne od zvrsti besedila (znaki, vrstice ipd.). Podobna zveza je tudi med vrsticami in stavki: ukaza C-a in C-e -premakneta kazalèek na zaèetek oz. konec vrstice, M-a in M-e pa na -zaèetek oz. konec stavka. +premakneta kazalÄek na zaÄetek oz. konec vrstice, M-a in M-e pa na +zaÄetek oz. konec stavka. >> Poskusite nekaj ukazov C-a, potem pa nekaj ukazov C-e. Poskusite nekaj ukazov M-a, potem pa nekaj ukazov M-e. -Ste opazili, da ponovljeni C-a ne napravijo niè, ponovljeni M-a pa se -premikajo naprej? Èeprav se ne obna¹ata enako, pa je vendar obna¹anje +Ste opazili, da ponovljeni C-a ne napravijo niÄ, ponovljeni M-a pa se +premikajo naprej? ÄŒeprav se ne obnaÅ¡ata enako, pa je vendar obnaÅ¡anje enega in drugega po svoje naravno. -Polo¾aju kazalèka na zaslonu pravimo tudi ,,point``, toèka. -Parafrazirano: kazalèek ka¾e na zaslonu, kje je toèka v besedilu. +Položaju kazalÄka na zaslonu pravimo tudi »point«, toÄka. +Parafrazirano: kazalÄek kaže na zaslonu, kje je toÄka v besedilu. -Povzetek preprostih ukazov za premikanje kazalèka, vkljuèno s premiki +Povzetek preprostih ukazov za premikanje kazalÄka, vkljuÄno s premiki po besedo in stavek: C-f Premik za znak naprej @@ -156,335 +160,329 @@ po besedo in stavek: M-b Premik za besedo nazaj C-n Premik v naslednjo vrstico - C-p Premik v prej¹njo vrstico + C-p Premik v prejÅ¡njo vrstico - C-a Premik na zaèetek vrstice + C-a Premik na zaÄetek vrstice C-e Premik na konec vrstice - M-a Premik na zaèetek stavka + M-a Premik na zaÄetek stavka M-e Premik na konec stavka >> Za vajo nekajkrat poskusite vsakega od teh ukazov. To so najpogosteje uporabljani ukazi. -©e dva pomembna ukaza za premikanje kazalèka sta M-< (META-manj¹i od), -ki ga premakne na zaèetek datoteke, in M-> (META-veèji od), ki ga +Å e dva pomembna ukaza za premikanje kazalÄka sta M-< (META-manjÅ¡i od), +ki ga premakne na zaÄetek datoteke, in M-> (META-veÄji od), ki ga premakne na konec datoteke. -Na ameri¹kih tipkovnicah najdete znak < nad vejico in morate +Na ameriÅ¡kih tipkovnicah najdete znak < nad vejico in morate pritisniti tipko Shift, da pridete do njega. Z ukazom M-< je enako - prav tako morate pritisniti tipko Shift, sicer moste izvedli drug -ukaz, Meta-vejica. Na na¹ih tipkovnicah sta oba znaka na isti tipko, -in za ukaz M-> morate pritisniti ¹e tipko Shift. +ukaz, Meta-vejica. Na naÅ¡ih tipkovnicah sta oba znaka na isti tipko, +in za ukaz M-> morate pritisniti Å¡e tipko Shift. ->> Poskusite zdaj M-<, skok na zaèetek tega uèbenika. +>> Poskusite zdaj M-<, skok na zaÄetek tega uÄbenika. Potem se vrnite nazaj z zaporednimi C-v. ->> Poskusite zdaj M->, skok na konec tega uèbenika. +>> Poskusite zdaj M->, skok na konec tega uÄbenika. Potem se vrnite nazaj z zaporednimi M-v. -Èe ima va¹a tipkovnica kurzorske tipke, lahko premikate kazalèek po -zaslonu tudi z njimi. Vseeno priporoèamo, da se privadite ukazov C-b, -C-f, C-n in C-p, in to iz treh razlogov. Prviè, delujejo na èisto vseh -terminalih. Drugiè, z nekaj prakse v Emacsu boste opazili, da je -tipkanje ukazov s CONTROL hitrej¹e od tipkanja s kurzorskimi tipkami, ker -ni treba ves èas premikati desnice s tipkovnice na kurzorske tipke in -nazaj. In tretjiè, ko se enkrat navadite teh ukazov s CONTROL, se boste -enostavneje nauèili tudi bolj zapletenih ukazov za premikanje kazalèka. +ÄŒe ima vaÅ¡a tipkovnica kurzorske tipke, lahko premikate kazalÄek po +zaslonu tudi z njimi. Vseeno priporoÄamo, da se privadite ukazov C-b, +C-f, C-n in C-p, in to iz treh razlogov. PrviÄ, delujejo na Äisto vseh +terminalih. DrugiÄ, z nekaj prakse v Emacsu boste opazili, da je +tipkanje ukazov s CONTROL hitrejÅ¡e od tipkanja s kurzorskimi tipkami, ker +ni treba ves Äas premikati desnice s tipkovnice na kurzorske tipke in +nazaj. In tretjiÄ, ko se enkrat navadite teh ukazov s CONTROL, se boste +enostavneje nauÄili tudi bolj zapletenih ukazov za premikanje kazalÄka. -Veèini ukazov v Emacsu lahko podamo ¹tevilèni argument; najveèkrat ta -pove, kolikokrat zapovrstjo naj se ukaz izvede. Veèkratno ponovitev -ukaza izvedemo tako, da najprej vtipkamo C-u, zatem ¹tevilo, -kolikokrat naj se ukaz ponovi, in nazadnje ¾eljeni ukaz. Èe ima va¹a +VeÄini ukazov v Emacsu lahko podamo Å¡tevilÄni argument; najveÄkrat ta +pove, kolikokrat zapovrstjo naj se ukaz izvede. VeÄkratno ponovitev +ukaza izvedemo tako, da najprej vtipkamo C-u, zatem Å¡tevilo, +kolikokrat naj se ukaz ponovi, in nazadnje željeni ukaz. ÄŒe ima vaÅ¡a tipkovnica tipko META (ali EDIT ali ALT), lahko izpustite ukaz C-u in -namesto tega vtipkate ¹tevilo ponovitev, medtem ko dr¾ite pritisnjeno -tipko META. Druga metoda je sicer kraj¹a, priporoèamo pa prvo, ker -deluje na vseh terminalih. Tak¹en ¹tevilèni argument je ,,prefiksni`` -argument, ker vnesemo argument pred ukazom, na katerega se nana¹a. +namesto tega vtipkate Å¡tevilo ponovitev, medtem ko držite pritisnjeno +tipko META. Druga metoda je sicer krajÅ¡a, priporoÄamo pa prvo, ker +deluje na vseh terminalih. TakÅ¡en Å¡tevilÄni argument je »prefiksni« +argument, ker vnesemo argument pred ukazom, na katerega se nanaÅ¡a. -Zgled: C-u 8 C-f premakne kazalèek za osem znakov naprej. +Zgled: C-u 8 C-f premakne kazalÄek za osem znakov naprej. ->> Poskusite s primernim argumentom za ¹tevilo ponovitev ukaza - C-n ali C-p priti èim bli¾e tej vrstici v enem samem skoku. +>> Poskusite s primernim argumentom za Å¡tevilo ponovitev ukaza + C-n ali C-p priti Äim bliže tej vrstici v enem samem skoku. -Veèina ukazov, ne pa vsi, uporablja ¹tevilèni argument kot ¹tevilo +VeÄina ukazov, ne pa vsi, uporablja Å¡tevilÄni argument kot Å¡tevilo ponovitev ukaza. Nekateri ukazi - nobeden od tistih, ki smo si jih ogledali do zdaj - ga uporabljajo kot stikalo: s podanim prefiksnim -argumentom napravi ukaz nekaj drugega kot obièajno. +argumentom napravi ukaz nekaj drugega kot obiÄajno. -Ukaza C-v in M-v sta tudi izjemi, a drugaèni. Èe jima podamo argument, -premakneta zaslon za navedeno ¹tevilo vrstic, ne pa zaslonov. Ukaz C-u +Ukaza C-v in M-v sta tudi izjemi, a drugaÄni. ÄŒe jima podamo argument, +premakneta zaslon za navedeno Å¡tevilo vrstic, ne pa zaslonov. Ukaz C-u 8 C-v, na primer, premakne zaslon navzgor za 8 vrstic. >> Poskusite zdaj C-u 8 C-v -To bi moralo zaslon premakniti navzgor za osem vrstic. Èe bi ga radi +To bi moralo zaslon premakniti navzgor za osem vrstic. ÄŒe bi ga radi premaknili nazaj, poskusite M-v z istim argumentom. -Èe uporabljate grafièni vmesnik, denimo X11 ali MS Windows, imate -verjetno ob robu Emacsovega okna navpièno pravokotno ploskev, +ÄŒe uporabljate grafiÄni vmesnik, denimo X ali MS Windows, imate +verjetno ob robu Emacsovega okna pokonÄno pravokotno ploskev, imenovano drsnik. Pogled na besedilo lahko premikate tudi tako, da z -mi¹ko kliknete na drsnik. +miÅ¡ko kliknete na drsnik. ->> Postavite kazalec na vrh oznaèenega obmoèja na drsniku in pritisnite - srednji gumb na mi¹ki. To bi moralo premakniti besedilo na mesto, - doloèeno s tem, kako visoko ali nizko na drsnik ste kliknili. ->> Medtem ko dr¾ite srednji gumb pritisnjen, premikajte mi¹ko gor in - dol. Vidite, kako se premika besedilo v Emacsovem oknu, ko - premikate mi¹ko? - - -* ÈE SE EMACS OBESI -------------------- +* ÄŒE SE EMACS PRENEHA ODZIVATI +------------------------------ -Èe se Emacs preneha odzivati na va¹e ukaze, ga lahko varno prekinete z +ÄŒe se Emacs preneha odzivati na vaÅ¡e ukaze, ga lahko varno prekinete z ukazom C-g. Z njim lahko prekinete ukaze, za katere bi trajalo predolgo, da bi se izvedli. -Isti ukaz, C-g, lahko uporabite tudi, da preklièete ¹tevilèni -argument, ali pa zaèetek ukaza, ki ga ne ¾elite izvesti. +Isti ukaz, C-g, lahko uporabite tudi, da prekliÄete Å¡tevilÄni +argument, ali pa zaÄetek ukaza, ki ga ne želite izvesti. ->> Vtipkajte C-u 100, s èimer ste izbrali ¹tevilèni argument 100, - zatem pa vtipkajte C-g. Vtipkajte zdaj C-f. Kazalèek se je - premaknil le za en znak, ker ste ¹tevilèni argument vmes preklicali +>> Vtipkajte C-u 100, s Äimer ste izbrali Å¡tevilÄni argument 100, + zatem pa vtipkajte C-g. Vtipkajte zdaj C-f. KazalÄek se je + premaknil le za en znak, ker ste Å¡tevilÄni argument vmes preklicali s C-g. -Tudi èe ste po nesreèi vtipkali <ESC>, se ga lahko znebite s C-g. +Tudi Äe ste po nesreÄi vtipkali <ESC>, se ga lahko znebite s C-g. -* ONEMOGOÈENI UKAZI +* ONEMOGOÄŒENI UKAZI ------------------- -Nekaj ukazov v Emacsu je namenoma ,,onemogoèenih``, da bi jih -zaèetniki ne izvedli po nesreèi. +Nekaj ukazov v Emacsu je namenoma »onemogoÄenih«, da bi jih +zaÄetniki ne izvedli po nesreÄi. -Èe vtipkate tak onemogoèen ukaz, se bo na zaslonu pojavilo novo okno z -obvestilom, kateri ukaz ste sku¹ali izvesti, in vas vpra¹alo, èe ga -res ¾elite izvesti. +ÄŒe vtipkate tak onemogoÄen ukaz, se bo na zaslonu pojavilo novo okno z +obvestilom, kateri ukaz ste skuÅ¡ali izvesti, in vas vpraÅ¡alo, Äe ga +res želite izvesti. -Èe v resnici ¾elite poskusiti ukaz, pritisnite preslednico kot odgovor -na vpra¹anje. Normalno verjetno ukaza ne ¾elite izvesti, zato na -vpra¹anje odgovorite z ,n`. +ÄŒe v resnici želite poskusiti ukaz, pritisnite preslednico kot odgovor +na vpraÅ¡anje. Normalno verjetno ukaza ne želite izvesti, zato na +vpraÅ¡anje odgovorite z »n«. ->> Vtipkajte C-x C-l (ki je onemogoèen ukaz), - zatem na vpra¹anje odgovorite n. +>> Vtipkajte C-x C-l (ki je onemogoÄen ukaz), + zatem na vpraÅ¡anje odgovorite n. * OKNA ------ -Emacs lahko prika¾e veè oken in v vsakem svoje besedilo. Kasneje bomo -razlo¾ili, kako uporabljamo veè oken hkrati. Zaenkrat bomo povedali -le, kako se znebite dodatnih oken, ki jih lahko odpre vgrajena pomoè ali -pa izpis kak¹nega drugega programa. Preprosto je: +Emacs lahko prikaže veÄ Â»oken« in v vsakem svoje besedilo. Kasneje +bomo razložili, kako uporabljamo veÄ oken hkrati. Zaenkrat bomo +povedali le, kako se znebite dodatnih oken, ki jih lahko odpre +vgrajena pomoÄ ali pa izpis kakÅ¡nega drugega programa. Preprosto je: C-x 1 Eno okno (torej, zaprimo vsa ostala). -To je CONTROL-x, ki mu sledi ¹tevka 1. Ukaz C-x 1 raztegne èez cel -zaslon okno, v katerem se nahaja kazalèek, ostala pa zapre. +To je CONTROL-x, ki mu sledi Å¡tevka 1. Ukaz C-x 1 raztegne Äez cel +zaslon okno, v katerem se nahaja kazalÄek, ostala pa zapre. ->> Premaknite kazalèek do te vrstice in vtipkajte C-u 0 C-l ->> Vtipkajte CONTROL-h k CONTROL-f. - Vidite, kako se je to okno skrèilo in odstopilo prostor oknu, - ki pojasnjuje ukaz CONTROL-f? +>> Premaknite kazalÄek do te vrstice in vtipkajte C-u 0 C-l +>> Vtipkajte C-h k C-f. + Vidite, kako se je to okno skrÄilo in odstopilo prostor oknu, + ki pojasnjuje ukaz C-f? >> Vtipkajte C-x 1 in spodnje okno se bo zaprlo. -Za razliko od ukazov, ki smo se jih nauèili do zdaj, je ta ukaz -sestavljen iz dveh znakov. Zaène se z znakom CONTROL-x. Cela vrsta -ukazov se zaène enako, in mnogi od njih zadevajo delo z datotekami, -delovnimi podroèji in podobnim. Vsem tem ukazom je skupno, da se -zaènejo s CONTROL-x, ki mu sledi ¹e en, dva ali trije znaki. +Za razliko od ukazov, ki smo se jih nauÄili do zdaj, je ta ukaz +sestavljen iz dveh znakov. ZaÄne se z znakom CONTROL-x. Cela vrsta +ukazov se zaÄne enako, in mnogi od njih zadevajo delo z datotekami, +delovnimi podroÄji in podobnim. Vsem tem ukazom je skupno, da se +zaÄnejo s CONTROL-x, ki mu sledi Å¡e en, dva ali trije znaki. * VRIVANJE IN BRISANJE ---------------------- -Èe ¾elite v obstojeèe besedilo vriniti novo, preprosto premaknite -kazalèek na ¾eljeno mesto in zaènite tipkati. Znake, ki jih lahko -vidite, na primer A, 7, * in podobno, razume Emacs kot del besedila in -jih takoj vrine. S pritiskom na Return (ali Enter) vrinete znak za -skok v novo vrstico. - -Zadnji vtipkani znak lahko izbri¹ete s pritiskom na tipko -<Delback>. To je tista tipka na tipkovnici, ki jo navadno uporabljate -za brisanje nazadnje natipkanega znaka. Navadno je to velika tipka -vrstico ali dve nad tipko <Return>, ki je oznaèena z "Backspace", -"Delete" ali "Del". +ÄŒe želite v obstojeÄe besedilo vriniti novo, preprosto premaknite +kazalÄek na želeno mesto in zaÄnite tipkati. Vidne znake, na primer A, +7, * in podobno, Emacs vrine takoj, ko jih vtipkate. S pritiskom na +tipko <Return> (ali <Enter>) vrinete znak za skok v novo vrstico. -Èe imate na tipkovnici tipko "Backspace", je to tipka <Delback>. Naj -vas ne zmede, èe imate poleg tega ¹e tipko "Delete" - <Delback> je -"Backspace". +Zadnji vtipkani znak lahko izbriÅ¡ete s pritiskom na tipko <DEL>. Ta +tipka je na tipkovnici obiÄajno oznaÄena z »Backspace« - skratka, to +je ista tipka, ki jo tudi v drugih programih uporabljate za brisanje +nazadnje natipkanega znaka. -Splo¹no <Delback> pobri¹e znak neposredno pred trenutnim polo¾ajem -kazalèka. +Najverjetneje imate na tipkovnici Å¡e tipko »Delete«. Naj vas to ne +zmede - z <DEL> mislimo tipko »Backspace«. ->> Vtipkajte zdaj nekaj znakov in jih zatem s tipko <Delback> pobri¹ite. - Niè naj vas ne skrbi, èe se je ta vrstica spremenila. Izvirnika - tega uèbenika ne boste pokvarili -- tole je samo va¹a osebna kopija. +>> Poskusite zdaj! Vtipkajte zdaj nekaj znakov in jih zatem s tipko + <DEL> pobriÅ¡ite. NiÄ naj vas ne skrbi, Äe se je ta vrstica + spremenila. Izvirnika tega uÄbenika ne boste pokvarili -- tole je + samo vaÅ¡a osebna delovna kopija. -Ko vrstica postane predolga za zaslon, se ,,nadaljuje`` v naslednji -vrstici na zaslonu. Obrnjena po¹evnica (znak ,\`) ali v grafiènih -okoljih zavita pu¹èica ob desnem robu oznaèuje vrstico, ki se -nadaljuje v naslednji zaslonski vrstici. +Ko vrstica postane predolga za zaslon, se »nadaljuje« v naslednji +vrstici na zaslonu. ÄŒe uporabljate grafiÄno okolje, boste opazili +zaviti puÅ¡Äici ob levem in desnem robu, ki oznaÄujeta vrstico, ki se +nadaljuje v naslednji zaslonski vrstici. ÄŒe uporabljate terminalski +vmesnik, je vrstica, ki se nadaljuje v naslednji zaslonski vrstici, +oznaÄena z obrnjeno poÅ¡evnico (znak »\«) v skrajnem desnem stolpcu. ->> Zdaj zaènite tipkati besedilo, dokler ne dose¾ete desnega roba, in - ¹e naprej. Opazili boste, da se pojavi znak za nadaljevanje. +>> Zdaj zaÄnite tipkati besedilo, dokler ne dosežete desnega roba, in + Å¡e naprej. Opazili boste, da se pojavi znak za nadaljevanje. ->> S tipko <Delback> pobri¹ite toliko znakov, da vrstica ne sega - veè èez ¹irino zaslona. Znak za nadaljevanje v naslednji +>> S tipko <DEL> pobriÅ¡ite toliko znakov, da vrstica ne sega + veÄ Äez Å¡irino zaslona. Znak za nadaljevanje v naslednji vrstici je izginil. -Znak za novo vrstico lahko pobri¹emo enako kot vsak drug znak. S tem, -ko pobri¹emo znak za novo vrstico, zdru¾imo vrstici v eno samo. Èe bo -nova vrstica predolga, da bi cela pri¹la na zaslon, bo razdeljena v -veè zaslonskih vrstic. +Znak za novo vrstico lahko pobriÅ¡emo enako kot vsak drug znak. S tem, +ko pobriÅ¡emo znak za novo vrstico, združimo vrstici v eno samo. ÄŒe bo +nova vrstica predolga, da bi cela priÅ¡la na zaslon, bo razdeljena v +veÄ zaslonskih vrstic. ->> Premaknite kazalèek na zaèetek vrstice in pritisnite <Delback>. To - zdru¾i vrstico s prej¹njo. +>> Premaknite kazalÄek na zaÄetek vrstice in pritisnite <DEL>. To + združi vrstico s prejÅ¡njo. >> Pritisnite <Return>. S tem ste ponovno vrinili znak za skok v novo vrstico, ki ste ga malo prej zbrisali. -Spomnimo se, da lahko za veèino ukazov v Emacsu doloèimo, naj se -izvedejo veèkrat zaporedoma; to vkljuèuje tudi vnos teksta. Ponovitev -obièajnega znaka ga veèkrat vrine v besedilo. +Spomnimo se, da lahko za veÄino ukazov v Emacsu doloÄimo, naj se +izvedejo veÄkrat zaporedoma; to vkljuÄuje tudi vnos teksta. Ponovitev +obiÄajnega znaka ga veÄkrat vrine v besedilo. >> Poskusite zdaj tole: da vnesete osem zvezdic, vtipkajte C-u 8 * -Zdaj ste se nauèili najpreprostej¹i naèin, da v Emacsu nekaj natipkate -in popravite. Bri¹ete lahko tudi besede ali vrstice. Tu je povzetek +Zdaj ste se nauÄili najpreprostejÅ¡i naÄin, da v Emacsu nekaj natipkate +in popravite. BriÅ¡ete lahko tudi besede ali vrstice. Tu je povzetek ukazov za brisanje: - <Delback> pobri¹e znak tik pred kazalèkom (levo od - oznake za kazalèek) - C-d pobri¹e znak tik za kazalèkom (,pod` oznako - za kazalèek) + <DEL> pobriÅ¡e znak tik pred kazalÄkom (levo od + oznake za kazalÄek) + C-d pobriÅ¡e znak tik za kazalÄkom (»pod« oznako + za kazalÄek) - M-<Delback> pobri¹e besedo tik pred kazalèkom - M-d pobri¹e besedo tik za kazalèkom + M-<DEL> pobriÅ¡e besedo tik pred kazalÄkom + M-d pobriÅ¡e besedo tik za kazalÄkom - C-k zavr¾e besedilo desno od kazalèka do konca vrstice - M-k zavr¾e besedilo od polo¾aja kazalèka do konca stavka + C-k zavrže besedilo desno od kazalÄka do konca vrstice + M-k zavrže besedilo od položaja kazalÄka do konca stavka -Èrka ,d` je iz angle¹ke besede ,delete` (pobrisati), èrka ,k` pa iz -besede ,kill` (pobiti). Ste opazili, da <Delback> in C-d na eni, ter -M-<Delback> in M-d na drugi strani nadaljujeta paralelo, ki sta jo zaèela -C-f in M-f (<Delback> pravzaprav ni kontrolni znak, kar pa naj nas ne +ÄŒrka »d« je iz angleÅ¡ke besede »delete« (pobrisati), Ärka »k« pa iz +besede »kill« (pobiti). Ste opazili, da <DEL> in C-d na eni, ter +M-<DEL> in M-d na drugi strani nadaljujeta paralelo, ki sta jo zaÄela +C-f in M-f (<DEL> pravzaprav ni kontrolni znak, kar pa naj nas ne moti). C-k in M-k sta v enakem sorodu s C-e in M-e: prvi deluje na vrstice, drugi na stavke. -Obstaja tudi splo¹en postopek za brisanje kateregakoli dela delovnega -podroèja. Kazalèek postavimo na en konec podroèja, ki ga ¾elimo -izbrisati, in pritisnemo C-@ ali C-SPC (SPC je -preslednica). Katerikoli od obeh ukazov deluje. Premaknite kazalèek na -drug konec podroèja, ki ga ¾elite izbrisati, in pritisnite C-w. S tem -ste zavrgli vse besedilo med obema mejama. +Obstaja tudi sploÅ¡en postopek za brisanje kateregakoli dela delovnega +podroÄja. KazalÄek postavimo na en konec podroÄja, ki ga želimo +izbrisati, in pritisnemo C-@ ali C-<SPC> (<SPC> je preslednica). +Katerikoli od obeh ukazov deluje. Premaknite kazalÄek na drug konec +podroÄja, ki ga želite izbrisati. Med premikanjem Emacs z barvo +oznaÄuje podroÄje med kazalÄkom in mestom, kjer ste pritisnili +C-<SPC>. KonÄno pritisnite C-w. S tem ste zavrgli vse besedilo med +obema mejama. ->> Premaknite kazalèek na èrko O, s katero se zaèenja prej¹nji +>> Premaknite kazalÄek na Ärko O, s katero se zaÄenja prejÅ¡nji odstavek. ->> Vtipkajte C-SPC. Emacs prika¾e sporoèilo "Mark set" (slov. Oznaka - postavljena) na dnu ekrana. ->> Premaknite kazalèek na èrko V v "postavimo" v drugi vrstici istega +>> Vtipkajte C-SPC. Emacs prikaže sporoÄilo »Mark set« (slov. »oznaka + postavljena«) na dnu ekrana. +>> Premaknite kazalÄek na Ärko V v »postavimo« v drugi vrstici istega odstavka. ->> Vtipkajte C-w. S tem zavr¾emo vse besedilo zaèen¹i z O in vse do - èrke V. +>> Vtipkajte C-w. S tem zavržemo vse besedilo zaÄenÅ¡i z O in vse do + Ärke V. -Razlika med tem, èe zavr¾ete cel odstavek besedila (angl. ,,kill``, -pobiti) ali pa èe pobri¹ete znak (angl. ,,delete``), je ta, da lahko -prvega vrnete nazaj z ukazom C-y, drugega pa ne. Na splo¹no ukazi, ki -lahko povzroèijo veliko ¹kode (pobri¹ejo veliko besedila), shranijo -pobrisano besedilo; tisti, ki pobri¹ejo samo posamezni znak, ali samo -prazne vrstice in presledke, pa ne. +Razlika med tem, Äe zavržete cel odstavek besedila (angl. »kill«, +pobiti) ali pa Äe pobriÅ¡ete znak (angl. »delete«), je ta, da lahko +prvega povrnete - na katerokoli mesto v besedilu - z ukazom C-y, +drugega pa ne (seveda pa lahko prekliÄete brisanje - glejte nižje). Na +sploÅ¡no ukazi, ki lahko povzroÄijo veliko Å¡kode (pobriÅ¡ejo veliko +besedila), shranijo pobrisano besedilo; tisti, ki pobriÅ¡ejo samo +posamezni znak, ali samo prazne vrstice in presledke, pa ne. ->> Postavite kazalèek na zaèetek neprazne vrstice. Pritisnite C-k, da - pobri¹ete vsebino vrstice. ->> ©e enkrat pritisnite C-k. To pobri¹e ¹e znak za novo vrstico. +>> Postavite kazalÄek na zaÄetek neprazne vrstice. Pritisnite C-k, da + pobriÅ¡ete vsebino vrstice. +>> Å e enkrat pritisnite C-k. To pobriÅ¡e Å¡e znak za novo vrstico. -Ste opazili, da prvi C-k pobri¹e vsebino vrstice, naslednji C-k pa ¹e -vrstici samo, s èimer se vse besedilo pod biv¹o vrstico premakne za -eno vrstico navzgor? Ukaz C-k obravnava ¹tevilèni argument malo -drugaèe: pobri¹e toliko in toliko vrstic z vsebinami vred. To ni zgolj -ponovitev. C-u 2 C-k pobri¹e dve polni vrstici besedila, kar je nekaj -drugega, kot èe dvakrat vtipkate C-k. +Ste opazili, da prvi C-k pobriÅ¡e vsebino vrstice, naslednji C-k pa Å¡e +vrstici samo, s Äimer se vse besedilo pod bivÅ¡o vrstico premakne za +eno vrstico navzgor? Ukaz C-k obravnava Å¡tevilÄni argument malo +drugaÄe: pobriÅ¡e toliko in toliko vrstic z vsebinami vred. To ni zgolj +ponovitev. C-u 2 C-k pobriÅ¡e dve polni vrstici besedila, kar je nekaj +drugega, kot Äe dvakrat vtipkate C-k. -Besedilo, ki ste ga prej pobili, lahko povrnete (angl. ,,yank`` -- +Besedilo, ki ste ga prej pobili, lahko povrnete (angl. »yank« - potegniti). Predstavljajte si, kot da potegnete nazaj nekaj, kar vam je nekdo odnesel. Pobito besedilo lahko potegnete nazaj na isti ali pa -na kak¹en drug kraj v besedilu, ali pa celo v kaki drugi -datoteki. Isto besedilo lahko veèkrat potegnete nazaj, tako da je v -delovnem podroèju poveèterjeno. +na kakÅ¡en drug kraj v besedilu, ali pa celo v kaki drugi datoteki. +Isto besedilo lahko veÄkrat potegnete nazaj, tako da je v delovnem +podroÄju poveÄterjeno. Nekateri drugi urejevalniki uporabljajo namesto +»kill« in »yank« izraza »cut« in »paste« (glejte glosar v priroÄniku +za Emacs). -Ukaz za vraèanje pobitega besedila je C-y. +Ukaz za vraÄanje pobitega besedila je C-y. >> Poskusite z ukazom C-y povrniti pobrisano besedilo. -Èe ste uporabili veè zaporednih ukazov C-k, je vse pobrisano besedilo +ÄŒe ste uporabili veÄ zaporednih ukazov C-k, je vse pobrisano besedilo shranjeno skupaj, in en sam C-y bo vrnil vse tako pobrisane vrstice. >> Poskusite, nekajkrat vtipkajte C-k. Zdaj pa vrnimo pobrisano besedilo: ->> Vtipkajte C-y. Zdaj pa premaknite kazalèek za nekaj vrstic navzdol - in ¹e enkrat vtipkajte C-y. Vidite zdaj, kako se kopira dele +>> Vtipkajte C-y. Zdaj pa premaknite kazalÄek za nekaj vrstic navzdol + in Å¡e enkrat vtipkajte C-y. Vidite zdaj, kako se kopira dele besedila? -Kaj pa, èe ste pobrisali nekaj besedila, ki bi ga radi vrnili, vendar -ste za iskanim odlomkom pobrisali ¹e nekaj? C-y vrne samo nazadnje -pobrisan odlomek. Vendar tudi prej¹nje besedilo ni izgubljeno. Do +Kaj pa, Äe ste pobrisali nekaj besedila, ki bi ga radi vrnili, vendar +ste za iskanim odlomkom pobrisali Å¡e nekaj? C-y vrne samo nazadnje +pobrisan odlomek. Vendar tudi prejÅ¡nje besedilo ni izgubljeno. Do njega lahko pridete z ukazom M-y. Ko ste vrnili nazadnje zbrisano besedilo s C-y, pritisnite M-y, ki ga zamenja s predzanje pobrisanim -besedilom. Vsak naslednji M-y prika¾e ¹e eno prej. Ko ste konèno -pri¹li do iskanega besedila, ni treba napraviti niè posebnega, da bi -ga obdr¾ali. Preprosto nadaljujte z urejanjem, in vrnjeno besedilo bo -ostalo, kamor ste ga odlo¾ili. +besedilom. Vsak naslednji M-y prikaže Å¡e eno prej. Ko ste konÄno +priÅ¡li do iskanega besedila, ni treba napraviti niÄ posebnega, da bi +ga obdržali. Preprosto nadaljujte z urejanjem, in vrnjeno besedilo bo +ostalo, kamor ste ga odložili. -Èe pritisnete M-y dovolj velikokrat, se boste vrnili na zaèete, torej +ÄŒe pritisnete M-y dovolj velikokrat, se boste vrnili na zaÄete, torej spet na zadnje pobrisano besedilo. ->> Pobri¹ite vrstico, premaknite se nekam drugam, in pobri¹ite ¹e +>> PobriÅ¡ite vrstico, premaknite se nekam drugam, in pobriÅ¡ite Å¡e eno vrstico. Z ukazom C-y dobite nazaj to drugo vrstico. Z ukazom M-y pa jo zamenjate s prvo vrstico. - Ponovite ukaz M-y ¹e nekajkrat in si oglejte, kaj dobite na - zaslon. Ponavljajte ga, dokler se ne prika¾e ponovno nazadnje - pobrisana vrstica, in ¹e naprej. Èe ¾elite, lahko tudi ukazu - M-y podate pozitivno ali negativno ¹tevilo ponovitev. + Ponovite ukaz M-y Å¡e nekajkrat in si oglejte, kaj dobite na + zaslon. Ponavljajte ga, dokler se ne prikaže ponovno nazadnje + pobrisana vrstica, in Å¡e naprej. ÄŒe želite, lahko tudi ukazu + M-y podate pozitivno ali negativno Å¡tevilo ponovitev. * PREKLIC UKAZA (UNDO) ---------------------- -Èe ste besedilo spremenili, a ste se kasneje premislili, lahko -besedilo vrnete v prvotno stanje z ukazom Undo, C-x u. Normalno vrne -C-x u zadnjo spremembo besedila; èe ukaz ponovimo, preklièemo ¹e -predzadnjo spremembo, in vsaka nadaljnja ponovitev se¾e ¹e eno +ÄŒe ste besedilo spremenili, a ste se kasneje premislili, lahko +besedilo vrnete v prvotno stanje z ukazom Undo, C-/. + +ObiÄajno C-/ prekliÄe spremembo besedila, ki jo izvede en ukaz; Äe +ukaz C-/ ponovimo, prekliÄemo Å¡e spremembo, ki jo je izvedel +predzadnji ukaz, in vsaka nadaljnja ponovitev C-/ seže Å¡e eno spremembo globlje v zgodovino. -Emacs hrani bolj ali manj celotno zgodovino na¹ih ukazov, z dvema -izjemama: ukazov, ki niso napravili nobene spremembe v besedilu -(npr. premik kazalèka), ne shranjuje, in zaporedje do 20 vrinjenih -znakov shrani kot en sam ukaz. Slednje prihrani nekaj ukazov C-x u, ki -bi jih morali vtipkati. +Emacs hrani bolj ali manj celotno zgodovino naÅ¡ih ukazov, z dvema +izjemama: ukazov, ki niso napravili nobene spremembe v besedilu (npr. +premik kazalÄka), ne shranjuje, in zaporedje do 20 vrinjenih znakov +shrani kot en sam ukaz. Slednje prihrani nekaj ukazov C-/, ki bi jih +morali vtipkati. ->> Pobri¹ite to vrstico z ukazom C-k, potem jo priklièite nazaj s C-x u. +>> PobriÅ¡ite to vrstico z ukazom C-k, potem jo prikliÄite nazaj s C-/. -C-_ je alternativni ukaz za preklic zadnjega ukaza. Deluje enako kot -s C-x u, ga je pa la¾je odtipkati, èe morate ukaz ponoviti veèkrat -zaporedoma. Te¾ava z ukazom C-_ je, da na nekaterih tipkovnicah ni -povsem oèitno, kako ga vtipkati, zato je podvojen ¹e kot C-x u. Na -nekaterih terminalih moramo na primer vtipkati /, medtem ko dr¾imo -pritisnjeno tipko CONTROL. +C-_ je alternativni ukaz za preklic zadnjega ukaza. Deluje povsem +enako kot C-/. Na nekaterih besedilnih terminalih v resnici pritisk +C-/ poÅ¡lje Emacsu ukaz C-_. Å e tretja možnost je C-x u, ki tudi deluje +povsem enako kot C-/, le z nekaj veÄ tipkanja. -Èe podamo ukazu C-_ ali C-x u numerièni argument, je to enako, kot èe -bi ukaz roèno ponovili tolikokrat, kot pravi argument. +ÄŒe podamo ukazu C-/, C-_ ali C-x u numeriÄni argument, je to enako, +kot Äe bi ukaz roÄno ponovili tolikokrat, kot pravi argument. -Ukaz za brisanje besedila lahko preklièete in besedilo povrnete, -enako, kot èe bi besedilo pobili. Razlika med brisanjem in pobijanjem -besedila je le ta, da le slednje lahko potegnete nazaj z ukazom -C-y. Preklic ukaza pa velja za eno in drugo. +Ukaz za brisanje besedila lahko prekliÄete in besedilo povrnete, +enako, kot Äe bi besedilo pobili. Razlika med brisanjem in pobijanjem +besedila je le ta, da le slednje lahko povrnete z ukazom C-y. Preklic +ukaza pa velja za eno in drugo. * DATOTEKE @@ -493,638 +491,657 @@ C-y. Preklic ukaza pa velja za eno in drugo. Da bi bile spremembe v besedilu trajne, morate besedilo shraniti v datoteko. V nasprotnem primeru jih boste za vedno izgubili tisti hip, ko boste zapustili Emacs. Besedilo postavimo v datoteko tako, da -na disku ,,poi¹èemo`` (angl. find) datoteko, preden zaènemo tipkati -(pravimo tudi, da ,,obi¹èemo`` datoteko). +na disku »poiÅ¡Äemo« (angl. find) datoteko, preden zaÄnemo tipkati +(pravimo tudi, da »obiÅ¡Äemo« datoteko). Poiskati datoteko pomeni, da v Emacsu vidimo vsebino datoteke. To je bolj ali manj tako, kot da z Emacsom urejamo datoteko samo. Vendar pa spremembe ne postanejo trajne, dokler datoteke ne shranimo -(angl. save) na disk. Tako imamo mo¾nost, da se izognemo temu, da bi -nam na pol spremenjene datoteke le¾ale po disku, kadar tega ne -¾elimo. Ker pa Emacs ohrani izvorno datoteko pod spremenjenim imenom, -lahko prvotno datoteko priklièemo nazaj celo ¹e potem, ko smo datoteko -¾e shranili na disk. +(angl. save) na disk. Tako imamo možnost, da se izognemo temu, da bi +nam na pol spremenjene datoteke ležale po disku, kadar tega ne +želimo. Ker pa Emacs ohrani izvorno datoteko pod spremenjenim imenom, +lahko prvotno datoteko prikliÄemo nazaj celo Å¡e potem, ko smo datoteko +že shranili na disk. -V predzadnji vrstici na dnu zaslona vidite vrstico, ki se zaène in -konèa z vezaji, in vsebuje niz znakov ,,--:-- TUTORIAL``. Ta del -zaslona navadno vsebuje ime datoteke, ki smo jo obiskali. Zdajle je to -,,TUTORIAL``, va¹a delovna kopija uèbenika Emacsa. Ko boste poiskali -kak¹no drugo datoteko, bo na tem mestu pisalo njeno ime. +V predzadnji vrstici na dnu zaslona vidite vrstico, ki se zaÄne z +vezaji, na zaÄetku pa vsebuje niz znakov »--:--- TUTORIAL« ali nekaj +podobnega. Ta del zaslona navadno vsebuje ime datoteke, ki smo jo +obiskali. Zdajle je to »TUTORIAL«, vaÅ¡a delovna kopija uÄbenika +Emacsa. Ko boste poiskali kakÅ¡no drugo datoteko, bo na tem mestu +izpisano ime te datoteke. Posebnost ukaza za iskanje datoteke je, da moramo povedati, katero -datoteko i¹èemo. Pravimo, da ukaz ,,prebere argument s terminala`` (v -tem primeru je argument ime datoteke). Ko vtipkate ukaz +datoteko iÅ¡Äemo. Pravimo, da ukaz »prebere argument« (v tem primeru je +argument ime datoteke). Ko vtipkate ukaz - C-x C-f (poi¹èi datoteko) + C-x C-f (poiÅ¡Äi datoteko) -vas Emacs povpra¹a po imenu datoteke. Kar vtipkate, se sproti vidi v -vrstici na dnu zaslona. Temu delovnemu podroèju pravimo pogovorni +vas Emacs povpraÅ¡a po imenu datoteke. Kar vtipkate, se sproti vidi v +vrstici na dnu zaslona. Temu delovnemu podroÄju pravimo pogovorni vmesnik (minibuffer), kadar se uporablja za tovrstni vnos. Znotraj -pogovornega vmesnika lahko uporabljate obièajne ukaze za urejanje, èe +pogovornega vmesnika lahko uporabljate obiÄajne ukaze za urejanje, Äe ste se na primer pri tipkanju zmotili. Sredi tipkanja imena datoteke (ali katerega koli drugega opravila v -pogovornem vmesniku) lahko ukaz preklièete s C-g. +pogovornem vmesniku) lahko ukaz prekliÄete s C-g. ->> Vtipkajte C-x C-f, zatem pa ¹e C-g. Zadnji ukaz od treh je +>> Vtipkajte C-x C-f, zatem pa Å¡e C-g. Zadnji ukaz od treh je zaprl pogovorni vmesnik in tudi preklical ukaz C-x C-f, ki je uporabljal pogovorni vmesnik. Konec z iskanjem datoteke. -Ko ste dokonèali ime, ga vnesete s pritiskom na <Return>. S tem se -po¾ene ukaz C-x C-f in poi¹èe iskano datoteko. Pogovorni vmesnik -izgine, ko je ukaz izveden. +Ko ste dokonÄali ime, ga vnesete s pritiskom na <Return>. Pogovorni +vmesnik izgine, ko je ukaz izveden. -Trenutek kasneje se vsebina datoteke pojavi na zaslonu. Zdaj lahko -dopolnjujete, urejate ali kako drugaèe spreminjate vsebino. Ko ¾elite, -da ostanejo spremembe trajne, izvedete ukaz: +Vsebina datoteke se pojavi na zaslonu. Zdaj lahko dopolnjujete, +urejate ali kako drugaÄe spreminjate vsebino. Ko želite, da ostanejo +spremembe trajne, izvedete ukaz: C-x C-s (shrani datoteko) -Besedilo se s tem shrani iz pomnilnika raèunalnika na datoteko na -disk. Ko prviè izvedete ta ukaz, se izvorna datoteka preimenuje, tako +Besedilo se s tem shrani iz pomnilnika raÄunalnika na datoteko na +disk. Ko prviÄ izvedete ta ukaz, se izvorna datoteka preimenuje, tako da ni izgubljena. Najdete jo pod novim imenom, ki se od starega -razlikuje po tem, da ima na koncu pripet znak ,,~``. +razlikuje po tem, da ima na koncu pripet znak »~«. -Ko je Emacs shranil datoteko, izpi¹e njeno ime. Shranjujte raje -pogosteje kot ne, da v primeru, èe gre z raèunalnikom kaj narobe, ne -izgubite veliko. +Ko je Emacs shranil datoteko, izpiÅ¡e njeno ime. Shranjujte raje +pogosteje kot ne, da v primeru, Äe gre z raÄunalnikom kaj narobe, ne +izgubite veliko (oglejte si tudi razdelek o samodejnem shranjevanju +nižje). ->> Vtipkajte C-x C-s, s èimer boste shranili svojo kopijo tega - uèbenika. Emacs bo v vrstici na dnu zaslona izpisal ,,Wrote - ...TUTORIAL``. +>> Vtipkajte C-x C-s TUTORIAL <Return>. + S tem boste shranili svojo kopijo tega uÄbenika. Emacs bo v vrstici + na dnu zaslona izpisal »Wrote ...TUTORIAL«. -Poi¹èete lahko lahko ¾e obstojeèo datoteko, da si jo ogledate ali -popravite, ali pa tudi datoteko, ki ¹e ne obstaja. To je naèin, kako z -Emacsom ustvarimo novo datoteko: poi¹èite datoteko z izbranim imenom, -ki bo sprva prazna, in zaènite pisati. Ko jo boste prviè shranili, bo -Emacs ustvaril datoteko z vne¹enim besedilom. Od tod dalje delate na -¾e obstojeèi datoteki. +PoiÅ¡Äete lahko lahko že obstojeÄo datoteko, da si jo ogledate ali +popravite, ali pa tudi datoteko, ki Å¡e ne obstaja. To je naÄin, kako z +Emacsom ustvarimo novo datoteko: poiÅ¡Äite datoteko z izbranim imenom, +ki bo sprva prazna, in zaÄnite pisati. Ko jo boste prviÄ shranili, bo +Emacs ustvaril datoteko z vneÅ¡enim besedilom. Od tod dalje delate na +že obstojeÄi datoteki. -* DELOVNA PODROÈJA +* DELOVNA PODROÄŒJA ------------------ -Tudi èe ste z ukazom C-x C-f poiskali in odprli drugo datoteko, prva -ostane v Emacsu. Nanjo se vrnete tako, da jo ¹e enkrat ,,poi¹èete`` z +Tudi Äe ste z ukazom C-x C-f poiskali in odprli drugo datoteko, prva +ostane v Emacsu. Nanjo se vrnete tako, da jo Å¡e enkrat »poiÅ¡Äete« z ukazom C-x C-f. Tako imate lahko v Emacsu hkrati kar precej datotek. ->> Ustvarite datoteko z imenom ,,bla`` tako, da vtipkate C-x C-f - bla <Return>. Natipkajte nekaj besedila, ga po potrebi popravite, in - shranite v datoteko ,,bla`` z ukazom C-x C-s. Ko ste konèali, se - vrnite v uèbenik z ukazom C-x C-f TUTORIAL <Return>. - -Emacs hrani besedilo vsake datoteke v takoimenovanem ,,delovnem -podroèju`` (angl. buffer). Ko poi¹èemo datoteko, Emacs ustvari zanjo -novo delovno podroèje. Vsa obstojeèa delovna podroèja v Emacsu vidimo +Emacs hrani besedilo vsake datoteke v takoimenovanem »delovnem +podroÄju« (angl. buffer). Ko poiÅ¡Äemo datoteko, Emacs ustvari zanjo +novo delovno podroÄje. Vsa obstojeÄa delovna podroÄja v Emacsu vidimo z ukazom: - C-x C-b Seznam delovnih podroèij. + C-x C-b Seznam delovnih podroÄij. >> Poskusite C-x C-b zdaj. -Vidite, da ima vsako delovno podroèje svoje ime, pri nekaterih pa pi¹e +Vidite, da ima vsako delovno podroÄje svoje ime, pri nekaterih pa piÅ¡e tudi ime datoteke, katere vsebina se hrani v njem. Vsako besedilo, ki -ga vidite v katerem od Emacsovih oken, je vedno del kak¹nega delovnega -podroèja. +ga vidite v katerem od Emacsovih oken, je vedno del kakÅ¡nega delovnega +podroÄja. ->> Z ukazom C-x 1 se znebite seznama delovnih podroèij. +>> Z ukazom C-x 1 se znebite seznama delovnih podroÄij. -Tudi èe imate veè delovnih podroèij, pa je vedno le eno od njih -trenutno dejavno. To je tisto delovno podroèje, ki ga popravljate. Èe -¾elite popravljati drugo delovno podroèje, morate ,,preklopiti`` -nanj. Èe bi radi preklopili na delovno podroèje, ki pripada kak¹ni -datoteki, ¾e poznate en naèin, kako to storiti: ponovno ,,obi¹èete`` -(odprete) to datoteko z ukazom C-x C-f. Obstaja pa ¹e la¾ji naèin: z -ukazom C-x b. Pri tem ukazu morate navesti ime delovnega podroèja. +Tudi Äe imate veÄ delovnih podroÄij, pa je vedno le eno od njih +trenutno dejavno. To je tisto delovno podroÄje, ki ga popravljate. ÄŒe +želite popravljati drugo delovno podroÄje, morate »preklopiti« +nanj. ÄŒe bi radi preklopili na delovno podroÄje, ki pripada kakÅ¡ni +datoteki, že poznate en naÄin, kako to storiti: ponovno »obiÅ¡Äete« +(odprete) to datoteko z ukazom C-x C-f. Obstaja pa Å¡e lažji naÄin: z +ukazom C-x b. Pri tem ukazu morate navesti ime delovnega podroÄja. ->> Vtipkajte C-x b bla <Return>, s èimer se vrnete v delovno podroèje - ,,bla`` z vsebino datoteke ,,bla``, ki ste jo maloprej - odprli. Zatem vtipkajte C-x b TUTORIAL <RETURN>, s èimer se vrnete - nazaj v ta uèbenik. +>> Ustvarite datoteko z imenom »bla« tako, da vtipkate C-x C-f bla + <Return>. Zatem se vrnite v ta uÄbenik z ukazom C-x C-f TUTORIAL + <Return>. -Veèinoma se ime delovnega podroèja kar ujema z imenom datoteke (brez -poti do datoteke), ne pa vedno. Seznam delovnih podroèij, ki ga -prika¾e ukaz C-x C-b, prika¾e imena vseh delovnih podroèij. +VeÄinoma se ime delovnega podroÄja kar ujema z imenom datoteke (brez +poti do datoteke), ne pa vedno. Seznam delovnih podroÄij, ki ga +prikaže ukaz C-x C-b, prikaže imena vseh delovnih podroÄij in +pripadajoÄa imena datotek. Vsako besedilo, ki ga vidite v katerem od Emacsovih oken, je vedno del -kak¹nega delovnega podroèja. Nekatera delovna podroèja ne pripadajo -nobeni datoteki. Podroèje ,,*Buffer List*``, na primer, je ¾e eno -takih. To delovno podroèje smo ustvarili ravnokar, ko smo pognali ukaz -C-x C-b, in vsebuje seznam delovnih podroèij. Tudi delovno podroèje -,,Messages`` ne pripada nobeni datoteki, ampak vsebuje sporoèila, ki -jih je Emacs izpisoval v odzivnem podroèju na dnu zaslona. +kakÅ¡nega delovnega podroÄja. Nekatera delovna podroÄja ne pripadajo +nobeni datoteki. PodroÄje »*Buffer List*«, na primer, je že eno takih. +To delovno podroÄje smo ustvarili ravnokar, ko smo pognali ukaz C-x +C-b, in vsebuje seznam delovnih podroÄij. Temu delovnemu podroÄju +TUTORIAL sprva ni pripadala datoteka, zdaj pa mu, ker smo v prejÅ¡njem +razdelku vtipkali C-x C-s in ga shranili v datoteko. + +Tudi delovno podroÄje »Messages« ne pripada nobeni datoteki, ampak +vsebuje sporoÄila, ki jih je Emacs izpisoval v odzivnem podroÄju na +dnu zaslona. ->> Vtipkajte C-x b *Messages* <Return> in si oglejte delovno podroèje - s sporoèili, zatem pa vtipkajte C-x b TUTORIAL <Return> in se tako - vrnite v uèbenik. +>> Vtipkajte C-x b *Messages* <Return> in si oglejte delovno podroÄje + s sporoÄili, zatem pa vtipkajte C-x b TUTORIAL <Return> in se tako + vrnite v uÄbenik. -Èe ste spreminjali besedilo ene datoteke, potem pa poiskali drugo, to +ÄŒe ste spreminjali besedilo ene datoteke, potem pa poiskali drugo, to ne shrani spremeb v prvo datoteko. Te ostanejo znotraj Emacsa, na -delovnem podroèju, ki pripada prvi datoteki. Ustvarjenje ali -spreminjanje delovnega podroèja druge datoteke nima nobenega vpliva na -podroèje prve. To je zelo uporabno, pomeni pa tudi, da potrebujemo -udobno pot, da shranimo delovno podroèje prve datoteke. Nerodno bi -bilo preklapljanje na prvo podroèje s C-x C-f, da bi shranili s C-x +delovnem podroÄju, ki pripada prvi datoteki. Ustvarjenje ali +spreminjanje delovnega podroÄja druge datoteke nima nobenega vpliva na +podroÄje prve. To je zelo uporabno, pomeni pa tudi, da potrebujemo +udobno pot, da shranimo delovno podroÄje prve datoteke. Nerodno bi +bilo preklapljanje na prvo podroÄje s C-x C-f, da bi shranili s C-x C-s. Namesto tega imamo: - C-x s Shrani nekatera delovna podroèja + C-x s Shrani nekatera delovna podroÄja -Ukaz C-x poi¹èe delovna podroèja, katerih vsebina je bila spremenjena, -odkar je bila zadnjiè shranjena na datoteko. Za vsako tako delovno -podroèje C-x s vpra¹a, èe ga ¾elite shraniti. +Ukaz C-x poiÅ¡Äe delovna podroÄja, katerih vsebina je bila spremenjena, +odkar je bila zadnjiÄ shranjena na datoteko. Za vsako tako delovno +podroÄje C-x s vpraÅ¡a, Äe ga želite shraniti. -* RAZ©IRJEN NABOR UKAZOV +* RAZÅ IRJEN NABOR UKAZOV ------------------------ -©e mnogo, mnogo je ukazov Emacsa, ki bi zaslu¾ili, da jih obesimo na +Å e mnogo, mnogo je ukazov Emacsa, ki bi zaslužili, da jih obesimo na razne kontrolne in meta znake. Emacs se temu izogne z ukazom X (iz angl. -eXtend - raz¹iriti), ki uvede ukaz iz raz¹irjenega nabora. Dveh vrst je: +eXtend - razÅ¡iriti), ki uvede ukaz iz razÅ¡irjenega nabora. Dveh vrst je: - C-x Znakovna raz¹iritev (angl. Character eXtend). + C-x Znakovna razÅ¡iritev (angl. Character eXtend). Sledi mu en sam znak. - M-x Raz¹iritev s poimenovanim ukazom. Sledi mu dolgo ime + M-x RazÅ¡iritev s poimenovanim ukazom. Sledi mu dolgo ime ukaza. -Tudi ti ukazi so na splo¹no uporabni, ne uporabljamo pa jih tako -pogosto kot tiste, ki ste se jih ¾e nauèili. Dva ukaza iz raz¹irjenega -nabora ¾e poznamo: C-x C-f, s katerim poi¹èemo datoteko, in C-x C-s, s -katerim datoteko shranimo. ©e en primer je ukaz, s katerim Emacsu -povemo, da ¾elimo konèati z delom iz iziti iz Emacsa. Ta ukaz je C-x -C-c (ne skrbite: preden konèa, Emacs ponudi, da shrani vse spremenjene +Tudi ti ukazi so na sploÅ¡no uporabni, ne uporabljamo pa jih tako +pogosto kot tiste, ki ste se jih že nauÄili. Dva ukaza iz razÅ¡irjenega +nabora že poznamo: C-x C-f, s katerim poiÅ¡Äemo datoteko, in C-x C-s, s +katerim datoteko shranimo. Å e en primer je ukaz, s katerim Emacsu +povemo, da želimo konÄati z delom iz iziti iz Emacsa. Ta ukaz je C-x +C-c (ne skrbite: preden konÄa, Emacs ponudi, da shrani vse spremenjene datoteke). -Z ukazom C-z Emacs zapustimo samo *zaèasno*, tako da lahko ob vrnitvi -nadaljujemo z delom, kjer smo ostali. +ÄŒe uporabljate grafiÄni vmesnik, ne potrebujete posebnega ukaza za +preklop iz Emacsa v katerikoli drug program, ampak to opravite z miÅ¡ko +ali ukazom upravljalnika oken. ÄŒe pa uporabljate besedilni terminal, +ki lahko prikazuje le en program naenkrat, morate zaÄasno zapustiti +Emacs, da preklopite na drug program. -Na sistemih, ki to dopu¹èajo, ukaz C-z izide iz Emacsa v ukazno -lupino, a ga ne konèa - èe uporabljate ukazno lupino C, se lahko -vrnete z ukazom ,fg` ali splo¹neje z ukazom ,,%emacs``. +Z ukazom C-z Emacs zapustimo samo *zaÄasno*, tako da lahko ob vrnitvi +nadaljujemo z delom, kjer smo ostali. Na sistemih, ki to dopuÅ¡Äajo, +ukaz C-z izide iz Emacsa v ukazno lupino, a ga ne konÄa - Äe +uporabljate ukazno lupino C, se lahko vrnete z ukazom »fg« ali +sploÅ¡neje z ukazom »%emacs«. -Drugod ukaz C-z po¾ene sekundarno ukazno lupino, tako da lahko -po¾enete kak¹en drug program in se kasneje vrnete v Emacs. V tem -primeru pravzaprav Emacsa ne zapustimo. Ukaz ,,exit`` v ukazni lupini -je navadno naèin, da zapremo sekundarno lupino in se vrnemo v Emacs. +Drugod ukaz C-z požene sekundarno ukazno lupino, tako da lahko +poženete kakÅ¡en drug program in se kasneje vrnete v Emacs. V tem +primeru pravzaprav Emacsa ne zapustimo. Ukaz »exit« v ukazni lupini +je navadno naÄin, da zapremo sekundarno lupino in se vrnemo v Emacs. -Ukaz C-x C-c uporabimo, èe se nameravamo odjaviti s sistema. To je -tudi pravilen naèin za izhod iz Emacsa, èe je tega pognal program za -delo s po¹to ali kak drug program, saj ta verjetno ne ve, kaj -napraviti z zaèasno prekinjenim Emacsom. V vseh ostalih primerih pa, -èe se ne nameravate odjaviti s sistema, uporabite C-z, in se vrnite v -Emacs, ko bi radi spet urejali besedilo. +Ukaz C-x C-c uporabimo, Äe se nameravamo odjaviti s sistema. To je +tudi pravilen naÄin za izhod iz Emacsa, Äe je tega pognal program za +delo s poÅ¡to ali kak drug program. Ukazov C-x je veliko. Zaenkrat smo spoznali naslednje: - C-x C-f Poi¹èi datoteko. + C-x C-f PoiÅ¡Äi datoteko. C-x C-s Shrani datoteko. - C-x C-b Prika¾i seznam delovnih podroèij. - C-x C-c Konèaj Emacs. + C-x C-b Prikaži seznam delovnih podroÄij. + C-x C-c KonÄaj Emacs. C-x 1 Zapri vsa okna razen enega. C-x u Preklic zadnjega ukaza. -Poimenovani raz¹irjeni ukazi so ukazi, ki se uporabljajo ¹e bolj -poredko, ali pa se uporabljajo samo v nekaterih naèinih dela. Eden +Poimenovani razÅ¡irjeni ukazi so ukazi, ki se uporabljajo Å¡e bolj +poredko, ali pa se uporabljajo samo v nekaterih naÄinih dela. Eden takih je na primer ukaz replace-string, ki po vsem besedilu zamenja en -niz znakov z drugim. Ko vtipkate M-x, se to izpi¹e v pogovornem -vmesniku na dnu zaslona, Emacs pa èaka, da vtipkate ime ukaza, ki ga -¾elite priklicati; v tem primeru je to ,,replace-string``. Vtipkajte -samo ,,repl s<TAB>`` in Emacs bo dopolnil ime (<TAB> je tabulatorska +niz znakov z drugim. Ko vtipkate M-x, se to izpiÅ¡e v pogovornem +vmesniku na dnu zaslona, Emacs pa Äaka, da vtipkate ime ukaza, ki ga +želite priklicati; v tem primeru je to »replace-string«. Vtipkajte +samo »repl s<TAB>« in Emacs bo dopolnil ime (<TAB> je tabulatorska tipka; navadno jo najdemo nad tipko Caps Lock ali Shift na levi strani tipkovnice). Ukaz vnesete s pritiskom na <Return>. -Ukaz replace-string potrebuje dva argumenta -- niz, ki ga ¾elite +Ukaz replace-string potrebuje dva argumenta -- niz, ki ga želite zamenjati, in niz, s katerim bi radi zamenjali prvega. Vsakega posebej -vnesete in zakljuèite s pritiskom na tipko Return. +vnesete in zakljuÄite s pritiskom na tipko Return. ->> Premaknite kazalèek na prazno vrstico dve vrstici pod to, zatem +>> Premaknite kazalÄek na prazno vrstico dve vrstici pod to, zatem vtipkajte M-x repl s<Return>zamenjala<Return>spremenila<Return>. Opazite, kako se je ta vrstica zamenjala? Vse besede z-a-m-e-n-j-a-l-a od tod do konca besedila ste nadomestili z besedo - ,,spremenila``. + »spremenila«. -* AVTOMATIÈNO SHRANJEVANJE +* AVTOMATIÄŒNO SHRANJEVANJE -------------------------- -Spremembe v datoteki, ki jih ¹e niste shranili na disk, so izgubljene, -èe medtem denimo zmanjka elektrike. Da bi vas zavaroval pred tem, -Emacs periodièno avtomatièno shrani vse datoteke, ki jih -urejate. Avtomatièno shranjena datoteka se od izvorne razlikuje po -znaku ,#` na zaèetku in koncu imena: èe se je va¹a datoteka imenovala -,,hello.c``, se avtomatièno shranjena datoteka imenuje -,,#hello.c#``. Ko normalno shranite datoteko, avtomatièno shranjena -datoteka ni veè potrebna, in Emacs jo pobri¹e. +Spremembe v datoteki, ki jih Å¡e niste shranili na disk, so izgubljene, +Äe medtem denimo zmanjka elektrike. Da bi vas zavaroval pred tem, +Emacs periodiÄno avtomatiÄno shrani vse datoteke, ki jih +urejate. AvtomatiÄno shranjena datoteka se od izvorne razlikuje po +znaku »#« na zaÄetku in koncu imena: Äe se je vaÅ¡a datoteka imenovala +»hello.c«, se avtomatiÄno shranjena datoteka imenuje +»#hello.c#«. Ko normalno shranite datoteko, avtomatiÄno shranjena +datoteka ni veÄ potrebna, in Emacs jo pobriÅ¡e. -Èe res pride do izgube podatkov v pomnilniku, lahko povrnete avtomatièno -shranjeno besedilo tako, da normalno poi¹èete datoteko (pravo ime -datoteke, ne ime avtomatièno shranjene datoteke), zatem pa vtipkate M-x -recover file<Return>. Ko vas vpra¹a za potrditev, vtipkajte yes<Return> -za nadaljevanje in povrnitev avtomatièno shranjenenih podatkov. +ÄŒe res pride do izgube podatkov v pomnilniku, lahko povrnete avtomatiÄno +shranjeno besedilo tako, da normalno poiÅ¡Äete datoteko (pravo ime +datoteke, ne ime avtomatiÄno shranjene datoteke), zatem pa vtipkate M-x +recover-file <Return>. Ko vas vpraÅ¡a za potrditev, vtipkajte yes<Return> +za nadaljevanje in povrnitev avtomatiÄno shranjenenih podatkov. -* ODZIVNO PODROÈJE +* ODZIVNO PODROÄŒJE ------------------ -Kadar Emacs opazi, da poèasi vtipkavate ukaz, odpre v zadnji vrstici -na dnu zaslona odzivno podroèje in v njem sproti prikazuje natipkano. +Kadar Emacs opazi, da poÄasi vtipkavate ukaz, odpre v zadnji vrstici +na dnu zaslona odzivno podroÄje in v njem sproti prikazuje natipkano. * STATUSNA VRSTICA ------------------ -Vrstica nad odzivnim podroèjem je statusna vrstica. Ta ka¾e verjetno +Vrstica nad odzivnim podroÄjem je statusna vrstica. Ta kaže verjetno nekaj podobnega kot: ---:** TUTORIAL (Fundamental)--L670--58%---------------------- +--:**- TUTORIAL (Fundamental)--L670--58%---------------------- V njej so izpisani pomembni podatki o stanju Emacsa in besedilu, ki ga urejate. -Zdaj ¾e veste, kaj pomeni ime datoteke -- to je datoteka, ki ste jo -poiskali. Oznaka --NN%-- pomeni, da je nad vrhom zaslona ¹e NN -odstotkov celotne datoteke. Èe je zaèetek datoteke na zaslonu, bo -namesto --00%-- pisalo --Top--. Podobno bo pisalo --Bot--, èe je -zadnja vrstica datoteke na zaslonu. Èe je datoteka, ki jo ogledujete, -tako kratka, da gre vsa na en zaslon, pa bo pisalo --All--. +Zdaj že veste, kaj pomeni ime datoteke -- to je datoteka, ki ste jo +poiskali. Oznaka --NN%-- pomeni, da je nad vrhom zaslona Å¡e NN +odstotkov celotne datoteke. ÄŒe je zaÄetek datoteke na zaslonu, bo +namesto »0%« pisalo »Top«. Podobno bo pisalo »Bot«, Äe je +zadnja vrstica datoteke na zaslonu. ÄŒe je datoteka, ki jo ogledujete, +tako kratka, da gre vsa na en zaslon, pa bo pisalo »All«. -Èrka L in ¹tevilke za njo ka¾ejo polo¾aj ¹e drugaèe, kot zaporedno -¹tevilko vrstice, v kateri je kazalèek. +ÄŒrka L in Å¡tevilke za njo kažejo položaj Å¡e drugaÄe, kot zaporedno +Å¡tevilko vrstice, v kateri je kazalÄek. -Zvezdice na zaèetku vrstice pomenijo, da ste datoteko ¾e spreminjali. +Zvezdice na zaÄetku vrstice pomenijo, da ste datoteko že spreminjali. Tik po tem, ko ste odprli ali shranili datoteko, ni nobenih zvezdic, -so samo èrtice. +so samo Ärtice. -Del statusne vrstice znotraj oklepajev vam pove, v kak¹nem naèinu dela -Emacs. Privzeti naèin je osnovni naèin (Fundamental), v katerem ste -sedaj. Fundamental je eden od glavnih naèinov (angl. major -mode). Emacs pozna veliko razliènih glavnih naèinov. Nekateri od njih +Del statusne vrstice znotraj oklepajev vam pove, v kakÅ¡nem naÄinu dela +Emacs. Privzeti naÄin je osnovni naÄin (Fundamental), v katerem ste +sedaj. Fundamental je eden od glavnih naÄinov (angl. major +mode). Emacs pozna veliko razliÄnih glavnih naÄinov. Nekateri od njih so namenjeni pisanju programov, kot na primer Lisp, ali pisanju -besedil, kot npr. Text. Naenkrat je lahko aktiven le en glavni naèin, -njegovo ime pa je vedno izpisano v statusni vrstici, kjer zdaj pi¹e +besedil, kot npr. Text. Naenkrat je lahko aktiven le en glavni naÄin, +njegovo ime pa je vedno izpisano v statusni vrstici, kjer zdaj piÅ¡e Fundamental. -Glavni naèini lahko spremenijo pomen nekaterim ukazom. Obstajajo, +Glavni naÄini lahko spremenijo pomen nekaterim ukazom. Obstajajo, denimo, ukazi za pisanje komentarjev v programu, in ker ima vsak programski jezik svoje predstave o tem, kako mora komentar izgledati, -mora vsak glavni naèin vnesti komentarje drugaèe. Ker je vsak glavni -naèin ime raz¹irjenega ukaza, lahko tako tudi izbiramo glavni -naèin. Na primer, M-x fundamental-mode vas postavi v naèin +mora vsak glavni naÄin vnesti komentarje drugaÄe. Ker je vsak glavni +naÄin ime razÅ¡irjenega ukaza, lahko tako tudi izbiramo glavni +naÄin. Na primer, M-x fundamental-mode vas postavi v naÄin Fundamental. -Èe nameravate popravljati slovensko (ali angle¹ko) besedilo, kot je na -primer tole, boste verjetno izbrali tekstovni naèin (Text). ->> Vtipkajte M-x text mode<Return>. +ÄŒe nameravate popravljati slovensko (ali angleÅ¡ko) besedilo, kot je na +primer tole, boste verjetno izbrali tekstovni naÄin (Text). +>> Vtipkajte M-x text-mode <Return>. -Brez skrbi, noben od ukazov Emacsa, ki ste se jih nauèili, se s tem ne -spremeni kaj dosti. Lahko pa opazite, da Emacs zdaj jemlje opu¹èaje za -dele besed, ko se premikate z M-f ali M-b. V osnovnem naèinu jih je +Brez skrbi, noben od ukazov Emacsa, ki ste se jih nauÄili, se s tem ne +spremeni kaj dosti. Lahko pa opazite, da Emacs zdaj jemlje opuÅ¡Äaje za +dele besed, ko se premikate z M-f ali M-b. V osnovnem naÄinu jih je obravnaval kot meje med besedami. -Glavni naèini navadno poèenjajo majhne spremembe, kot je ta: veèina -ukazov ,,opravi isti posel``, vendar pa to poènejo na razlièen naèin. +Glavni naÄini navadno poÄenjajo majhne spremembe, kot je ta: veÄina +ukazov »opravi isti posel«, vendar pa to poÄnejo na razliÄen naÄin. -Dokumentacijo o trenutno aktivnem glavnem naèinu dobite z ukazom C-h m. +Dokumentacijo o trenutno aktivnem glavnem naÄinu dobite z ukazom C-h m. ->> Uporabite C-u C-v enkrat ali veèkrat, toliko, da bo ta vrstica blizu - vrha zaslona. ->> Vtipkajte C-h m, da vidite, v èem se tekstovni naèin (Text) razlikuje +>> Vtipkajte C-l C-l, da postavite to vrstico na vrh zaslona. +>> Vtipkajte C-h m, da vidite, v Äem se tekstovni naÄin (Text) razlikuje od osnovnega (Fundamental). >> Vtipkajte C-x 1, da umaknete dokumentacijo z zaslona. -Glavnim naèinom pravimo glavni naèini zato, ker obstajajo tudi -podnaèini (angl. minor modes). Podnaèini ne nadome¹èajo glavnih -naèinom, ampak le spreminjajo njihovo obna¹anje. Podnaèine lahko -aktiviramo ali deaktiviramo neodvisno od glavnega naèina in neodvisno -od ostalih podnaèinov. Tako lahko ne uporabljate nobenega podnaèina, -en podnaèin, ali kombinacijo veèih podnaèinov. +Glavnim naÄinom pravimo glavni naÄini zato, ker obstajajo tudi +podnaÄini (angl. minor modes). PodnaÄini ne nadomeÅ¡Äajo glavnih +naÄinom, ampak le spreminjajo njihovo obnaÅ¡anje. PodnaÄine lahko +aktiviramo ali deaktiviramo neodvisno od glavnega naÄina in neodvisno +od ostalih podnaÄinov. Tako lahko ne uporabljate nobenega podnaÄina, +en podnaÄin, ali kombinacijo veÄih podnaÄinov. -Podnaèin, ki je zelo uporaben posebno za pisanje besedil, je Auto -Fill. Ko je vklopljen, Emacs med pisanjem avtomatièno deli vrstice na +PodnaÄin, ki je zelo uporaben posebno za pisanje besedil, je Auto +Fill. Ko je vklopljen, Emacs med pisanjem avtomatiÄno deli vrstice na presledkih med besedami, tako da vrstice niso predolge. -Vklopite ga lahko z ukazom M-x auto fill mode<Return>. Ko je -vklopljen, ga lahko izklopite z istim ukazom, M-x -auto fill mode<Return>. Z istim ukazom torej preklapljamo -(angl. toggle) med vklopljenim in izklopljenim stanjem. +Vklopite ga lahko z ukazom M-x auto-fill-mode <Return>. Ko je +vklopljen, ga lahko izklopite z istim ukazom, M-x auto-fill-mode +<Return>. Z istim ukazom torej preklapljamo (angl. toggle) med +vklopljenim in izklopljenim stanjem. ->> Vtipkajte zdaj M-x auto fill mode<Return>. Potem zaènite tipkati - "asdf asdkl sdjf sdjkf"... dokler ne opazite, da je Emacs razbil +>> Vtipkajte zdaj M-x auto-fill-mode <Return>. Potem zaÄnite tipkati + »asdf asdkl sdjf sdjkf«... dokler ne opazite, da je Emacs razbil vrstico na dve. Med tipkanjem mora biti dovolj presledkov, saj Auto Fill prelamlja vrstice samo na presledkih. -©irina besedila je navadno postavljena na 70 znakov, kar pa lahko -spremenite z ukazom C-x f. Novo ¹irino morate podati kot ¹tevilèni +Å irina besedila je navadno postavljena na 70 znakov, kar pa lahko +spremenite z ukazom C-x f. Novo Å¡irino morate podati kot Å¡tevilÄni argument. >> Vtipkajte C-x f in argument 20. (C-u 2 0 C-x f). Zatem vtipkajte - nekaj besedila in poglejte, èe bo Emacs res delil vrstice pri 20 + nekaj besedila in poglejte, Äe bo Emacs res delil vrstice pri 20 znakih. Potem z ukazom C-x f postavite mejo nazaj na 70. -Auto Fill deluje le, kadar pi¹ete novo besedilo, ne pa, -kadar popravljate ¾e napisan odstavek. -Tak odstavek lahko poravnate tako, da kazalèek premaknete nekam -znotraj odstavka in uka¾ete M-q (META-q). +Auto Fill deluje le, kadar piÅ¡ete novo besedilo, ne pa, +kadar popravljate že napisan odstavek. +Tak odstavek lahko poravnate tako, da kazalÄek premaknete nekam +znotraj odstavka in ukažete M-q (META-q). ->> Premaknite kazalèek v prej¹nji odstavek in izvedite M-q. +>> Premaknite kazalÄek v prejÅ¡nji odstavek in izvedite M-q. * ISKANJE --------- -Emacs lahko v besedilu poi¹èe niz znakov (zaporedje znakov ali besed), -naprej ali nazaj po besedilu. Iskanje spada v skupino ukazov za -premikanje kazalèka, saj premakne kazalèek na kraj v besedilu, kjer je -na¹el iskani niz. +Emacs lahko v besedilu poiÅ¡Äe niz znakov (»niz« je zaporedje soslednih +znakov), naprej ali nazaj po besedilu. Iskanje spada v skupino ukazov +za premikanje kazalÄka, saj premakne kazalÄek na kraj v besedilu, kjer +je naÅ¡el iskani niz. -Iskanje v Emacsu je morda nekoliko drugaèno od tistega, ki ste ga -navajeni, in sicer je ,,inkrementalno``. To pomeni, da se iskanje -odvija hkrati s tem, ko tipkate iskani niz. +Iskanje v Emacsu je »inkrementalno«. To pomeni, da se iskanje odvija +hkrati s tem, ko tipkate iskani niz. Ukaza za iskanje sta C-s za iskanje naprej po datoteki in C-r za -iskanje nazaj po datoteki. POÈAKAJTE! Ne preizku¹ajte jih ¹e ta hip! +iskanje nazaj po datoteki. POÄŒAKAJTE! Ne preizkuÅ¡ajte jih Å¡e ta hip! -Ko boste natipkali C-s, boste opazili niz ,,I-search`` kot pozivnik +Ko boste natipkali C-s, boste opazili niz »I-search« kot pozivnik v pogovornem vmesniku. To vam pove, da je Emacs v inkrementalnem iskanju -in vas èaka, da zaènete tipkati, kar i¹èete. <Return> zakljuèi iskanje. +in vas Äaka, da zaÄnete tipkati, kar iÅ¡Äete. <Return> zakljuÄi iskanje. ->> Pritisnite zdaj C-s. POÈASI, èrko za èrko, vtipkajte besedo - ,,kazalèek``. Za vsako vtipkano èrko se ustavite in si oglejte, kaj - se je zgodilo s kazalèkom. ->> ©e enkrat pritisnite C-s, da poi¹èete naslednji ,,kazalèek``. ->> ©estkrat pritisnite <Delback> in opazujte, kako se premika kazalèek. ->> Konèajte iskanje s tipko <Return>. +>> Pritisnite zdaj C-s. POÄŒASI, Ärko za Ärko, vtipkajte besedo + »kazalÄek«. Za vsako vtipkano Ärko se ustavite in si oglejte, kaj + se je zgodilo s kazalÄkom. +>> Å e enkrat pritisnite C-s, da poiÅ¡Äete naslednji »kazalÄek«. +>> Å estkrat pritisnite <DEL> in opazujte, kako se premika kazalÄek. +>> KonÄajte iskanje s tipko <Return>. -Ste videli, kaj se je zgodilo? Emacs pri inkrementalnem iskanju sku¹a -poiskati niz, ki ste ga natipkali do tistega hipa. Da poi¹èete -naslednje mesto, kjer se pojavi ,,kazalèek``, samo ¹e enkrat -pritisnete C-s. Èe takega mesta ni, Emacs èivkne in vam sporoèi, da +Ste videli, kaj se je zgodilo? Emacs pri inkrementalnem iskanju skuÅ¡a +poiskati niz, ki ste ga natipkali do tistega hipa. Da poiÅ¡Äete +naslednje mesto, kjer se pojavi »kazalÄek«, samo Å¡e enkrat +pritisnete C-s. ÄŒe takega mesta ni, Emacs Äivkne in vam sporoÄi, da iskanje ni uspelo. Tudi C-g prekine iskanje. -OPOZORILO: Na nekaterih sistemih bo s pritiskom na C-s ekran -zmrznil. To je znak, da je operacijski sistem prestregel znak C-s in -ga interpretiral kot znak za prekinitev toka podatkov, namesto da bi -ga posredoval programu Emacs. Ekran ,,odtajate`` s pritiskom na -C-q. Potem si oglejte razdelek ,,Spontaneous Entry to Incremental -Search`` v priroèniku za nasvet, kako se spopasti s to nev¹eènostjo. +ÄŒe sredi inkrementalnega iskanja pritisnete <DEL>, boste opazili, +da to pobriÅ¡e zadnji znak v iskanem nizu, kazalÄek pa se premakne +nazaj na mesto v besedilu, kjer je naÅ¡el krajÅ¡i niz. Na primer, +predpostavimo, da ste do zdaj natipkali »ka« in je kazalÄek na +mestu, kjer se prviÄ pojavi »ka«. ÄŒe zdaj pritisnete <DEL>, boste +s tem v pogovornem vmesniku izbrisali »a«, hkrati pa se bo kazalÄek +postavil na mesto, kjer je prviÄ naÅ¡el »k«, preden ste natipkali Å¡e +»a«. -Èe sredi inkrementalnega iskanja pritisnete <Delback>, boste opazili, -da to pobri¹e zadnji znak v iskanem nizu, kazalèek pa se premakne -nazaj na mesto v besedilu, kjer je na¹el kraj¹i niz. Na primer, -predpostavimo, da ste do zdaj natipkali ,,ka`` in je kazalèek na -mestu, kjer se prviè pojavi ,,ka``. Èe zdaj pritisnete <Delback>, boste -s tem v pogovornem vmesniku izbrisali ,a`, hkrati pa se bo kazalèek -postavil na mesto, kjer je prviè na¹el ,k`, preden ste natipkali ¹e -,a`. - -Èe sredi iskanja vtipkate katerikoli kontrolni znaki ali metaznak +ÄŒe sredi iskanja vtipkate katerikoli kontrolni znaki ali metaznak (razen tistih, ki imajo poseben pomen pri iskanju, to sta C-s in C-r), se iskanje prekine. -C-s zaène iskati na mestu v datoteki, kjer trenutno stoji kazalèek, in -i¹èe do konca datoteke. Èe bi radi iskali proti zaèetku datoteke, +C-s zaÄne iskati na mestu v datoteki, kjer trenutno stoji kazalÄek, in +iÅ¡Äe do konca datoteke. ÄŒe bi radi iskali proti zaÄetku datoteke, namesto C-s vtipkamo C-r. Vse, kar smo povedali o ukazu C-s, velja tudi za C-r, le smer iskanja je obrnjena. -* VEÈ OKEN NA ZASLONU +* VEÄŒ OKEN NA ZASLONU --------------------- -Ena simpatiènih lastnosti Emacsa je, da zna hkrati prikazati veè oken -na ekranu, tudi èe ne delamo v grafiènem naèinu. +Ena simpatiÄnih lastnosti Emacsa je, da zna hkrati prikazati veÄ oken +na zaslonu, tudi Äe ne delamo v grafiÄnem naÄinu. (Opozorimo naj, da +Emacs uporablja izraz »okvir« (angl. »frame«) - razložen je v +naslednjem razdelku - za tisto, Äemur nekateri drugi programi pravijo +»okno« (angl. »window«). PriroÄnik za Emacs vsebuje glosar +uporabljenih izrazov.) ->> Premaknite kazalèek v to vrstico in vtipkajte C-u 0 C-l (zadnji - znak je CONTROL-L, ne CONTROL-1) +>> Premaknite kazalÄek v to vrstico in vtipkajte C-l C-l. >> Zdaj vtipkajte C-x 2, da razdelite zaslon na dve okni. - V obeh oknih imate odprt ta priroènik. Kazalèek je ostal v zgornjem + V obeh oknih imate odprt ta priroÄnik. KazalÄek je ostal v zgornjem oknu. >> Pritisnite C-M-v za listanje v spodnjem oknu. - (Èe nimate tipke META, tipkajte ESC C-v). ->> Vtipkajte C-x o (o kot ,,other``, drugi), da preselite kazalèek v + (ÄŒe nimate tipke META, tipkajte ESC C-v). +>> Vtipkajte C-x o (o kot »other«, drugi), da preselite kazalÄek v spodnje okno. ->> S C-v in M-v se v spodnjem oknu premikate po vsebini datoteke. - Zgornje okno ¹e vedno ka¾e ta navodila. ->> Ponovni C-x o vas vrne v zgornje okno. Kazalèek se je vrnil na - mesto, kjer je bil, preden smo skoèili v spodnje okno. +>> Z ukazoma C-v in M-v se v spodnjem oknu premikate po vsebini + datoteke. Zgornje okno Å¡e vedno kaže ta navodila. +>> Ponovni C-x o vas vrne v zgornje okno. KazalÄek se je vrnil na + mesto, kjer je bil, preden smo skoÄili v spodnje okno. -Z ukazom C-x o lahko preklapljamo med okni. Vsako okno si zapomni, kje -v oknu je ostal kazalèek, samo trenutno aktivno okno pa kazalèek tudi -v resnici prika¾e. Vsi obièajni ukazi za urejanje, ki smo se jih -nauèili, veljajo za aktivno okno. +Z ukazom C-x o lahko preklapljamo med okni. Izbrano okno, torej tisto, +v katerem urejamo besedilo, je tisto z zelo opaznim kazalÄkom, ki +utripa, kadar ne tipkamo. Tudi ostala okna pa si zapomnijo, kje je +ostal kazalÄek. ÄŒe poganjate Emacs v grafiÄnem naÄinu, je položaj +kazalÄka v teh oknih prikazan kot ne-utripajoÄ Ärtni pravokotnik. Ukaz C-M-v je zelo uporaben, kadar urejamo besedilo v enem oknu, -drugega pa uporabljamo samo za pomoè. Kazalèek ostaja ves èas v oknu, -v katerem urejamo, po vsebini spodnjega okna pa se vseeno lahko -premikamo, ne da bi morali venomer skakati iz enega okna v drugega. +drugega pa uporabljamo samo za pomoÄ. Ne da bi zapustili izbrano okno, +se lahko premikamo po vsebini drugega okna z ukazon C-M-v. -C-M-v je primer znaka CONTROL-META. Èe imate v resnici tipko META (na -PC navadno levi Alt), lahko vtipkate C-M-v tako, da dr¾ite pritisnjeni +C-M-v je primer znaka CONTROL-META. ÄŒe imate v resnici tipko META (na +PC navadno levi Alt), lahko vtipkate C-M-v tako, da držite pritisnjeni tako CONTROL kot META, medtem ko vtipkate v. Ni pomembno, katero od -tipk, CONTROL ali META, pritisnete prvo, saj obe delujeta ¹ele, ko -pritisnete znak, ki sledi (v zgornjem primeru ,v`). +tipk, CONTROL ali META, pritisnete prvo, saj obe delujeta Å¡ele, ko +pritisnete znak, ki sledi (v zgornjem primeru »v«). -Nasprotno pa je vrstni red pritiskanja pomemben, èe nimate tipke META -in namesto nje uporabljate ESC. V tem primeru morate najprej -pritisniti ESC, potem pa Control-v. Obratna kombinacija, CONTROL-ESC v -ne deluje. To je zato, ker je ESC znak sam po sebi, ne pa modifikator, -kot sta CONTROL in META. +Nasprotno pa je vrstni red pritiskanja pomemben, Äe nimate tipke META +in namesto nje uporabljate <ESC>. V tem primeru morate najprej +pritisniti <ESC>, potem pa Control-v. Obratna kombinacija, +CONTROL-<ESC> ne deluje. To je zato, ker je <ESC> znak sam po sebi, ne +pa modifikator, kot sta CONTROL in META. >> V zgornjem oknu vtipkajte C-x 1, da se znebite spodnjega okna. -(Èe bi vtipkali C-x 1 v spodnjem oknu, bi se znebili -zgornjega. Razmi¹ljajte o tem ukazu kot ,,Obdr¾i samo eno okno, in -sicer tisto, v katerem sem zdaj.``) +(ÄŒe bi vtipkali C-x 1 v spodnjem oknu, bi se znebili +zgornjega. RazmiÅ¡ljajte o tem ukazu kot »Obdrži samo eno okno, in +sicer tisto, v katerem sem zdaj.«) -Seveda ni nujno, da obe okni ka¾eta isto delovno podroèje. Èe v enem -oknu izvedete C-x C-f in poi¹èete novo datoteko, se vsebina drugega +Seveda ni nujno, da obe okni kažeta isto delovno podroÄje. ÄŒe v enem +oknu izvedete C-x C-f in poiÅ¡Äete novo datoteko, se vsebina drugega okna ne spremeni. V vsakem oknu lahko neodvisno obdelujete drugo datoteko. -Pa ¹e ena pot, kako v dveh oknih prika¾ete dve razlièni datoteki: +Pa Å¡e ena pot, kako v dveh oknih prikažete dve razliÄni datoteki: ->> Vtipkajte C-x 4 C-f, in na pozivnik vtipkajte ime ene va¹ih - datotek. Konèajte z <Return>. Odpre se ¹e eno okno in izbrana - datoteka se pojavi v drugem oknu. Tudi kazalèek se preseli v drugo +>> Vtipkajte C-x 4 C-f, in na pozivnik vtipkajte ime ene vaÅ¡ih + datotek. KonÄajte z <Return>. Odpre se Å¡e eno okno in izbrana + datoteka se pojavi v drugem oknu. Tudi kazalÄek se preseli v drugo okno. >> Vtipkajte C-x o, da se vrnete nazaj v zgornje okno, in C-x 1, da zaprete spodnje okno. +* VEÄŒ HKRATNIH OKVIROV +---------------------- + +Emacs lahko ustvari tudi veÄ Â»okvirov«. Okvir je zbirka oken, skupaj z +menuji, drsniki, pogovornim vmesnikom ipd. V grafiÄnem naÄinu je +Emacsov »okvir« tisto, Äemur veÄina drugih programov pravi »okno«. ÄŒe +delate v grafiÄnem naÄinu, je lahko veÄ okvirov hkrati prikazanih na +zaslonu. V besedilnem terminalu imamo seveda na voljo le en okvir. + +>> Vtipkajte M-x make-frame <Return> + Opazite, kako se je na zaslonu pojavil nov okvir. + +Vse, kar ste poÄeli v prvotnem okviru, lahko poÄnete tudi v novem. +Prvi okvir ni v niÄemer poseben. + +>> Vtipkajte M-x delete-frame <Return> + Ukaz izbriÅ¡e izbrani okvir. + +Okvir lahko izbriÅ¡ete tudi z obiÄajnim naÄinom, ki ga ponuja grafiÄni +sistem - pogosto s klikom na simbol »X« v enem od zgornjih kotov okna. +ÄŒe zaprete zadnji okvir, s tem obenem zaprete tudi Emacs. + + * REKURZIVNI NIVOJI UREJANJA ---------------------------- -Vèasih boste pri¹li v nekaj, èemur se pravi ,,rekurzivni nivo -urejanja``. To se vidi po tem, da v statusni vrstici oglati oklepaji -oklepajo ime glavnega naèina. V osnovnem naèinu bi, na primer, videli +VÄasih boste priÅ¡li v nekaj, Äemur se pravi »rekurzivni nivo +urejanja«. To se vidi po tem, da v statusni vrstici oglati oklepaji +oklepajo ime glavnega naÄina. V osnovnem naÄinu bi, na primer, videli [(Fundamental)] namesto (Fundamental). -Iz rekurzivnega nivoja urejanja se re¹ite, èe vtipkate ESC ESC ESC. To -zaporedje je vsenamenski ukaz ,,pojdi ven``. Uporabite ga lahko tudi -za ukinjanje odveènih oken, ali vrnitev iz pogovornega vmesnika. +Iz rekurzivnega nivoja urejanja se reÅ¡ite, Äe vtipkate ESC ESC ESC. To +zaporedje je vsenamenski ukaz »pojdi ven«. Uporabite ga lahko tudi +za ukinjanje odveÄnih oken, ali vrnitev iz pogovornega vmesnika. >> Pritisnite M-x, da odprete pogovorni vmesnik, zatem pa vtipkajte ESC ESC ESC, da pridete ven iz njega. Z ukazom C-g ne morete iz rekurzivnega nivoja urejanja, ker C-g -preklièe ukaze ali argumente ZNOTRAJ rekurzivnega nivoja. +prekliÄe ukaze ali argumente ZNOTRAJ rekurzivnega nivoja. -* DODATNA POMOÈ +* DODATNA POMOÄŒ --------------- -V tem uvodu smo posku¹ali zbrati dovolj informacij, da lahko zaènete -Emacs uporabljati. Emacs ponuja toliko, da bi bilo nemogoèe vse to -zbrati tukaj. Verjetno pa bi se vseeno radi nauèili kaj o ¹tevilnih -koristnih mo¾nostih, ki jih ¹e ne poznate. Emacs ima ¾e vgrajene +V tem uvodu smo poskuÅ¡ali zbrati dovolj informacij, da lahko zaÄnete +Emacs uporabljati. Emacs ponuja toliko, da bi bilo nemogoÄe vse to +zbrati tukaj. Verjetno pa bi se vseeno radi nauÄili kaj o Å¡tevilnih +koristnih možnostih, ki jih Å¡e ne poznate. Emacs ima že vgrajene veliko dokumentacije, do katere lahko pridete s pritiskom na CONTROL-h -(h kot ,,help``, pomoè). +(h kot »help«, pomoÄ). -Za pomoè pritisnete C-h, potem pa vtipkate znak, ki pove, kak¹no pomoè -¾elite. Èe ste poplnoma izgubljeni, vtipkajte C-h ? in Emacs vam bo -povedal, kak¹na pomoè je sploh na voljo. Èe ste vtipkali C-h, pa ste -si premislili, lahko ukaz preklièete s C-g. +Za pomoÄ pritisnete C-h, potem pa vtipkate znak, ki pove, kakÅ¡no pomoÄ +želite. ÄŒe ste poplnoma izgubljeni, vtipkajte C-h ? in Emacs vam bo +povedal, kakÅ¡na pomoÄ je sploh na voljo. ÄŒe ste vtipkali C-h, pa ste +si premislili, lahko ukaz prekliÄete s C-g. -(Na nekaterih sistemih se znak C-h preslika v kaj drugega. To ni -dobro, in v takem primeru se prito¾ite sistemskemu vzdr¾evalcu. Medtem -pa, èe C-h ne prika¾e sporoèila o pomoèi na dnu zaslona, namesto tega -poskusite pritisniti tipko F1 ali pa vtipkajte M-x help <Return>.) +(ÄŒe C-h ne prikaže sporoÄila o pomoÄi na dnu zaslona, poskusite +namesto tega pritisniti tipko F1 ali pa vtipkajte M-x help <Return>.) -Najosnovnej¹i tip pomoèi prika¾e C-h c. Pritisnite C-h, tipko c, zatem +NajosnovnejÅ¡i tip pomoÄi prikaže C-h c. Pritisnite C-h, tipko c, zatem pa ukazni znak ali zaporedje ukaznih znakov, in Emacs bo izpisal kratek opis ukaza. >> Vtipkajte C-h c C-p. - Izpi¹e se nekaj takega kot + IzpiÅ¡e se nekaj takega kot C-p runs the command previous-line -Ukaz je izpisal ime funkcije, ki izvede ukaz. Imena funkcij -uporabljamo, kadar pi¹emo prilagoditve in raz¹iritve Emacsa. Ker pa so -navadno imena funkcij izbrana tako, da kaj povedo o tem, kaj funkcija -poène, bo verjetno to tudi dovolj za kratko osve¾itev, èe ste se z -ukazom ¾e kdaj sreèali. +Ukaz je izpisal ime funkcije, ki izvede ukaz. Ker so navadno imena +funkcij izbrana tako, da kaj povedo o tem, kaj funkcija poÄne, bo +verjetno to tudi dovolj za kratko osvežitev, Äe ste se z ukazom že +kdaj sreÄali. Ukazu C-h lahko sledi tudi zaporedje znakov, kot na primer C-x C-s, -ali, èe nimate tipke META, <Esc>v. +ali, Äe nimate tipke META, <Esc>v. -Za veè informacij o ukazu vtipkajte C-h k namesto C-h c. +Za veÄ informacij o ukazu vtipkajte C-h k namesto C-h c. >> Vtipkajte C-h k C-p. -To odpre novo okno in v njem prika¾e dokumentacijo o funkciji, obenem +To odpre novo okno in v njem prikaže dokumentacijo o funkciji, obenem z njenim imenom. Ko ste opravili, vtipkajte C-x 1, da se znebite okna -z pomoèjo. Tega seveda ni potrebno napraviti takoj, ampak lahko -urejate, medtem ko imate odprto okno s pomoèjo, in ga zaprete, ko ste -konèali. +z pomoÄjo. Tega ni potrebno napraviti ta hip. Namesto tega lahko +urejate, medtem ko imate odprto okno s pomoÄjo, in ga zaprete, ko ste +konÄali. -Sledi ¹e nekaj uporabnih mo¾nosti, ki jih ponuja pomoè: +Sledi Å¡e nekaj uporabnih možnosti, ki jih ponuja pomoÄ: - C-h f Opi¹i funkcijo. Kot argument morate podati ime + C-h f OpiÅ¡i funkcijo. Kot argument morate podati ime funkcije. ->> Poskusite C-h f previous-line<Return>. - To izpi¹e vse podatke, ki jih ima Emacs o funkciji, ki izvede ukaz C-p. +>> Poskusite C-h f previous-line <Return>. + To izpiÅ¡e vse podatke, ki jih ima Emacs o funkciji, ki izvede ukaz C-p. -Podoben ukaz C-h v izpi¹e dokumentacijo za spremenljivke, s katerimi -lahko nastavite obna¹anje Emacsa. Ob pozivniku morate vpisati ime -spremenljivke. +Podoben ukaz C-h v izpiÅ¡e dokumentacijo za spremenljivke, vkljuÄno s +tistimi, s katerimi lahko nastavite obnaÅ¡anje Emacsa. Ob pozivniku +morate vpisati ime spremenljivke. - C-h a Apropos. Vtipkajte kljuèno besedo in Emacs bo izpisal - vse ukaze, ki vsebujejo to kljuèno besedo. Vse te - ukaze lahko priklièete z META-x. Pri nekaterih ukazih + C-h a Apropos. Vtipkajte kljuÄno besedo in Emacs bo izpisal + vse ukaze, ki vsebujejo to kljuÄno besedo. Vse te + ukaze lahko prikliÄete z META-x. Pri nekaterih ukazih bo Apropos izpisal tudi eno ali dvoznakovno - zaporedje, s katerim dose¾ete isti uèinek. + zaporedje, s katerim dosežete isti uÄinek. ->> Vtipkajte C-h a file<Return>. +>> Vtipkajte C-h a file <Return>. To odpre novo okno, v katerem so vsa dolga imena ukazov, ki vsebujejo -,,file`` v imenu. Izvedete jih lahko z M-x. Pri nekaterih se izpi¹e +»file« v imenu. Izvedete jih lahko z M-x. Pri nekaterih se izpiÅ¡e tudi kratek ukaz, npr. C-x C-f ali C-x C-w pri ukazih find-file in write-file. ->> Pritisnite C-M-v, da se sprehajate po oknu s pomoèjo. Poskusite +>> Pritisnite C-M-v, da se sprehajate po oknu s pomoÄjo. Poskusite nekajkrat. ->> Vtipkajte C-x 1, da zaprete okno s pomoèjo. +>> Vtipkajte C-x 1, da zaprete okno s pomoÄjo. - C-h i Priroèniki z navodili za uporabo (tkim. datoteke - "info"). Ta ukaz vas prestavi v posebno delovno - podroèje, imenovano "info". V njem lahko prebirate - priroènike za programe, ki so name¹èeni v sistemu. Z - ukazom m emacs<Return> denimo dobite priroènik za - urejevalnik Emacs. Èe sistema Info ¹e niste + C-h i PriroÄniki z navodili za uporabo (tkim. datoteke + »info«). Ta ukaz vas prestavi v posebno delovno + podroÄje, imenovano »*info*«. V njem lahko prebirate + priroÄnike za programe, ki so nameÅ¡Äeni v sistemu. Z + ukazom m emacs<Return> denimo dobite priroÄnik za + urejevalnik Emacs. ÄŒe sistema Info Å¡e niste uporabljali, vtipkajte ? in Emacs vas bo popeljal na - vódeni izlet po naèinu Info in mo¾nostih, ki jih - ponuja. Ko boste zakljuèili z branjem tega prvega - berila, bo priroènik za Emacs v sistemu Info va¹ + vódeni izlet po naÄinu Info in možnostih, ki jih + ponuja. Ko boste zakljuÄili z branjem tega prvega + berila, bo priroÄnik za Emacs v sistemu Info vaÅ¡ glavni vir dokumentacije. -* DRUGE MO®NOSTI +* DRUGE MOŽNOSTI ---------------- -©e veè se lahko nauèite o Emacsu z branjem priroènika, bodisi -natisnjenega, bodisi na zaslonu v sistemu Info (uporabite menu Help -ali vtipkajte F10 h r). Dve mo¾nosti, ki vam bosta morda posebej v¹eè, -sta samodejno zakljuèevanje vrstice, s katerim prihranite nekaj -tipkanja, in dired, s katerim poenostavimo delo z datotekami. +Å e veÄ se lahko nauÄite o Emacsu z branjem priroÄnika, bodisi +natisnjenega, bodisi znotraj samega Emacsa (uporabite menu Help ali +vtipkajte C-h r). Dve možnosti, ki vam bosta morda posebej vÅ¡eÄ, sta +samodejno zakljuÄevanje vrstice, s katerim prihranite nekaj tipkanja, +in dired, s katerim poenostavimo delo z datotekami. -Samodejno zakljuèevanje vrstic je naèin, s katerim prihranimo nekaj -tipkanja. Èe ¾elite denimo preklopiti v delovno podroèje *Messages*, +Samodejno zakljuÄevanje vrstic je naÄin, s katerim prihranimo nekaj +tipkanja. ÄŒe želite denimo preklopiti v delovno podroÄje *Messages*, je dovolj, da vtipkate C-x b *M<Tab> in Emacs bo sam dopolnil -preostanek imena delovnega podroèja. Samodejno zakljuèevanje je -opisano v sistemu Info v priroèniku za Emacs, razdelek ,,Completion``. +preostanek imena delovnega podroÄja. Samodejno zakljuÄevanje deluje +tudi za imena ukazov in imena datotek. Samodejno zakljuÄevanje je +opisano v priroÄniku za Emacs, razdelek »Completion«. -Dired omogoèa izpis seznama datotek v imeniku (in po mo¾nosti tudi +Dired omogoÄa izpis seznama datotek v imeniku (in po možnosti tudi podimenikih), premikanje po seznamu, obiskovanje (odpiranje), preimenovanje, brisanje in druge operacije z datotekami. Dired je -opisav v sistemu Info v priroèniku za Emacs, razdelek ,,Dired``. +opisav v priroÄniku za Emacs, razdelek »Dired«. -Priroènik opisuje tudi mnoge druge mo¾nosti Emacsa. +PriroÄnik opisuje tudi mnoge druge možnosti Emacsa. -* ZAKLJUÈEK +* ZAKLJUÄŒEK ----------- -Zapomnite si, da Emacs zapustite z ukazom C-x C-c. Èe bi radi samo -zaèasno skoèili v ukazno lupino in se kasneje vrnili v Emacs, pa -storite to z ukazom C-z. +Emacs zapustite z ukazom C-x C-c. -Ta uèbenik je napisan z namenom, da bi bil razumljiv vsem novincem v -Emacsu. Èe se vam kaj ne zdi jasno napisano, ne valite krivde nase - -prito¾ite se! +Ta uÄbenik je napisan z namenom, da bi bil razumljiv vsem novincem v +Emacsu. ÄŒe se vam kaj ne zdi jasno napisano, ne valite krivde nase - +pritožite se! -* RAZMNO®EVANJE IN RAZ©IRJANJE +* RAZMNOŽEVANJE IN RAZÅ IRJANJE ------------------------------ -Angle¹ki izvirnik tega uvoda v Emacs je naslednik dolge vrste tovrstnih -besedil, zaèen¹i s tistim, ki ga je Stuart Cracraft napisal za izvorni -Emacs. V sloven¹èino ga je prevedel Primo¾ Peterlin. +AngleÅ¡ki izvirnik tega uvoda v Emacs je naslednik dolge vrste tovrstnih +besedil, zaÄenÅ¡i s tistim, ki ga je Stuart Cracraft napisal za izvorni +Emacs. V slovenÅ¡Äino ga je prevedel Primož Peterlin. To besedilo, kot sam GNU Emacs, je avtorsko delo, in njegovo -razmno¾evanje in raz¹irjanje je dovoljeno pod naslednjimi pogoji: +razmnoževanje in razÅ¡irjanje je dovoljeno pod naslednjimi pogoji: + +Copyright © 1985, 1996, 1998, 2001-2012 Free Software Foundation, Inc. -Copyright (C) 1985, 1996, 1998, 2001-2012 Free Software Foundation, Inc. + Ta datoteka je del paketa GNU Emacs. - Dovoljeno je izdelovati in raz¹irjati neokrnjene kopije tega spisa - v kakr¹nikoli obliki pod pogojem, da je ohranjena navedba o - avtorstvu in to dovoljenje, ter da distributer dovoljuje prejemniku - nadaljnje raz¹irjanje pod pogoji, navedenimi v tem dovoljenju. + GNU Emacs je prost program; lahko ga redistribuirate in/ali prirejate + po pogojih, doloÄenih v dovoljenju za rabo »GNU General Public License«, + izdanem pri Free Software Foundation, bodisi 3. izdaje tega dovoljenja, + bodisi katerekoli kasnejÅ¡e izdaje, ki je na voljo. - Pod pogoji iz prej¹njega odstavka je dovoljeno raz¹irjati - spremenjene verzije tega spisa ali njegovih delov, èe je jasno - oznaèeno, kdo je nazadnje vnesel spremembe. + GNU Emacs je ponujen v dobri veri, da je uporaben, vendar zanj NI + NOBENEGA JAMSTVA, niti implicitnih jamstev PRIMERNOSTI ZA PRODAJO + ali USTREZNOSTI ZA DOLOÄŒEN NAMEN. Podrobnosti so na voljo v »GNU + General Public License«. -Pogoji za razmno¾evanje in raz¹irjanje samega Emacsa so malo drugaèni, -a v istem duhu. Prosimo, preberite datoteko COPYING in potem dajte -kopijo programa GNU Emacs svojim prijateljem. Pomagajte zatreti -obstrukcionizem (,,lastni¹tvo``) v programju tako, da uporabljate, -pi¹ete in delite prosto programje! + Kopijo »GNU General Public License« bi morali prejeti skupaj s paketom + GNU Emacs. ÄŒe je niste, je na voljo na <http://www.gnu.org/licenses/>. + +Prosimo, preberite datoteko COPYING in potem ponudite kopijo programa +GNU Emacs svojim prijateljem. Pomagajte zatreti obstrukcionizem +(»lastniÅ¡tvo«) v programju tako, da uporabljate, piÅ¡ete in delite +prosto programje! ;;; Local Variables: -;;; coding: iso-latin-2 +;;; coding: utf-8 ;;; sentence-end-double-space: nil ;;; End: - diff --git a/etc/tutorials/TUTORIAL.translators b/etc/tutorials/TUTORIAL.translators index 64780687bb1..3ec948eb79a 100644 --- a/etc/tutorials/TUTORIAL.translators +++ b/etc/tutorials/TUTORIAL.translators @@ -2,8 +2,8 @@ This file contains the list of translators and maintainers of the tutorial. * TUTORIAL.bg: -Author: Ognyan Kulev <ogi@fmi.uni-sofia.bg> -Maintainer: Ognyan Kulev <ogi@fmi.uni-sofia.bg> +Author: Ognyan Kulev <ogi@tower.3.bg> +Maintainer: Ognyan Kulev <ogi@tower.3.bg> * TUTORIAL.cn: Author: Sun Yijiang <sunyijiang@gmail.com> @@ -75,8 +75,8 @@ Author: Miroslav VaÅ¡ko <vasko@debian.cz> Maintainer: Maintainer needed. * TUTORIAL.sl: -Author: Primož Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> -Maintainer: Primož Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> +Author: Primož Peterlin <primozz.peterlin@gmail.com> +Maintainer: Primož Peterlin <primozz.peterlin@gmail.com> * TUTORIAL.sv: Author: Mats Lidell <matsl@contactor.se> diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2813d80d9ff..97281db4c7c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,136 @@ +2012-01-23 Mike Lamb <mrlamb@gmail.com> (tiny change) + + * eshell/esh-util.el (eshell-read-hosts-file): + Skip comment lines. (Bug#10549) + + * eshell/em-unix.el (pcomplete/ssh): Remove. (Bug#10548) + +2012-01-23 Juanma Barranquero <lekktu@gmail.com> + + * subr.el (display-delayed-warnings): Doc fix. + (collapse-delayed-warnings): New function to collapse identical + adjacent warnings. + (delayed-warnings-hook): Add it. + +2012-01-22 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp.el (tramp-action-login): Set connection property "login-as". + + * net/tramp-cache.el (tramp-dump-connection-properties): Do not dump + properties, when "login-as" is set. + + * net/tramp-sh.el (tramp-methods): Add user spec to "pscp" and "psftp". + (tramp-default-user-alist): Don't add "pscp". + (tramp-do-copy-or-rename-file-out-of-band): Use connection + property "login-as", if set. (Bug#10530) + +2012-01-21 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp-sh.el (tramp-default-user-alist): Don't add "plink", + "plink1" and "psftp". (Bug#10530) + +2012-01-21 Kenichi Handa <handa@m17n.org> + + * international/mule-cmds.el (prefer-coding-system): Show a + warning message if the default value of file-name-coding-system + was not changed. + +2012-01-21 Jérémy Compostella <jeremy.compostella@gmail.com> + + * windmove.el (windmove-reference-loc): Fix + windmove-reference-loc miscalculation. + +2012-01-21 Jay Belanger <jay.p.belanger@gmail.com> + + * calc/calc-units.el (math-put-default-units): Don't use "1" as a + default unit. + +2012-01-21 Glenn Morris <rgm@gnu.org> + + * international/mule.el (auto-coding-alist): Add .tbz. + + * files.el (local-enable-local-variables): Doc fix. + (inhibit-local-variables-regexps): Rename from + inhibit-first-line-modes-regexps. Keep old name as obsolete alias. + Doc fix. Add some extensions from auto-coding-alist. + (inhibit-local-variables-suffixes): + Rename from inhibit-first-line-modes-suffixes. Doc fix. + (inhibit-local-variables-p): + New function, extracted from set-auto-mode-1. + (set-auto-mode): Doc fix. Respect inhibit-local-variables-regexps. + (set-auto-mode-1): Doc fix. Use inhibit-local-variables-p. + (hack-local-variables): Doc fix. Make the mode-only case + respect enable-local-variables and friends. + Respect inhibit-local-variables-regexps for file-locals, but + not for directory-locals. + (set-visited-file-name): + Take account of inhibit-local-variables-regexps. + Whether it applies may change as the file name is changed. + * jka-cmpr-hook.el (jka-compr-install): + * jka-compr.el (jka-compr-uninstall): + Update for inhibit-first-line-modes-suffixes name change. + +2012-01-20 Martin Rudalics <rudalics@gmx.at> + + * help-macro.el (make-help-screen): Temporarily restore original + binding for minor-mode-map-alist (Bug#10454). + +2012-01-19 Julien Danjou <julien@danjou.info> + + * color.el (color-name-to-rgb): Use the white color to find the max + color component value and return correctly computed values. + (color-name-to-rgb): Add missing float conversion for max value. + +2012-01-19 Martin Rudalics <rudalics@gmx.at> + + * window.el (window--state-get-1, window-state-get): Do not use + special state value for window-persistent-parameters. Rename + argument IGNORE to WRITABLE. Rewrite doc-string. + (window--state-put-2): Reset all window parameters to nil before + assigning values of persistent parameters. + +2012-01-18 Alan Mackenzie <acm@muc.de> + + Eliminate sluggishness and hangs in fontification of "semicolon + deserts". + + * progmodes/cc-engine.el (c-state-nonlit-pos-interval): change + value 10000 -> 3000. + (c-state-safe-place): Reformulate so it doesn't stack up an + infinite number of wrong entries in c-state-nonlit-pos-cache. + (c-determine-limit-get-base, c-determine-limit): New functions to + determine backward search limits disregarding literals. + (c-find-decl-spots): Amend commenting. + (c-cheap-inside-bracelist-p): New function which detects "={". + + * progmodes/cc-fonts.el + (c-make-font-lock-BO-decl-search-function): Give a limit to a + backward search. + (c-font-lock-declarations): Fix an occurrence of point being + undefined. Check additionally for point being in a bracelist or + near a macro invocation without a semicolon so as to avoid a + fruitless time consuming search for a declarator. Give a more + precise search limit for declarators using the new + c-determine-limit. + +2012-01-18 Glenn Morris <rgm@gnu.org> + + * files.el (auto-mode-alist, inhibit-first-line-modes-regexps) + (set-auto-mode): Doc fixes. + +2012-01-17 Glenn Morris <rgm@gnu.org> + + * isearch.el (search-nonincremental-instead): Fix doc typo. + + * dired.el (dired-insert-directory): Handle newlines in directory name. + (dired-build-subdir-alist): Unescape newlines in directory name. + +2012-01-17 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp.el (tramp-local-end-of-line): New defcustom. + (tramp-action-login, tramp-action-yesno, tramp-action-yn) + (tramp-action-terminal): Use it. (Bug#10530) + 2012-01-16 Stefan Monnier <monnier@iro.umontreal.ca> * minibuffer.el (completion--replace): Strip properties (bug#10062). @@ -34,6 +167,17 @@ * dired.el (dired-get-filename): Fix 'verbatim case of previous change. +2012-01-13 Alan Mackenzie <acm@muc.de> + + Fix filling for when filladapt mode is enabled. + + * progmodes/cc-cmds.el (c-fill-paragraph): In the invocation of + c-mask-paragraph, pass in `fill-paragraph' rather than + `fill-region-as-paragraph'. (This is a reversion of a previous + change.) + * progmodes/cc-mode.el (c-basic-common-init): Make + fill-paragraph-handle-comment buffer local and set it to nil. + 2012-01-13 Glenn Morris <rgm@gnu.org> * dired.el (dired-switches-escape-p): New function. diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 8f4c79e3f0a..dcbf845c371 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -415,18 +415,19 @@ If EXPR is nil, return nil." (defun math-put-default-units (expr) "Put the units in EXPR in the default units table." - (let* ((units (math-get-units expr)) - (standard-units (math-get-standard-units expr)) + (let ((units (math-get-units expr))) + (unless (eq units 1) + (let* ((standard-units (math-get-standard-units expr)) (default-units (gethash standard-units math-default-units-table))) - (cond - ((not default-units) - (puthash standard-units (list units) math-default-units-table)) - ((not (equal units (car default-units))) - (puthash standard-units - (list units (car default-units)) - math-default-units-table))))) + (cond + ((not default-units) + (puthash standard-units (list units) math-default-units-table)) + ((not (equal units (car default-units))) + (puthash standard-units + (list units (car default-units)) + math-default-units-table))))))) (defun calc-convert-units (&optional old-units new-units) diff --git a/lisp/cedet/semantic/wisent/js-wy.el b/lisp/cedet/semantic/wisent/js-wy.el index b8d3240aef1..05346b02c8d 100644 --- a/lisp/cedet/semantic/wisent/js-wy.el +++ b/lisp/cedet/semantic/wisent/js-wy.el @@ -1,7 +1,7 @@ ;;; semantic/wisent/js-wy.el --- Generated parser support file ;; Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc. -;; Copyright (C) 1998-2011 Ecma International +;; Copyright (C) 1998-2011 Ecma International. ;; This file is part of GNU Emacs. diff --git a/lisp/cedet/semantic/wisent/python-wy.el b/lisp/cedet/semantic/wisent/python-wy.el index cb0f37c8f16..e8229dcd9ea 100644 --- a/lisp/cedet/semantic/wisent/python-wy.el +++ b/lisp/cedet/semantic/wisent/python-wy.el @@ -1,7 +1,8 @@ ;;; semantic/wisent/python-wy.el --- Generated parser support file ;; Copyright (C) 2002-2004, 2007, 2010-2012 Free Software Foundation, Inc. -;; Copyright (C) 2001-2010 Python Software Foundation +;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Python Software Foundation; All Rights Reserved ;; This file is part of GNU Emacs. diff --git a/lisp/color.el b/lisp/color.el index ff7f0eee4e6..6fab613ba69 100644 --- a/lisp/color.el +++ b/lisp/color.el @@ -53,7 +53,10 @@ numbers, (RED GREEN BLUE), each between 0.0 and 1.0 inclusive. Optional arg FRAME specifies the frame where the color is to be displayed. If FRAME is omitted or nil, use the selected frame. If FRAME cannot display COLOR, return nil." - (mapcar (lambda (x) (/ x 65535.0)) (color-values color frame))) + ;; `colors-values' maximum value is either 65535 or 65280 depending on the + ;; display system. So we use a white conversion to get the max value. + (let ((valmax (float (car (color-values "#ffffff"))))) + (mapcar (lambda (x) (/ x valmax)) (color-values color frame)))) (defun color-rgb-to-hex (red green blue) "Return hexadecimal notation for the color RED GREEN BLUE. diff --git a/lisp/dired.el b/lisp/dired.el index f1a778ad05a..57f67ca7c8c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1172,7 +1172,22 @@ see `dired-use-ls-dired' for more details.") "\\015" (text-properties-at (match-beginning 0))) nil t)) - (set-marker end nil))) + (set-marker end nil)) + ;; Replace any newlines in DIR with literal "\n"s, for the sake + ;; of the header line. To disambiguate a literal "\n" in the + ;; actual dirname, we also replace "\" with "\\". + ;; Personally, I think this should always be done, irrespective + ;; of the value of dired-actual-switches, because: + ;; i) Dired simply does not work with an unescaped newline in + ;; the directory name used in the header (bug=10469#28), and + ;; ii) "\" is always replaced with "\\" in the listing, so doing + ;; it in the header as well makes things consistent. + ;; But at present it is only done if "-b" is in ls-switches, + ;; because newlines in dirnames are uncommon, and people may + ;; have gotten used to seeing unescaped "\" in the headers. + ;; Note: adjust dired-build-subdir-alist if you change this. + (setq dir (replace-regexp-in-string "\\\\" "\\\\" dir nil t) + dir (replace-regexp-in-string "\n" "\\n" dir nil t))) (dired-insert-set-properties opoint (point)) ;; If we used --dired and it worked, the lines are already indented. ;; Otherwise, indent them. @@ -2541,12 +2556,31 @@ instead of `dired-actual-switches'." (delete-region (point) (match-end 1)) (insert new-dir-name)) (setq count (1+ count)) + ;; Undo any escaping of newlines and \ by dired-insert-directory. + ;; Convert "n" preceded by odd number of \ to newline, and \\ to \. + (when (and (dired-switches-escape-p switches) + (string-match-p "\\\\" new-dir-name)) + (let (temp res) + (mapc (lambda (char) + (cond ((equal char ?\\) + (if temp + (setq res (concat res "\\") + temp nil) + (setq temp "\\"))) + ((and temp (equal char ?n)) + (setq res (concat res "\n") + temp nil)) + (t + (setq res (concat res temp (char-to-string char)) + temp nil)))) + new-dir-name) + (setq new-dir-name res))) (dired-alist-add-1 new-dir-name - ;; Place a sub directory boundary between lines. - (save-excursion - (goto-char (match-beginning 0)) - (beginning-of-line) - (point-marker))))) + ;; Place a sub directory boundary between lines. + (save-excursion + (goto-char (match-beginning 0)) + (beginning-of-line) + (point-marker))))) (if (and (> count 1) (called-interactively-p 'interactive)) (message "Buffer includes %d directories" count))) ;; We don't need to sort it because it is in buffer order per diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index f24180b5c7f..296e2ee8b24 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -792,8 +792,6 @@ external command." (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) pcomplete-default-completion-function))) -(defalias 'pcomplete/ssh 'pcomplete/rsh) - (defvar block-size) (defvar by-bytes) (defvar dereference-links) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index f111fd91230..8218e91ddc7 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -483,7 +483,7 @@ list." (insert-file-contents eshell-hosts-file) (goto-char (point-min)) (while (re-search-forward - "^\\(\\S-+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t) + "^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t) (if (match-string 1) (add-to-list 'hosts (match-string 1))) (if (match-string 2) diff --git a/lisp/files.el b/lisp/files.el index f15c523400d..7a72775ac3f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -510,14 +510,36 @@ and ignores this variable." (other :tag "Query" other)) :group 'find-file) +;; This is an odd variable IMO. +;; You might wonder why it is needed, when we could just do: +;; (set (make-local-variable 'enable-local-variables) nil) +;; These two are not precisely the same. +;; Setting this variable does not cause -*- mode settings to be +;; ignored, whereas setting enable-local-variables does. +;; Only three places in Emacs use this variable: tar and arc modes, +;; and rmail. The first two don't need it. They already use +;; inhibit-local-variables-regexps, which is probably enough, and +;; could also just set enable-local-variables locally to nil. +;; Them setting it has the side-effect that dir-locals cannot apply to +;; eg tar files (?). FIXME Is this appropriate? +;; AFAICS, rmail is the only thing that needs this, and the only +;; reason it uses it is for BABYL files (which are obsolete). +;; These contain "-*- rmail -*-" in the first line, which rmail wants +;; to respect, so that find-file on a BABYL file will switch to +;; rmail-mode automatically (this is nice, but hardly essential, +;; since most people are used to explicitly running a command to +;; access their mail; M-x gnus etc). Rmail files may happen to +;; contain Local Variables sections in messages, which Rmail wants to +;; ignore. So AFAICS the only reason this variable exists is for a +;; minor convenience feature for handling of an obsolete Rmail file format. (defvar local-enable-local-variables t "Like `enable-local-variables' but meant for buffer-local bindings. The meaningful values are nil and non-nil. The default is non-nil. If a major mode sets this to nil, buffer-locally, then any local -variables list in the file will be ignored. +variables list in a file visited in that mode will be ignored. -This variable does not affect the use of major modes -specified in a -*- line.") +This variable does not affect the use of major modes specified +in a -*- line.") (defcustom enable-local-eval 'maybe "Control processing of the \"variable\" `eval' in a file's local variables. @@ -2405,9 +2427,6 @@ If the element has the form (REGEXP FUNCTION NON-NIL), then after calling FUNCTION (if it's not nil), we delete the suffix that matched REGEXP and search the list again for another match. -If the file name matches `inhibit-first-line-modes-regexps', -then `auto-mode-alist' is not processed. - The extensions whose FUNCTION is `archive-mode' should also appear in `auto-coding-alist' with `no-conversion' coding system. @@ -2478,16 +2497,55 @@ of a script, mode MODE is enabled. See also `auto-mode-alist'.") -(defvar inhibit-first-line-modes-regexps - (mapcar 'purecopy '("\\.tar\\'" "\\.tgz\\'" "\\.tiff?\\'" - "\\.gif\\'" "\\.png\\'" "\\.jpe?g\\'")) - "List of regexps; if one matches a file name, don't look for `-*-'.") +(define-obsolete-variable-alias 'inhibit-first-line-modes-regexps + 'inhibit-file-local-variables-regexps "24.1") + +;; TODO really this should be a list of modes (eg tar-mode), not regexps, +;; because we are duplicating info from auto-mode-alist. +;; TODO many elements of this list are also in auto-coding-alist. +(defvar inhibit-local-variables-regexps + (mapcar 'purecopy '("\\.tar\\'" "\\.t[bg]z\\'" + "\\.arc\\'" "\\.zip\\'" "\\.lzh\\'" "\\.lha\\'" + "\\.zoo\\'" "\\.[jew]ar\\'" "\\.xpi\\'" "\\.rar\\'" + "\\.7z\\'" + "\\.sx[dmicw]\\'" "\\.odt\\'" + "\\.tiff?\\'" "\\.gif\\'" "\\.png\\'" "\\.jpe?g\\'")) + "List of regexps matching file names in which to ignore local variables. +This includes `-*-' lines as well as trailing \"Local Variables\" sections. +Files matching this list are typically binary file formats. +They may happen to contain sequences that look like local variable +specifications, but are not really, or they may be containers for +member files with their own local variable sections, which are +not appropriate for the containing file. +See also `inhibit-local-variables-suffixes'.") + +(define-obsolete-variable-alias 'inhibit-first-line-modes-suffixes + 'inhibit-local-variables-suffixes "24.1") -(defvar inhibit-first-line-modes-suffixes nil - "List of regexps for what to ignore, for `inhibit-first-line-modes-regexps'. -When checking `inhibit-first-line-modes-regexps', we first discard +(defvar inhibit-local-variables-suffixes nil + "List of regexps matching suffixes to remove from file names. +When checking `inhibit-local-variables-regexps', we first discard from the end of the file name anything that matches one of these regexps.") +;; TODO explicitly add case-fold-search t? +(defun inhibit-local-variables-p () + "Return non-nil if file local variables should be ignored. +This checks the file (or buffer) name against `inhibit-local-variables-regexps' +and `inhibit-local-variables-suffixes'." + (let ((temp inhibit-local-variables-regexps) + (name (if buffer-file-name + (file-name-sans-versions buffer-file-name) + (buffer-name)))) + (while (let ((sufs inhibit-local-variables-suffixes)) + (while (and sufs (not (string-match (car sufs) name))) + (setq sufs (cdr sufs))) + sufs) + (setq name (substring name 0 (match-beginning 0)))) + (while (and temp + (not (string-match (car temp) name))) + (setq temp (cdr temp))) + temp)) + (defvar auto-mode-interpreter-regexp (purecopy "#![ \t]?\\([^ \t\n]*\ /bin/env[ \t]\\)?\\([^ \t\n]+\\)") @@ -2550,21 +2608,24 @@ Also applies to `magic-fallback-mode-alist'.") (defun set-auto-mode (&optional keep-mode-if-same) "Select major mode appropriate for current buffer. -To find the right major mode, this function checks for a -*- mode tag, +To find the right major mode, this function checks for a -*- mode tag checks for a `mode:' entry in the Local Variables section of the file, checks if it uses an interpreter listed in `interpreter-mode-alist', matches the buffer beginning against `magic-mode-alist', compares the filename against the entries in `auto-mode-alist', then matches the buffer beginning against `magic-fallback-mode-alist'. -If `enable-local-variables' is nil, this function does not check for -any mode: tag anywhere in the file. +If `enable-local-variables' is nil, or if the file name matches +`inhibit-local-variables-regexps', this function does not check +for any mode: tag anywhere in the file. If `local-enable-local-variables' +is nil, then the only mode: tag that can be relevant is a -*- one. If the optional argument KEEP-MODE-IF-SAME is non-nil, then we set the major mode only if that would change it. In other words we don't actually set it to the same mode the buffer already has." ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- - (let (end done mode modes) + (let ((try-locals (not (inhibit-local-variables-p))) + end done mode modes) ;; Once we drop the deprecated feature where mode: is also allowed to ;; specify minor-modes (ie, there can be more than one "mode:"), we can ;; remove this section and just let (hack-local-variables t) handle it. @@ -2572,7 +2633,9 @@ we don't actually set it to the same mode the buffer already has." (save-excursion (goto-char (point-min)) (skip-chars-forward " \t\n") + ;; Note by design local-enable-local-variables does not matter here. (and enable-local-variables + try-locals (setq end (set-auto-mode-1)) (if (save-excursion (search-forward ":" end t)) ;; Find all specifications for the `mode:' variable @@ -2603,8 +2666,12 @@ we don't actually set it to the same mode the buffer already has." (or (set-auto-mode-0 mode keep-mode-if-same) ;; continuing would call minor modes again, toggling them off (throw 'nop nil)))))) + ;; hack-local-variables checks local-enable-local-variables etc, but + ;; we might as well be explicit here for the sake of clarity. (and (not done) enable-local-variables + local-enable-local-variables + try-locals (setq mode (hack-local-variables t)) (not (memq mode modes)) ; already tried and failed (if (not (functionp mode)) @@ -2714,38 +2781,24 @@ same, do nothing and return nil." (defun set-auto-mode-1 () "Find the -*- spec in the buffer. Call with point at the place to start searching from. -If one is found, set point to the beginning -and return the position of the end. -Otherwise, return nil; point may be changed." +If one is found, set point to the beginning and return the position +of the end. Otherwise, return nil; may change point. +The variable `inhibit-local-variables-regexps' can cause a -*- spec to +be ignored; but `enable-local-variables' and `local-enable-local-variables' +have no effect." (let (beg end) (and ;; Don't look for -*- if this file name matches any - ;; of the regexps in inhibit-first-line-modes-regexps. - (let ((temp inhibit-first-line-modes-regexps) - (name (if buffer-file-name - (file-name-sans-versions buffer-file-name) - (buffer-name)))) - (while (let ((sufs inhibit-first-line-modes-suffixes)) - (while (and sufs (not (string-match (car sufs) name))) - (setq sufs (cdr sufs))) - sufs) - (setq name (substring name 0 (match-beginning 0)))) - (while (and temp - (not (string-match (car temp) name))) - (setq temp (cdr temp))) - (not temp)) - + ;; of the regexps in inhibit-local-variables-regexps. + (not (inhibit-local-variables-p)) (search-forward "-*-" (line-end-position - ;; If the file begins with "#!" - ;; (exec interpreter magic), look - ;; for mode frobs in the first two - ;; lines. You cannot necessarily - ;; put them in the first line of - ;; such a file without screwing up - ;; the interpreter invocation. - ;; The same holds for - ;; '\" - ;; in man pages (preprocessor + ;; If the file begins with "#!" (exec + ;; interpreter magic), look for mode frobs + ;; in the first two lines. You cannot + ;; necessarily put them in the first line + ;; of such a file without screwing up the + ;; interpreter invocation. The same holds + ;; for '\" in man pages (preprocessor ;; magic for the `man' program). (and (looking-at "^\\(#!\\|'\\\\\"\\)") 2)) t) (progn @@ -3090,19 +3143,41 @@ Uses `hack-local-variables-apply' to apply the variables. If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" is specified, and return the corresponding mode symbol, or nil. In this case, we try to ignore minor-modes, and only return a -major-mode." +major-mode. + +If `enable-local-variables' or `local-enable-local-variables' is nil, +this function does nothing. If `inhibit-local-variables-regexps' +applies to the file in question, the file is not scanned for +local variables, but directory-local variables may still be applied." + ;; We don't let inhibit-local-variables-p influence the value of + ;; enable-local-variables, because then it would affect dir-local + ;; variables. We don't want to search eg tar files for file local + ;; variable sections, but there is no reason dir-locals cannot apply + ;; to them. The real meaning of inhibit-local-variables-p is "do + ;; not scan this file for local variables". (let ((enable-local-variables (and local-enable-local-variables enable-local-variables)) result) (unless mode-only (setq file-local-variables-alist nil) (report-errors "Directory-local variables error: %s" + ;; Note this is a no-op if enable-local-variables is nil. (hack-dir-local-variables))) - (when (or mode-only enable-local-variables) - ;; If MODE-ONLY is non-nil, and the prop line specifies a mode, - ;; then we're done, and have no need to scan further. - (unless (and (setq result (hack-local-variables-prop-line mode-only)) - mode-only) + ;; This entire function is basically a no-op if enable-local-variables + ;; is nil. All it does is set file-local-variables-alist to nil. + (when enable-local-variables + ;; This part used to ignore enable-local-variables when mode-only + ;; was non-nil. That was inappropriate, eg consider the + ;; (artificial) example of: + ;; (setq local-enable-local-variables nil) + ;; Open a file foo.txt that contains "mode: sh". + ;; It correctly opens in text-mode. + ;; M-x set-visited-file name foo.c, and it incorrectly stays in text-mode. + (unless (or (inhibit-local-variables-p) + ;; If MODE-ONLY is non-nil, and the prop line specifies a + ;; mode, then we're done, and have no need to scan further. + (and (setq result (hack-local-variables-prop-line mode-only)) + mode-only)) ;; Look for "Local variables:" line in last page. (save-excursion (goto-char (point-max)) @@ -3192,14 +3267,13 @@ major-mode." (indirect-variable var)) val) result) (error nil))))) - (forward-line 1))))))))) - ;; Now we've read all the local variables. - ;; If MODE-ONLY is non-nil, return whether the mode was specified. - (cond (mode-only result) - ;; Otherwise, set the variables. - (enable-local-variables - (hack-local-variables-filter result nil) - (hack-local-variables-apply))))) + (forward-line 1)))))))) + ;; Now we've read all the local variables. + ;; If MODE-ONLY is non-nil, return whether the mode was specified. + (if mode-only result + ;; Otherwise, set the variables. + (hack-local-variables-filter result nil) + (hack-local-variables-apply))))) (defun hack-local-variables-apply () "Apply the elements of `file-local-variables-alist'. @@ -3611,7 +3685,7 @@ the old visited file has been renamed to the new name FILENAME." (interactive "FSet visited file name: ") (if (buffer-base-buffer) (error "An indirect buffer cannot visit a file")) - (let (truename) + (let (truename old-try-locals) (if filename (setq filename (if (string-equal filename "") @@ -3636,7 +3710,8 @@ the old visited file has been renamed to the new name FILENAME." (progn (and filename (lock-buffer filename)) (unlock-buffer))) - (setq buffer-file-name filename) + (setq old-try-locals (not (inhibit-local-variables-p)) + buffer-file-name filename) (if filename ; make buffer name reflect filename. (let ((new-name (file-name-nondirectory buffer-file-name))) (setq default-directory (file-name-directory buffer-file-name)) @@ -3656,59 +3731,63 @@ the old visited file has been renamed to the new name FILENAME." (setq buffer-file-number (if filename (nthcdr 10 (file-attributes buffer-file-name)) - nil))) - ;; write-file-functions is normally used for things like ftp-find-file - ;; that visit things that are not local files as if they were files. - ;; Changing to visit an ordinary local file instead should flush the hook. - (kill-local-variable 'write-file-functions) - (kill-local-variable 'local-write-file-hooks) - (kill-local-variable 'revert-buffer-function) - (kill-local-variable 'backup-inhibited) - ;; If buffer was read-only because of version control, - ;; that reason is gone now, so make it writable. - (if vc-mode - (setq buffer-read-only nil)) - (kill-local-variable 'vc-mode) - ;; Turn off backup files for certain file names. - ;; Since this is a permanent local, the major mode won't eliminate it. - (and buffer-file-name - backup-enable-predicate - (not (funcall backup-enable-predicate buffer-file-name)) - (progn - (make-local-variable 'backup-inhibited) - (setq backup-inhibited t))) - (let ((oauto buffer-auto-save-file-name)) - ;; If auto-save was not already on, turn it on if appropriate. - (if (not buffer-auto-save-file-name) - (and buffer-file-name auto-save-default - (auto-save-mode t)) - ;; If auto save is on, start using a new name. - ;; We deliberately don't rename or delete the old auto save - ;; for the old visited file name. This is because perhaps - ;; the user wants to save the new state and then compare with the - ;; previous state from the auto save file. - (setq buffer-auto-save-file-name - (make-auto-save-file-name))) - ;; Rename the old auto save file if any. - (and oauto buffer-auto-save-file-name - (file-exists-p oauto) - (rename-file oauto buffer-auto-save-file-name t))) - (and buffer-file-name - (not along-with-file) - (set-buffer-modified-p t)) - ;; Update the major mode, if the file name determines it. - (condition-case nil - ;; Don't change the mode if it is special. - (or (not change-major-mode-with-file-name) - (get major-mode 'mode-class) - ;; Don't change the mode if the local variable list specifies it. - (hack-local-variables t) - ;; TODO consider making normal-mode handle this case. - (let ((old major-mode)) - (set-auto-mode t) - (or (eq old major-mode) - (hack-local-variables)))) - (error nil))) + nil)) + ;; write-file-functions is normally used for things like ftp-find-file + ;; that visit things that are not local files as if they were files. + ;; Changing to visit an ordinary local file instead should flush the hook. + (kill-local-variable 'write-file-functions) + (kill-local-variable 'local-write-file-hooks) + (kill-local-variable 'revert-buffer-function) + (kill-local-variable 'backup-inhibited) + ;; If buffer was read-only because of version control, + ;; that reason is gone now, so make it writable. + (if vc-mode + (setq buffer-read-only nil)) + (kill-local-variable 'vc-mode) + ;; Turn off backup files for certain file names. + ;; Since this is a permanent local, the major mode won't eliminate it. + (and buffer-file-name + backup-enable-predicate + (not (funcall backup-enable-predicate buffer-file-name)) + (progn + (make-local-variable 'backup-inhibited) + (setq backup-inhibited t))) + (let ((oauto buffer-auto-save-file-name)) + ;; If auto-save was not already on, turn it on if appropriate. + (if (not buffer-auto-save-file-name) + (and buffer-file-name auto-save-default + (auto-save-mode t)) + ;; If auto save is on, start using a new name. + ;; We deliberately don't rename or delete the old auto save + ;; for the old visited file name. This is because perhaps + ;; the user wants to save the new state and then compare with the + ;; previous state from the auto save file. + (setq buffer-auto-save-file-name + (make-auto-save-file-name))) + ;; Rename the old auto save file if any. + (and oauto buffer-auto-save-file-name + (file-exists-p oauto) + (rename-file oauto buffer-auto-save-file-name t))) + (and buffer-file-name + (not along-with-file) + (set-buffer-modified-p t)) + ;; Update the major mode, if the file name determines it. + (condition-case nil + ;; Don't change the mode if it is special. + (or (not change-major-mode-with-file-name) + (get major-mode 'mode-class) + ;; Don't change the mode if the local variable list specifies it. + ;; The file name can influence whether the local variables apply. + (and old-try-locals + ;; h-l-v also checks it, but might as well be explcit. + (not (inhibit-local-variables-p)) + (hack-local-variables t)) + ;; TODO consider making normal-mode handle this case. + (let ((old major-mode)) + (set-auto-mode t) + (or (eq old major-mode) + (hack-local-variables)))) + (error nil)))) (defun write-file (filename &optional confirm) "Write current buffer into file FILENAME. diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c7358779818..8e790962c34 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2012-01-21 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * mm-decode.el (mm-interactively-view-part): Fix prompt. + 2012-01-10 Teodor Zlatanov <tzz@lifelogs.com> * nntp.el (nntp-send-authinfo): Query `auth-source-search' with the diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 10e0fa2861c..dd3eb6c9d96 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1353,7 +1353,7 @@ Use CMD as the process." (mailcap-mime-info type 'all))) (method (let ((minibuffer-local-completion-map mm-viewer-completion-map)) - (completing-read "Viewer" methods)))) + (completing-read "Viewer: " methods)))) (when (string= method "") (error "No method given")) (if (string-match "^[^% \t]+$" method) diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 0bd6f3c4798..112c72778bc 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -184,9 +184,12 @@ and then returns." (when config (set-window-configuration config) (setq config nil)) - ;; `defn' must make sure that its frame is - ;; selected, so we won't iconify it below. - (call-interactively defn) + ;; Temporarily rebind `minor-mode-map-alist' + ;; to `new-minor-mode-map-alist' (Bug#10454). + (let ((minor-mode-map-alist new-minor-mode-map-alist)) + ;; `defn' must make sure that its frame is + ;; selected, so we won't iconify it below. + (call-interactively defn)) (when new-frame ;; Do not iconify the selected frame. (unless (eq new-frame (selected-frame)) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index cbe548c2ccf..378cbc9badd 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -418,7 +418,10 @@ To prefer, for instance, utf-8, say the following: (if (memq eol-type '(0 1 2)) (setq base (coding-system-change-eol-conversion base eol-type))) - (set-default-coding-systems base))) + (set-default-coding-systems base) + (if (called-interactively-p 'interactive) + (or (eq base default-file-name-coding-system) + (message "The default value of `file-name-coding-system' was not changed because the specified coding system is not suitable for file names."))))) (defvar sort-coding-systems-predicate nil "If non-nil, a predicate function to sort coding systems. diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 17163071d3f..d4dd4e4cf24 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1668,6 +1668,7 @@ in-place." ;;; FILE I/O +;; TODO many elements of this list are also in inhibit-local-variables-regexps. (defcustom auto-coding-alist ;; .exe and .EXE are added to support archive-mode looking at DOS ;; self-extracting exe archives. @@ -1677,7 +1678,7 @@ arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . no-conversion-multibyte) ("\\.\\(exe\\|EXE\\)\\'" . no-conversion) - ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion) + ("\\.\\(sx[dmicw]\\|odt\\|tar\\|t[bg]z\\)\\'" . no-conversion) ("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion) ("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion) ("\\.pdf\\'" . no-conversion) diff --git a/lisp/isearch.el b/lisp/isearch.el index a6cc69be9a6..ce759116860 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -102,7 +102,7 @@ in Isearch mode is always downcased." :group 'isearch) (defcustom search-nonincremental-instead t - "If non-nil, do a nonincremental search instead if exiting immediately. + "If non-nil, do a nonincremental search instead of exiting immediately. Actually, `isearch-edit-string' is called to let you enter the search string, and RET terminates editing and does a nonincremental search." :type 'boolean diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el index d09e64634c3..600ed549731 100644 --- a/lisp/jka-cmpr-hook.el +++ b/lisp/jka-cmpr-hook.el @@ -119,7 +119,7 @@ based on the filename itself and `jka-compr-compression-info-list'." (defun jka-compr-install () "Install jka-compr. This adds entries to `file-name-handler-alist' and `auto-mode-alist' -and `inhibit-first-line-modes-suffixes'." +and `inhibit-local-variables-suffixes'." (setq jka-compr-file-name-handler-entry (cons (jka-compr-build-file-regexp) 'jka-compr-handler)) @@ -145,12 +145,12 @@ and `inhibit-first-line-modes-suffixes'." ;; are chosen right according to the file names ;; sans `.gz'. (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist) - ;; Also add these regexps to - ;; inhibit-first-line-modes-suffixes, so that a - ;; -*- line in the first file of a compressed tar - ;; file doesn't override tar-mode. + ;; Also add these regexps to inhibit-local-variables-suffixes, + ;; so that a -*- line in the first file of a compressed tar file, + ;; or a Local Variables section in a member file at the end of + ;; the tar file don't override tar-mode. (push (jka-compr-info-regexp x) - inhibit-first-line-modes-suffixes))) + inhibit-local-variables-suffixes))) (setq auto-mode-alist (append auto-mode-alist jka-compr-mode-alist-additions)) diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 786e4292d5f..8a8d7cdbb52 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -657,16 +657,15 @@ It is not recommended to set this variable permanently to anything but nil.") (defun jka-compr-uninstall () "Uninstall jka-compr. This removes the entries in `file-name-handler-alist' and `auto-mode-alist' -and `inhibit-first-line-modes-suffixes' that were added +and `inhibit-local-variables-suffixes' that were added by `jka-compr-installed'." - ;; Delete from inhibit-first-line-modes-suffixes - ;; what jka-compr-install added. + ;; Delete from inhibit-local-variables-suffixes what jka-compr-install added. (mapc (function (lambda (x) (and (jka-compr-info-strip-extension x) - (setq inhibit-first-line-modes-suffixes + (setq inhibit-local-variables-suffixes (delete (jka-compr-info-regexp x) - inhibit-first-line-modes-suffixes))))) + inhibit-local-variables-suffixes))))) jka-compr-compression-info-list--internal) (let* ((fnha (cons nil file-name-handler-alist)) diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 03a5fe5b88e..d222dd1011d 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -243,7 +243,7 @@ PROPERTY is set persistent when KEY is a vector." (aset key 3 nil)) (let ((hash (or (gethash key tramp-cache-data) (puthash key (make-hash-table :test 'equal) - tramp-cache-data)))) + tramp-cache-data)))) (puthash property value hash) (setq tramp-cache-data-changed t) (tramp-message key 7 "%s %s" property value) @@ -329,10 +329,15 @@ KEY identifies the connection, it is either a process or a vector." tramp-cache-data-changed (stringp tramp-persistency-file-name)) (let ((cache (copy-hash-table tramp-cache-data))) - ;; Remove temporary data. + ;; Remove temporary data. If there is the key "login-as", we + ;; don't save either, because all other properties might + ;; depend on the login name, and we want to give the + ;; possibility to use another login name later on. (maphash (lambda (key value) - (if (and (vectorp key) (not (tramp-file-name-localname key))) + (if (and (vectorp key) + (not (tramp-file-name-localname key)) + (not (gethash "login-as" value))) (progn (remhash "process-name" value) (remhash "process-buffer" value) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2478253841f..38e19730a6d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -380,7 +380,7 @@ detected as prompt when being sent on echoing hosts, therefore.") (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) (tramp-copy-program "pscp") - (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k") + (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) @@ -394,7 +394,7 @@ detected as prompt when being sent on echoing hosts, therefore.") (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) (tramp-copy-program "pscp") - (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k") + (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) @@ -419,13 +419,12 @@ detected as prompt when being sent on echoing hosts, therefore.") `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'") nil "root")) ;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored. +;; Do not add "plink" based methods, they ask interactively for the user. ;;;###tramp-autoload (add-to-list 'tramp-default-user-alist `(,(concat "\\`" - (regexp-opt - '("rcp" "remcp" "rsh" "telnet" "krlogin" - "plink" "plink1" "pscp" "psftp" "fcp")) + (regexp-opt '("rcp" "remcp" "rsh" "telnet" "krlogin" "fcp")) "\\'") nil ,(user-login-name))) @@ -2281,8 +2280,10 @@ The method used must be an out-of-band method." ;; Set variables for computing the prompt for reading ;; password. (setq tramp-current-method (tramp-file-name-method v) - tramp-current-user (tramp-file-name-user v) - tramp-current-host (tramp-file-name-real-host v)) + tramp-current-user (or (tramp-file-name-user v) + (tramp-get-connection-property + v "login-as" nil)) + tramp-current-host (tramp-file-name-real-host v)) ;; Expand hops. Might be necessary for gateway methods. (setq v (car (tramp-compute-multi-hops v))) @@ -2309,8 +2310,15 @@ The method used must be an out-of-band method." (setq port (string-to-number (match-string 2 host)) host (string-to-number (match-string 1 host)))) + ;; Check for user. There might be an interactive setting. + (setq user (or (tramp-file-name-user v) + (tramp-get-connection-property v "login-as" nil))) + ;; Compose copy command. - (setq spec (format-spec-make + (setq host (or host "") + user (or user "") + port (or port "") + spec (format-spec-make ?h host ?u user ?p port ?t (tramp-get-connection-property (tramp-get-connection-process v) "temp-file" "") diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index afb7ab4312b..f13315bc662 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -460,6 +460,12 @@ usually suffice.") "Regexp which matches `tramp-echo-mark' as it gets echoed by the remote shell.") +(defcustom tramp-local-end-of-line + (if (memq system-type '(windows-nt)) "\r\n" "\n") + "*String used for end of line in local processes." + :group 'tramp + :type 'string) + (defcustom tramp-rsh-end-of-line "\n" "*String used for end of line in rsh connections. I don't think this ever needs to be changed, so please tell me about it @@ -1902,7 +1908,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;; operations shall return at least a default value ;; in order to give the user a chance to correct the ;; file name in the minibuffer. - ;; We cannot use 'debug as error handler. In order + ;; We cannot use `debug' as error handler. In order ;; to get a full backtrace, one could apply ;; (setq debug-on-error t debug-on-signal t) (error @@ -3109,14 +3115,16 @@ beginning of local filename are not substituted." (defun tramp-action-login (proc vec) "Send the login name." (when (not (stringp tramp-current-user)) - (save-window-excursion - (let ((enable-recursive-minibuffers t)) - (pop-to-buffer (tramp-get-connection-buffer vec)) - (setq tramp-current-user (read-string (match-string 0)))))) - (tramp-message vec 3 "Sending login name `%s'" tramp-current-user) + (setq tramp-current-user + (with-connection-property vec "login-as" + (save-window-excursion + (let ((enable-recursive-minibuffers t)) + (pop-to-buffer (tramp-get-connection-buffer vec)) + (read-string (match-string 0))))))) (with-current-buffer (tramp-get-connection-buffer vec) (tramp-message vec 6 "\n%s" (buffer-string))) - (tramp-send-string vec tramp-current-user)) + (tramp-message vec 3 "Sending login name `%s'" tramp-current-user) + (tramp-send-string vec (concat tramp-current-user tramp-local-end-of-line))) (defun tramp-action-password (proc vec) "Query the user for a password." @@ -3148,7 +3156,7 @@ See also `tramp-action-yn'." (throw 'tramp-action 'permission-denied)) (with-current-buffer (tramp-get-connection-buffer vec) (tramp-message vec 6 "\n%s" (buffer-string))) - (tramp-send-string vec "yes")))) + (tramp-send-string vec (concat "yes" tramp-local-end-of-line))))) (defun tramp-action-yn (proc vec) "Ask the user for confirmation using `y-or-n-p'. @@ -3162,7 +3170,7 @@ See also `tramp-action-yesno'." (throw 'tramp-action 'permission-denied)) (with-current-buffer (tramp-get-connection-buffer vec) (tramp-message vec 6 "\n%s" (buffer-string))) - (tramp-send-string vec "y")))) + (tramp-send-string vec (concat "y" tramp-local-end-of-line))))) (defun tramp-action-terminal (proc vec) "Tell the remote host which terminal type to use. @@ -3170,7 +3178,7 @@ The terminal type can be configured with `tramp-terminal-type'." (tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type) (with-current-buffer (tramp-get-connection-buffer vec) (tramp-message vec 6 "\n%s" (buffer-string))) - (tramp-send-string vec tramp-terminal-type)) + (tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line))) (defun tramp-action-process-alive (proc vec) "Check, whether a process has finished." diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 76b9f304164..509bb203f78 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -4382,11 +4382,8 @@ Optional prefix ARG means justify paragraph as well." (let ((fill-paragraph-function ;; Avoid infinite recursion. (if (not (eq fill-paragraph-function 'c-fill-paragraph)) - fill-paragraph-function)) - (start-point (point-marker))) - (c-mask-paragraph - t nil (lambda () (fill-region-as-paragraph (point-min) (point-max) arg))) - (goto-char start-point)) + fill-paragraph-function))) + (c-mask-paragraph t nil 'fill-paragraph arg)) ;; Always return t. This has the effect that if filling isn't done ;; above, it isn't done at all, and it's therefore effectively ;; disabled in normal code. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 2e0294341da..25344fe96a7 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2074,7 +2074,7 @@ comment at the start of cc-engine.el for more info." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; We maintain a simple cache of positions which aren't in a literal, so as to ;; speed up testing for non-literality. -(defconst c-state-nonlit-pos-interval 10000) +(defconst c-state-nonlit-pos-interval 3000) ;; The approximate interval between entries in `c-state-nonlit-pos-cache'. (defvar c-state-nonlit-pos-cache nil) @@ -2129,7 +2129,7 @@ comment at the start of cc-engine.el for more info." (widen) (save-excursion (let ((c c-state-nonlit-pos-cache) - pos npos lit) + pos npos lit macro-beg) ;; Trim the cache to take account of buffer changes. (while (and c (> (car c) c-state-nonlit-pos-cache-limit)) (setq c (cdr c))) @@ -2139,16 +2139,32 @@ comment at the start of cc-engine.el for more info." (setq c (cdr c))) (setq pos (or (car c) (point-min))) - (while (<= (setq npos (+ pos c-state-nonlit-pos-interval)) - here) - (setq lit (car (cddr (c-state-pp-to-literal pos npos)))) - (setq pos (or (cdr lit) npos)) ; end of literal containing npos. + (while + ;; Add an element to `c-state-nonlit-pos-cache' each iteration. + (and + (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here) + (progn + (setq lit (car (cddr (c-state-pp-to-literal pos npos)))) + (cond + ((null lit) + (setq pos npos) + t) + ((<= (cdr lit) here) + (setq pos (cdr lit)) + t) + (t + (setq pos (car lit)) + nil)))) + (goto-char pos) (when (and (c-beginning-of-macro) (/= (point) pos)) - (c-syntactic-end-of-macro) - (or (eobp) (forward-char)) - (setq pos (point))) - (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache))) + (setq macro-beg (point)) + (c-syntactic-end-of-macro) + (or (eobp) (forward-char)) + (setq pos (if (<= (point) here) + (point) + macro-beg))) + (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache))) (if (> pos c-state-nonlit-pos-cache-limit) (setq c-state-nonlit-pos-cache-limit pos)) @@ -4351,6 +4367,78 @@ comment at the start of cc-engine.el for more info." (t 'c))) ; Assuming the range is valid. range)) +(defsubst c-determine-limit-get-base (start try-size) + ;; Get a "safe place" approximately TRY-SIZE characters before START. + ;; This doesn't preserve point. + (let* ((pos (max (- start try-size) (point-min))) + (base (c-state-safe-place pos)) + (s (parse-partial-sexp base pos))) + (if (or (nth 4 s) (nth 3 s)) ; comment or string + (nth 8 s) + (point)))) + +(defun c-determine-limit (how-far-back &optional start try-size) + ;; Return a buffer position HOW-FAR-BACK non-literal characters from START + ;; (default point). This is done by going back further in the buffer then + ;; searching forward for literals. The position found won't be in a + ;; literal. We start searching for the sought position TRY-SIZE (default + ;; twice HOW-FAR-BACK) bytes back from START. This function must be fast. + ;; :-) + (save-excursion + (let* ((start (or start (point))) + (try-size (or try-size (* 2 how-far-back))) + (base (c-determine-limit-get-base start try-size)) + (pos base) + + (s (parse-partial-sexp pos pos)) ; null state. + stack elt size + (count 0)) + (while (< pos start) + ;; Move forward one literal each time round this loop. + ;; Move forward to the start of a comment or string. + (setq s (parse-partial-sexp + pos + start + nil ; target-depth + nil ; stop-before + s ; state + 'syntax-table)) ; stop-comment + + ;; Gather details of the non-literal-bit - starting pos and size. + (setq size (- (if (or (nth 4 s) (nth 3 s)) + (nth 8 s) + (point)) + pos)) + (if (> size 0) + (setq stack (cons (cons pos size) stack))) + + ;; Move forward to the end of the comment/string. + (if (or (nth 4 s) (nth 3 s)) + (setq s (parse-partial-sexp + (point) + start + nil ; target-depth + nil ; stop-before + s ; state + 'syntax-table))) ; stop-comment + (setq pos (point))) + + ;; Now try and find enough non-literal characters recorded on the stack. + ;; Go back one recorded literal each time round this loop. + (while (and (< count how-far-back) + stack) + (setq elt (car stack) + stack (cdr stack)) + (setq count (+ count (cdr elt)))) + + ;; Have we found enough yet? + (cond + ((>= count how-far-back) + (+ (car elt) (- count how-far-back))) + ((eq base (point-min)) + (point-min)) + (t + (c-determine-limit (- how-far-back count) base try-size)))))) ;; `c-find-decl-spots' and accompanying stuff. @@ -4487,13 +4575,14 @@ comment at the start of cc-engine.el for more info." ;; Call CFD-FUN for each possible spot for a declaration, cast or ;; label from the point to CFD-LIMIT. ;; - ;; CFD-FUN is called with point at the start of the spot. It's - ;; passed two arguments: The first is the end position of the token - ;; preceding the spot, or 0 for the implicit match at bob. The - ;; second is a flag that is t when the match is inside a macro. If - ;; CFD-FUN adds `c-decl-end' properties somewhere below the current - ;; spot, it should return non-nil to ensure that the next search - ;; will find them. + ;; CFD-FUN is called with point at the start of the spot. It's passed two + ;; arguments: The first is the end position of the token preceding the spot, + ;; or 0 for the implicit match at bob. The second is a flag that is t when + ;; the match is inside a macro. Point should be moved forward by at least + ;; one token. + ;; + ;; If CFD-FUN adds `c-decl-end' properties somewhere below the current spot, + ;; it should return non-nil to ensure that the next search will find them. ;; ;; Such a spot is: ;; o The first token after bob. @@ -4867,7 +4956,8 @@ comment at the start of cc-engine.el for more info." (goto-char cfd-continue-pos) (if (= cfd-continue-pos cfd-limit) (setq cfd-match-pos cfd-limit) - (c-find-decl-prefix-search))))) + (c-find-decl-prefix-search))))) ; Moves point, sets cfd-continue-pos, + ; cfd-match-pos, etc. ;; A cache for found types. @@ -8047,6 +8137,23 @@ comment at the start of cc-engine.el for more info." next-open-brace (c-pull-open-brace paren-state))) open-brace)) +(defun c-cheap-inside-bracelist-p (paren-state) + ;; Return the position of the L-brace if point is inside a brace list + ;; initialization of an array, etc. This is an approximate function, + ;; designed for speed over accuracy. It will not find every bracelist, but + ;; a non-nil result is reliable. We simply search for "= {" (naturally with + ;; syntactic whitespace allowed). PAREN-STATE is the normal thing that it + ;; is everywhere else. + (let (b-pos) + (save-excursion + (while + (and (setq b-pos (c-pull-open-brace paren-state)) + (progn (goto-char b-pos) + (c-backward-sws) + (c-backward-token-2) + (not (looking-at "="))))) + b-pos))) + (defun c-inside-bracelist-p (containing-sexp paren-state) ;; return the buffer position of the beginning of the brace list ;; statement if we're inside a brace list, otherwise return nil. diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index e7d00815708..2d116e1ecdc 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -446,10 +446,12 @@ ;; `parse-sexp-lookup-properties' (when it exists). (parse-sexp-lookup-properties (cc-eval-when-compile - (boundp 'parse-sexp-lookup-properties)))) + (boundp 'parse-sexp-lookup-properties))) + (BOD-limit + (c-determine-limit 1000))) (goto-char (let ((here (point))) - (if (eq (car (c-beginning-of-decl-1)) 'same) + (if (eq (car (c-beginning-of-decl-1 BOD-limit)) 'same) (point) here))) ,(c-make-font-lock-search-form regexp highlights)) @@ -1240,6 +1242,7 @@ casts and declarations are fontified. Used on level 2 and higher." ;; it finds any. That's necessary so that we later will ;; stop inside them to fontify types there. (c-parse-and-markup-<>-arglists t) + lbrace ; position of some {. ;; The font-lock package in Emacs is known to clobber ;; `parse-sexp-lookup-properties' (when it exists). (parse-sexp-lookup-properties @@ -1351,7 +1354,6 @@ casts and declarations are fontified. Used on level 2 and higher." (or (looking-at c-typedef-key) (goto-char start-pos))) - ;; Now analyze the construct. ;; In QT, "more" is an irritating keyword that expands to nothing. ;; We skip over it to prevent recognition of "more slots: <symbol>" ;; as a bitfield declaration. @@ -1360,6 +1362,8 @@ casts and declarations are fontified. Used on level 2 and higher." (concat "\\(more\\)\\([^" c-symbol-chars "]\\|$\\)"))) (goto-char (match-end 1)) (c-forward-syntactic-ws)) + + ;; Now analyze the construct. (setq decl-or-cast (c-forward-decl-or-cast-1 match-pos context last-cast-end)) @@ -1428,6 +1432,39 @@ casts and declarations are fontified. Used on level 2 and higher." (c-fontify-recorded-types-and-refs) nil) + ;; Restore point, since at this point in the code it has been + ;; left undefined by c-forward-decl-or-cast-1 above. + ((progn (goto-char start-pos) nil)) + + ;; If point is inside a bracelist, there's no point checking it + ;; being at a declarator. + ((let ((paren-state (c-parse-state))) + (setq lbrace (c-cheap-inside-bracelist-p paren-state))) + ;; Move past this bracelist to prevent an endless loop. + (goto-char lbrace) + (unless (c-safe (progn (forward-list) t)) + (goto-char start-pos) + (c-forward-token-2)) + nil) + + ;; If point is just after a ")" which is followed by an + ;; identifier which isn't a label, or at the matching "(", we're + ;; at either a macro invocation, a cast, or a + ;; for/while/etc. statement. The cast case is handled above. + ;; None of these cases can contain a declarator. + ((or (and (eq (char-before match-pos) ?\)) + (c-on-identifier) + (save-excursion (not (c-forward-label)))) + (and (eq (char-after) ?\() + (save-excursion + (and + (progn (c-backward-token-2) (c-on-identifier)) + (save-excursion (not (c-forward-label))) + (progn (c-backward-token-2) + (eq (char-after) ?\()))))) + (c-forward-token-2) ; Must prevent looping. + nil) + ((and (not c-enums-contain-decls) ;; An optimization quickly to eliminate scans of long enum ;; declarations in the next cond arm. @@ -1441,13 +1478,14 @@ casts and declarations are fontified. Used on level 2 and higher." (progn (c-backward-token-2) (looking-at c-brace-list-key))))))) - t) + (c-forward-token-2) + nil) (t ;; Are we at a declarator? Try to go back to the declaration ;; to check this. If we get there, check whether a "typedef" ;; is there, then fontify the declarators accordingly. - (let ((decl-search-lim (max (- (point) 50000) (point-min))) + (let ((decl-search-lim (c-determine-limit 1000)) paren-state bod-res encl-pos is-typedef c-recognize-knr-p) ; Strictly speaking, bogus, but it ; speeds up lisp.h tremendously. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index b74d878516d..0c86b68f1d9 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -490,6 +490,7 @@ that requires a literal mode spec at compile time." (make-local-variable 'paragraph-ignore-fill-prefix) (make-local-variable 'adaptive-fill-mode) (make-local-variable 'adaptive-fill-regexp) + (make-local-variable 'fill-paragraph-handle-comment) ;; now set their values (set (make-local-variable 'parse-sexp-ignore-comments) t) @@ -500,6 +501,9 @@ that requires a literal mode spec at compile time." (set (make-local-variable 'comment-line-break-function) 'c-indent-new-comment-line) + ;; For the benefit of adaptive file, which otherwise mis-fills. + (setq fill-paragraph-handle-comment nil) + ;; Install `c-fill-paragraph' on `fill-paragraph-function' so that a ;; direct call to `fill-paragraph' behaves better. This still ;; doesn't work with filladapt but it's better than nothing. diff --git a/lisp/subr.el b/lisp/subr.el index 14f9192405c..c9e213c86a0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1857,12 +1857,30 @@ FILE should be the name of a library, with no directory name." (defun display-delayed-warnings () "Display delayed warnings from `delayed-warnings-list'. -This is the default value of `delayed-warnings-hook'." +Used from `delayed-warnings-hook' (which see)." (dolist (warning (nreverse delayed-warnings-list)) (apply 'display-warning warning)) (setq delayed-warnings-list nil)) -(defvar delayed-warnings-hook '(display-delayed-warnings) +(defun collapse-delayed-warnings () + "Remove duplicates from `delayed-warnings-list'. +Collapse identical adjacent warnings into one (plus count). +Used from `delayed-warnings-hook' (which see)." + (let ((count 1) + collapsed warning) + (while delayed-warnings-list + (setq warning (pop delayed-warnings-list)) + (if (equal warning (car delayed-warnings-list)) + (setq count (1+ count)) + (when (> count 1) + (setcdr warning (cons (format "%s [%d times]" (cadr warning) count) + (cddr warning))) + (setq count 1)) + (push warning collapsed))) + (setq delayed-warnings-list (nreverse collapsed)))) + +(defvar delayed-warnings-hook '(collapse-delayed-warnings + display-delayed-warnings) "Normal hook run to process delayed warnings. Functions in this hook should access the `delayed-warnings-list' variable (which see) and remove from it the warnings they process.") diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 1066ebc7f81..9ba65cda143 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -31,19 +31,19 @@ ;;; Commentary: -;; PCL-CVS is a front-end to the CVS version control system. For people -;; familiar with VC, it is somewhat like VC-dired: it presents the status of -;; all the files in your working area and allows you to commit/update several -;; of them at a time. Compared to VC-dired, it is considerably better and -;; faster (but only for CVS). +;; PCL-CVS is a front-end to the CVS version control system. +;; It presents the status of all the files in your working area and +;; allows you to commit/update several of them at a time. +;; Compare with the general Emacs utility vc-dir, which tries +;; to be VCS-agnostic. You may find PCL-CVS better/faster for CVS. ;; PCL-CVS was originally written by Per Cederqvist many years ago. This ;; version derives from the XEmacs-21 version, itself based on the 2.0b2 ;; version (last release from Per). It is a thorough rework. -;; Contrary to what you'd expect, PCL-CVS is not a replacement for VC but only -;; for VC-dired. As such, I've tried to make PCL-CVS and VC interoperate -;; seamlessly (I also use VC). +;; PCL-CVS is not a replacement for VC, but adds extra functionality. +;; As such, I've tried to make PCL-CVS and VC interoperate seamlessly +;; (I also use VC). ;; To use PCL-CVS just use `M-x cvs-examine RET <dir> RET'. ;; There is a TeXinfo manual, which can be helpful to get started. diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el index 6f9a6d6b7df..9d55e9c7b43 100644 --- a/lisp/vc/vc-dav.el +++ b/lisp/vc/vc-dav.el @@ -170,10 +170,7 @@ It should return a status of either 0 (no differences found), or ;; Return a dav-specific mode line string for URL. Are there any ;; specific states that we want exposed? ;; -;; vc-dav-dired-state-info(url) -;; Translate the `vc-state' property of URL into a string that can -;; be used in a vc-dired buffer. Are there any extra states that -;; we want exposed? +;; vc-dir support ;; ;; vc-dav-receive-file(url rev) ;; Let this backend `receive' a file that is already registered diff --git a/lisp/windmove.el b/lisp/windmove.el index 10a564419fb..0523530869b 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -417,17 +417,17 @@ supplied, if ARG is greater or smaller than zero, respectively." (- (nth 3 edges) 1)))) (cond ((> effective-arg 0) - top-left) + top-left) ((< effective-arg 0) - bottom-right) + bottom-right) ((= effective-arg 0) - (windmove-coord-add - top-left - (let ((col-row - (posn-col-row - (posn-at-point (window-point window) window)))) - (cons (- (car col-row) (window-hscroll window)) - (cdr col-row))))))))) + (windmove-coord-add + top-left + ;; Don't care whether window is horizontally scrolled - + ;; `posn-at-point' handles that already. See also: + ;; http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00638.html + (posn-col-row + (posn-at-point (window-point window) window)))))))) ;; This uses the reference location in the current window (calculated ;; by `windmove-reference-loc' above) to find a reference location diff --git a/lisp/window.el b/lisp/window.el index 54e5ec9c74c..9122904b0bb 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3568,7 +3568,7 @@ specific buffers." )) ;;; Window states, how to get them and how to put them in a window. -(defun window--state-get-1 (window &optional ignore) +(defun window--state-get-1 (window &optional writable) "Helper function for `window-state-get'." (let* ((type (cond @@ -3585,29 +3585,22 @@ specific buffers." (normal-height . ,(window-normal-size window)) (normal-width . ,(window-normal-size window t)) (combination-limit . ,(window-combination-limit window)) - ,@(let (list) - ;; Make copies of persistent window parameters whose cdr - ;; is either t or, when IGNORE is non-nil, is either nil - ;; or `state'. - (dolist (pers window-persistent-parameters) - (when (and (consp pers) - (or (eq (cdr pers) t) - (and (memq (cdr pers) '(state nil)) - (not ignore)))) - (let ((par (assq (car pers) (window-parameters window)))) - (setq list (cons (cons (car pers) (when par (cdr par))) - list))))) - ;; Save `clone-of' parameter unless IGNORE or - ;; `window-persistent-parameters' prevail. - (when (and (not (assq 'clone-of (window-parameters window))) - (let ((clone-of - (assq 'clone-of - window-persistent-parameters))) - (when clone-of - (if ignore - (eq (cdr clone-of) t) - (memq (cdr clone-of) '(state nil)))))) - (setq list (cons (cons 'clone-of window) list))) + ,@(let ((parameters (window-parameters window)) + list) + ;; Make copies of those window parameters whose + ;; persistence property is `writable' if WRITABLE is + ;; non-nil and non-nil if WRITABLE is nil. + (dolist (par parameters) + (let ((pers (cdr (assq (car par) + window-persistent-parameters)))) + (when (and pers (or (not writable) (eq pers 'writable))) + (setq list (cons (cons (car par) (cdr par)) list))))) + ;; Add `clone-of' parameter if necessary. + (let ((pers (cdr (assq 'clone-of + window-persistent-parameters)))) + (when (and pers (or (not writable) (eq pers 'writable)) + (not (assq 'clone-of list))) + (setq list (cons (cons 'clone-of window) list)))) (when list `((parameters . ,list)))) ,@(when buffer @@ -3628,31 +3621,34 @@ specific buffers." (scroll-bars . ,(window-scroll-bars window)) (vscroll . ,(window-vscroll window)) (dedicated . ,(window-dedicated-p window)) - (point . ,(if ignore point (copy-marker point))) - (start . ,(if ignore start (copy-marker start))) + (point . ,(if writable point (copy-marker point))) + (start . ,(if writable start (copy-marker start))) ,@(when mark - `((mark . ,(if ignore + `((mark . ,(if writable mark (copy-marker mark)))))))))))) (tail (when (memq type '(vc hc)) (let (list) (setq window (window-child window)) (while window - (setq list (cons (window--state-get-1 window ignore) list)) + (setq list (cons (window--state-get-1 window writable) list)) (setq window (window-right window))) (nreverse list))))) (append head tail))) -(defun window-state-get (&optional window ignore) +(defun window-state-get (&optional window writable) "Return state of WINDOW as a Lisp object. WINDOW can be any window and defaults to the root window of the selected frame. -Optional argument IGNORE non-nil means do not use markers for -sampling positions like `window-point' or `window-start' and do -not record parameters unless `window-persistent-parameters' -requests it. IGNORE should be non-nil when the return value -shall be written to a file and read back in another session. +Optional argument WRITABLE non-nil means do not use markers for +sampling `window-point' and `window-start'. Together, WRITABLE +and the variable `window-persistent-parameters' specify which +window parameters are saved by this function. WRITABLE should be +non-nil when the return value shall be written to a file and read +back in another session. Otherwise, an application may run into +an `invalid-read-syntax' error while attempting to read back the +value from file. The return value can be used as argument for `window-state-put' to put the state recorded here into an arbitrary window. The @@ -3678,7 +3674,7 @@ value can be also stored on disk and read back in a new session." ;; These are probably not needed. ,@(when (window-size-fixed-p window) `((fixed-height . t))) ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) - (window--state-get-1 window ignore))) + (window--state-get-1 window writable))) (defvar window-state-put-list nil "Helper variable for `window-state-put'.") @@ -3757,15 +3753,13 @@ value can be also stored on disk and read back in a new session." (state (cdr (assq 'buffer item)))) (when combination-limit (set-window-combination-limit window combination-limit)) - ;; Assign saved window parameters. If a parameter's value is nil, - ;; don't assign it unless the new window has it set already (which - ;; shouldn't happen unless some `window-configuration-change-hook' - ;; function installed it). + ;; Reset window's parameters and assign saved ones (we might want + ;; a `remove-window-parameters' function here). + (dolist (parameter (window-parameters window)) + (set-window-parameter window (car parameter) nil)) (when parameters (dolist (parameter parameters) - (when (or (cdr parameter) - (window-parameter window (car parameter))) - (set-window-parameter window (car parameter) (cdr parameter))))) + (set-window-parameter window (car parameter) (cdr parameter)))) ;; Process buffer related state. (when state ;; We don't want to raise an error here so we create a buffer if diff --git a/src/ChangeLog b/src/ChangeLog index aa4e92b4134..c8b1e654830 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,25 @@ +2012-01-21 Chong Yidong <cyd@gnu.org> + + * floatfns.c (Fcopysign): Make the second argument non-optional, + since nil is not allowed anyway. + +2012-01-21 Andreas Schwab <schwab@linux-m68k.org> + + * process.c (read_process_output): Use p instead of XPROCESS (proc). + (send_process): Likewise. + +2012-01-19 Martin Rudalics <rudalics@gmx.at> + + * window.c (save_window_save, Fcurrent_window_configuration) + (Vwindow_persistent_parameters): Do not use Qstate. Rewrite + doc-strings. + +2012-01-19 Kenichi Handa <handa@m17n.org> + + * character.c (char_width): New function. + (Fchar_width, c_string_width, lisp_string_width): + Use char_width (Bug#9496). + 2012-01-16 Martin Rudalics <rudalics@gmx.at> * window.c (Vwindow_persistent_parameters): New variable. diff --git a/src/character.c b/src/character.c index a2cb416d770..593fbcece0b 100644 --- a/src/character.c +++ b/src/character.c @@ -308,6 +308,31 @@ If the multibyte character does not represent a byte, return -1. */) } } + +/* Return width (columns) of C considering the buffer display table DP. */ + +static int +char_width (int c, struct Lisp_Char_Table *dp) +{ + int width = CHAR_WIDTH (c); + + if (dp) + { + Lisp_Object disp = DISP_CHAR_VECTOR (dp, c), ch; + int i; + + if (VECTORP (disp)) + for (i = 0, width = 0; i < ASIZE (disp); i++) + { + ch = AREF (disp, i); + if (CHARACTERP (ch)) + width += CHAR_WIDTH (XFASTINT (ch)); + } + } + return width; +} + + DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0, doc: /* Return width of CHAR when displayed in the current buffer. The width is measured by how many columns it occupies on the screen. @@ -315,21 +340,11 @@ Tab is taken to occupy `tab-width' columns. usage: (char-width CHAR) */) (Lisp_Object ch) { - Lisp_Object disp; int c, width; - struct Lisp_Char_Table *dp = buffer_display_table (); CHECK_CHARACTER (ch); c = XINT (ch); - - /* Get the way the display table would display it. */ - disp = dp ? DISP_CHAR_VECTOR (dp, c) : Qnil; - - if (VECTORP (disp)) - width = sanitize_char_width (ASIZE (disp)); - else - width = CHAR_WIDTH (c); - + width = char_width (c, buffer_display_table ()); return make_number (width); } @@ -350,22 +365,9 @@ c_string_width (const unsigned char *str, EMACS_INT len, int precision, while (i_byte < len) { - int bytes, thiswidth; - Lisp_Object val; + int bytes; int c = STRING_CHAR_AND_LENGTH (str + i_byte, bytes); - - if (dp) - { - val = DISP_CHAR_VECTOR (dp, c); - if (VECTORP (val)) - thiswidth = sanitize_char_width (ASIZE (val)); - else - thiswidth = CHAR_WIDTH (c); - } - else - { - thiswidth = CHAR_WIDTH (c); - } + int thiswidth = char_width (c, dp); if (precision > 0 && (width + thiswidth > precision)) @@ -447,18 +449,7 @@ lisp_string_width (Lisp_Object string, EMACS_INT precision, else c = str[i_byte], bytes = 1; chars = 1; - if (dp) - { - val = DISP_CHAR_VECTOR (dp, c); - if (VECTORP (val)) - thiswidth = sanitize_char_width (ASIZE (val)); - else - thiswidth = CHAR_WIDTH (c); - } - else - { - thiswidth = CHAR_WIDTH (c); - } + thiswidth = char_width (c, dp); } if (precision <= 0) diff --git a/src/floatfns.c b/src/floatfns.c index c44784f2120..305c78cae63 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -294,7 +294,7 @@ DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, } #ifdef HAVE_COPYSIGN -DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0, +DEFUN ("copysign", Fcopysign, Scopysign, 2, 2, 0, doc: /* Copy sign of X2 to value of X1, and return the result. Cause an error if X1 or X2 is not a float. */) (Lisp_Object x1, Lisp_Object x2) diff --git a/src/process.c b/src/process.c index 3dc753f5159..bdf16b7dbd2 100644 --- a/src/process.c +++ b/src/process.c @@ -5060,9 +5060,8 @@ read_process_output (Lisp_Object proc, register int channel) proc_buffered_char[channel] = -1; } #ifdef HAVE_GNUTLS - if (XPROCESS (proc)->gnutls_p) - nbytes = emacs_gnutls_read (XPROCESS (proc), - chars + carryover + buffered, + if (p->gnutls_p) + nbytes = emacs_gnutls_read (p, chars + carryover + buffered, readmax - buffered); else #endif @@ -5527,9 +5526,8 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, #endif { #ifdef HAVE_GNUTLS - if (XPROCESS (proc)->gnutls_p) - written = emacs_gnutls_write (XPROCESS (proc), - buf, this); + if (p->gnutls_p) + written = emacs_gnutls_write (p, buf, this); else #endif written = emacs_write (outfd, buf, this); diff --git a/src/window.c b/src/window.c index 3ee731e60bf..a3b58d648a1 100644 --- a/src/window.c +++ b/src/window.c @@ -59,7 +59,7 @@ static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; static Lisp_Object Qsafe, Qabove, Qbelow; -static Lisp_Object Qauto_buffer_name, Qclone_of, Qstate; +static Lisp_Object Qauto_buffer_name, Qclone_of; static int displayed_window_lines (struct window *); static struct window *decode_window (Lisp_Object); @@ -5894,9 +5894,8 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) tem = XCDR (tem)) { pers = XCAR (tem); - /* Save values for persistent window parameters whose cdr - is either nil or t. */ - if (CONSP (pers) && (NILP (XCDR (pers)) || EQ (XCDR (pers), Qt))) + /* Save values for persistent window parameters. */ + if (CONSP (pers) && !NILP (XCDR (pers))) { par = Fassq (XCAR (pers), w->window_parameters); if (NILP (par)) @@ -5971,7 +5970,9 @@ and for each displayed buffer, where display starts, and the positions of point and mark. An exception is made for point in the current buffer: its value is -not- saved. This also records the currently selected frame, and FRAME's focus -redirection (see `redirect-frame-focus'). */) +redirection (see `redirect-frame-focus'). The variable +`window-persistent-parameters' specifies which window parameters are +saved by this function. */) (Lisp_Object frame) { register Lisp_Object tem; @@ -6509,7 +6510,6 @@ syms_of_window (void) DEFSYM (Qbelow, "below"); DEFSYM (Qauto_buffer_name, "auto-buffer-name"); DEFSYM (Qclone_of, "clone-of"); - DEFSYM (Qstate, "state"); staticpro (&Vwindow_list); @@ -6621,28 +6621,28 @@ function `set-window-combination-limit'. */); DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters, doc: /* Alist of persistent window parameters. -Parameters in this list are saved by `current-window-configuration' and -`window-state-get' and subsequently restored to their previous values by -`set-window-configuration' and `window-state-put'. +This alist specifies which window parameters shall get saved by +`current-window-configuration' and `window-state-get' and subsequently +restored to their previous values by `set-window-configuration' and +`window-state-put'. The car of each entry of this alist is the symbol specifying the parameter. The cdr is one of the following: -The symbol `state' means the parameter is saved by `window-state-get' -provided its IGNORE argument is nil. `current-window-configuration' -does not save this parameter. +nil means the parameter is neither saved by `window-state-get' nor by +`current-window-configuration'. -nil means the parameter is saved by `current-window-configuration' and, -provided its IGNORE argument is nil, by `window-state-get'. +t means the parameter is saved by `current-window-configuration' and, +provided its WRITABLE argument is nil, by `window-state-get'. -t means the parameter is saved unconditionally by both -`current-window-configuration' and `window-state-get'. Parameters -without read syntax (like windows or frames) should not use that. +The symbol `writable' means the parameter is saved unconditionally by +both `current-window-configuration' and `window-state-get'. Do not use +this value for parameters without read syntax (like windows or frames). Parameters not saved by `current-window-configuration' or `window-state-get' are left alone by `set-window-configuration' respectively are not installed by `window-state-put'. */); - Vwindow_persistent_parameters = list1 (Fcons (Qclone_of, Qstate)); + Vwindow_persistent_parameters = list1 (Fcons (Qclone_of, Qt)); defsubr (&Sselected_window); defsubr (&Sminibuffer_window); |
