+2014-01-29 Glenn Morris <rgm@gnu.org>
+
+ * killing.texi (Deletion): Mention cycle-spacing.
+
+2014-01-28 Glenn Morris <rgm@gnu.org>
+
+ * text.texi (Fill Commands): Mention fill-single-char-nobreak-p.
+
+ * indent.texi (Tab Stops): Updates for new tab-stop behavior.
+
+2014-01-27 Glenn Morris <rgm@gnu.org>
+
+ * dired.texi (Misc Dired Features): Copyedits for hide-details.
+
+ * buffers.texi (List Buffers): Tiny edit.
+
+ * calendar.texi (Time Intervals): Update for files in ~/.emacs.d/.
+
2014-01-26 Glenn Morris <rgm@gnu.org>
* ack.texi (Acknowledgments):
@kindex C-x C-b
@findex list-buffers
To display a list of existing buffers, type @kbd{C-x C-b}. Each
-line in the list shows one buffer's name, major mode and visited file.
+line in the list shows one buffer's name, size, major mode and visited file.
The buffers are listed in the order that they were current; the
buffers that were current most recently come first.
then, only an explicit @kbd{M-x timeclock-out} or @kbd{M-x
timeclock-change} will tell Emacs that the current interval is over.
-@cindex @file{.timelog} file
+@cindex @file{timelog} file
@vindex timeclock-file
@findex timeclock-reread-log
The timeclock functions work by accumulating the data in a file
-called @file{.timelog} in your home directory. You can specify a
+called @file{~/.emacs.d/timelog}. You can specify a
different name for this file by customizing the variable
@code{timeclock-file}. If you edit the timeclock file manually, or if
you change the value of any of timeclock's customizable variables, you
a regular expression search. @xref{Repeat Isearch}, for information
about search repetition.
-@cindex Adding to the kill ring in Dired.
+@cindex adding to the kill ring in Dired
@kindex w @r{(Dired)}
@findex dired-copy-filename-as-kill
The command @kbd{w} (@code{dired-copy-filename-as-kill}) puts the
it added to the kill ring, so you can use it to display the list of
currently marked files in the echo area.
+@kindex ( @r{(Dired)}
+@findex dired-hide-details-mode
+@vindex dired-hide-details-hide-symlink-targets
+@vindex dired-hide-details-hide-information-lines
+@cindex hiding details in Dired
+ The command @kbd{(} (@code{dired-hide-details-mode}) toggles whether
+details, such as ownership or file permissions, are visible in the
+current Dired buffer. By default, it also hides the targets of
+symbolic links, and all lines other than the header line and
+file/directory listings. To change this, customize the options
+@code{dired-hide-details-hide-symlink-targets} and
+@code{dired-hide-details-hide-information-lines}, respectively.
+
@cindex Dired and version control
If the directory you are visiting is under version control
(@pxref{Version Control}), then the normal VC diff and log commands
to the file in that directory. Precisely which action is taken is
determined by the originating program. Dragging files out of a Dired
buffer is currently not supported.
-
-@kindex ( @r{(Dired)}
-@c )
-@findex dired-hide-details-mode
-@vindex dired-hide-details-hide-symlink-targets
-@vindex dired-hide-details-hide-information-lines
-@cindex Hide details in Dired.
- The command @kbd{(} (@code{dired-hide-details-mode}) toggles whether
-details, such as ownership or file permissions, are hidden. If the
-variable @code{dired-hide-details-hide-symlink-targets} is
-non-@code{nil} then targets of symbolic links are hidden as well. A
-non-@code{nil} value for the variable
-@code{dired-hide-details-hide-information-lines} means that all lines
-other than the header and lines containing files and directories are
-hidden.
Emacs defines certain column numbers to be @dfn{tab stops}. These
are used as stopping points by @key{TAB} when inserting whitespace in
Text mode and related modes (@pxref{Indentation}), and by commands
-like @kbd{M-i} (@pxref{Indentation Commands}). By default, tab stops
-are located every 8 columns. These positions are stored in the
-variable @code{tab-stop-list}, whose value is a list of column numbers
-in increasing order.
+like @kbd{M-i} (@pxref{Indentation Commands}). The variable
+@code{tab-stop-list} controls these positions. The default value
+is @code{nil}, which means a tab stop every 8 columns. The value
+can also be a list of column numbers (in increasing order) at which to
+place tab stops. Emacs extends the list forever by repeating the
+difference between the last and next-to-last elements.
@findex edit-tab-stops
@kindex C-c C-c @r{(Edit Tab Stops)}
@noindent
The first line contains a colon at each tab stop. The numbers on the
-next two lines are present just to indicate where the colons are. It
-is implicitly extended to infinity by repeating the last step.
+next two lines are present just to indicate where the colons are.
+If the value of @code{tab-stop-list} is @code{nil}, as it is by default,
+no colons are displayed initially.
You can edit this buffer to specify different tab stops by placing
colons on the desired columns. The buffer uses Overwrite mode
-(@pxref{Minor Modes}). When you are done, type @kbd{C-c C-c} to make
+(@pxref{Minor Modes}). Remember that Emacs will extend the list of
+tab stops forever by repeating the difference between the last two
+explicit stops that you place. When you are done, type @kbd{C-c C-c} to make
the new tab stops take effect. Normally, the new tab stop settings
apply to all buffers. However, if you have made the
@code{tab-stop-list} variable local to the buffer where you called
delete all the text in the region if it is active (@pxref{Using
Region}).
-@c FIXME: `cycle-spacing' should be documented, too. (Maybe not in
-@c this node, tho.) --xfq
@kindex M-\
@findex delete-horizontal-space
@kindex M-SPC
@findex just-one-space
+@findex cycle-spacing
The other delete commands are those that delete only whitespace
characters: spaces, tabs and newlines. @kbd{M-\}
(@code{delete-horizontal-space}) deletes all the spaces and tab
(even if there were none before). With a numeric argument @var{n}, it
leaves @var{n} spaces before point if @var{n} is positive; if @var{n}
is negative, it deletes newlines in addition to spaces and tabs,
-leaving @var{-n} spaces before point.
+leaving @var{-n} spaces before point. The command @code{cycle-spacing}
+acts like a more flexible version of @code{just-one-space}. It
+does different things if you call it repeatedly in succession.
+The first call acts like @code{just-one-space}, the next removes
+all whitespace, and a third call restores the original whitespace.
@kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines
after the current line. If the current line is blank, it deletes all
(@pxref{Hooks}). Each function in this hook is called with no
arguments, with point positioned where Emacs is considering breaking a
line. If a function returns a non-@code{nil} value, Emacs will not
-break the line there. Two functions you can use are
+break the line there. Functions you can use there include:
@code{fill-single-word-nobreak-p} (don't break after the first word of
-a sentence or before the last) and @code{fill-french-nobreak-p} (don't
-break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}).
+a sentence or before the last); @code{fill-single-char-nobreak-p}
+(don't break after a one-letter word); and @code{fill-french-nobreak-p}
+(don't break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}).
@node Fill Prefix
@subsection The Fill Prefix
+2014-01-28 Glenn Morris <rgm@gnu.org>
+
+ * text.texi (Indent Tabs): Update related to tab-stops.
+
2014-01-24 Glenn Morris <rgm@gnu.org>
* control.texi (Handling Errors): Update with-demoted-errors.
@code{nil}.
@end deffn
+@c There is also cycle-spacing, but I cannot see it being useful in
+@c Lisp programs, so it is not mentioned here.
+
@deffn Command delete-blank-lines
This function deletes blank lines surrounding point. If point is on a
blank line with one or more blank lines before or after it, then all but
@deffn Command tab-to-tab-stop
This command inserts spaces or tabs before point, up to the next tab
-stop column defined by @code{tab-stop-list}. It searches the list for
-an element greater than the current column number, and uses that element
-as the column to indent to. It does nothing if no such element is
-found.
+stop column defined by @code{tab-stop-list}.
@end deffn
@defopt tab-stop-list
-This variable is the list of tab stop columns used by
-@code{tab-to-tab-stops}. The elements should be integers in increasing
-order. The tab stop columns need not be evenly spaced.
-
-Use @kbd{M-x edit-tab-stops} to edit the location of tab stops
-interactively.
+This variable defines the tab stop columns used by @code{tab-to-tab-stop}.
+It should be either @code{nil}, or a list of increasing integers,
+which need not be evenly spaced. The list is implicitly
+extended to infinity through repetition of the interval between the
+last and penultimate elements (or @code{tab-width} if the list has
+fewer than two elements). A value of @code{nil} means a tab stop
+every @code{tab-width} columns.
+
+Use @kbd{M-x edit-tab-stops} to edit the location of tab stops interactively.
@end defopt
@node Motion by Indent
+2014-01-27 Glenn Morris <rgm@gnu.org>
+
+ * idlwave.texi (Lesson III---User Catalog, Online Help)
+ (Starting the Shell, Catalogs, User Catalog):
+ * remember.texi (Quick Start):
+ * viper.texi:
+ * vip.texi (Customization, Customizing Constants)
+ (Customizing Key Bindings): Update for files being in ~/.emacs.d/.
+
2014-01-25 Xue Fuqiao <xfq.free@gmail.com>
* cc-mode.texi (Minor Modes): Minor fix.
selected by default) and click on the @samp{Scan&Save} button. Then
go for a cup of coffee while IDLWAVE collects information for each and
every IDL routine on your search path. All this information is
-written to the file @file{.idlwave/idlusercat.el} in your home
-directory and will from now on automatically load whenever you use
+written to the file @file{~/.emacs.d/idlwave/idlusercat.el}
+and will from now on automatically load whenever you use
IDLWAVE@. You may find it necessary to rebuild the catalog on occasion
as your local libraries change, or build a library catalog for those
directories instead. Invoke routine info (@kbd{C-c ?}) or completion
information. By default, IDLWAVE automatically attempts to convert this
XML catalog into a format Emacs can more easily understand, and caches
this information in your @code{idlwave_config_directory}
-(@file{~/.idlwave/}, by default). It also re-scans the XML catalog if
+(@file{~/.emacs.d/idlwave/}, by default). It also re-scans the XML catalog if
it is newer than the current cached version. You can force rescan with
the menu entry @code{IDLWAVE->Routine Info->Rescan XML Help Catalog}.
Non-@code{nil} means preserve command history between sessions.
@end defopt
-@defopt idlwave-shell-command-history-file (@file{~/.idlwave/.idlwhist})
+@defopt idlwave-shell-command-history-file (@file{~/.emacs.d/idlwave/.idlwhist})
The file in which the command history of the idlwave shell is saved.
Unless it's an absolute path, it goes in
@code{idlwave-config-directory}.
to setup directories for user catalog scan (@pxref{User Catalog} for
more on this variable). Note that, before the shell is running, IDLWAVE
can only know about the IDL search path by consulting the file pointed
-to by @code{idlwave-path-file} (@file{~/.idlwave/idlpath.el}, by
+to by @code{idlwave-path-file} (@file{~/.emacs.d/idlwave/idlpath.el}, by
default). If @code{idlwave-auto-write-path} is enabled (which is the
default), the paths are written out whenever the IDLWAVE shell is
started.
Unix/MacOSX, will be obtained from the Shell and recorded, if run.
@end defopt
-@defopt idlwave-config-directory (@file{~/.idlwave})
+@defopt idlwave-config-directory (@file{~/.emacs.d/idlwave})
Default path where IDLWAVE saves configuration information, a user
catalog (if any), and a cached scan of the XML catalog (IDL v6.2 and
later).
The user catalog is the old routine catalog system. It is produced
within Emacs, and stored in a single file in the user's home directory
-(@file{.idlwave/idlusercat.el} by default). Although library catalogs
+(@file{.emacs.d/idlwave/idlusercat.el} by default). Although library catalogs
are more flexible, there may be reasons to prefer a user catalog
instead, including:
the @samp{*Remember*} buffer.
@end itemize
-By default, @code{remember-finalize} saves the note in @file{~/.notes}.
+By default, @code{remember-finalize} saves the note in @file{~/emacs.d/notes}.
You can edit it now to see the remembered and timestamped note. You
can edit this file however you want. New entries will always be added
to the end.
initial contents.
As a simple beginning, you can start by using the Text File backend,
-keeping your @file{~/.notes} file in outline-mode format, with a final
+keeping your @file{~/.emacs.d/notes} file in outline-mode format, with a final
entry called @samp{* Raw data}. Remembered data will be added to the
end of the file. Every so often, you can move the data that gets
appended there into other files, or reorganize your document.
@node Customization
@chapter Customization
-If you have a file called @file{.vip} in your home directory, then it
+If you have a file called @file{~/.emacs.d/vip} (or @file{~/.vip}), then it
will also be loaded when VIP is loaded. This file is thus useful for
customizing VIP.
@end table
@noindent
You can reset these constants in VIP by the Ex command @kbd{set}. Or you
-can include a line like this in your @file{.vip} file:
+can include a line like this in your @file{~/.emacs.d/vip} file:
@example
(setq vip-case-fold-search t)
@end example
VIP uses @code{vip-command-mode-map} as the @dfn{local keymap} for vi mode.
For example, in vi mode, @key{SPC} is bound to the function
@code{vip-scroll}. But, if you wish to make @key{SPC} and some other keys
- behave like Vi, you can include the following lines in your @file{.vip}
-file.
+ behave like Vi, you can include the following lines in your
+@file{~/.emacs.d/vip} file.
@example
(define-key vip-command-mode-map "\C-g" 'vip-info-on-file)
in some cases, especially in the Vi Insert state. John Hawkins
<jshawkin@@eecs.umich.edu> has provided a set of customizations, which
enables additional Emacs bindings under Viper. These customizations can be
-included in your @file{~/.viper} file and are found at the following URL:
-@file{http://traeki.freeshell.org/files/viper-sample}.
+included in your @file{~/.emacs.d/viper} file and are found at the
+following URL: @file{http://traeki.freeshell.org/files/viper-sample}.
@menu
* Emacs Preliminaries:: Basic concepts in Emacs.
version 20.0, Emacsen have an interactive interface, which simplifies the
job of customization significantly.
-Viper also uses the file @file{~/.viper} for Viper-specific customization.
+Viper also uses the file @file{~/.emacs.d/viper} for Viper-specific customization.
The location of Viper customization file can be changed by setting the
variable @code{viper-custom-file-name} in @file{.emacs} @emph{prior} to loading
Viper.
The latest versions of Emacs have an interactive customization facility,
which allows you to (mostly) bypass the use of the @file{.emacs} and
-@file{.viper} files. You can reach this customization
+@code{viper-custom-file-name} files. You can reach this customization
facility from within Viper's VI state by executing the Ex command
@kbd{:customize}.
need for deleting file names that Emacs provides in its prompts. (This is
usually convenient, but occasionally the prompt may suggest a wrong file
name for you.) If you see a prompt @kbd{/usr/foo/} and you wish to edit the
-file @kbd{~/.viper}, you don't have to erase the prompt. Instead, simply
-continue typing what you need. Emacs will interpret @kbd{/usr/foo/~/.viper}
+file @kbd{~/.file}, you don't have to erase the prompt. Instead, simply
+continue typing what you need. Emacs will interpret @kbd{/usr/foo/~/.file}
correctly. Similarly, if the prompt is @kbd{~/foo/} and you need to get to
@kbd{/bar/file}, keep typing. Emacs interprets @kbd{~/foo//bar/} as
@kbd{/bar/file}, since when it sees @samp{//}, it understands that
Initially, the minibuffer comes up in Insert state.
Some users prefer plain Emacs bindings in the minibuffer. To this end, set
-@code{viper-vi-style-in-minibuffer} to @code{nil} in @file{.viper}.
-@xref{Customization}, to learn how to do this.
+@code{viper-vi-style-in-minibuffer} to @code{nil} in
+your Viper customization file. @xref{Customization}, to learn how to do this.
When the minibuffer changes Viper states, you will notice that the appearance
of the text there changes as well. This is useful because the minibuffer
(@pxref{Multiple Files in Viper}). In addition to the files, Emacs has
buffers. These can be seen in the @kbd{:args} list and switched using
@kbd{:next} if you type @kbd{:set ex-cycle-through-non-files t}, or
-specify @code{(setq ex-cycle-through-non-files t)} in your @file{.viper}
-file. @xref{Customization}, for details.
+specify @code{(setq ex-cycle-through-non-files t)} in your
+Viper customization file. @xref{Customization}, for details.
@node Undo and Backups
@section Undo and Backups
@cindex word search
Viper provides buffer search, the ability to search the buffer for a region
-under the cursor. You have to turn this on in @file{.viper} either by calling
+under the cursor. You have to turn this on in your Viper customization file
+either by calling
@example
(viper-buffer-search-enable)
@end example
@vindex @code{viper-search-face}
@noindent
-in @file{~/.viper}. If you want to change how patterns are highlighted, you
-will have to change @code{viper-search-face} to your liking. The easiest
-way to do this is to use Emacs customization widget, which is accessible
-from the menubar. Viper customization group is located under the
+in your Viper customization file. If you want to change how patterns are
+highlighted, you will have to change @code{viper-search-face} to your liking.
+The easiest way to do this is to use Emacs customization widget, which is
+accessible from the menubar. Viper customization group is located under the
@emph{Emulations} customization group, which in turn is under the
@emph{Editing} group (or simply by typing @kbd{:customize}). All Viper
faces are grouped together under Viper's
Viper can be set free from the line--limited movements in Vi, such as @kbd{l}
refusing to move beyond the line, @key{ESC} moving one character back,
-etc. These derive from Ex, which is a line editor. If your @file{.viper}
-contains
+etc. These derive from Ex, which is a line editor. If your
+Viper customization file contains
@example
@code{(setq viper-ex-style-motion nil)}
hit @kbd{C-x} followed by @kbd{2}, then the current window will be split
into 2. Except for novice users, @kbd{C-c} is also set to execute an Emacs
command from the current major mode. @key{ESC} will do the same, if you
-configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to @code{nil}
-in @file{.viper}. @xref{Customization}. @kbd{C-\} in Insert, Replace, or Vi
-states will make Emacs think @kbd{Meta} has been hit.
+configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to
+@code{nil} in your Viper customization file. @xref{Customization}.
+@kbd{C-\} in Insert, Replace, or Vi states will make Emacs think
+@kbd{Meta} has been hit.
@item \
@kindex @kbd{\}
Escape to Emacs to execute a single Emacs command. For instance,
@item
@cindex initialization
@cindex .viper
-Elisp code in a @file{.viper} file in your home directory. Viper
-loads @file{.viper} just before it does the binding for mode
-hooks. This is recommended for experts only.
+Elisp code in a @file{~/.emacs.d/viper} (or @file{~/.viper}) file.
+Viper loads this file just before it does the binding for mode hooks.
+This is recommended for experts only.
@item
@cindex .emacs
Elisp code in your @file{.emacs} file before and after the @code{(require
customizable variables easily. This method is good for novice and
experts alike. The customization code in the form of Lisp commands will be
placed in @file{~/.emacs} or some other customization file depending on the
-version of Emacs that you use. Still, it is recommended to separate
+version of Emacs that you use. Still, it is recommended to separate
Viper-related customization produced by the Emacs customization widget
-and keep it in the @file{.viper} file.
+and keep it in your Viper customization file.
Some advanced customization cannot be accomplished this way, however, and
-has to be done in Emacs Lisp in the @file{.viper} file. For the common
+has to be done in Emacs Lisp in your Viper customization file. For the common
cases, examples are provided that you can use directly.
@end itemize
for each buffer (or you can add @code{viper-mode} to the appropriate major mode
hooks using @code{viper-load-hook}).
-This option must be set in the file @file{~/.viper}.
-@item viper-custom-file-name "~/.viper"
+This option must be set in your Viper customization file.
+@item viper-custom-file-name "~/.emacs.d/viper"
File used for Viper-specific customization.
-Change this setting, if you want. Must be set in @file{.emacs} (not @file{.viper}!)
+Change this setting, if you want. Must be set in @file{.emacs}
before Viper is loaded. Note that you
have to set it as a string inside double quotes.
@item viper-spell-function 'ispell-region
@code{viper-repeat-from-history},
which checks the second key by which it is invoked to see which of the
previous commands to invoke. Viper binds @kbd{f12 1} and @kbd{f12 2} only,
-but the user can bind more in @file{~/.viper}. @xref{Vi Macros}, for how to do
-this.
+but the user can bind more in his/her Viper customization file.
+@xref{Vi Macros}, for how to do this.
@item viper-keep-point-on-undo nil
If not @code{nil}, Viper tries to not move point when undoing commands.
Instead, it will briefly move the cursor to the place where change has
replacement regions (and multi-line replacement regions are deleted).
@item viper-toggle-key "\C-z"
Specifies the key used to switch from Emacs to Vi and back.
-Must be set in @file{.viper}. This variable can't be
+Must be set in your Viper customization file. This variable can't be
changed interactively after Viper is loaded.
In Insert state, this key acts as a temporary escape to Vi state, i.e., it
@noindent
You can reset some of these constants in Viper with the Ex command @kbd{:set}
(when so indicated in the table). Or you
-can include a line like this in your @file{.viper} file:
+can include a line like this in your Viper customization file:
@example
(setq viper-case-fold-search t)
@end example
If you want to
bind a key, say @kbd{C-v}, to the function that scrolls
page down and to make @kbd{0} display information on the current buffer,
-putting this in @file{.viper} will do the trick in Vi state:
+putting this in your Viper customization file will do the trick in Vi state:
@example
(define-key viper-vi-global-user-map "\C-v" 'scroll-down)
@end example
@end example
@noindent
-in @file{~/.viper}. To do the same in Vi and Insert states, you should use
-@code{vi-state} and @code{insert-state}. Changes in Insert state are also
-in effect in Replace state. For instance, suppose that the user wants to
-use @kbd{dd} in Vi state under Dired mode to delete files, @kbd{u} to unmark
-files, etc. The following code in @file{~/.viper} will then do the job:
+in your Viper customization file. To do the same in Vi and Insert states, you
+should use @code{vi-state} and @code{insert-state}. Changes in Insert state
+are also in effect in Replace state. For instance, suppose that the user wants
+to use @kbd{dd} in Vi state under Dired mode to delete files, @kbd{u} to unmark
+files, etc. The following code in the Viper customization file will then do
+the job:
@example
(setq my-dired-modifier-map (make-sparse-keymap))
several such minor modes and takes care of them, so the above trick
is usually not necessary. If you find that some minor mode, e.g.,
@code{nasty-mode} interferes with Viper, putting the following in
-@file{.viper} should fix the problem:
+your Viper customization file should fix the problem:
@lisp
(viper-harness-minor-mode "nasty-mode")
@end lisp
@item viper-buffer-search-char nil
Enable buffer search. Explicit call to @code{viper-buffer-search-enable}
sets @code{viper-buffer-search-char} to @kbd{g}. Alternatively, the user can
-set @code{viper-buffer-search-char} in @file{.viper} to a key sequence
-to be used for buffer search. There is no need to call
+set @code{viper-buffer-search-char} in his/her Viper customization file to a key
+sequence to be used for buffer search. There is no need to call
@code{viper-buffer-search-enable} in that case.
@findex @code{viper-buffer-search-enable}
@vindex @code{viper-buffer-search-char}
second @kbd{/} doesn't follow quickly enough, then Viper will issue the
usual prompt @kbd{/} and will wait for input, as usual in Vi.
If you don't like this behavior, you can ``unrecord'' these macros in your
-@file{~/.viper} file. For instance, if you don't like the above feature, put
-this in @file{~/.viper}:
+Viper customization file. For instance, if you don't like the above
+feature, put this in the file:
@example
(viper-set-searchstyle-toggling-macros 'undefine)
@end example
in succession
will undo the previous insertion from the ring and insert the next item on
the ring. If a larger ring size is needed, change the value of the above
-variable in the @file{~/.viper} file.
+variable in the Viper customization file.
Since typing these sequences of keys may be tedious, it is suggested that the
user should bind a function key, such as @kbd{f31}, as follows:
(copy-face 'default 'viper-minibuffer-insert-face)
(copy-face 'default 'viper-minibuffer-emacs-face)
@end example
-in the @file{~/.viper} file or through the customization widget, as
+in their Viper customization file or through the customization widget, as
described above. However, in that case, the user will not have any
indication of the current Viper state in the minibuffer. (This is important
if the user accidentally switches to another Viper state by typing @key{ESC} or
not already bound to something else. If you want to use the mouse-search
feature, and the @kbd{Meta-Shift-Mouse-1} mouse action is already bound to
something else, you can rebind the mouse-search feature by setting
-@code{viper-mouse-search-key} to something else in your @code{~/.viper}
-file:
+@code{viper-mouse-search-key} to something else in
+your Viper customization file:
@lisp
(setq viper-mouse-search-key '(meta 1))
@end lisp
If the requested mouse action (e.g., (meta 1)) is already taken for other
purposes then you have to confirm your intention by placing the following
-command in @code{~/.viper} after setting @code{viper-mouse-search-key}:
+command in your Viper customization file after setting
+@code{viper-mouse-search-key}:
@lisp
(viper-bind-mouse-search-key 'force)
@end lisp
Note: while loading initially, Viper binds this mouse action only if it not
already bound to something else. If you want to use this feature and the
default mouse action is already bound, you can rebind mouse-insert by
-placing this command in @code{~/.viper}:
+placing this command in your Viper customization file:
@lisp
(setq viper-mouse-insert-key '(meta 2))
@end lisp
If you want to bind mouse-insert to an action even if this action is
already taken for other purposes in Emacs, then you should add this command
-to @code{~/.viper}, after setting @code{viper-mouse-insert-key}:
+to your Viper customization file, after setting @code{viper-mouse-insert-key}:
@lisp
(viper-bind-mouse-insert-key 'force)
@end lisp
When the user finishes defining a macro (which is done by typing @kbd{C-x)},
a departure from Vi), you will be asked whether you want this
macro to be global, mode-specific, or buffer-specific. You will also be
-given a chance to save the macro in your @file{~/.viper} file.
+given a chance to save the macro in your Viper customization file.
This is the easiest way to save a macro and make
it permanently available. If you work your startup files with bare hands,
here is how Viper saves the above macro so that it will be
For convenience, Viper also lets you define Vi-style macros in its Emacs
state. There is no Ex command, like @kbd{:map} and @kbd{:map!} for doing
-this, but the user can include such a macro in the @file{~/.viper} file. The
-only thing is that the @code{viper-record-kbd-macro} command should specify
+this, but the user can include such a macro in the Viper customization file.
+The only thing is that the @code{viper-record-kbd-macro} command should specify
@code{emacs-state} instead of @code{vi-state} or @code{insert-state}.
The user can get rid of a macro either by using the Ex commands @kbd{:unmap}
macro is executed. Suppose now we wanted to bind the key sequence
@kbd{f13 f13} to the command @code{eval-last-sexp}. To accomplish this, we
can type @kbd{M-x eval-last-sexp} followed by @kbd{C-x )}.
-If you answer positively to Viper's offer to save this macro in @file{~/.viper}
-for future uses, the following will be inserted in that file:
+If you answer positively to Viper's offer to save this macro in your
+Viper customization file for future uses, the following will be inserted
+in that file:
@example
(viper-record-kbd-macro [f16 f16] 'vi-state
recognized as a timeout macro is controlled by the variable
@code{viper-fast-keyseq-timeout}, which defaults to 200 milliseconds.
-For the most part, Viper macros defined in @file{~/.viper} can be shared
-between X and TTY modes.
+For the most part, Viper macros defined in the Viper customization file can
+be shared between X and TTY modes.
The problem with TTY may be that the function keys there generate sequences
of events instead of a single event (as under a window system).
Emacs maps some of these sequences back to the logical keys
Find the next bracket/parenthesis/brace and go to its match.
By default, Viper ignores brackets/parentheses/braces that occur inside
parentheses. You can change this by setting
-@code{viper-parse-sexp-ignore-comments} to @code{nil} in your @file{.viper} file.
+@code{viper-parse-sexp-ignore-comments} to @code{nil} in your Viper
+customization file.
This option can also be toggled interactively if you quickly hit @kbd{%%%}.
This latter feature is implemented as a vi-style keyboard macro. If you
@end example
@findex @code{viper-set-parsing-style-toggling-macro}
-in your @file{~/.viper} file.
+in your Viper customization file.
@end table
@kindex @kbd{%}
Since typing the above sequences of keys may be tedious, the
functions doing the perusing can be bound to unused keyboard keys in the
-@file{~/.viper} file. @xref{Viper Specials}, for details.
+Viper customization file. @xref{Viper Specials}, for details.
@end table
@kindex @kbd{C-c M-p}
@kindex @kbd{C-c M-n}
any file where this newline is missing. This is done by setting Emacs
variable @code{require-final-newline} to @code{t}. If you don't like this
feature, use @code{setq-default} to set @code{require-final-newline} to
-@code{nil}. This must be done in @file{.viper} file.
+@code{nil}. This must be done in the Viper customization file.
@item :[x,y] w <name>
Write to the file <name>.
@item :[x,y] w>> <name>
---
** The configure option `--with-crt-dir' has been removed.
-It is no longer needed, as the crt*.o files are no longer linked
-specially.
+It is no longer needed, as the crt*.o files are no longer linked specially.
---
** Directories passed to configure option `--enable-locallisppath' are
** `emacs-bzr-version' has been renamed to `emacs-repository-version',
and works for git too, if you fetch the repository notes.
-** New user options:
-
-*** `read-regexp-defaults-function' defines a function to read regexps,
+** `read-regexp-defaults-function' defines a function to read regexps,
used by commands like `rgrep', `lgrep' `occur', `highlight-regexp', etc.
You can customize this to specify a function that provides a default
value from the regexp last history element, or from the symbol found
at point.
+++
-*** `load-prefer-newer' affects how the `load' function chooses the
-file to load. If this is non-nil, then when both .el and .elc
+** New option `load-prefer-newer' affects how the `load' function chooses
+the file to load. If this is non-nil, then when both .el and .elc
versions of a file exist, and the caller did not explicitly specify
which one to load, then the newer file is loaded. The default, nil,
means to always load the .elc file.
*** `electric-indent-mode' is enabled by default.
++++
*** `tab-stop-list' is now implicitly extended to infinity by repeating
the last step. Its default value is changed to nil, which means a tab
stop every `tab-width' columns.
-** Filling changes
-
-*** New command `cycle-spacing' cycles between spacing conventions:
-having just one space, no spaces, or reverting to the original
-spacing. Like `just-one-space', it can handle or ignore newlines and
-leave different number of spaces.
-
-*** `fill-single-char-nobreak-p' prevents fill from breaking a line after
-a 1-letter word, which is an error according to Polish and
-Czech typography rules. To globally enable this feature, evaluate:
++++
+** New command `cycle-spacing' acts like a smarter `just-one-space'.
+When called in succession, it cycles between spacing conventions:
+one space, no spaces, original spacing.
- (add-hook 'fill-nobreak-predicate 'fill-single-char-nobreak-p)
++++
+** The new function `fill-single-char-nobreak-p' can stop fill from breaking
+a line after a one-letter word, which is an error in some typographical
+conventions. To use it, add it to the `fill-nobreak-predicate' hook.
+++
** Uniquify is enabled by default, with `post-forward-angle-brackets' style.
\f
* Changes in Specialized Modes and Packages in Emacs 24.4
++++
** More packages look for ~/.emacs.d/<foo> additionally to ~/.<foo>.
Affected files:
~/.emacs.d/timelog replaces ~/.timelog
~/.emacs.d/ido.last replaces ~/.ido.last
~/.emacs.d/kkcrc replaces ~/.kkcrc
~/.emacs.d/quickurls replaces ~/.quickurls
-~/.emacs.d/idlwave replaces ~/.idlwave
+~/.emacs.d/idlwave/ replaces ~/.idlwave/
~/.emacs.d/bdfcache.el replaces ~/.bdfcache.el
~/.emacs.d/places replaces ~/.emacs-places
~/.emacs.d/shadows replaces ~/.shadows
*** New minor mode `jit-lock-debug-mode' lets you use the debuggers on
code run via JIT Lock.
-** Battery
-
---
-*** Battery information via the BSD `apm' utility is now supported.
-
-** Buffer Menu
+** Battery information can now be retrieved from BSD's `apm' utility.
-*** `M-s a C-o' shows lines matching a regexp in marked buffers using Occur.
+---
+** In the Buffer Menu, `M-s a C-o' shows matches for a regexp in marked buffers.
** Calendar and Diary
** Calc
++++
*** Calc by default now uses the Gregorian calendar for all dates, and
uses January 1, 1 AD as its day number 1. Previously Calc used the
Julian calendar for dates before September 14, 1752, and it used
December 31, 1 BC as its day number 1; the new scheme is more
consistent with Calendar's calendrical system and day numbering.
-*** The new variable `calc-gregorian-switch' lets you configure the
-date when Calc switches from the Julian to the Gregorian calendar.
-Nil, the default value, means to always use the Gregorian calendar.
-The value (YEAR MONTH DAY) means to start using the Gregorian calendar
-on the given date.
++++
+*** The new option `calc-gregorian-switch' lets you configure if
+(and when) Calc switches from the Julian to the Gregorian calendar.
++++
*** Support for ISO 8601 dates.
** CEDET
**** Improved detection of used namespaces in current scope in C++.
**** Parsing of default values for variables and function arguments in C/C++.
-They are also displayed by the summarize feature in the modeline.
+They are also displayed by the summarize feature in the mode line.
**** Improved parsing of function pointers in C/C++.
This also includes parsing of function pointers as function arguments.
-**** Parsing of C/C++ preprocessor macros which open new scope.
-For example, this enables parsing of macros which open new namespaces.
+**** Parsing of C/C++ preprocessor macros that open new scope.
+For example, this enables parsing of macros that open new namespaces.
**** Support for 'this' pointer in inline member functions in C++.
** CUA mode
*** CUA mode now uses `delete-selection-mode' and `shift-select-mode'.
-Hence, you can now enable it independently from `transient-mark-mode',
-`delete-selection-mode', and `shift-select-mode'.
+Hence, you can now enable it independently from those modes, and from
+`transient-mark-mode'.
+---
*** `cua-highlight-region-shift-only' is now obsolete.
You can disable `transient-mark-mode' to get the same result.
** CFEngine mode
+---
*** Support for completion, ElDoc, and Flycheck has been added.
+---
*** The current CFEngine syntax is parsed from "cf-promises -s json".
There is a fallback syntax available if you don't have cf-promises or
-if it doesn't support that option.
+if your version doesn't support that option. See option `cfengine-cf-promises'.
** Delete Selection mode can now be used without `transient-mark-mode'.
and `desktop-restore-forces-onscreen' offer further customization.
+++
-** Dired
-
-*** New minor mode `dired-hide-details-mode' hides details.
+** New Dired minor mode `dired-hide-details-mode' toggles whether details,
+such as file ownership or permissions, are visible.
** Eldoc Mode works properly in the minibuffer.
`electric-pair-text-syntax-table' to tweak pairing behavior inside
strings and comments.
-** EPA
-
-*** New option `epa-mail-aliases'.
+** New EPA option `epa-mail-aliases'.
You can set this to a list of alias expansions for keys to use
in `epa-mail-encrypt'.
is `foo@bar.com', ignore that name as regards encryption.
This is useful to avoid a query when you have no key for that name.
-** ERC
-
-*** New option `erc-accidental-paste-threshold-seconds'.
+** New ERC option `erc-accidental-paste-threshold-seconds'.
If set to a number, this can be used to avoid accidentally pasting large
amounts of data into the ERC input.
Tramp-using variants can still be used by enabling the eshell-tramp
module.
-** F90 mode
---
-*** New option `f90-smart-end-names'.
+** New F90 mode option `f90-smart-end-names'.
** Icomplete is a bit more like Ido.
** JS Mode
+---
+*** New option `js-switch-indent-offset'.
+
+---
*** Better indentation of multiple-variable declarations.
-If declaration spans several lines, variables on the following lines
+If a declaration spans several lines, variables on the following lines
are lined up to the first one.
-*** We now recognize and better indent continuations in array
-comprehensions.
-
-*** New option `js-switch-indent-offset`.
+---
+*** Recognition and better indentation of continuations in array comprehensions.
-** MH-E has been updated to MH-E version 8.5.
-See MH-E-NEWS for details.
++++
+** MH-E has been updated to version 8.5 - see separate MH-E-NEWS file.
+++
** Octave mode
that it matches symbols, and non-symbol characters between symbols.
+++
-** New SES command `ses-rename-cell' allows assigning names to SES cells.
+** New SES command `ses-rename-cell' allows assignment of names to SES cells.
---
** The shell.el option `explicit-bash-args' includes --noediting by default.
** Shell Script mode
-*** `sh-mode' now has its own setting for `add-log-current-defun-function'.
+---
+*** The SMIE indentation engine is now used by default - see `sh-use-smie'.
-*** The SMIE indentation engine is now used by default.
+---
+*** `sh-mode' now has its own setting for `add-log-current-defun-function'.
** SMIE indentation can be customized via `smie-config'.
Emacs can learn the appropriate indentation settings if you provide it
under current version control system. When called with a prefix
argument, you can remove a file from the ignored file list.
----
-*** `cvs-append-to-ignore' has been renamed to `vc-cvs-append-to-ignore'
-because it is moved to vc-cvs.el.
-
** VHDL mode
---
** The Woman commands `woman-default-faces' and `woman-monochrome-faces'
are obsolete. Customize the `woman-*' faces instead.
-** Obsolete packages:
+** Obsolete packages
*** Iswitchb is made obsolete by icomplete-mode.
** New hook `pre-redisplay-function'.
+++
-** New bool-vector set operation functions:
+** New bool-vector set operation functions
*** `bool-vector-exclusive-or'
*** `bool-vector-union'
*** `bool-vector-intersection'
** New library subr-x.el with miscellaneous small utility functions
*** `hash-table-keys'
*** `hash-table-values'
-*** `string-blank-p`
-*** `string-empty-p`
-*** `string-join`
-*** `string-reverse`
+*** `string-blank-p'
+*** `string-empty-p'
+*** `string-join'
+*** `string-reverse'
*** `string-trim-left'
*** `string-trim-right'
*** `string-trim'
*** `string-remove-suffix'
+++
-** Obsoleted functions:
+** Obsoleted functions
*** `log10'
*** `dont-compile'
*** `lisp-complete-symbol'
*** `frame-update-faces' (not needed)
*** `frame-update-face-colors' (`frame-set-background-mode')
*** `x-frob-font-weight' and `x-frob-font-slant' (`make-face-*' functions)
-*** `x-make-font-bold and x-make-font-demibold (`make-face-bold')
+*** `x-make-font-bold' and `x-make-font-demibold' (`make-face-bold')
*** `x-make-font-italic' and `x-make-font-oblique' (`make-face-italic')
*** `x-make-font-bold-italic' (`make-face-bold-italic')
*** `x-make-font-unbold' (`make-face-unbold')
More specifically do what's needed to make ibuffer.el the default,
or just an extension of buff-menu.el.
+** Replace linum.el with nlinum.el
+ http://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00379.html
+
** Use pcomplete by default in shell-mode.
This means to make it behave (by default) more like the current code.
Use it also for read-shell-command, M-x compile, ...
+2014-01-29 Glenn Morris <rgm@gnu.org>
+
+ * simple.el (just-one-space, cycle-spacing): Doc fixes.
+
+2014-01-28 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (fit-frame-to-buffer): Fix calculations for margins and
+ height constraints.
+
+2014-01-28 Luke Lee <luke.yx.lee@gmail.com>
+
+ * progmodes/hideif.el: Extend to full CPP expression syntax.
+ (hif-token-alist): Add missing tokens.
+ (hif-token-regexp): Add support for float/octal/hex immediates.
+ (hif-string-literal-regexp): New const.
+ (hif-tokenize): Recognize strings and float/octal/hex immediates.
+ (hif-exprlist): New function.
+ (hif-parse-if-exp): Use it.
+ (hif-logior-expr, hif-logxor-expr, hif-logand-expr, hif-comp-expr)
+ (hif-logshift-expr, hif-muldiv-expr, hif-lognot, hif-shiftleft)
+ (hif-shiftright, hif-multiply, hif-divide, hif-modulo, hif-equal)
+ (hif-logxor, hif-comma): New functions.
+
+2014-01-28 Glenn Morris <rgm@gnu.org>
+
+ * textmodes/fill.el (fill-single-char-nobreak-p): Doc tweak.
+
+ * indent.el (tab-stop-list): Doc fix. Add :version.
+
+ * vc/pcvs.el (vc-editable-p, vc-checkout): Remove unused declarations.
+ (cvs-append-to-ignore): Add compatibility alias.
+
+2014-01-27 Glenn Morris <rgm@gnu.org>
+
+ * dired.el (dired-hide-details-mode): Don't autoload it,
+ since it cannot be used outside Dired buffers anyway.
+
+ * emulation/cua-base.el (cua-mode): Doc fix.
+
+ * dired.el (dired-hide-details-hide-symlink-targets)
+ (dired-hide-details-hide-information-lines)
+ (dired-hide-details-mode): Doc fixes.
+
+ * shadowfile.el (shadow-info-file, shadow-todo-file): Doc fix.
+ * strokes.el (strokes-file): Doc fix. Bump :version.
+ (strokes-help): Doc fix.
+ * emulation/viper-init.el (viper-vi-style-in-minibuffer): Doc fix.
+ * emulation/viper.el (viper): Doc fix for custom group.
+ (top-level): Remove oh-so-no-longer-relevant text about vip.
+ * obsolete/otodo-mode.el (todo-prefix): Doc fix.
+
+ * ido.el (ido-save-directory-list-file):
+ * saveplace.el (save-place-file):
+ * calendar/timeclock.el (timeclock-file):
+ * net/quickurl.el (quickurl-url-file):
+ * obsolete/otodo-mode.el (todo-file-do, todo-file-done, todo-file-top):
+ * progmodes/idlwave.el (idlwave-config-directory):
+ * textmodes/remember.el (remember-data-file):
+ Bump :version.
+
2014-01-26 Glenn Morris <rgm@gnu.org>
* progmodes/opascal.el (opascal-tab-always-indents, opascal-tab):
;;
;; (add-hook 'kill-emacs-query-functions 'timeclock-query-out)
-;; NOTE: If you change your .timelog file without using timeclock's
+;; NOTE: If you change your timelog file without using timeclock's
;; functions, or if you change the value of any of timeclock's
;; customizable variables, you should run the command
;; `timeclock-reread-log'. This will recompute any discrepancies in
(defcustom timeclock-file (locate-user-emacs-file "timelog" ".timelog")
"The file used to store timeclock data in."
+ :version "24.4" ; added locate-user-emacs-file
:type 'file
:group 'timeclock)
:group 'dired)
(defcustom dired-hide-details-hide-symlink-targets t
- "If non-nil, `dired-hide-details-mode' hides symbolic link targets."
+ "Non-nil means `dired-hide-details-mode' hides symbolic link targets."
:type 'boolean
:version "24.4"
:group 'dired)
(defcustom dired-hide-details-hide-information-lines t
- "Non-nil means hide lines other than header and file/dir lines."
+ "Non-nil means `dired-hide-details-mode' hides all but header and file lines."
:type 'boolean
:version "24.4"
:group 'dired)
(substring file (match-end 0))
file))
\f
-;;; Minor mode for hiding details
-;;;###autoload
(define-minor-mode dired-hide-details-mode
- "Hide details in Dired mode."
+ "Toggle visibility of detailed information in current Dired buffer.
+When this minor mode is enabled, details such as file ownership and
+permissions are hidden from view.
+
+See options: `dired-hide-details-hide-symlink-targets' and
+`dired-hide-details-hide-information-lines'."
:group 'dired
(unless (derived-mode-p 'dired-mode)
(error "Not a Dired buffer"))
You can customize `cua-enable-cua-keys' to completely disable the
CUA bindings, or `cua-prefix-override-inhibit-delay' to change
-the prefix fallback behavior.
-
-CUA mode manages Transient Mark mode internally. Trying to disable
-Transient Mark mode while CUA mode is enabled does not work; if you
-only want to highlight the region when it is selected using a
-shifted movement key, set `cua-highlight-region-shift-only'."
+the prefix fallback behavior."
:global t
:group 'cua
:set-after '(cua-enable-modeline-indications
(if (featurep 'xemacs) "X" "")
))))))
-;; Ex source command. Loads the file specified as argument or `~/.viper'
+;; Ex source command.
+;; Loads the file specified as argument or viper-custom-file-name.
(defun ex-source ()
(viper-get-ex-file)
(if (string= ex-file "")
(defcustom viper-vi-style-in-minibuffer t
"If t, use vi-style editing in minibuffer.
-Should be set in `~/.viper' file."
+Should be set in `viper-custom-file-name'."
:type 'boolean
:group 'viper)
(defvar viper-empty-keymap (make-sparse-keymap))
;; This was the main Vi mode in old versions of VIP which may have been
-;; extensively used by VIP users. We declare it as a global var
-;; and, after .viper is loaded, we add this keymap to viper-vi-basic-map.
+;; extensively used by VIP users. We declare it as a global var and, after
+;; viper-custom-file-name is loaded, we add this keymap to viper-vi-basic-map.
(defvar viper-mode-map (make-sparse-keymap))
;; Some important keys used in viper
;; More general definitions are inherited by more specific scopes:
;; global->major mode->buffer. More specific definitions override more general
(defun viper-record-kbd-macro (macro-name state macro-body &optional scope)
- "Record a Vi macro. Can be used in `.viper' file to define permanent macros.
+ "Record a Vi macro.
+Can be used in `viper-custom-file-name' to define permanent macros.
MACRO-NAME is a string of characters or a vector of keys. STATE is
either `vi-state' or `insert-state'. It specifies the Viper state in which to
define the macro. MACRO-BODY is a string that represents the keyboard macro.
(error "Can't map an empty macro name"))
;; Macro-name is usually a vector. However, command history or macros
- ;; recorded in ~/.viper may be recorded as strings. So, convert to
- ;; vectors.
+ ;; recorded in viper-custom-file-name may be recorded as strings.
+ ;; So, convert to vectors.
(setq macro-name (viper-fixup-macro macro-name))
(if (viper-char-array-p macro-name)
(setq macro-name (viper-char-array-to-macro macro-name)))
;; if we don't let vector macro-body through %S,
;; the symbols `\.' `\[' etc will be converted into
;; characters, causing invalid read error on recorded
- ;; macros in .viper.
+ ;; macros in viper-custom-file-name.
;; I am not sure is macro-body can still be a string at
;; this point, but I am preserving this option anyway.
(if (vectorp macro-body)
;; in effect
(defun viper-unrecord-kbd-macro (macro-name state)
"Delete macro MACRO-NAME from Viper STATE.
-MACRO-NAME must be a vector of viper-style keys. This command is used by Viper
-internally, but the user can also use it in ~/.viper to delete pre-defined
-macros supplied with Viper. The best way to avoid mistakes in macro names to
-be passed to this function is to use viper-describe-kbd-macros and copy the
-name from there."
+MACRO-NAME must be a vector of viper-style keys. This command is used
+by Viper internally, but you can also use it in `viper-custom-file-name'
+to delete pre-defined macros supplied with Viper. The best way to avoid
+mistakes in macro names to be passed to this function is to use
+`viper-describe-kbd-macros' and copy the name from there."
(let* (state-name keymap
(macro-alist-var
(cond ((eq state 'vi-state)
macro-pair macro-entry)
;; Macro-name is usually a vector. However, command history or macros
- ;; recorded in ~/.viper may appear as strings. So, convert to vectors.
+ ;; recorded in viper-custom-file-name may appear as strings.
+ ;; So, convert to vectors.
(setq macro-name (viper-fixup-macro macro-name))
(if (viper-char-array-p macro-name)
(setq macro-name (viper-char-array-to-macro macro-name)))
;;
;; The last viper-vi-basic-minor-mode contains most of the usual Vi bindings
;; in its edit mode. This mode provides access to all Emacs facilities.
-;; Novice users, however, may want to set their viper-expert-level to 1
-;; in their .viper file. This will enable viper-vi-diehard-minor-mode. This
-;; minor mode's bindings make Viper simulate the usual Vi very closely.
+;; Novice users, however, may want to set their viper-expert-level to 1 in
+;; their viper-custom-file-name. This will enable viper-vi-diehard-minor-mode.
+;; This minor mode's bindings make Viper simulate the usual Vi very closely.
;; For instance, C-c will not have its standard Emacs binding
;; and so many of the goodies of Emacs are not available.
;;
;;
;; Viper gurus should have at least
;; (setq viper-expert-level 4)
-;; in their ~/.viper files. This will unsuppress all Emacs keys that are not
-;; essential for VI-style editing.
+;; in their viper-custom-file-name. This will unsuppress all Emacs keys
+;; that are not essential for VI-style editing.
;; Pick-and-choose users may want to put
;; (setq viper-expert-level 5)
-;; in ~/.viper. Viper will then leave it up to the user to set the variables
-;; viper-want-* See viper-set-expert-level for details.
+;; in viper-custom-file-name. Viper will then leave it up to the user to
+;; set the variables viper-want-* See viper-set-expert-level for details.
;;
;; The very first minor mode, viper-vi-intercept-minor-mode, is of no
;; concern for the user. It is needed to bind Viper's vital keys, such as
(defgroup viper nil
"Vi emulation within Emacs.
-NOTE: Viper customization should be saved in `viper-custom-file-name', which
-defaults to `~/.viper'."
+NOTE: Viper customization should be saved in `viper-custom-file-name'."
:prefix "viper-"
:group 'emulations)
(require 'viper)
in your init file (preferably, close to the top).
-These two lines must come in the order given.
-
-** Viper users:
- **** The startup file name has been changed from .vip to .viper
- **** All vip-* style names have been converted to viper-* style."))
+These two lines must come in the order given."))
(if (y-or-n-p "Viperize? ")
(setq viper-mode t)
(setq viper-mode nil))
;; Set some useful macros, advices
-;; These must be BEFORE ~/.viper is loaded,
-;; so the user can unrecord them in ~/.viper.
+;; These must be BEFORE viper-custom-file-name is loaded,
+;; so the user can unrecord them in viper-custom-file-name.
(if viper-mode
(progn
;; set advices and some variables that give emacs Vi look.
;; Make %%% toggle parsing comments for matching parentheses
(viper-set-parsing-style-toggling-macro nil)
- ;; ~/.viper is loaded if exists
+ ;; viper-custom-file-name is loaded if exists
(viper-load-custom-file)
;; should be after loading custom file to avoid the pesky msg that
\f
-;; Applying Viper customization -- runs after (load .viper)
+;; Applying Viper customization -- runs after (load viper-custom-file-name)
;; Save user settings or Viper defaults for vars controlled by
;; viper-expert-level
;; Intercept maps could go in viper-keym.el
-;; We keep them here in case someone redefines them in ~/.viper
+;; We keep them here in case someone redefines them in viper-custom-file-name
(define-key viper-vi-intercept-map viper-ESC-key 'viper-intercept-ESC-key)
(define-key viper-insert-intercept-map viper-ESC-key 'viper-intercept-ESC-key)
;; Copyright (C) 1992, 2001-2014 Free Software Foundation, Inc.
;; Author: Anders Holst <aho@sans.kth.se>
-;; Last change: 3 March 1998
+;; Maintainer: FSF
;; Version: 1.6
;; Keywords: abbrev convenience
Variables stored are: `ido-last-directory-list', `ido-work-directory-list',
`ido-work-file-list', and `ido-dir-file-cache'.
Must be set before enabling ido mode."
+ :version "24.4" ; added locate-user-emacs-file
:type 'string
:group 'ido)
(move-marker opoint nil))
(tab-to-tab-stop))))
-(defcustom tab-stop-list
- nil
+(defcustom tab-stop-list nil
"List of tab stop positions used by `tab-to-tab-stop'.
-This should be a list of integers, ordered from smallest to largest.
-It implicitly extends to infinity by repeating the last step (e.g. '(1 2 5)
-is equivalent to '(1 2 5 8 11)).
-If the list has less than 2 elements, `tab-width' is used as the \"last step\"."
+This should be nil, or a list of integers, ordered from smallest to largest.
+It implicitly extends to infinity through repetition of the last step.
+For example, '(1 2 5) is equivalent to '(1 2 5 8 11 ...). If the list has
+fewer than 2 elements, `tab-width' is used as the \"last step\".
+A value of nil means a tab stop every `tab-width' columns."
:group 'indent
+ :version "24.4" ; from explicit list to nil
+ :safe 'listp
:type '(repeat integer))
-(put 'tab-stop-list 'safe-local-variable 'listp)
(defvar edit-tab-stops-map
(let ((map (make-sparse-keymap)))
(defcustom quickurl-url-file
(locate-user-emacs-file "quickurls" ".quickurls")
"File that contains the URL list."
+ :version "24.4" ; added locate-user-emacs-file
:type 'file
:group 'quickurl)
This is useful in conjunction with `calendar' and `diary' if you use
-#include \"~/.todo-do\"
+#include \"~/.emacs.d/todo-do\"
in your diary file to include your todo list file as part of your
diary. With the default value \"*/*\" the diary displays each entry
:group 'todo)
(defcustom todo-file-do (locate-user-emacs-file "todo-do" ".todo-do")
"TODO mode list file."
+ :version "24.4" ; added locate-user-emacs-file
:type 'file
:group 'todo)
(defcustom todo-file-done (locate-user-emacs-file "todo-done" ".todo-done")
"TODO mode archive file."
+ :version "24.4" ; added locate-user-emacs-file
:type 'file
:group 'todo)
(defcustom todo-mode-hook nil
Not in TODO format, but diary compatible.
Automatically generated when `todo-save-top-priorities' is non-nil."
+ :version "24.4" ; added locate-user-emacs-file
:type 'string
:group 'todo)
["Quit" todo-quit t]
))
-;; As calendar reads .todo-do before todo-mode is loaded.
+;; As calendar reads todo-file-do before todo-mode is loaded.
;;;###autoload
(define-derived-mode todo-mode nil "TODO"
"Major mode for editing TODO lists."
;; M-x hide-ifdefs or C-c @ h
;;
;; Hide-ifdef suppresses the display of code that the preprocessor wouldn't
-;; pass through. The support of constant expressions in #if lines is
-;; limited to identifiers, parens, and the operators: &&, ||, !, and
-;; "defined". Please extend this.
+;; pass through. Support complete C/C++ expression and precedence.
;;
;; The hidden code is marked by ellipses (...). Be
;; cautious when editing near ellipses, since the hidden text is
;;
;; Written by Brian Marick, at Gould, Computer Systems Division, Urbana IL.
;; Extensively modified by Daniel LaLiberte (while at Gould).
+;;
+;; Extensively modified by Luke Lee in 2013 to support complete C expression
+;; evaluation.
;;; Code:
(defvar hif-token-list)
(defconst hif-token-alist
- '(("||" . or)
- ("&&" . and)
+ '(("||" . hif-or)
+ ("&&" . hif-and)
("|" . hif-logior)
+ ("^" . hif-logxor)
("&" . hif-logand)
- ("==" . equal)
+ ("<<" . hif-shiftleft)
+ (">>" . hif-shiftright)
+ ("==" . hif-equal)
+ ;; Note: we include tokens like `=' which aren't supported by CPP's
+ ;; expression syntax, because they are still relevant for the tokenizer,
+ ;; especially in conjunction with ##.
+ ("=" . hif-assign)
("!=" . hif-notequal)
- ("!" . not)
- ("(" . lparen)
- (")" . rparen)
+ ("##" . hif-token-concat)
+ ("!" . hif-not)
+ ("~" . hif-lognot)
+ ("(" . hif-lparen)
+ (")" . hif-rparen)
(">" . hif-greater)
("<" . hif-less)
(">=" . hif-greater-equal)
("<=" . hif-less-equal)
("+" . hif-plus)
("-" . hif-minus)
+ ("*" . hif-multiply)
+ ("/" . hif-divide)
+ ("%" . hif-modulo)
("?" . hif-conditional)
(":" . hif-colon)))
(defconst hif-token-regexp
- (concat (regexp-opt (mapcar 'car hif-token-alist)) "\\|\\w+"))
+ (concat (regexp-opt (mapcar 'car hif-token-alist))
+ "\\|0x[0-9a-fA-F]+\\.?[0-9a-fA-F]*"
+ "\\|[0-9]+\\.?[0-9]*" ;; decimal/octal
+ "\\|\\w+"))
+
+(defconst hif-string-literal-regexp "\\(\"\\(?:[^\"\\]\\|\\\\.\\)*\"\\)")
+
(defun hif-tokenize (start end)
"Separate string between START and END into a list of tokens."
((looking-at "\\\\\n")
(forward-char 2))
+ ((looking-at hif-string-literal-regexp)
+ (push (substring-no-properties (match-string 1)) token-list)
+ (goto-char (match-end 0)))
((looking-at hif-token-regexp)
(let ((token (buffer-substring (point) (match-end 0))))
(goto-char (match-end 0))
;; (message "token: %s" token) (sit-for 1)
- (push (or (cdr (assoc token hif-token-alist))
- (if (string-equal token "defined") 'hif-defined)
- (if (string-match "\\`[0-9]*\\'" token)
- (string-to-number token))
- (intern token))
- token-list)))
+ (push
+ (or (cdr (assoc token hif-token-alist))
+ (if (string-equal token "defined") 'hif-defined)
+ ;; TODO:
+ ;; 1. postfix 'l', 'll', 'ul' and 'ull'
+ ;; 2. floating number formats
+ ;; 3. hexadecimal/octal floats
+ ;; 4. 098 is interpreted as octal conversion error
+ ;; FIXME: string-to-number does not convert hex floats
+ (if (string-match "0x\\([0-9a-fA-F]+\\.?[0-9a-fA-F]*\\)"
+ token)
+ (string-to-number (match-string 1 token) 16)) ;; hex
+ ;; FIXME: string-to-number does not convert octal floats
+ (if (string-match "\\`0[0-9]+\\(\\.[0-9]+\\)?\\'" token)
+ (string-to-number token 8)) ;; octal
+ (if (string-match "\\`[1-9][0-9]*\\(\\.[0-9]+\\)?\\'"
+ token)
+ (string-to-number token)) ;; decimal
+ (intern token))
+ token-list)))
(t (error "Bad #if expression: %s" (buffer-string)))))))
(nreverse token-list)))
-;;;-----------------------------------------------------------------
-;;; Translate C preprocessor #if expressions using recursive descent.
-;;; This parser is limited to the operators &&, ||, !, and "defined".
-;;; Added ==, !=, +, and -. Gary Oberbrunner, garyo@avs.com, 8/9/94
+;;------------------------------------------------------------------------
+;; Translate C preprocessor #if expressions using recursive descent.
+;; This parser was limited to the operators &&, ||, !, and "defined".
+;; Added ==, !=, +, and -. Gary Oberbrunner, garyo@avs.com, 8/9/94
+;;
+;; Implement the C language operator precedence table. Add all those
+;; missing operators that could be used in macros. Luke Lee 2013-09-04
+
+;; | Operator Type | Operator | Associativity |
+;; +----------------------+-----------------------------+---------------+
+;; | Primary Expression | () [] . -> expr++ expr-- | left-to-right |
+;; | Unary Operators | * & + - ! ~ ++expr --expr | right-to-left |
+;; | | (typecast) sizeof | |
+;; | Binary Operators | * / % | left-to-right |
+;; | | + - | |
+;; | | >> << | |
+;; | | < > <= >= | |
+;; | | == != | |
+;; | | & | |
+;; | | ^ | |
+;; | | | | |
+;; | | && | |
+;; | | || | |
+;; | Ternary Operator | ?: | right-to-left |
+;; x| Assignment Operators | = += -= *= /= %= >>= <<= &= | right-to-left |
+;; | | ^= = | |
+;; | Comma | , | left-to-right |
(defsubst hif-nexttoken ()
"Pop the next token from token-list into the let variable \"hif-token\"."
(let ((hif-token-list token-list))
(hif-nexttoken)
(prog1
- (hif-expr)
+ (and hif-token
+ (hif-exprlist))
(if hif-token ; is there still a token?
(error "Error: unexpected token: %s" hif-token)))))
+(defun hif-exprlist ()
+ "Parse an exprlist: expr { ',' expr}"
+ (let ((result (hif-expr)))
+ (if (eq hif-token 'hif-comma)
+ (let ((temp (list result)))
+ (while
+ (progn
+ (hif-nexttoken)
+ (push (hif-expr) temp)
+ (eq hif-token 'hif-comma)))
+ (cons 'hif-comma (nreverse temp)))
+ result)))
+
(defun hif-expr ()
"Parse an expression as found in #if.
expr : or-expr | or-expr '?' expr ':' expr."
result))
(defun hif-or-expr ()
- "Parse n or-expr : and-expr | or-expr '||' and-expr."
+ "Parse an or-expr : and-expr | or-expr '||' and-expr."
(let ((result (hif-and-expr)))
- (while (eq hif-token 'or)
+ (while (eq hif-token 'hif-or)
(hif-nexttoken)
(setq result (list 'hif-or result (hif-and-expr))))
result))
(defun hif-and-expr ()
- "Parse an and-expr : eq-expr | and-expr '&&' eq-expr."
+ "Parse an and-expr : logior-expr | and-expr '&&' logior-expr."
+ (let ((result (hif-logior-expr)))
+ (while (eq hif-token 'hif-and)
+ (hif-nexttoken)
+ (setq result (list 'hif-and result (hif-logior-expr))))
+ result))
+
+(defun hif-logior-expr ()
+ "Parse a logor-expr : logxor-expr | logor-expr '|' logxor-expr."
+ (let ((result (hif-logxor-expr)))
+ (while (eq hif-token 'hif-logior)
+ (hif-nexttoken)
+ (setq result (list 'hif-logior result (hif-logxor-expr))))
+ result))
+
+(defun hif-logxor-expr ()
+ "Parse a logxor-expr : logand-expr | logxor-expr '^' logand-expr."
+ (let ((result (hif-logand-expr)))
+ (while (eq hif-token 'hif-logxor)
+ (hif-nexttoken)
+ (setq result (list 'hif-logxor result (hif-logand-expr))))
+ result))
+
+(defun hif-logand-expr ()
+ "Parse a logand-expr : eq-expr | logand-expr '&' eq-expr."
(let ((result (hif-eq-expr)))
- (while (eq hif-token 'and)
+ (while (eq hif-token 'hif-logand)
(hif-nexttoken)
- (setq result (list 'hif-and result (hif-eq-expr))))
+ (setq result (list 'hif-logand result (hif-eq-expr))))
result))
(defun hif-eq-expr ()
- "Parse an eq-expr : math | eq-expr `=='|`!='|`<'|`>'|`>='|`<=' math."
- (let ((result (hif-math))
+ "Parse an eq-expr : comp | eq-expr `=='|`!=' comp."
+ (let ((result (hif-comp-expr))
(eq-token nil))
- (while (memq hif-token '(equal hif-notequal hif-greater hif-less
- hif-greater-equal hif-less-equal))
+ (while (memq hif-token '(hif-equal hif-notequal))
(setq eq-token hif-token)
(hif-nexttoken)
- (setq result (list eq-token result (hif-math))))
+ (setq result (list eq-token result (hif-comp-expr))))
+ result))
+
+(defun hif-comp-expr ()
+ "Parse a comp-expr : logshift | comp-expr `<'|`>'|`>='|`<=' logshift."
+ (let ((result (hif-logshift-expr))
+ (comp-token nil))
+ (while (memq hif-token '(hif-greater hif-less hif-greater-equal hif-less-equal))
+ (setq comp-token hif-token)
+ (hif-nexttoken)
+ (setq result (list comp-token result (hif-logshift-expr))))
+ result))
+
+(defun hif-logshift-expr ()
+ "Parse a logshift : math | logshift `<<'|`>>' math."
+ (let ((result (hif-math))
+ (shift-token nil))
+ (while (memq hif-token '(hif-shiftleft hif-shiftright))
+ (setq shift-token hif-token)
+ (hif-nexttoken)
+ (setq result (list shift-token result (hif-math))))
result))
(defun hif-math ()
- "Parse an expression with + or - and simpler things.
- math : factor | math '+|-' factor."
+ "Parse an expression with + or -.
+ math : muldiv | math '+|-' muldiv."
+ (let ((result (hif-muldiv-expr))
+ (math-op nil))
+ (while (memq hif-token '(hif-plus hif-minus))
+ (setq math-op hif-token)
+ (hif-nexttoken)
+ (setq result (list math-op result (hif-muldiv-expr))))
+ result))
+
+(defun hif-muldiv-expr ()
+ "Parse an expression with *,/,%.
+ muldiv : factor | muldiv '*|/|%' factor."
(let ((result (hif-factor))
(math-op nil))
- (while (memq hif-token '(hif-plus hif-minus hif-logior hif-logand))
+ (while (memq hif-token '(hif-multiply hif-divide hif-modulo))
(setq math-op hif-token)
(hif-nexttoken)
(setq result (list math-op result (hif-factor))))
result))
(defun hif-factor ()
- "Parse a factor: '!' factor | '(' expr ')' | 'defined(' id ')' | id."
+ "Parse a factor: '!' factor | '~' factor | '(' expr ')' | 'defined(' id ')' | 'id(parmlist)' | strings | id."
(cond
- ((eq hif-token 'not)
+ ((eq hif-token 'hif-not)
(hif-nexttoken)
(list 'hif-not (hif-factor)))
- ((eq hif-token 'lparen)
+ ((eq hif-token 'hif-lognot)
(hif-nexttoken)
- (let ((result (hif-expr)))
- (if (not (eq hif-token 'rparen))
+ (list 'hif-lognot (hif-factor)))
+
+ ((eq hif-token 'hif-lparen)
+ (hif-nexttoken)
+ (let ((result (hif-exprlist)))
+ (if (not (eq hif-token 'hif-rparen))
(error "Bad token in parenthesized expression: %s" hif-token)
(hif-nexttoken)
result)))
((eq hif-token 'hif-defined)
(hif-nexttoken)
- (let ((paren (when (eq hif-token 'lparen) (hif-nexttoken) t))
+ (let ((paren (when (eq hif-token 'hif-lparen) (hif-nexttoken) t))
(ident hif-token))
- (if (memq hif-token '(or and not hif-defined lparen rparen))
+ (if (memq hif-token '(or and not hif-defined hif-lparen hif-rparen))
(error "Error: unexpected token: %s" hif-token))
(when paren
(hif-nexttoken)
- (unless (eq hif-token 'rparen)
+ (unless (eq hif-token 'hif-rparen)
(error "Error: expected \")\" after identifier")))
(hif-nexttoken)
`(hif-defined (quote ,ident))))
(or (not (zerop (hif-mathify a))) (not (zerop (hif-mathify b)))))
(defun hif-not (a)
(zerop (hif-mathify a)))
+(defun hif-lognot (a)
+ (lognot (hif-mathify a)))
(defmacro hif-mathify-binop (fun)
`(lambda (a b)
,(format "Like `%s' but treat t and nil as 1 and 0." fun)
(,fun (hif-mathify a) (hif-mathify b))))
+(defun hif-shiftleft (a b)
+ (setq a (hif-mathify a))
+ (setq b (hif-mathify b))
+ (if (< a 0)
+ (ash a b)
+ (lsh a b)))
+
+(defun hif-shiftright (a b)
+ (setq a (hif-mathify a))
+ (setq b (hif-mathify b))
+ (if (< a 0)
+ (ash a (- b))
+ (lsh a (- b))))
+
+
+(defalias 'hif-multiply (hif-mathify-binop *))
+(defalias 'hif-divide (hif-mathify-binop /))
+(defalias 'hif-modulo (hif-mathify-binop %))
(defalias 'hif-plus (hif-mathify-binop +))
(defalias 'hif-minus (hif-mathify-binop -))
+(defalias 'hif-equal (hif-mathify-binop =))
(defalias 'hif-notequal (hif-mathify-binop /=))
(defalias 'hif-greater (hif-mathify-binop >))
(defalias 'hif-less (hif-mathify-binop <))
(defalias 'hif-greater-equal (hif-mathify-binop >=))
(defalias 'hif-less-equal (hif-mathify-binop <=))
(defalias 'hif-logior (hif-mathify-binop logior))
+(defalias 'hif-logxor (hif-mathify-binop logxor))
(defalias 'hif-logand (hif-mathify-binop logand))
+
+(defun hif-comma (&rest expr)
+ "Evaluate a list of expr, return the result of the last item"
+ (let ((result nil))
+ (dolist (e expr)
+ (ignore-errors
+ (setq result (funcall hide-ifdef-evaluator e))))
+ result))
+
+
;;;----------- end of parser -----------------------
(defcustom idlwave-config-directory
(locate-user-emacs-file "idlwave" ".idlwave")
"Directory for configuration files and user-library catalog."
+ :version "24.4" ; added locate-user-emacs-file
:group 'idlwave-routine-info
:type 'file)
(defcustom save-place-file (locate-user-emacs-file "places" ".emacs-places")
"Name of the file that records `save-place-alist' value."
+ :version "24.4" ; added locate-user-emacs-file
:type 'file
:group 'save-place)
;; documentation for these functions for information on how and when to use
;; them). After doing this once, everything should be automatic.
-;; The lists of clusters and shadows are saved in a file called .shadows,
-;; so that they can be remembered from one Emacs session to another, even
-;; (as much as possible) if the Emacs session terminates abnormally. The
-;; files needing to be copied are stored in .shadow_todo; if a file cannot
-;; be copied for any reason, it will stay on the list to be tried again
-;; next time. The .shadows file should itself have shadows on all your
-;; accounts so that the information in it is consistent everywhere, but
-;; .shadow_todo is local information and should have no shadows.
+;; The lists of clusters and shadows are saved in a ~/.emacs.d/shadows
+;; (`shadow-info-file') file, so that they can be remembered from one
+;; Emacs session to another, even (as much as possible) if the Emacs
+;; session terminates abnormally. The files needing to be copied are
+;; stored in `shadow-todo-file'; if a file cannot be copied for any
+;; reason, it will stay on the list to be tried again next time. The
+;; `shadow-info-file' file should itself have shadows on all your accounts
+;; so that the information in it is consistent everywhere, but
+;; `shadow-todo-file' is local information and should have no shadows.
;; If you do not want to copy a particular file, you can answer "no" and
;; be asked again next time you hit C-x 4 s or exit Emacs. If you do not
;; want to be asked again, use shadow-cancel, and you will not be asked
;; until you change the file and save it again. If you do not want to
-;; shadow that file ever again, you can edit it out of the .shadows
-;; buffer. Anytime you edit the .shadows buffer, you must type M-x
+;; shadow that file ever again, you can edit it out of the shadows
+;; buffer. Anytime you edit the shadows buffer, you must type M-x
;; shadow-read-files to load in the new information, or your changes will
;; be overwritten!
:type 'boolean
:group 'shadow)
+;; FIXME in a sense, this changed in 24.4 (addition of locate-user-emacs-file),
+;; but due to the weird way this variable is initialized to nil, it didn't
+;; literally change. Same for shadow-todo-file.
(defcustom shadow-info-file nil
"File to keep shadow information in.
The `shadow-info-file' should be shadowed to all your accounts to
-ensure consistency. Default: ~/.shadows"
+ensure consistency. Default: ~/.emacs.d/shadows"
:type '(choice (const nil) file)
:group 'shadow)
decide not to copy your shadow files at the end of one Emacs session, it will
remember and ask you again in your next Emacs session.
This file must NOT be shadowed to any other system, it is host-specific.
-Default: ~/.shadow_todo"
+Default: ~/.emacs.d/shadow_todo"
:type '(choice (const nil) file)
:group 'shadow)
(defun just-one-space (&optional n)
"Delete all spaces and tabs around point, leaving one space (or N spaces).
-If N is negative, delete newlines as well, leaving -N spaces."
+If N is negative, delete newlines as well, leaving -N spaces.
+See also `cycle-spacing'."
(interactive "*p")
(cycle-spacing n nil t))
variable.")
(defun cycle-spacing (&optional n preserve-nl-back single-shot)
- "Manipulate spaces around the point in a smart way.
+ "Manipulate whitespace around point in a smart way.
+In interactive use, this function behaves differently in successive
+consecutive calls.
-When run as an interactive command, the first time it's called
-in a sequence, deletes all spaces and tabs around point leaving
-one (or N spaces). If this does not change content of the
-buffer, skips to the second step:
+The first call in a sequence acts like `just-one-space'.
+It deletes all spaces and tabs around point, leaving one space
+\(or N spaces). N is the prefix argument. If N is negative,
+it deletes newlines as well, leaving -N spaces.
+\(If PRESERVE-NL-BACK is non-nil, it does not delete newlines before point.)
-When run for the second time in a sequence, deletes all the
-spaces it has previously inserted.
+The second call in a sequence (or the first call if the above does
+not result in any changes) deletes all spaces.
-When run for the third time, returns the whitespace and point in
-a state encountered when it had been run for the first time.
+The third call in a sequence restores the original whitespace (and point).
-For example, if buffer contains \"foo ^ bar\" with \"^\" denoting the
-point, calling `cycle-spacing' command will replace two spaces with
-a single space, calling it again immediately after, will remove all
-spaces, and calling it for the third time will bring two spaces back
-together.
-
-If N is negative, delete newlines as well. However, if
-PRESERVE-NL-BACK is t new line characters prior to the point
-won't be removed.
-
-If SINGLE-SHOT is non-nil, will only perform the first step. In
-other words, it will work just like `just-one-space' command."
+If SINGLE-SHOT is non-nil, it only performs the first step in the sequence."
(interactive "*p")
(let ((orig-pos (point))
(skip-characters (if (and n (< n 0)) " \t\n\r" " \t"))
;; > M-x strokes-prompt-user-save-strokes
-;; and it will save your strokes in ~/.strokes, or you may wish to change
-;; this by setting the variable `strokes-file'.
+;; and it will save your strokes in your `strokes-file'.
;; Note that internally, all of the routines that are part of this
;; package are able to deal with complex strokes, as they are a superset
:group 'strokes)
(defcustom strokes-file (locate-user-emacs-file "strokes" ".strokes")
- "File containing saved strokes for Strokes mode (default is ~/.strokes)."
+ "File containing saved strokes for Strokes mode."
+ :version "24.4" ; added locate-user-emacs-file
:type 'file
:group 'strokes)
> C-u M-x strokes-list-strokes
-Your strokes are stored as you enter them. They get saved in a file
-called ~/.strokes, along with other strokes configuration variables.
-You can change this location by setting the variable `strokes-file'.
-You will be prompted to save them when you exit Emacs, or you can save
-them with
+Your strokes are stored as you enter them. They get saved into the
+file specified by the `strokes-file' variable, along with other strokes
+configuration variables. You will be prompted to save them when
+you exit Emacs, or you can save them with
> M-x strokes-prompt-user-save-strokes
(eq (char-syntax (following-char)) ?w)))))))
(defun fill-single-char-nobreak-p ()
- "Return t if point is placed just after a 1-letter word.
-This is used in `fill-nobreak-predicate' to prevent breaking line just
-after a 1-letter word (usually conjunction or preposition) which is
-considered composition error in Polish and Czech typography."
+ "Return non-nil if a one-letter word is before point.
+This function is suitable for adding to the hook `fill-nobreak-predicate',
+to prevent the breaking of a line just after a one-letter word,
+which is an error according to some typographical conventions."
(save-excursion
(skip-chars-backward " \t")
(backward-char 2)
;;
;; * Using "remember"
;;
-;; As a rough beginning, what I do is to keep my .notes file in
+;; As a rough beginning, what I do is to keep my `remember-data-file' in
;; outline-mode format, with a final entry called "* Raw data". Then,
;; at intervals, I can move the data that gets appended there into
;; other places. But certainly this should evolve into an intuitive
"The file in which to store unprocessed data.
When set via customize, visited file of the notes buffer (if it
exists) might be changed."
+ :version "24.4" ; added locate-user-emacs-file
:type 'file
:set (lambda (symbol value)
(let ((buf (find-buffer-visiting (default-value symbol))))
;;; type-break.el --- encourage rests from typing at appropriate intervals -*- lexical-binding: t -*-
-;; Copyright (C) 1994-1995, 1997, 2000-2014 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1994-1995, 1997, 2000-2014 Free Software Foundation, Inc.
;; Author: Noah Friedman
;; Maintainer: Noah Friedman <friedman@splode.com>
(locate-user-emacs-file "type-break" ".type-break")
"Name of file used to save state across sessions.
If this is nil, no data will be saved across sessions."
+ :version "24.4" ; added locate-user
:type 'file)
(defvar type-break-post-command-hook '(type-break-check)
(setf (cvs-fileinfo->type fi) 'DEAD))
(cvs-cleanup-collection cvs-cookies nil nil nil))
-(declare-function vc-editable-p "vc" (file))
-(declare-function vc-checkout "vc" (file &optional writable rev))
+(define-obsolete-function-alias 'cvs-append-to-ignore 'vc-cvs-append-to-ignore
+ "24.4")
+
(defun cvs-mode-find-file-other-window (e)
"Select a buffer containing the file in another window."
(not (memq major-mode (cdr whitespace-global-modes)))
(memq major-mode whitespace-global-modes)))
(t nil))
- ;; ...we have a display (we're running a batch job)
+ ;; ...we have a display (not running a batch job)
(not noninteractive)
;; ...the buffer is not internal (name starts with a space)
(not (eq (aref (buffer-name) 0) ?\ ))
;; Handle margins.
(margins (or (frame-parameter frame 'fit-frame-to-buffer-margins)
fit-frame-to-buffer-margins))
- (left-margin (or (window--sanitize-margin
- (nth 0 margins) 0 display-width)
- (nth 0 workarea)))
- (top-margin (or (window--sanitize-margin
- (nth 1 margins) 0 display-height)
- (nth 1 workarea)))
+ (left-margin (if (nth 0 margins)
+ (or (window--sanitize-margin
+ (nth 0 margins) 0 display-width)
+ 0)
+ (nth 0 workarea)))
+ (top-margin (if (nth 1 margins)
+ (or (window--sanitize-margin
+ (nth 1 margins) 0 display-height)
+ 0)
+ (nth 1 workarea)))
(workarea-width (nth 2 workarea))
- (right-margin (or (window--sanitize-margin
- (nth 2 margins) left-margin display-width)
- (+ left-margin workarea-width)))
+ (right-margin (if (nth 2 margins)
+ (- display-width
+ (or (window--sanitize-margin
+ (nth 2 margins) left-margin display-width)
+ 0))
+ (nth 2 workarea)))
(workarea-height (nth 3 workarea))
- (bottom-margin (or (window--sanitize-margin
- (nth 3 margins) top-margin display-height)
- (+ top-margin workarea-height)))
+ (bottom-margin (if (nth 3 margins)
+ (- display-height
+ (or (window--sanitize-margin
+ (nth 3 margins) top-margin display-height)
+ 0))
+ (nth 3 workarea)))
;; The pixel width of FRAME (which does not include the
;; window manager's decorations).
(frame-width (frame-pixel-width))
(not (zerop lines)))
(1- lines)
0))))
- ;; The maximum height we can use for fitting.
- (fit-height
- (- workarea-height extra-height toolbar-extra-height))
- ;; The pixel position of FRAME's top border. We usually
- ;; try to leave this alone.
+ ;; The pixel position of FRAME's top border.
(top
(let ((top (frame-parameter nil 'top)))
(if (consp top)
(max-height
(cond
((numberp (nth 0 sizes)) (* (nth 0 sizes) char-height))
- ((numberp max-height) (* max-height char-height))))
+ ((numberp max-height) (* max-height char-height))
+ (t display-height)))
(min-height
(cond
((numberp (nth 1 sizes)) (* (nth 1 sizes) char-height))
((numberp (nth 2 sizes))
(- (* (nth 2 sizes) char-width) window-extra-width))
((numberp max-width)
- (- (* max-width char-width) window-extra-width))))
+ (- (* max-width char-width) window-extra-width))
+ (t display-height)))
(min-width
(cond
((numberp (nth 3 sizes))
(value (window-text-pixel-size
nil t t workarea-width workarea-height t))
(width (+ (car value) (window-right-divider-width)))
- (height (+ (cdr value) (window-bottom-divider-width)))
- remainder)
- (unless frame-resize-pixelwise
- ;; Round sizes to character sizes.
- (setq remainder (% width char-width))
- (unless (zerop remainder)
- (setq width (+ width (- char-width remainder))))
- (setq remainder (% height char-height))
- (setq height (+ height (- char-height remainder))))
- ;; Now make sure that we don't get larger than our rounded
- ;; maximum lines and columns.
- (when (> width fit-width)
- (setq width (- fit-width (% fit-width char-width))))
- (when (> height fit-height)
- (setq height (- fit-height (% fit-height char-height))))
+ (height (+ (cdr value) (window-bottom-divider-width))))
;; Don't change height or width when the window's size is fixed
;; in either direction.
(cond
- ((eq window-size-fixed 'height)
- (setq height nil))
((eq window-size-fixed 'width)
+ (setq width nil))
+ ((eq window-size-fixed 'height)
(setq height nil)))
+ ;; Fit width to constraints.
(when width
+ (unless frame-resize-pixelwise
+ ;; Round to character sizes.
+ (setq width (* (/ (+ width char-width -1) char-width)
+ char-width)))
;; Fit to maximum and minimum widths.
- (when max-width
- (setq width (min width max-width)))
- (when min-width
- (setq width (max width min-width)))
+ (setq width (max (min width max-width) min-width))
;; Add extra width.
(setq width (+ width extra-width))
- ;; Preserve right margin.
- (let ((right (+ left width extra-width)))
+ ;; Preserve margins.
+ (let ((right (+ left width)))
(cond
((> right right-margin)
;; Move frame to left (we don't know its real width).
- (setq left (min (- right-margin display-width) -1)))
+ (setq left (max left-margin (- left (- right right-margin)))))
((< left left-margin)
;; Move frame to right.
(setq left left-margin)))))
+ ;; Fit height to constraints.
(when height
+ (unless frame-resize-pixelwise
+ (setq height (* (/ (+ height char-height -1) char-height)
+ char-height)))
;; Fit to maximum and minimum heights.
- (when max-height
- (setq height (min height max-height)))
- (when min-height
- (setq height (max height min-height)))
+ (setq height (max (min height max-height) min-height))
;; Add extra height.
(setq height (+ height extra-height))
- ;; Preserve bottom and top margins.
- (let ((bottom (+ top height extra-height)))
+ ;; Preserve margins.
+ (let ((bottom (+ top height)))
(cond
((> bottom bottom-margin)
;; Move frame up (we don't know its real height).
- (setq top (min (- bottom-margin display-height) -1)))
+ (setq top (max top-margin (- top (- bottom bottom-margin)))))
((< top top-margin)
;; Move frame down.
(setq top top-margin)))))
* fileio.c (Finsert_file_contents): Cancel the previous change.
+2014-01-29 Martin Rudalics <rudalics@gmx.at>
+
+ * w32fns.c (x_set_tool_bar_lines): Don't clear area on frames
+ that are not visible.
+
+2014-01-29 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (create_and_show_popup_menu): Handle case when no key
+ is grabbed (Bug#16565).
+
+2014-01-28 Martin Rudalics <rudalics@gmx.at>
+
+ * xdisp.c (last_max_ascent): Re-remove after erroneously
+ reintroducing it on 2013-11-30 and abolishing Dmitry's removal
+ from 2013-03-29.
+ (move_it_to): Re-remove reference to last_max_ascent.
+ (Fwindow_text_pixel_size): Add iterator's max_ascent and
+ max_descent here instead of calling line_bottom_y. Fix
+ doc-string.
+
+2014-01-28 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * terminal.c (initial_free_frame_resources): New function.
+ (init_initial_terminal): Install new hook to free face cache
+ on initial frame and avoid memory leak. For details, see
+ <http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01974.html>.
+ * xfaces.c (free_frame_faces): Adjust comment.
+
+2014-01-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data.c (Fstring_to_number): Document results if unparsable
+ (Bug#16551).
+
2014-01-26 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (x_focus_changed): Check for non-X terminal-frame (Bug#16540)
DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
doc: /* Parse STRING as a decimal number and return the number.
-This parses both integers and floating point numbers.
-It ignores leading spaces and tabs, and all trailing chars.
+Ignore leading spaces and tabs, and all trailing chars. Return 0 if
+STRING cannot be parsed as an integer or floating point number.
If BASE, interpret STRING as a number in that base. If BASE isn't
present, base 10 is used. BASE must be between 2 and 16 (inclusive).
-If the base used is not 10, STRING is always parsed as integer. */)
+If the base used is not 10, STRING is always parsed as an integer. */)
(register Lisp_Object string, Lisp_Object base)
{
register char *p;
\f
/* Return the symbol in OBARRAY whose names matches the string
of SIZE characters (SIZE_BYTE bytes) at PTR.
- If there is no such symbol in OBARRAY, return nil.
+ If there is no such symbol, return the integer bucket number of
+ where the symbol would be if it were present.
Also store the bucket number in oblookup_last_bucket_number. */
return store_terminal_param (t, parameter, value);
}
-\f
+/* Initial frame has no device-dependent output data, but has
+ face cache which should be freed when the frame is deleted. */
+
+static void
+initial_free_frame_resources (struct frame *f)
+{
+ eassert (FRAME_INITIAL_P (f));
+ free_frame_faces (f);
+}
/* Create the bootstrap display terminal for the initial frame.
Returns a terminal of type output_initial. */
initial_terminal->name = xstrdup ("initial_terminal");
initial_terminal->kboard = initial_kboard;
initial_terminal->delete_terminal_hook = &delete_initial_terminal;
+ initial_terminal->delete_frame_hook = &initial_free_frame_resources;
/* All other hooks are NULL. */
return initial_terminal;
/* If the tool bar gets smaller, the internal border below it
has to be cleared. It was formerly part of the display
of the larger tool bar, and updating windows won't clear it. */
- if (FRAME_INTERNAL_BORDER_WIDTH (f) != 0)
+ if (FRAME_INTERNAL_BORDER_WIDTH (f) != 0 && FRAME_VISIBLE_P (f))
{
int height = FRAME_INTERNAL_BORDER_WIDTH (f);
int width = FRAME_PIXEL_WIDTH (f);
/* Ascent and height of the last line processed by move_it_to. */
-static int last_max_ascent, last_height;
+static int last_height;
/* Non-zero if there's a help-echo in the echo area. */
it->current_y += it->max_ascent + it->max_descent;
++it->vpos;
last_height = it->max_ascent + it->max_descent;
- last_max_ascent = it->max_ascent;
it->max_ascent = it->max_descent = 0;
}
it->current_y += it->max_ascent + it->max_descent;
++it->vpos;
last_height = it->max_ascent + it->max_descent;
- last_max_ascent = it->max_ascent;
}
if (backup_data)
include the height of the mode- or header-line of WINDOW in the return
value. If it is either the symbol `mode-line' or `header-line', include
only the height of that line, if present, in the return value. If t,
-include the height of any of these lines in the return value. */)
+include the height of both, if present, in the return value. */)
(Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit, Lisp_Object y_limit,
Lisp_Object mode_and_header_line)
{
SET_TEXT_POS (startp, start, CHAR_TO_BYTE (start));
start_display (&it, w, startp);
- /** move_it_vertically_backward (&it, 0); **/
if (NILP (x_limit))
x = move_it_to (&it, end, -1, max_y, -1, MOVE_TO_POS | MOVE_TO_Y);
else
MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
}
- if (start == end)
- y = it.current_y;
- else
- {
- /* Count last line. */
- last_height = 0;
- y = line_bottom_y (&it); /* - y; */
- }
+ y = it.current_y + it.max_ascent + it.max_descent;
if (!EQ (mode_and_header_line, Qheader_line)
&& !EQ (mode_and_header_line, Qt))
}
-/* Free face cache of frame F. Called from delete_frame. */
+/* Free face cache of frame F. Called from frame-dependent
+ resource freeing function, e.g. (x|tty)_free_frame_resources. */
void
free_frame_faces (struct frame *f)
for (i = 0; i < 5; i++)
if (FRAME_DISPLAY_INFO (f)->grabbed & (1 << i))
break;
+ // If keys aren't grabbed (i.e. a mouse up event), use 0.
+ if (i == 5) i = 0;
}
/* Display the menu. */
+2014-01-27 Michael Albinus <michael.albinus@gmx.de>
+
+ * automated/file-notify-tests.el (file-notify--deftest-remote):
+ Do not skip when the local test has failed. They are unrelated.
+ (file-notify--wait-for-events): Use `sit-for'. Let-bind
+ `noninteractive' to nil, otherwise `sit-for' could be degraded to
+ `sleep-for'.
+ (file-notify-test02-events): Check for `file-remote-p' instead of
+ `file-notify--test-remote-enabled'.
+
+2014-01-26 Michael Albinus <michael.albinus@gmx.de>
+
+ * automated/file-notify-tests.el (file-notify-test02-events):
+ Let test case fail for Bug#16519.
+
2014-01-22 Michael Albinus <michael.albinus@gmx.de>
* automated/file-notify-tests.el (file-notify-test02-events):
file-notify-test-remote-temporary-file-directory)
(ert-test (ert-get-test ',test)))
(skip-unless (file-notify--test-remote-enabled))
- ;; The local test could have passed, skipped, or quit. All of
- ;; these results should not prevent us to run the remote test.
- ;; That's why we skip only for failed local tests.
- (skip-unless
- (not (ert-test-failed-p (ert-test-most-recent-result ert-test))))
(tramp-cleanup-connection
(tramp-dissect-file-name temporary-file-directory) nil 'keep-password)
(funcall (ert-test-body ert-test)))))
(defmacro file-notify--wait-for-events (timeout until)
"Wait for file notification events until form UNTIL is true.
-TIMEOUT is the maximum time to wait for."
+TIMEOUT is the maximum time to wait for, in seconds."
`(with-timeout (,timeout (ignore))
(while (null ,until)
- ;; glib events, and remote events.
- (accept-process-output nil 0.1)
- ;; inotify events.
- (read-event nil nil 0.1))))
+ (let (noninteractive)
+ (sit-for 0.1 'nodisplay)))))
(ert-deftest file-notify-test02-events ()
"Check file creation/removal notifications."
+ ;; Bug#16519.
+ :expected-result
+ (if (and noninteractive
+ (not (file-remote-p temporary-file-directory))
+ (memq file-notify--library '(gfilenotify w32notify)))
+ :failed :passed)
(skip-unless (file-notify--test-local-enabled))
(let (desc)
(unwind-protect
(ignore-errors (delete-file file-notify--test-tmpfile))
(ignore-errors (delete-file file-notify--test-tmpfile1))))
- (should
- (or file-notify--test-results
- (and noninteractive (eq file-notify--library 'gfilenotify)))) ;; Bug#16519.
+ (should file-notify--test-results)
(dolist (result file-notify--test-results)
;(message "%s" (ert-test-result-messages result))
(when (ert-test-failed-p result)