mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-11 16:08:13 +00:00
merge trunk
This commit is contained in:
commit
9fe32d61c5
@ -270,32 +270,35 @@ to a bug. There are two differences between normal tags and user tags:
|
||||
1) Anyone can define any valid usertag they like. In contrast, only a
|
||||
limited, predefined set of normal tags are available (see above).
|
||||
|
||||
2) A usertag is associated with a specific email address.
|
||||
2) A usertag is associated with a specific user. This is normally
|
||||
an email address (with an "@" sign and least 4 characters after the "@"),
|
||||
but on debbugs.gnu.org, the definition is less strict - anything with
|
||||
5 or more alphanumeric characters will work. For personal tags,
|
||||
using an email address is still recommended. Please only use the
|
||||
"emacs" user, or other short users, for "official" tags.
|
||||
|
||||
You set usertags in the same way as tags, by talking to the control
|
||||
server. One difference is that you can also specify the associated
|
||||
email address. If you don't explicitly specify an address, then it
|
||||
will use the one from which you send the control message. The address
|
||||
must have the form of an email address (with an "@" sign and least 4
|
||||
characters after the "@").
|
||||
You set usertags in the same way as tags, by talking to the control server.
|
||||
One difference is that you can also specify the associated user.
|
||||
If you don't explicitly specify a user, then it will use the email
|
||||
address from which you send the control message.
|
||||
|
||||
*** Setting usertags
|
||||
|
||||
a) In a control message:
|
||||
|
||||
user bug-gnu-emacs@gnu.org
|
||||
user emacs # or email@example.com
|
||||
usertags 1234 any-tag-you-like
|
||||
|
||||
This will add a usertag "any-tag-you-like" to bug 1234. The tag will
|
||||
be associated with the address "bug-gnu-emacs@gnu.org". If you omit
|
||||
the first line, the tag will be associated with your email address.
|
||||
be associated with the user "emacs". If you omit the first line,
|
||||
the tag will be associated with your email address.
|
||||
|
||||
The syntax of the usertags command is the same as that of tags (eg wrt
|
||||
the optional [=+-] argument).
|
||||
|
||||
b) In an initial submission, in the pseudo-header:
|
||||
|
||||
User: bug-gnu-emacs@gnu.org
|
||||
User: emacs
|
||||
Usertags: a-new-tag
|
||||
|
||||
Again, the "User" is optional.
|
||||
@ -312,7 +315,7 @@ http://debbugs.gnu.org/cgi/pkgindex.cgi?indexon=users
|
||||
|
||||
**** To find all bugs usertagged by a given email address:
|
||||
|
||||
http://debbugs.gnu.org/cgi/pkgreport.cgi?users=bug-gnu-emacs@gnu.org
|
||||
http://debbugs.gnu.org/cgi/pkgreport.cgi?users=emacs
|
||||
|
||||
(Supposedly, the "users" field can be a comma-separated list of more
|
||||
than one email address, but it does not seem to work for me.)
|
||||
@ -322,7 +325,7 @@ than one email address, but it does not seem to work for me.)
|
||||
This works just like a normal tags search, but with the addition of a
|
||||
"users" field. Eg:
|
||||
|
||||
http://debbugs.gnu.org/cgi/pkgreport.cgi?users=bug-gnu-emacs@gnu.org;tag=calendar
|
||||
http://debbugs.gnu.org/cgi/pkgreport.cgi?users=emacs;tag=calendar
|
||||
|
||||
*** To merge bugs:
|
||||
Eg when bad replies create a bunch of new bugs for the same report.
|
||||
|
@ -1,3 +1,7 @@
|
||||
2012-10-13 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* files.texi (File Conveniences): ImageMagick enabled by default.
|
||||
|
||||
2012-10-10 Dani Moncayo <dmoncayo@gmail.com>
|
||||
|
||||
* basic.texi (Arguments): Fix typos.
|
||||
|
@ -1931,15 +1931,22 @@ non-@code{nil}. Currently, Emacs only supports animation in GIF
|
||||
files.
|
||||
|
||||
@cindex ImageMagick support
|
||||
If your Emacs was compiled with ImageMagick support, it is possible
|
||||
to view a much wider variety of image types in Image mode, by
|
||||
rendering the images via ImageMagick. However, this feature is
|
||||
currently disabled by default. To enable it, add the following line
|
||||
to your init file:
|
||||
|
||||
@example
|
||||
(imagemagick-register-types)
|
||||
@end example
|
||||
@vindex imagemagick-enabled-types
|
||||
@vindex imagemagick-types-inhibit
|
||||
If Emacs was compiled with support for the ImageMagick library, it
|
||||
can use ImageMagick to render a wide variety of images. The variable
|
||||
@code{imagemagick-enabled-types} lists the image types that Emacs may
|
||||
render using ImageMagick; each element in the list should be an
|
||||
internal ImageMagick name for an image type, as a symbol or an
|
||||
equivalent string (e.g.@: @code{BMP} for @file{.bmp} images). To
|
||||
enable ImageMagick for all possible image types, change
|
||||
@code{imagemagick-enabled-types} to @code{t}. The variable
|
||||
@code{imagemagick-types-inhibit} lists the image types which should
|
||||
never be rendered using ImageMagick, regardless of the value of
|
||||
@code{imagemagick-enabled-types} (the default list includes types like
|
||||
@code{C} and @code{HTML}, which ImageMagick can render as an ``image''
|
||||
but Emacs should not). To disable ImageMagick entirely, change
|
||||
@code{imagemagick-types-inhibit} to @code{t}.
|
||||
|
||||
@findex thumbs-mode
|
||||
@findex mode, thumbs
|
||||
|
@ -1,3 +1,7 @@
|
||||
2012-10-13 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* display.texi (ImageMagick Images): ImageMagick enabled by default.
|
||||
|
||||
2012-10-05 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* minibuf.texi (Basic Completion): Clarify list form of completion
|
||||
|
@ -4579,56 +4579,34 @@ specifying the bounding box of the PostScript image, analogous to the
|
||||
@cindex images, support for more formats
|
||||
|
||||
If you build Emacs with ImageMagick support, you can use the
|
||||
ImageMagick library to load many image formats. The image type symbol
|
||||
ImageMagick library to load many image formats (@pxref{File
|
||||
Conveniences,,, emacs, The GNU Emacs Manual}). The image type symbol
|
||||
for images loaded via ImageMagick is @code{imagemagick}, regardless of
|
||||
the actual underlying image format.
|
||||
|
||||
@defun imagemagick-types
|
||||
This function returns a list of image file extensions supported by the
|
||||
current ImageMagick installation.
|
||||
current ImageMagick installation. Each list element is a symbol
|
||||
representing an internal ImageMagick name for an image type, such as
|
||||
@code{BMP} for @file{.bmp} images.
|
||||
@end defun
|
||||
|
||||
By default, Emacs does not use ImageMagick to display images in
|
||||
Image mode, e.g.@: when visiting such files with @kbd{C-x C-f}. This
|
||||
feature is enabled by calling @code{imagemagick-register-types}.
|
||||
|
||||
@defun imagemagick-register-types
|
||||
This function enables using Image mode to visit image files supported
|
||||
by ImageMagick. @xref{File Conveniences,,, emacs, The GNU Emacs
|
||||
Manual}. It also causes @code{create-image} and other helper
|
||||
functions to associate such file names with the @code{imagemagick}
|
||||
image type (@pxref{Defining Images}).
|
||||
|
||||
All image file extensions supported by ImageMagick are registered,
|
||||
except those specified in @code{imagemagick-types-inhibit}. If Emacs
|
||||
was not compiled with ImageMagick support, this function does nothing.
|
||||
@end defun
|
||||
|
||||
@defopt imagemagick-types-inhibit
|
||||
This variable specifies a list of image types that should @emph{not}
|
||||
be registered by @code{imagemagick-register-types}. Each entry in
|
||||
this list should be one of the symbols returned by
|
||||
@code{imagemagick-types}. The default value lists several file types
|
||||
that are considered ``images'' by ImageMagick, but which should not be
|
||||
considered as images by Emacs, including C files and HTML files.
|
||||
@defopt imagemagick-enabled-types
|
||||
The value of this variable is a list of ImageMagick image types which
|
||||
Emacs may attempt to render using ImageMagick. Each list element
|
||||
should be one of the symbols in the list returned by
|
||||
@code{imagemagick-types}, or an equivalent string. Alternatively, a
|
||||
value of @code{t} enables ImageMagick for all possible image types.
|
||||
Regardless of the value of this variable,
|
||||
@code{imagemagick-types-inhibit} (see below) takes precedence.
|
||||
@end defopt
|
||||
|
||||
@ignore
|
||||
@c I don't know what this means. I suspect it means eg loading jpg
|
||||
@c images via libjpeg or ImageMagick. But it doesn't work.
|
||||
@c If you don't have libjpeg support compiled in, you cannot
|
||||
@c view jpeg images, even if you have imagemagick support:
|
||||
@c http://debbugs.gnu.org/9045
|
||||
@c And if you have both compiled in, then you always get
|
||||
@c the libjpeg version:
|
||||
@c http://debbugs.gnu.org/10746
|
||||
There may be overlap between image loaders in your Emacs installation,
|
||||
and you may prefer to use a different one for a given image type
|
||||
(which loader will be used in practice depends on the priority of the
|
||||
loaders).
|
||||
For example, if you never want to use the ImageMagick loader to view
|
||||
JPEG files, add @code{JPG} to this list.
|
||||
@end ignore
|
||||
@defopt imagemagick-types-inhibit
|
||||
The value of this variable lists the ImageMagick image types which
|
||||
should never be rendered using ImageMagick, regardless of the value of
|
||||
@code{imagemagick-enabled-types}. A value of @code{t} disables
|
||||
ImageMagick entirely.
|
||||
@end defopt
|
||||
|
||||
Images loaded with ImageMagick support the following additional
|
||||
image descriptor properties:
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
* charsets/JISC6226.map: Re-generated.
|
||||
|
||||
2012-10-14 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* compilation.txt (msft): Add error messages in new Studio 2010
|
||||
format.
|
||||
|
||||
2012-10-11 Kenichi Handa <handa@gnu.org>
|
||||
|
||||
* charsets/CNS-2.map, charsets/CNS-3.map, charsets/CNS-4.map,
|
||||
|
6
etc/NEWS
6
etc/NEWS
@ -137,16 +137,16 @@ It is no longer necessary to call `imagemagick-register-types'
|
||||
explicitly to install ImageMagick image types; that function is called
|
||||
automatically at startup, or when customizing a relevant imagemagick-
|
||||
option.
|
||||
|
||||
+++
|
||||
*** Setting `imagemagick-types-inhibit' to t now disables the use of
|
||||
ImageMagick to view images. You must call imagemagick-register-types
|
||||
afterwards if you do not use customize to change this.
|
||||
|
||||
+++
|
||||
*** The new variable `imagemagick-enabled-types' also affects which
|
||||
ImageMagick types are treated as images. The function
|
||||
`imagemagick-filter-types' returns the list of types that will be
|
||||
treated as images.
|
||||
|
||||
---
|
||||
*** Images displayed via ImageMagick now support transparency and the
|
||||
:background image spec property.
|
||||
|
||||
|
@ -308,6 +308,13 @@ made it more strict about the error message that follows.
|
||||
keyboard handler.c(537) : warning C4005: 'min' : macro redefinition
|
||||
d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if'
|
||||
d:\tmp\test.c(1145) : see declaration of 'nsRefPtr'
|
||||
1>test_main.cpp(29): error C2144: syntax error : 'int' should be preceded by ';'
|
||||
1>test_main.cpp(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
|
||||
1>
|
||||
1>Build FAILED.
|
||||
1>
|
||||
1>Time Elapsed 00:00:01.46
|
||||
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
||||
|
||||
|
||||
* Open Watcom
|
||||
|
@ -1,3 +1,56 @@
|
||||
2012-10-14 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* progmodes/compile.el (compilation-error-regexp-alist-alist):
|
||||
Adjust the msft regexp to the output of Studio 2010, and move msft
|
||||
before edg-1. See the discussion on emacs-devel,
|
||||
http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00579.html,
|
||||
for the details.
|
||||
|
||||
2012-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* emacs-lisp/eieio.el (eieio-oset-default, eieio-oset, oset-default)
|
||||
(oset): Move uses of object-class-fast macro after its definition.
|
||||
|
||||
* emacs-lisp/gv.el (if): Don't use closures in non-lexical-binding code.
|
||||
|
||||
2012-10-13 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* textmodes/ispell.el (ispell-pdict-save): If flyspell-mode is
|
||||
enabled, re-enable it (Bug#11963).
|
||||
|
||||
2012-10-13 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* emacs-lisp/debug.el (debug): When debugger-will-be-back is
|
||||
non-nil, restore window configuration (Bug#12623).
|
||||
|
||||
2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* help-fns.el (describe-variable, describe-function-1):
|
||||
* help-mode.el (help-make-xrefs): Remove error handler, made unneeded.
|
||||
|
||||
* emacs-lisp/eieio.el (lisp-imenu-generic-expression): Fix typo.
|
||||
|
||||
2012-10-12 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* mail/rmailsum.el (rmail-header-summary):
|
||||
Fix 2010-11-26 test for multiline Subject: field. (Bug#12625)
|
||||
|
||||
2012-10-12 Fabián Ezequiel Gallina <fgallina@cuca>
|
||||
|
||||
* progmodes/python.el (python-mode-map):
|
||||
Replace subtitute-key-definition with proper command remapping.
|
||||
(python-nav--up-list): Fix behavior for blocks on the same level.
|
||||
|
||||
2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* help-fns.el (describe-function-1): Handle autoloads w/o docstrings.
|
||||
|
||||
* emacs-lisp/bytecomp.el (byte-compile-eval): Adjust to long-ago
|
||||
changes to the format of load-history.
|
||||
|
||||
* international/mule-cmds.el (read-char-by-name): Move let-binding of
|
||||
completion-ignore-case in case that var is buffer-local (bug#12615).
|
||||
|
||||
2012-10-11 Kenichi Handa <handa@gnu.org>
|
||||
|
||||
* international/eucjp-ms.el: Re-generated.
|
||||
@ -10,8 +63,8 @@
|
||||
2012-10-10 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* window.el (switch-to-buffer-preserve-window-point): New option.
|
||||
(switch-to-buffer): Obey
|
||||
`switch-to-buffer-preserve-window-point' (Bug#4041).
|
||||
(switch-to-buffer):
|
||||
Obey `switch-to-buffer-preserve-window-point' (Bug#4041).
|
||||
|
||||
2012-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
|
@ -875,13 +875,11 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
|
||||
(byte-compile-cl-file-p (car xs))))
|
||||
(dolist (s xs)
|
||||
(cond
|
||||
((symbolp s)
|
||||
(unless (memq s old-autoloads)
|
||||
(push s byte-compile-noruntime-functions)))
|
||||
((and (consp s) (eq t (car s)))
|
||||
(push (cdr s) old-autoloads))
|
||||
((and (consp s) (eq 'autoload (car s)))
|
||||
(push (cdr s) byte-compile-noruntime-functions)))))))
|
||||
((and (consp s) (memq (car s) '(autoload defun)))
|
||||
(unless (memq (cdr s) old-autoloads)
|
||||
(push (cdr s) byte-compile-noruntime-functions))))))))
|
||||
;; Go through current-load-list for the locally defined funs.
|
||||
(let (old-autoloads)
|
||||
(while (and hist-nil-new (not (eq hist-nil-new hist-nil-orig)))
|
||||
|
@ -728,7 +728,8 @@ If ALIST is non-nil, the new pairs are prepended to it."
|
||||
;;;###autoload
|
||||
(progn
|
||||
;; Make sure functions defined with cl-defsubst can be inlined even in
|
||||
;; packages which do not require CL.
|
||||
;; packages which do not require CL. We don't put an autoload cookie
|
||||
;; directly on that function, since those cookies only go to cl-loaddefs.
|
||||
(autoload 'cl--defsubst-expand "cl-macs")
|
||||
;; Autoload, so autoload.el and font-lock can use it even when CL
|
||||
;; is not loaded.
|
||||
|
@ -213,7 +213,8 @@ first will be printed into the backtrace buffer."
|
||||
(or enable-recursive-minibuffers (> (minibuffer-depth) 0)))
|
||||
(standard-input t) (standard-output t)
|
||||
inhibit-redisplay
|
||||
(cursor-in-echo-area nil))
|
||||
(cursor-in-echo-area nil)
|
||||
(window-configuration (current-window-configuration)))
|
||||
(unwind-protect
|
||||
(save-excursion
|
||||
(when (eq (car debugger-args) 'debug)
|
||||
@ -266,16 +267,19 @@ first will be printed into the backtrace buffer."
|
||||
;; Make sure we unbind buffer-read-only in the right buffer.
|
||||
(save-excursion
|
||||
(recursive-edit))))
|
||||
(when (and (not debugger-will-be-back)
|
||||
(window-live-p debugger-window)
|
||||
(eq (window-buffer debugger-window) debugger-buffer))
|
||||
;; Record height of debugger window.
|
||||
(setq debugger-previous-window-height
|
||||
(window-total-size debugger-window))
|
||||
;; Unshow debugger-buffer.
|
||||
(quit-restore-window debugger-window debugger-bury-or-kill)
|
||||
;; Restore current buffer (Bug#12502).
|
||||
(set-buffer debugger-old-buffer))
|
||||
(if debugger-will-be-back
|
||||
;; Restore previous window configuration (Bug#12623).
|
||||
(set-window-configuration window-configuration)
|
||||
(when (and (window-live-p debugger-window)
|
||||
(eq (window-buffer debugger-window) debugger-buffer))
|
||||
(progn
|
||||
;; Record height of debugger window.
|
||||
(setq debugger-previous-window-height
|
||||
(window-total-size debugger-window))
|
||||
;; Unshow debugger-buffer.
|
||||
(quit-restore-window debugger-window debugger-bury-or-kill)
|
||||
;; Restore current buffer (Bug#12502).
|
||||
(set-buffer debugger-old-buffer))))
|
||||
;; Restore previous state of debugger-buffer in case we were
|
||||
;; in a recursive invocation of the debugger, otherwise just
|
||||
;; erase the buffer and put it into fundamental mode.
|
||||
|
@ -1556,71 +1556,6 @@ Fills in OBJ's SLOT with its default value."
|
||||
;; return it verbatim
|
||||
(t val)))
|
||||
|
||||
;;; Object Set macros
|
||||
;;
|
||||
(defmacro oset (obj slot value)
|
||||
"Set the value in OBJ for slot SLOT to VALUE.
|
||||
SLOT is the slot name as specified in `defclass' or the tag created
|
||||
with in the :initarg slot. VALUE can be any Lisp object."
|
||||
`(eieio-oset ,obj (quote ,slot) ,value))
|
||||
|
||||
(defun eieio-oset (obj slot value)
|
||||
"Do the work for the macro `oset'.
|
||||
Fills in OBJ's SLOT with VALUE."
|
||||
(if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
|
||||
(if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot)))
|
||||
(let ((c (eieio-slot-name-index (object-class-fast obj) obj slot)))
|
||||
(if (not c)
|
||||
;; It might be missing because it is a :class allocated slot.
|
||||
;; Let's check that info out.
|
||||
(if (setq c
|
||||
(eieio-class-slot-name-index (aref obj object-class) slot))
|
||||
;; Oset that slot.
|
||||
(progn
|
||||
(eieio-validate-class-slot-value (object-class-fast obj) c value slot)
|
||||
(aset (aref (class-v (aref obj object-class))
|
||||
class-class-allocation-values)
|
||||
c value))
|
||||
;; See oref for comment on `slot-missing'
|
||||
(slot-missing obj slot 'oset value)
|
||||
;;(signal 'invalid-slot-name (list (object-name obj) slot))
|
||||
)
|
||||
(eieio-validate-slot-value (object-class-fast obj) c value slot)
|
||||
(aset obj c value))))
|
||||
|
||||
(defmacro oset-default (class slot value)
|
||||
"Set the default slot in CLASS for SLOT to VALUE.
|
||||
The default value is usually set with the :initform tag during class
|
||||
creation. This allows users to change the default behavior of classes
|
||||
after they are created."
|
||||
`(eieio-oset-default ,class (quote ,slot) ,value))
|
||||
|
||||
(defun eieio-oset-default (class slot value)
|
||||
"Do the work for the macro `oset-default'.
|
||||
Fills in the default value in CLASS' in SLOT with VALUE."
|
||||
(if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
|
||||
(if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot)))
|
||||
(let* ((scoped-class class)
|
||||
(c (eieio-slot-name-index class nil slot)))
|
||||
(if (not c)
|
||||
;; It might be missing because it is a :class allocated slot.
|
||||
;; Let's check that info out.
|
||||
(if (setq c (eieio-class-slot-name-index class slot))
|
||||
(progn
|
||||
;; Oref that slot.
|
||||
(eieio-validate-class-slot-value class c value slot)
|
||||
(aset (aref (class-v class) class-class-allocation-values) c
|
||||
value))
|
||||
(signal 'invalid-slot-name (list (class-name class) slot)))
|
||||
(eieio-validate-slot-value class c value slot)
|
||||
;; Set this into the storage for defaults.
|
||||
(setcar (nthcdr (- c 3) (aref (class-v class) class-public-d))
|
||||
value)
|
||||
;; Take the value, and put it into our cache object.
|
||||
(eieio-oset (aref (class-v class) class-default-object-cache)
|
||||
slot value)
|
||||
)))
|
||||
|
||||
;;; Handy CLOS macros
|
||||
;;
|
||||
(defmacro with-slots (spec-list object &rest body)
|
||||
@ -1871,6 +1806,71 @@ method invocation orders of the involved classes."
|
||||
(setq ia (cdr ia)))
|
||||
f))
|
||||
|
||||
;;; Object Set macros
|
||||
;;
|
||||
(defmacro oset (obj slot value)
|
||||
"Set the value in OBJ for slot SLOT to VALUE.
|
||||
SLOT is the slot name as specified in `defclass' or the tag created
|
||||
with in the :initarg slot. VALUE can be any Lisp object."
|
||||
`(eieio-oset ,obj (quote ,slot) ,value))
|
||||
|
||||
(defun eieio-oset (obj slot value)
|
||||
"Do the work for the macro `oset'.
|
||||
Fills in OBJ's SLOT with VALUE."
|
||||
(if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
|
||||
(if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot)))
|
||||
(let ((c (eieio-slot-name-index (object-class-fast obj) obj slot)))
|
||||
(if (not c)
|
||||
;; It might be missing because it is a :class allocated slot.
|
||||
;; Let's check that info out.
|
||||
(if (setq c
|
||||
(eieio-class-slot-name-index (aref obj object-class) slot))
|
||||
;; Oset that slot.
|
||||
(progn
|
||||
(eieio-validate-class-slot-value (object-class-fast obj) c value slot)
|
||||
(aset (aref (class-v (aref obj object-class))
|
||||
class-class-allocation-values)
|
||||
c value))
|
||||
;; See oref for comment on `slot-missing'
|
||||
(slot-missing obj slot 'oset value)
|
||||
;;(signal 'invalid-slot-name (list (object-name obj) slot))
|
||||
)
|
||||
(eieio-validate-slot-value (object-class-fast obj) c value slot)
|
||||
(aset obj c value))))
|
||||
|
||||
(defmacro oset-default (class slot value)
|
||||
"Set the default slot in CLASS for SLOT to VALUE.
|
||||
The default value is usually set with the :initform tag during class
|
||||
creation. This allows users to change the default behavior of classes
|
||||
after they are created."
|
||||
`(eieio-oset-default ,class (quote ,slot) ,value))
|
||||
|
||||
(defun eieio-oset-default (class slot value)
|
||||
"Do the work for the macro `oset-default'.
|
||||
Fills in the default value in CLASS' in SLOT with VALUE."
|
||||
(if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
|
||||
(if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot)))
|
||||
(let* ((scoped-class class)
|
||||
(c (eieio-slot-name-index class nil slot)))
|
||||
(if (not c)
|
||||
;; It might be missing because it is a :class allocated slot.
|
||||
;; Let's check that info out.
|
||||
(if (setq c (eieio-class-slot-name-index class slot))
|
||||
(progn
|
||||
;; Oref that slot.
|
||||
(eieio-validate-class-slot-value class c value slot)
|
||||
(aset (aref (class-v class) class-class-allocation-values) c
|
||||
value))
|
||||
(signal 'invalid-slot-name (list (class-name class) slot)))
|
||||
(eieio-validate-slot-value class c value slot)
|
||||
;; Set this into the storage for defaults.
|
||||
(setcar (nthcdr (- c 3) (aref (class-v class) class-public-d))
|
||||
value)
|
||||
;; Take the value, and put it into our cache object.
|
||||
(eieio-oset (aref (class-v class) class-default-object-cache)
|
||||
slot value)
|
||||
)))
|
||||
|
||||
;;; CLOS queries into classes and slots
|
||||
;;
|
||||
(defun slot-boundp (object slot)
|
||||
@ -2750,7 +2750,7 @@ This method signals `no-next-method' by default. Override this
|
||||
method to not throw an error, and its return value becomes the
|
||||
return value of `call-next-method'."
|
||||
(signal 'no-next-method (list (object-name object) args))
|
||||
)
|
||||
)
|
||||
|
||||
(defgeneric clone (obj &rest params)
|
||||
"Make a copy of OBJ, and then supply PARAMS.
|
||||
@ -3050,7 +3050,7 @@ Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate."
|
||||
;;; Interfacing with imenu in emacs lisp mode
|
||||
;; (Only if the expression is defined)
|
||||
;;
|
||||
(if (eval-when-compile (boundp 'list-imenu-generic-expression))
|
||||
(if (eval-when-compile (boundp 'lisp-imenu-generic-expression))
|
||||
(progn
|
||||
|
||||
(defun eieio-update-lisp-imenu-expression ()
|
||||
|
@ -358,7 +358,8 @@ The return value is the last VAL in the list.
|
||||
|
||||
(put 'if 'gv-expander
|
||||
(lambda (do test then &rest else)
|
||||
(if (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy)))
|
||||
(if (or (not lexical-binding) ;The other code requires lexical-binding.
|
||||
(macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy))))
|
||||
;; This duplicates the `do' code, which is a problem if that
|
||||
;; code is large, but otherwise results in more efficient code.
|
||||
`(if ,test ,(gv-get then do)
|
||||
|
@ -615,13 +615,11 @@ FILE is the file where FUNCTION was probably defined."
|
||||
(point)))
|
||||
(terpri)(terpri)
|
||||
|
||||
(let* ((doc-raw (condition-case err
|
||||
(documentation function t)
|
||||
(error (format "No Doc! %S" err))))
|
||||
(let* ((doc-raw (documentation function t))
|
||||
;; If the function is autoloaded, and its docstring has
|
||||
;; key substitution constructs, load the library.
|
||||
(doc (progn
|
||||
(and (autoloadp real-def)
|
||||
(and (autoloadp real-def) doc-raw
|
||||
help-enable-auto-load
|
||||
(string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]"
|
||||
doc-raw)
|
||||
@ -849,12 +847,10 @@ it is displayed along with the global value."
|
||||
(obsolete (get variable 'byte-obsolete-variable))
|
||||
(use (car obsolete))
|
||||
(safe-var (get variable 'safe-local-variable))
|
||||
(doc (condition-case err
|
||||
(or (documentation-property
|
||||
variable 'variable-documentation)
|
||||
(documentation-property
|
||||
alias 'variable-documentation))
|
||||
(error (format "Doc not found: %S" err))))
|
||||
(doc (or (documentation-property
|
||||
variable 'variable-documentation)
|
||||
(documentation-property
|
||||
alias 'variable-documentation)))
|
||||
(extra-line nil))
|
||||
|
||||
;; Mention if it's a local variable.
|
||||
|
@ -505,14 +505,12 @@ that."
|
||||
((and
|
||||
(or (boundp sym)
|
||||
(get sym 'variable-documentation))
|
||||
(condition-case err
|
||||
(or
|
||||
(documentation-property
|
||||
sym 'variable-documentation)
|
||||
(documentation-property
|
||||
(indirect-variable sym)
|
||||
'variable-documentation))
|
||||
(error (message "No doc found: %S" err) nil)))
|
||||
(or
|
||||
(documentation-property
|
||||
sym 'variable-documentation)
|
||||
(documentation-property
|
||||
(indirect-variable sym)
|
||||
'variable-documentation)))
|
||||
(help-xref-button 8 'help-variable sym))
|
||||
((fboundp sym)
|
||||
(help-xref-button 8 'help-function sym)))))))
|
||||
|
@ -2945,13 +2945,14 @@ at the beginning of the name.
|
||||
This function also accepts a hexadecimal number of Unicode code
|
||||
point or a number in hash notation, e.g. #o21430 for octal,
|
||||
#x2318 for hex, or #10r8984 for decimal."
|
||||
(let* ((completion-ignore-case t)
|
||||
(input (completing-read
|
||||
prompt
|
||||
(lambda (string pred action)
|
||||
(if (eq action 'metadata)
|
||||
'(metadata (category . unicode-name))
|
||||
(complete-with-action action (ucs-names) string pred))))))
|
||||
(let ((input
|
||||
(completing-read
|
||||
prompt
|
||||
(lambda (string pred action)
|
||||
(let ((completion-ignore-case t))
|
||||
(if (eq action 'metadata)
|
||||
'(metadata (category . unicode-name))
|
||||
(complete-with-action action (ucs-names) string pred)))))))
|
||||
(cond
|
||||
((string-match-p "\\`[0-9a-fA-F]+\\'" input)
|
||||
(string-to-number input 16))
|
||||
|
1946
lisp/ldefs-boot.el
1946
lisp/ldefs-boot.el
File diff suppressed because it is too large
Load Diff
@ -4707,7 +4707,7 @@ If prefix argument REVERSE is non-nil, sorts in reverse order.
|
||||
|
||||
;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
|
||||
;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels
|
||||
;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "bef21a376bd5bd59792a20dd86e6ec34")
|
||||
;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "6cafe6b03e187b5836e3c359322b5cbf")
|
||||
;;; Generated autoloads from rmailsum.el
|
||||
|
||||
(autoload 'rmail-summary "rmailsum" "\
|
||||
|
@ -785,7 +785,7 @@ the message being processed."
|
||||
(setq pos (point))
|
||||
(forward-line 1)
|
||||
(setq str (buffer-substring pos (1- (point))))
|
||||
(while (looking-at "\\s ")
|
||||
(while (looking-at "[ \t]")
|
||||
(setq str (concat str " "
|
||||
(buffer-substring (match-end 0)
|
||||
(line-end-position))))
|
||||
|
@ -171,6 +171,15 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
|
||||
"\\(?:^cucumber\\(?: -p [^[:space:]]+\\)?\\|#\\)\
|
||||
\\(?: \\)\\([^\(].*\\):\\([1-9][0-9]*\\)" 1 2)
|
||||
|
||||
(msft
|
||||
;; Must be before edg-1, so that MSVC's longer messages are
|
||||
;; considered before EDG.
|
||||
;; The message may be a "warning", "error", or "fatal error" with
|
||||
;; an error code, or "see declaration of" without an error code.
|
||||
"^ *\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) ?\
|
||||
: \\(?:see declaration\\|\\(?:warnin\\(g\\)\\|[a-z ]+\\) C[0-9]+:\\)"
|
||||
2 3 nil (4))
|
||||
|
||||
(edg-1
|
||||
"^\\([^ \n]+\\)(\\([0-9]+\\)): \\(?:error\\|warnin\\(g\\)\\|remar\\(k\\)\\)"
|
||||
1 2 nil (3 . 4))
|
||||
|
@ -229,15 +229,9 @@
|
||||
(defvar python-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
;; Movement
|
||||
(substitute-key-definition 'backward-sentence
|
||||
'python-nav-backward-block
|
||||
map global-map)
|
||||
(substitute-key-definition 'forward-sentence
|
||||
'python-nav-forward-block
|
||||
map global-map)
|
||||
(substitute-key-definition 'backward-up-list
|
||||
'python-nav-backward-up-list
|
||||
map global-map)
|
||||
(define-key map [remap backward-sentence] 'python-nav-backward-block)
|
||||
(define-key map [remap forward-sentence] 'python-nav-forward-block)
|
||||
(define-key map [remap backward-up-list] 'python-nav-backward-up-list)
|
||||
(define-key map "\C-c\C-j" 'imenu)
|
||||
;; Indent specific
|
||||
(define-key map "\177" 'python-indent-dedent-line-backspace)
|
||||
@ -1444,7 +1438,7 @@ DIR is always 1 or -1 and comes sanitized from
|
||||
(save-excursion
|
||||
(let ((indentation (current-indentation)))
|
||||
(while (and (python-nav-backward-block)
|
||||
(> (current-indentation) indentation))))
|
||||
(>= (current-indentation) indentation))))
|
||||
(point))))
|
||||
(and (> (point) prev-block-pos)
|
||||
(goto-char prev-block-pos))))
|
||||
|
@ -1893,11 +1893,14 @@ If so, ask if it needs to be saved."
|
||||
(interactive (list ispell-silently-savep t))
|
||||
(if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p))
|
||||
(setq ispell-pdict-modified-p (car ispell-pdict-modified-p)))
|
||||
(if (or ispell-pdict-modified-p force-save)
|
||||
(if (or no-query (y-or-n-p "Personal dictionary modified. Save? "))
|
||||
(progn
|
||||
(ispell-send-string "#\n") ; save dictionary
|
||||
(message "Personal dictionary saved."))))
|
||||
(when (and (or ispell-pdict-modified-p force-save)
|
||||
(or no-query
|
||||
(y-or-n-p "Personal dictionary modified. Save? ")))
|
||||
(ispell-send-string "#\n") ; save dictionary
|
||||
(message "Personal dictionary saved.")
|
||||
(when flyspell-mode
|
||||
(flyspell-mode 0)
|
||||
(flyspell-mode 1)))
|
||||
;; unassert variable, even if not saved to avoid questioning.
|
||||
(setq ispell-pdict-modified-p nil))
|
||||
|
||||
|
@ -1,3 +1,14 @@
|
||||
2012-10-13 Liam Stitt <stittl@cuug.ab.ca> (tiny change)
|
||||
|
||||
* url-vars.el (url-uncompressor-alist):
|
||||
* url-file.el (url-file-find-possibly-compressed-file, url-file):
|
||||
Recognize .xz compression (Bug#11839).
|
||||
|
||||
2012-10-13 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* url-http.el (url-http):
|
||||
* url.el (url-retrieve-internal): Doc fix (Bug#6407).
|
||||
|
||||
2012-10-08 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* url-methods.el (url-scheme-get-property): url-https.el was
|
||||
|
@ -40,7 +40,7 @@ can do automatic decompression for them, and won't find 'foo' if
|
||||
'foo.gz' exists, even though the FTP server would happily serve it up
|
||||
to them."
|
||||
(let ((scratch nil)
|
||||
(compressed-extensions '("" ".gz" ".z" ".Z" ".bz2"))
|
||||
(compressed-extensions '("" ".gz" ".z" ".Z" ".bz2" ".xz"))
|
||||
(found nil))
|
||||
(while (and compressed-extensions (not found))
|
||||
(if (file-exists-p (setq scratch (concat fname (pop compressed-extensions))))
|
||||
@ -166,6 +166,8 @@ to them."
|
||||
(or filename (error "File does not exist: %s" (url-recreate-url url)))
|
||||
;; Need to figure out the content-type from the real extension,
|
||||
;; not the compressed one.
|
||||
;; FIXME should this regexp not include more extensions; basically
|
||||
;; everything that url-file-find-possibly-compressed-file does?
|
||||
(setq uncompressed-filename (if (string-match "\\.\\(gz\\|Z\\|z\\)$" filename)
|
||||
(substring filename 0 (match-beginning 0))
|
||||
filename))
|
||||
@ -177,6 +179,7 @@ to them."
|
||||
(".uue" "x-uuencoded")
|
||||
(".hqx" "x-hqx")
|
||||
(".bz2" "x-bzip2")
|
||||
(".xz" "x-xz")
|
||||
(_ nil)))
|
||||
|
||||
(if (file-directory-p filename)
|
||||
|
@ -1150,8 +1150,12 @@ the end of the document."
|
||||
(defun url-http (url callback cbargs &optional retry-buffer)
|
||||
"Retrieve URL via HTTP asynchronously.
|
||||
URL must be a parsed URL. See `url-generic-parse-url' for details.
|
||||
When retrieval is completed, the function CALLBACK is executed with
|
||||
CBARGS as the arguments.
|
||||
|
||||
When retrieval is completed, execute the function CALLBACK, using
|
||||
the arguments listed in CBARGS. The first element in CBARGS
|
||||
should be a plist describing what has happened so far during the
|
||||
request, as described in the docstring of `url-retrieve' (if in
|
||||
doubt, specify nil).
|
||||
|
||||
Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a
|
||||
previous `url-http' call, which is being re-attempted."
|
||||
|
@ -152,7 +152,8 @@ variable."
|
||||
(".uue" . "x-uuencoded")
|
||||
(".hqx" . "x-hqx")
|
||||
(".Z" . "x-compress")
|
||||
(".bz2" . "x-bzip2"))
|
||||
(".bz2" . "x-bzip2")
|
||||
(".xz" . "x-xz"))
|
||||
"An alist of file extensions and appropriate content-transfer-encodings."
|
||||
:type '(repeat (cons :format "%v"
|
||||
(string :tag "Extension")
|
||||
|
@ -131,9 +131,9 @@ characters are percent-encoded; see `url-encode-url'.
|
||||
CALLBACK is called when the object has been completely retrieved, with
|
||||
the current buffer containing the object, and any MIME headers associated
|
||||
with it. It is called as (apply CALLBACK STATUS CBARGS).
|
||||
STATUS is a list with an even number of elements representing
|
||||
what happened during the request, with most recent events first,
|
||||
or an empty list if no events have occurred. Each pair is one of:
|
||||
STATUS is a plist representing what happened during the request,
|
||||
with most recent events first, or an empty list if no events have
|
||||
occurred. Each pair is one of:
|
||||
|
||||
\(:redirect REDIRECTED-TO) - the request was redirected to this URL
|
||||
\(:error (ERROR-SYMBOL . DATA)) - an error occurred. The error can be
|
||||
@ -169,8 +169,10 @@ URL-encoded before it's used."
|
||||
(defun url-retrieve-internal (url callback cbargs &optional silent
|
||||
inhibit-cookies)
|
||||
"Internal function; external interface is `url-retrieve'.
|
||||
CBARGS is what the callback will actually receive - the first item is
|
||||
the list of events, as described in the docstring of `url-retrieve'.
|
||||
CBARGS is the list of arguments that the callback function will
|
||||
receive; its first element should be a plist specifying what has
|
||||
happened so far during the request, as described in the docstring
|
||||
of `url-retrieve' (if in doubt, specify nil).
|
||||
|
||||
If SILENT, don't message progress reports and the like.
|
||||
If INHIBIT-COOKIES, cookies will neither be stored nor sent to
|
||||
|
105
src/ChangeLog
105
src/ChangeLog
@ -1,3 +1,108 @@
|
||||
2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
|
||||
|
||||
2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
|
||||
|
||||
* coding.c (detect_coding): Set coding->id before calling
|
||||
this->detector.
|
||||
|
||||
2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* fileio.c: Formatting fixes.
|
||||
|
||||
2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Fix some stat-related races.
|
||||
* fileio.c (Fwrite_region): Avoid race condition if a file is
|
||||
removed or renamed by some other process immediately after Emacs
|
||||
writes it but before Emacs stats it. Do not assume that stat (or
|
||||
fstat) succeeds.
|
||||
* image.c (slurp_file): Resolve the file name with fopen + fstat
|
||||
rather than stat + fopen.
|
||||
(pbm_read_file) [0]: Remove unused code with stat race.
|
||||
* process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
|
||||
Remove ineffective code with stat race.
|
||||
|
||||
2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* doc.c (get_doc_string): Don't signal an error if the file is missing.
|
||||
|
||||
2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* nsterm.m (hold_event_q): New static variable.
|
||||
(EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
|
||||
! q_event_ptr.
|
||||
(hold_event): New function.
|
||||
(ns_read_socket): If hold_event_q have events, store them and
|
||||
return (Bug#12384).
|
||||
(setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
|
||||
is zero (Bug#12384).
|
||||
|
||||
2012-10-12 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
|
||||
|
||||
2012-10-12 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
|
||||
|
||||
* fileio.c (check_existing): New function.
|
||||
(make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
|
||||
instead of calling 'stat', when what's needed is to check whether
|
||||
a file exists. This avoids expensive system calls on MS-Windows.
|
||||
(Bug#12587)
|
||||
|
||||
* w32.c (init_environment): Call 'check_existing' instead of
|
||||
'stat'.
|
||||
|
||||
* lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
|
||||
determine whether a file exists and is not a directory.
|
||||
|
||||
* lisp.h (check_existing): Add prototype.
|
||||
|
||||
2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
|
||||
|
||||
2012-10-12 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* buffer.c (Fset_buffer): Doc fix. (Bug#12624)
|
||||
|
||||
2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
|
||||
|
||||
* eval.c (Fautoload): Remember previous autoload status in load-history.
|
||||
|
||||
2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
|
||||
* lread.c (load_each_byte, new_backquote_flag, readchar)
|
||||
(read_filtered_event, lisp_file_lexically_bound_p)
|
||||
(safe_to_load_version, Fload, complete_filename_p, openp)
|
||||
(build_load_history, readevalloop, read_escape, read1)
|
||||
(string_to_number, read_vector, read_list):
|
||||
* macros.c (Fstart_kbd_macro):
|
||||
* marker.c (CONSIDER):
|
||||
* menu.c (parse_single_submenu, digest_single_submenu)
|
||||
(find_and_return_menu_selection, Fx_popup_menu):
|
||||
* minibuf.c (read_minibuf_noninteractive, read_minibuf)
|
||||
(Ftry_completion):
|
||||
* nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
|
||||
(ns_menu_show):
|
||||
* xmenu.c (set_frame_menubar, create_and_show_popup_menu)
|
||||
(xmenu_show, xdialog_show):
|
||||
Use bool for booleans.
|
||||
* lread.c (safe_to_load_version): Rename from safe_to_load_p,
|
||||
as it's not a predicate. All uses changed. Omit unnecessary
|
||||
buffer termination.
|
||||
|
||||
2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* editfns.c (save_excursion_save): Use nil if mark points to nowhere.
|
||||
(save_excursion_restore): Do not restore mark if it was not saved.
|
||||
|
||||
2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* marker.c (cached_modiff): EMACS_INT, not int.
|
||||
|
33
src/buffer.c
33
src/buffer.c
@ -897,6 +897,8 @@ delete_all_overlays (struct buffer *b)
|
||||
{
|
||||
struct Lisp_Overlay *ov, *next;
|
||||
|
||||
/* FIXME: Since each drop_overlay will scan BUF_MARKERS to unlink its
|
||||
markers, we have an unneeded O(N^2) behavior here. */
|
||||
for (ov = b->overlays_before; ov; ov = next)
|
||||
{
|
||||
drop_overlay (b, ov);
|
||||
@ -1886,16 +1888,19 @@ cleaning up all windows currently displaying the buffer to be killed. */)
|
||||
|
||||
if (b->base_buffer)
|
||||
{
|
||||
/* Unchain all markers that belong to this indirect buffer.
|
||||
Don't unchain the markers that belong to the base buffer
|
||||
or its other indirect buffers. */
|
||||
for (m = BUF_MARKERS (b); m; )
|
||||
{
|
||||
struct Lisp_Marker *next = m->next;
|
||||
if (m->buffer == b)
|
||||
unchain_marker (m);
|
||||
m = next;
|
||||
}
|
||||
{ /* Unchain all markers that belong to this indirect buffer.
|
||||
Don't unchain the markers that belong to the base buffer
|
||||
or its other indirect buffers. */
|
||||
struct Lisp_Marker **mp;
|
||||
for (mp = &BUF_MARKERS (b); *mp; )
|
||||
{
|
||||
struct Lisp_Marker *m = *mp;
|
||||
if (m->buffer == b)
|
||||
*mp = m->next;
|
||||
else
|
||||
mp = &m->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1911,8 +1916,12 @@ cleaning up all windows currently displaying the buffer to be killed. */)
|
||||
BUF_MARKERS (b) = NULL;
|
||||
set_buffer_intervals (b, NULL);
|
||||
|
||||
/* Perhaps we should explicitly free the interval tree here... */
|
||||
/* Perhaps we should explicitly free the interval tree here... */
|
||||
}
|
||||
/* Since we've unlinked the markers, the overlays can't be here any more
|
||||
either. */
|
||||
b->overlays_before = NULL;
|
||||
b->overlays_after = NULL;
|
||||
|
||||
/* Reset the local variables, so that this buffer's local values
|
||||
won't be protected from GC. They would be protected
|
||||
@ -2176,7 +2185,7 @@ set_buffer_temp (struct buffer *b)
|
||||
DEFUN ("set-buffer", Fset_buffer, Sset_buffer, 1, 1, 0,
|
||||
doc: /* Make buffer BUFFER-OR-NAME current for editing operations.
|
||||
BUFFER-OR-NAME may be a buffer or the name of an existing buffer. See
|
||||
also `save-excursion' when you want to make a buffer current
|
||||
also `with-current-buffer' when you want to make a buffer current
|
||||
temporarily. This function does not display the buffer, so its effect
|
||||
ends when the current command terminates. Use `switch-to-buffer' or
|
||||
`pop-to-buffer' to switch buffers permanently. */)
|
||||
|
@ -6301,6 +6301,9 @@ detect_coding (struct coding_system *coding)
|
||||
{
|
||||
category = coding_priorities[i];
|
||||
this = coding_categories + category;
|
||||
/* Some of this->detector (e.g. detect_coding_sjis)
|
||||
require this information. */
|
||||
coding->id = this->id;
|
||||
if (this->id < 0)
|
||||
{
|
||||
/* No coding system of this category is defined. */
|
||||
|
@ -144,7 +144,8 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
|
||||
}
|
||||
#endif
|
||||
if (fd < 0)
|
||||
error ("Cannot open doc string file \"%s\"", name);
|
||||
return concat3 (build_string ("Cannot open doc string file \""),
|
||||
file, build_string ("\"\n"));
|
||||
}
|
||||
|
||||
/* Seek only to beginning of disk block. */
|
||||
|
@ -819,9 +819,13 @@ save_excursion_save (void)
|
||||
{
|
||||
bool visible = (XBUFFER (XWINDOW (selected_window)->buffer)
|
||||
== current_buffer);
|
||||
/* Do not copy the mark if it points to nowhere. */
|
||||
Lisp_Object mark = (XMARKER (BVAR (current_buffer, mark))->buffer
|
||||
? Fcopy_marker (BVAR (current_buffer, mark), Qnil)
|
||||
: Qnil);
|
||||
|
||||
return Fcons (Fpoint_marker (),
|
||||
Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil),
|
||||
Fcons (mark,
|
||||
Fcons (visible ? Qt : Qnil,
|
||||
Fcons (BVAR (current_buffer, mark_active),
|
||||
selected_window))));
|
||||
@ -856,9 +860,14 @@ save_excursion_restore (Lisp_Object info)
|
||||
info = XCDR (info);
|
||||
tem = XCAR (info);
|
||||
omark = Fmarker_position (BVAR (current_buffer, mark));
|
||||
Fset_marker (BVAR (current_buffer, mark), tem, Fcurrent_buffer ());
|
||||
nmark = Fmarker_position (tem);
|
||||
unchain_marker (XMARKER (tem));
|
||||
if (NILP (tem))
|
||||
unchain_marker (XMARKER (BVAR (current_buffer, mark)));
|
||||
else
|
||||
{
|
||||
Fset_marker (BVAR (current_buffer, mark), tem, Fcurrent_buffer ());
|
||||
nmark = Fmarker_position (tem);
|
||||
unchain_marker (XMARKER (tem));
|
||||
}
|
||||
|
||||
/* visible */
|
||||
info = XCDR (info);
|
||||
|
@ -1876,9 +1876,11 @@ this does nothing and returns nil. */)
|
||||
CHECK_STRING (file);
|
||||
|
||||
/* If function is defined and not as an autoload, don't override. */
|
||||
if (!EQ (XSYMBOL (function)->function, Qunbound)
|
||||
&& !(CONSP (XSYMBOL (function)->function)
|
||||
&& EQ (XCAR (XSYMBOL (function)->function), Qautoload)))
|
||||
if ((CONSP (XSYMBOL (function)->function)
|
||||
&& EQ (XCAR (XSYMBOL (function)->function), Qautoload)))
|
||||
/* Remember that the function was already an autoload. */
|
||||
LOADHIST_ATTACH (Fcons (Qt, function));
|
||||
else if (!EQ (XSYMBOL (function)->function, Qunbound))
|
||||
return Qnil;
|
||||
|
||||
if (NILP (Vpurify_flag))
|
||||
|
100
src/fileio.c
100
src/fileio.c
@ -52,6 +52,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define NOMINMAX 1
|
||||
#include <windows.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/file.h>
|
||||
#endif /* not WINDOWSNT */
|
||||
|
||||
#ifdef MSDOS
|
||||
@ -668,7 +669,6 @@ make_temp_name (Lisp_Object prefix, bool base64_p)
|
||||
|
||||
while (1)
|
||||
{
|
||||
struct stat ignored;
|
||||
unsigned num = make_temp_name_count;
|
||||
|
||||
p[0] = make_temp_name_tbl[num & 63], num >>= 6;
|
||||
@ -680,7 +680,7 @@ make_temp_name (Lisp_Object prefix, bool base64_p)
|
||||
make_temp_name_count += 25229;
|
||||
make_temp_name_count %= 225307;
|
||||
|
||||
if (stat (data, &ignored) < 0)
|
||||
if (!check_existing (data))
|
||||
{
|
||||
/* We want to return only if errno is ENOENT. */
|
||||
if (errno == ENOENT)
|
||||
@ -1370,8 +1370,7 @@ See also the function `substitute-in-file-name'.")
|
||||
p = nm;
|
||||
while (*p)
|
||||
{
|
||||
if (p[0] == '/' && p[1] == '/'
|
||||
)
|
||||
if (p[0] == '/' && p[1] == '/')
|
||||
nm = p + 1;
|
||||
if (p[0] == '/' && p[1] == '~')
|
||||
nm = p + 1, lose = 1;
|
||||
@ -1510,17 +1509,16 @@ search_embedded_absfilename (char *nm, char *endp)
|
||||
|
||||
for (p = nm + 1; p < endp; p++)
|
||||
{
|
||||
if ((0
|
||||
|| IS_DIRECTORY_SEP (p[-1]))
|
||||
if (IS_DIRECTORY_SEP (p[-1])
|
||||
&& file_name_absolute_p (p)
|
||||
#if defined (WINDOWSNT) || defined (CYGWIN)
|
||||
/* // at start of file name is meaningful in Apollo,
|
||||
WindowsNT and Cygwin systems. */
|
||||
&& !(IS_DIRECTORY_SEP (p[0]) && p - 1 == nm)
|
||||
#endif /* not (WINDOWSNT || CYGWIN) */
|
||||
)
|
||||
)
|
||||
{
|
||||
for (s = p; *s && (!IS_DIRECTORY_SEP (*s)); s++);
|
||||
for (s = p; *s && !IS_DIRECTORY_SEP (*s); s++);
|
||||
if (p[0] == '~' && s > p + 1) /* We've got "/~something/". */
|
||||
{
|
||||
char *o = alloca (s - p + 1);
|
||||
@ -1735,7 +1733,7 @@ those `/' is discarded. */)
|
||||
*x = 0;
|
||||
|
||||
/* If /~ or // appears, discard everything through first slash. */
|
||||
while ((p = search_embedded_absfilename (xnm, x)))
|
||||
while ((p = search_embedded_absfilename (xnm, x)) != NULL)
|
||||
/* This time we do not start over because we've already expanded envvars
|
||||
and replaced $$ with $. Maybe we should start over as well, but we'd
|
||||
need to quote some $ to $$ first. */
|
||||
@ -2169,7 +2167,7 @@ With a prefix argument, TRASH is nil. */)
|
||||
|
||||
encoded_file = ENCODE_FILE (filename);
|
||||
|
||||
if (0 > unlink (SSDATA (encoded_file)))
|
||||
if (unlink (SSDATA (encoded_file)) < 0)
|
||||
report_file_error ("Removing old name", list1 (filename));
|
||||
return Qnil;
|
||||
}
|
||||
@ -2218,8 +2216,8 @@ This is what happens in interactive use with M-x. */)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
Lisp_Object fname = NILP (Ffile_directory_p (file))
|
||||
? file : Fdirectory_file_name (file);
|
||||
Lisp_Object fname = (NILP (Ffile_directory_p (file))
|
||||
? file : Fdirectory_file_name (file));
|
||||
newname = Fexpand_file_name (Ffile_name_nondirectory (fname), newname);
|
||||
}
|
||||
else
|
||||
@ -2247,7 +2245,7 @@ This is what happens in interactive use with M-x. */)
|
||||
|| INTEGERP (ok_if_already_exists))
|
||||
barf_or_query_if_file_exists (newname, "rename to it",
|
||||
INTEGERP (ok_if_already_exists), 0, 0);
|
||||
if (0 > rename (SSDATA (encoded_file), SSDATA (encoded_newname)))
|
||||
if (rename (SSDATA (encoded_file), SSDATA (encoded_newname)) < 0)
|
||||
{
|
||||
if (errno == EXDEV)
|
||||
{
|
||||
@ -2328,7 +2326,7 @@ This is what happens in interactive use with M-x. */)
|
||||
INTEGERP (ok_if_already_exists), 0, 0);
|
||||
|
||||
unlink (SSDATA (newname));
|
||||
if (0 > link (SSDATA (encoded_file), SSDATA (encoded_newname)))
|
||||
if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) < 0)
|
||||
report_file_error ("Adding new name", list2 (file, newname));
|
||||
|
||||
UNGCPRO;
|
||||
@ -2385,15 +2383,14 @@ This happens for interactive use with M-x. */)
|
||||
|| INTEGERP (ok_if_already_exists))
|
||||
barf_or_query_if_file_exists (linkname, "make it a link",
|
||||
INTEGERP (ok_if_already_exists), 0, 0);
|
||||
if (0 > symlink (SSDATA (encoded_filename),
|
||||
SSDATA (encoded_linkname)))
|
||||
if (symlink (SSDATA (encoded_filename), SSDATA (encoded_linkname)) < 0)
|
||||
{
|
||||
/* If we didn't complain already, silently delete existing file. */
|
||||
if (errno == EEXIST)
|
||||
{
|
||||
unlink (SSDATA (encoded_linkname));
|
||||
if (0 <= symlink (SSDATA (encoded_filename),
|
||||
SSDATA (encoded_linkname)))
|
||||
if (symlink (SSDATA (encoded_filename), SSDATA (encoded_linkname))
|
||||
>= 0)
|
||||
{
|
||||
UNGCPRO;
|
||||
return Qnil;
|
||||
@ -2423,6 +2420,21 @@ On Unix, this is a name starting with a `/' or a `~'. */)
|
||||
return file_name_absolute_p (SSDATA (filename)) ? Qt : Qnil;
|
||||
}
|
||||
|
||||
/* Return true if FILENAME exists. */
|
||||
bool
|
||||
check_existing (const char *filename)
|
||||
{
|
||||
#ifdef DOS_NT
|
||||
/* The full emulation of Posix 'stat' is too expensive on
|
||||
DOS/Windows, when all we want to know is whether the file exists.
|
||||
So we use 'access' instead, which is much more lightweight. */
|
||||
return (access (filename, F_OK) >= 0);
|
||||
#else
|
||||
struct stat st;
|
||||
return (stat (filename, &st) >= 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Return true if file FILENAME exists and can be executed. */
|
||||
|
||||
static bool
|
||||
@ -2490,7 +2502,6 @@ Use `file-symlink-p' to test for such links. */)
|
||||
{
|
||||
Lisp_Object absname;
|
||||
Lisp_Object handler;
|
||||
struct stat statbuf;
|
||||
|
||||
CHECK_STRING (filename);
|
||||
absname = Fexpand_file_name (filename, Qnil);
|
||||
@ -2503,7 +2514,7 @@ Use `file-symlink-p' to test for such links. */)
|
||||
|
||||
absname = ENCODE_FILE (absname);
|
||||
|
||||
return (stat (SSDATA (absname), &statbuf) >= 0) ? Qt : Qnil;
|
||||
return (check_existing (SSDATA (absname))) ? Qt : Qnil;
|
||||
}
|
||||
|
||||
DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0,
|
||||
@ -2584,7 +2595,6 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
|
||||
{
|
||||
Lisp_Object absname, dir, encoded;
|
||||
Lisp_Object handler;
|
||||
struct stat statbuf;
|
||||
|
||||
CHECK_STRING (filename);
|
||||
absname = Fexpand_file_name (filename, Qnil);
|
||||
@ -2596,7 +2606,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
|
||||
return call2 (handler, Qfile_writable_p, absname);
|
||||
|
||||
encoded = ENCODE_FILE (absname);
|
||||
if (stat (SSDATA (encoded), &statbuf) >= 0)
|
||||
if (check_existing (SSDATA (encoded)))
|
||||
return (check_writable (SSDATA (encoded))
|
||||
? Qt : Qnil);
|
||||
|
||||
@ -2611,9 +2621,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
|
||||
/* The read-only attribute of the parent directory doesn't affect
|
||||
whether a file or directory can be created within it. Some day we
|
||||
should check ACLs though, which do affect this. */
|
||||
if (stat (SDATA (dir), &statbuf) < 0)
|
||||
return Qnil;
|
||||
return S_ISDIR (statbuf.st_mode) ? Qt : Qnil;
|
||||
return (access (SDATA (dir), D_OK) < 0) ? Qnil : Qt;
|
||||
#else
|
||||
return (check_writable (!NILP (dir) ? SSDATA (dir) : "")
|
||||
? Qt : Qnil);
|
||||
@ -3192,7 +3200,7 @@ emacs_lseek (int fd, EMACS_INT offset, int whence)
|
||||
{
|
||||
/* Use "&" rather than "&&" to suppress a bogus GCC warning; see
|
||||
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43772>. */
|
||||
if (! ((TYPE_MINIMUM (off_t) <= offset) & (offset <= TYPE_MAXIMUM (off_t))))
|
||||
if (! ((offset >= TYPE_MINIMUM (off_t)) & (offset <= TYPE_MAXIMUM (off_t))))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
@ -3365,7 +3373,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
|
||||
|
||||
if (!NILP (beg))
|
||||
{
|
||||
if (! (RANGED_INTEGERP (0, beg, TYPE_MAXIMUM (off_t))))
|
||||
if (! RANGED_INTEGERP (0, beg, TYPE_MAXIMUM (off_t)))
|
||||
wrong_type_argument (intern ("file-offset"), beg);
|
||||
beg_offset = XFASTINT (beg);
|
||||
}
|
||||
@ -3374,7 +3382,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
|
||||
|
||||
if (!NILP (end))
|
||||
{
|
||||
if (! (RANGED_INTEGERP (0, end, TYPE_MAXIMUM (off_t))))
|
||||
if (! RANGED_INTEGERP (0, end, TYPE_MAXIMUM (off_t)))
|
||||
wrong_type_argument (intern ("file-offset"), end);
|
||||
end_offset = XFASTINT (end);
|
||||
}
|
||||
@ -3410,8 +3418,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
|
||||
|
||||
if (beg_offset < likely_end)
|
||||
{
|
||||
ptrdiff_t buf_bytes =
|
||||
Z_BYTE - (!NILP (replace) ? ZV_BYTE - BEGV_BYTE : 0);
|
||||
ptrdiff_t buf_bytes
|
||||
= Z_BYTE - (!NILP (replace) ? ZV_BYTE - BEGV_BYTE : 0);
|
||||
ptrdiff_t buf_growth_max = BUF_BYTES_MAX - buf_bytes;
|
||||
off_t likely_growth = likely_end - beg_offset;
|
||||
if (buf_growth_max < likely_growth)
|
||||
@ -4534,6 +4542,7 @@ This calls `write-region-annotate-functions' at the start, and
|
||||
int save_errno = 0;
|
||||
const char *fn;
|
||||
struct stat st;
|
||||
EMACS_TIME modtime;
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
int count1;
|
||||
Lisp_Object handler;
|
||||
@ -4746,12 +4755,19 @@ This calls `write-region-annotate-functions' at the start, and
|
||||
}
|
||||
#endif
|
||||
|
||||
modtime = invalid_emacs_time ();
|
||||
if (visiting)
|
||||
{
|
||||
if (fstat (desc, &st) == 0)
|
||||
modtime = get_stat_mtime (&st);
|
||||
else
|
||||
ok = 0, save_errno = errno;
|
||||
}
|
||||
|
||||
/* NFS can report a write failure now. */
|
||||
if (emacs_close (desc) < 0)
|
||||
ok = 0, save_errno = errno;
|
||||
|
||||
stat (fn, &st);
|
||||
|
||||
/* Discard the unwind protect for close_file_unwind. */
|
||||
specpdl_ptr = specpdl + count1;
|
||||
|
||||
@ -4779,9 +4795,9 @@ This calls `write-region-annotate-functions' at the start, and
|
||||
/* Do this before reporting IO error
|
||||
to avoid a "file has changed on disk" warning on
|
||||
next attempt to save. */
|
||||
if (visiting)
|
||||
if (EMACS_TIME_VALID_P (modtime))
|
||||
{
|
||||
current_buffer->modtime = get_stat_mtime (&st);
|
||||
current_buffer->modtime = modtime;
|
||||
current_buffer->modtime_size = st.st_size;
|
||||
}
|
||||
|
||||
@ -5031,12 +5047,12 @@ e_write (int desc, Lisp_Object string, ptrdiff_t start, ptrdiff_t end,
|
||||
|
||||
if (coding->produced > 0)
|
||||
{
|
||||
coding->produced -=
|
||||
emacs_write (desc,
|
||||
STRINGP (coding->dst_object)
|
||||
? SSDATA (coding->dst_object)
|
||||
: (char *) BYTE_POS_ADDR (coding->dst_pos_byte),
|
||||
coding->produced);
|
||||
coding->produced
|
||||
-= emacs_write (desc,
|
||||
STRINGP (coding->dst_object)
|
||||
? SSDATA (coding->dst_object)
|
||||
: (char *) BYTE_POS_ADDR (coding->dst_pos_byte),
|
||||
coding->produced);
|
||||
|
||||
if (coding->produced)
|
||||
return 0;
|
||||
@ -5215,8 +5231,8 @@ auto_save_1 (void)
|
||||
if (stat (SSDATA (BVAR (current_buffer, filename)), &st) >= 0)
|
||||
/* But make sure we can overwrite it later! */
|
||||
auto_save_mode_bits = (st.st_mode | 0600) & 0777;
|
||||
else if ((modes = Ffile_modes (BVAR (current_buffer, filename)),
|
||||
INTEGERP (modes)))
|
||||
else if (modes = Ffile_modes (BVAR (current_buffer, filename)),
|
||||
INTEGERP (modes))
|
||||
/* Remote files don't cooperate with stat. */
|
||||
auto_save_mode_bits = (XINT (modes) | 0600) & 0777;
|
||||
}
|
||||
|
@ -1035,9 +1035,9 @@ xg_set_widget_bg (FRAME_PTR f, GtkWidget *w, long unsigned int pixel)
|
||||
xbg.pixel = pixel;
|
||||
if (XQueryColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &xbg))
|
||||
{
|
||||
bg.red = (double)xbg.red/65536.0;
|
||||
bg.green = (double)xbg.green/65536.0;
|
||||
bg.blue = (double)xbg.blue/65536.0;
|
||||
bg.red = (double)xbg.red/65535.0;
|
||||
bg.green = (double)xbg.green/65535.0;
|
||||
bg.blue = (double)xbg.blue/65535.0;
|
||||
bg.alpha = 1.0;
|
||||
gtk_widget_override_background_color (w, GTK_STATE_FLAG_NORMAL, &bg);
|
||||
}
|
||||
|
44
src/image.c
44
src/image.c
@ -2140,12 +2140,11 @@ x_find_image_file (Lisp_Object file)
|
||||
static unsigned char *
|
||||
slurp_file (char *file, ptrdiff_t *size)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
FILE *fp = fopen (file, "rb");
|
||||
unsigned char *buf = NULL;
|
||||
struct stat st;
|
||||
|
||||
if (stat (file, &st) == 0
|
||||
&& (fp = fopen (file, "rb")) != NULL
|
||||
if (fp && fstat (fileno (fp), &st) == 0
|
||||
&& 0 <= st.st_size && st.st_size <= min (PTRDIFF_MAX, SIZE_MAX)
|
||||
&& (buf = xmalloc (st.st_size),
|
||||
fread (buf, 1, st.st_size, fp) == st.st_size))
|
||||
@ -5004,45 +5003,6 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_NTGUI
|
||||
#if 0 /* Unused. ++kfs */
|
||||
|
||||
/* Read FILE into memory. Value is a pointer to a buffer allocated
|
||||
with xmalloc holding FILE's contents. Value is null if an error
|
||||
occurred. *SIZE is set to the size of the file. */
|
||||
|
||||
static char *
|
||||
pbm_read_file (Lisp_Object file, int *size)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
char *buf = NULL;
|
||||
struct stat st;
|
||||
|
||||
if (stat (SDATA (file), &st) == 0
|
||||
&& (fp = fopen (SDATA (file), "rb")) != NULL
|
||||
&& 0 <= st.st_size && st.st_size <= min (PTRDIFF_MAX, SIZE_MAX)
|
||||
&& (buf = xmalloc (st.st_size),
|
||||
fread (buf, 1, st.st_size, fp) == st.st_size))
|
||||
{
|
||||
*size = st.st_size;
|
||||
fclose (fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fp)
|
||||
fclose (fp);
|
||||
if (buf)
|
||||
{
|
||||
xfree (buf);
|
||||
buf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
#endif
|
||||
#endif /* HAVE_NTGUI */
|
||||
|
||||
/* Load PBM image IMG for use on frame F. */
|
||||
|
||||
static bool
|
||||
|
@ -3027,7 +3027,7 @@ extern Lisp_Object oblookup (Lisp_Object, const char *, ptrdiff_t, ptrdiff_t);
|
||||
} while (0)
|
||||
extern int openp (Lisp_Object, Lisp_Object, Lisp_Object,
|
||||
Lisp_Object *, Lisp_Object);
|
||||
Lisp_Object string_to_number (char const *, int, int);
|
||||
extern Lisp_Object string_to_number (char const *, int, bool);
|
||||
extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
|
||||
Lisp_Object);
|
||||
extern void dir_warning (const char *, Lisp_Object);
|
||||
@ -3182,6 +3182,7 @@ extern void internal_delete_file (Lisp_Object);
|
||||
extern void syms_of_fileio (void);
|
||||
extern Lisp_Object make_temp_name (Lisp_Object, bool);
|
||||
extern Lisp_Object Qdelete_file;
|
||||
extern bool check_existing (const char *);
|
||||
|
||||
/* Defined in search.c. */
|
||||
extern void shrink_regexp_cache (void);
|
||||
|
174
src/lread.c
174
src/lread.c
@ -95,10 +95,10 @@ static Lisp_Object Qload_in_progress;
|
||||
It must be set to nil before all top-level calls to read0. */
|
||||
static Lisp_Object read_objects;
|
||||
|
||||
/* Nonzero means READCHAR should read bytes one by one (not character)
|
||||
/* True means READCHAR should read bytes one by one (not character)
|
||||
when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char.
|
||||
This is set to 1 by read1 temporarily while handling #@NUMBER. */
|
||||
static int load_each_byte;
|
||||
This is set by read1 temporarily while handling #@NUMBER. */
|
||||
static bool load_each_byte;
|
||||
|
||||
/* List of descriptors now open for Fload. */
|
||||
static Lisp_Object load_descriptor_list;
|
||||
@ -135,11 +135,11 @@ static ptrdiff_t prev_saved_doc_string_length;
|
||||
/* This is the file position that string came from. */
|
||||
static file_offset prev_saved_doc_string_position;
|
||||
|
||||
/* Nonzero means inside a new-style backquote
|
||||
/* True means inside a new-style backquote
|
||||
with no surrounding parentheses.
|
||||
Fread initializes this to zero, so we need not specbind it
|
||||
Fread initializes this to false, so we need not specbind it
|
||||
or worry about what happens to it when there is an error. */
|
||||
static int new_backquote_flag;
|
||||
static bool new_backquote_flag;
|
||||
static Lisp_Object Qold_style_backquotes;
|
||||
|
||||
/* A list of file names for files being loaded in Fload. Used to
|
||||
@ -150,7 +150,7 @@ static Lisp_Object Vloads_in_progress;
|
||||
static int read_emacs_mule_char (int, int (*) (int, Lisp_Object),
|
||||
Lisp_Object);
|
||||
|
||||
static void readevalloop (Lisp_Object, FILE*, Lisp_Object, int,
|
||||
static void readevalloop (Lisp_Object, FILE *, Lisp_Object, bool,
|
||||
Lisp_Object, Lisp_Object,
|
||||
Lisp_Object, Lisp_Object);
|
||||
static Lisp_Object load_unwind (Lisp_Object);
|
||||
@ -192,7 +192,7 @@ readchar (Lisp_Object readcharfun, bool *multibyte)
|
||||
int (*readbyte) (int, Lisp_Object);
|
||||
unsigned char buf[MAX_MULTIBYTE_LENGTH];
|
||||
int i, len;
|
||||
int emacs_mule_encoding = 0;
|
||||
bool emacs_mule_encoding = 0;
|
||||
|
||||
if (multibyte)
|
||||
*multibyte = 0;
|
||||
@ -546,10 +546,10 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
|
||||
static Lisp_Object read_internal_start (Lisp_Object, Lisp_Object,
|
||||
Lisp_Object);
|
||||
static Lisp_Object read0 (Lisp_Object);
|
||||
static Lisp_Object read1 (Lisp_Object, int *, int);
|
||||
static Lisp_Object read1 (Lisp_Object, int *, bool);
|
||||
|
||||
static Lisp_Object read_list (int, Lisp_Object);
|
||||
static Lisp_Object read_vector (Lisp_Object, int);
|
||||
static Lisp_Object read_list (bool, Lisp_Object);
|
||||
static Lisp_Object read_vector (Lisp_Object, bool);
|
||||
|
||||
static Lisp_Object substitute_object_recurse (Lisp_Object, Lisp_Object,
|
||||
Lisp_Object);
|
||||
@ -562,28 +562,28 @@ static void substitute_in_interval (INTERVAL, Lisp_Object);
|
||||
|
||||
/* Read input events until we get one that's acceptable for our purposes.
|
||||
|
||||
If NO_SWITCH_FRAME is non-zero, switch-frame events are stashed
|
||||
If NO_SWITCH_FRAME, switch-frame events are stashed
|
||||
until we get a character we like, and then stuffed into
|
||||
unread_switch_frame.
|
||||
|
||||
If ASCII_REQUIRED is non-zero, we check function key events to see
|
||||
If ASCII_REQUIRED, check function key events to see
|
||||
if the unmodified version of the symbol has a Qascii_character
|
||||
property, and use that character, if present.
|
||||
|
||||
If ERROR_NONASCII is non-zero, we signal an error if the input we
|
||||
get isn't an ASCII character with modifiers. If it's zero but
|
||||
ASCII_REQUIRED is non-zero, we just re-read until we get an ASCII
|
||||
If ERROR_NONASCII, signal an error if the input we
|
||||
get isn't an ASCII character with modifiers. If it's false but
|
||||
ASCII_REQUIRED is true, just re-read until we get an ASCII
|
||||
character.
|
||||
|
||||
If INPUT_METHOD is nonzero, we invoke the current input method
|
||||
If INPUT_METHOD, invoke the current input method
|
||||
if the character warrants that.
|
||||
|
||||
If SECONDS is a number, we wait that many seconds for input, and
|
||||
If SECONDS is a number, wait that many seconds for input, and
|
||||
return Qnil if no input arrives within that time. */
|
||||
|
||||
static Lisp_Object
|
||||
read_filtered_event (int no_switch_frame, int ascii_required,
|
||||
int error_nonascii, int input_method, Lisp_Object seconds)
|
||||
read_filtered_event (bool no_switch_frame, bool ascii_required,
|
||||
bool error_nonascii, bool input_method, Lisp_Object seconds)
|
||||
{
|
||||
Lisp_Object val, delayed_switch_frame;
|
||||
EMACS_TIME end_time;
|
||||
@ -767,7 +767,7 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
|
||||
positioned following the first line, if it is a comment or #! line,
|
||||
otherwise nothing is read. */
|
||||
|
||||
static int
|
||||
static bool
|
||||
lisp_file_lexically_bound_p (Lisp_Object readcharfun)
|
||||
{
|
||||
int ch = READCHAR;
|
||||
@ -797,11 +797,11 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
|
||||
else
|
||||
/* Look for an appropriate file-variable in the first line. */
|
||||
{
|
||||
int rv = 0;
|
||||
bool rv = 0;
|
||||
enum {
|
||||
NOMINAL, AFTER_FIRST_DASH, AFTER_ASTERIX,
|
||||
} beg_end_state = NOMINAL;
|
||||
int in_file_vars = 0;
|
||||
bool in_file_vars = 0;
|
||||
|
||||
#define UPDATE_BEG_END_STATE(ch) \
|
||||
if (beg_end_state == NOMINAL) \
|
||||
@ -897,20 +897,17 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
|
||||
because of an incompatible change in the byte compiler. */
|
||||
|
||||
static int
|
||||
safe_to_load_p (int fd)
|
||||
safe_to_load_version (int fd)
|
||||
{
|
||||
char buf[512];
|
||||
int nbytes, i;
|
||||
int safe_p = 1;
|
||||
int version = 1;
|
||||
|
||||
/* Read the first few bytes from the file, and look for a line
|
||||
specifying the byte compiler version used. */
|
||||
nbytes = emacs_read (fd, buf, sizeof buf - 1);
|
||||
nbytes = emacs_read (fd, buf, sizeof buf);
|
||||
if (nbytes > 0)
|
||||
{
|
||||
buf[nbytes] = '\0';
|
||||
|
||||
/* Skip to the next newline, skipping over the initial `ELC'
|
||||
with NUL bytes following it, but note the version. */
|
||||
for (i = 0; i < nbytes && buf[i] != '\n'; ++i)
|
||||
@ -920,13 +917,11 @@ safe_to_load_p (int fd)
|
||||
if (i >= nbytes
|
||||
|| fast_c_string_match_ignore_case (Vbytecomp_version_regexp,
|
||||
buf + i, nbytes - i) < 0)
|
||||
safe_p = 0;
|
||||
version = 0;
|
||||
}
|
||||
if (safe_p)
|
||||
safe_p = version;
|
||||
|
||||
lseek (fd, 0, SEEK_SET);
|
||||
return safe_p;
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
@ -1030,12 +1025,12 @@ Return t if the file exists and loads successfully. */)
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
struct gcpro gcpro1, gcpro2, gcpro3;
|
||||
Lisp_Object found, efound, hist_file_name;
|
||||
/* 1 means we printed the ".el is newer" message. */
|
||||
int newer = 0;
|
||||
/* 1 means we are loading a compiled file. */
|
||||
int compiled = 0;
|
||||
/* True means we printed the ".el is newer" message. */
|
||||
bool newer = 0;
|
||||
/* True means we are loading a compiled file. */
|
||||
bool compiled = 0;
|
||||
Lisp_Object handler;
|
||||
int safe_p = 1;
|
||||
bool safe_p = 1;
|
||||
const char *fmode = "r";
|
||||
Lisp_Object tmp[2];
|
||||
int version;
|
||||
@ -1190,7 +1185,7 @@ Return t if the file exists and loads successfully. */)
|
||||
record_unwind_protect (load_warn_old_style_backquotes, file);
|
||||
|
||||
if (!memcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4)
|
||||
|| (fd >= 0 && (version = safe_to_load_p (fd)) > 0))
|
||||
|| (fd >= 0 && (version = safe_to_load_version (fd)) > 0))
|
||||
/* Load .elc files directly, but not when they are
|
||||
remote and have no handler! */
|
||||
{
|
||||
@ -1202,7 +1197,7 @@ Return t if the file exists and loads successfully. */)
|
||||
GCPRO3 (file, found, hist_file_name);
|
||||
|
||||
if (version < 0
|
||||
&& ! (version = safe_to_load_p (fd)))
|
||||
&& ! (version = safe_to_load_version (fd)))
|
||||
{
|
||||
safe_p = 0;
|
||||
if (!load_dangerous_libraries)
|
||||
@ -1394,10 +1389,10 @@ close_load_descs (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
static bool
|
||||
complete_filename_p (Lisp_Object pathname)
|
||||
{
|
||||
register const unsigned char *s = SDATA (pathname);
|
||||
const unsigned char *s = SDATA (pathname);
|
||||
return (IS_DIRECTORY_SEP (s[0])
|
||||
|| (SCHARS (pathname) > 2
|
||||
&& IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])));
|
||||
@ -1447,14 +1442,13 @@ static Lisp_Object Qdir_ok;
|
||||
int
|
||||
openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *storeptr, Lisp_Object predicate)
|
||||
{
|
||||
register int fd;
|
||||
int fd;
|
||||
ptrdiff_t fn_size = 100;
|
||||
char buf[100];
|
||||
register char *fn = buf;
|
||||
int absolute = 0;
|
||||
char *fn = buf;
|
||||
bool absolute = 0;
|
||||
ptrdiff_t want_length;
|
||||
Lisp_Object filename;
|
||||
struct stat st;
|
||||
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
|
||||
Lisp_Object string, tail, encoded_fn;
|
||||
ptrdiff_t max_suffix_len = 0;
|
||||
@ -1503,7 +1497,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
|
||||
{
|
||||
ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail));
|
||||
Lisp_Object handler;
|
||||
int exists;
|
||||
bool exists;
|
||||
|
||||
/* Concatenate path element/specified name with the suffix.
|
||||
If the directory starts with /:, remove that. */
|
||||
@ -1548,11 +1542,18 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef WINDOWSNT
|
||||
struct stat st;
|
||||
#endif
|
||||
const char *pfn;
|
||||
|
||||
encoded_fn = ENCODE_FILE (string);
|
||||
pfn = SSDATA (encoded_fn);
|
||||
#ifdef WINDOWSNT
|
||||
exists = access (pfn, F_OK) == 0 && access (pfn, D_OK) < 0;
|
||||
#else
|
||||
exists = (stat (pfn, &st) == 0 && ! S_ISDIR (st.st_mode));
|
||||
#endif
|
||||
if (exists)
|
||||
{
|
||||
/* Check that we can access or open it. */
|
||||
@ -1588,14 +1589,16 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
|
||||
the source has an associated file name or not.
|
||||
|
||||
FILENAME is the file name that we are loading from.
|
||||
ENTIRE is 1 if loading that entire file, 0 if evaluating part of it. */
|
||||
|
||||
ENTIRE is true if loading that entire file, false if evaluating
|
||||
part of it. */
|
||||
|
||||
static void
|
||||
build_load_history (Lisp_Object filename, int entire)
|
||||
build_load_history (Lisp_Object filename, bool entire)
|
||||
{
|
||||
register Lisp_Object tail, prev, newelt;
|
||||
register Lisp_Object tem, tem2;
|
||||
register int foundit = 0;
|
||||
Lisp_Object tail, prev, newelt;
|
||||
Lisp_Object tem, tem2;
|
||||
bool foundit = 0;
|
||||
|
||||
tail = Vload_history;
|
||||
prev = Qnil;
|
||||
@ -1680,7 +1683,7 @@ static void
|
||||
readevalloop (Lisp_Object readcharfun,
|
||||
FILE *stream,
|
||||
Lisp_Object sourcename,
|
||||
int printflag,
|
||||
bool printflag,
|
||||
Lisp_Object unibyte, Lisp_Object readfun,
|
||||
Lisp_Object start, Lisp_Object end)
|
||||
{
|
||||
@ -1689,12 +1692,12 @@ readevalloop (Lisp_Object readcharfun,
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
|
||||
struct buffer *b = 0;
|
||||
int continue_reading_p;
|
||||
bool continue_reading_p;
|
||||
Lisp_Object lex_bound;
|
||||
/* Nonzero if reading an entire buffer. */
|
||||
int whole_buffer = 0;
|
||||
/* 1 on the first time around. */
|
||||
int first_sexp = 1;
|
||||
/* True if reading an entire buffer. */
|
||||
bool whole_buffer = 0;
|
||||
/* True on the first time around. */
|
||||
bool first_sexp = 1;
|
||||
Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
|
||||
|
||||
if (NILP (Ffboundp (macroexpand))
|
||||
@ -2072,9 +2075,9 @@ static char *read_buffer;
|
||||
If the escape sequence forces unibyte, return eight-bit char. */
|
||||
|
||||
static int
|
||||
read_escape (Lisp_Object readcharfun, int stringp)
|
||||
read_escape (Lisp_Object readcharfun, bool stringp)
|
||||
{
|
||||
register int c = READCHAR;
|
||||
int c = READCHAR;
|
||||
/* \u allows up to four hex digits, \U up to eight. Default to the
|
||||
behavior for \u, and change this value in the case that \U is seen. */
|
||||
int unicode_hex_count = 4;
|
||||
@ -2375,10 +2378,10 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix)
|
||||
in *PCH and the return value is not interesting. Else, we store
|
||||
zero in *PCH and we read and return one lisp object.
|
||||
|
||||
FIRST_IN_LIST is nonzero if this is the first element of a list. */
|
||||
FIRST_IN_LIST is true if this is the first element of a list. */
|
||||
|
||||
static Lisp_Object
|
||||
read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
||||
read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
|
||||
{
|
||||
int c;
|
||||
bool uninterned_symbol = 0;
|
||||
@ -2803,10 +2806,11 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
||||
else
|
||||
{
|
||||
Lisp_Object value;
|
||||
bool saved_new_backquote_flag = new_backquote_flag;
|
||||
|
||||
new_backquote_flag++;
|
||||
new_backquote_flag = 1;
|
||||
value = read0 (readcharfun);
|
||||
new_backquote_flag--;
|
||||
new_backquote_flag = saved_new_backquote_flag;
|
||||
|
||||
return Fcons (Qbackquote, Fcons (value, Qnil));
|
||||
}
|
||||
@ -2858,7 +2862,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
||||
{
|
||||
int modifiers;
|
||||
int next_char;
|
||||
int ok;
|
||||
bool ok;
|
||||
|
||||
c = READCHAR;
|
||||
if (c < 0)
|
||||
@ -2894,14 +2898,14 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
||||
{
|
||||
char *p = read_buffer;
|
||||
char *end = read_buffer + read_buffer_size;
|
||||
register int ch;
|
||||
/* Nonzero if we saw an escape sequence specifying
|
||||
int ch;
|
||||
/* True if we saw an escape sequence specifying
|
||||
a multibyte character. */
|
||||
int force_multibyte = 0;
|
||||
/* Nonzero if we saw an escape sequence specifying
|
||||
bool force_multibyte = 0;
|
||||
/* True if we saw an escape sequence specifying
|
||||
a single-byte character. */
|
||||
int force_singlebyte = 0;
|
||||
int cancel = 0;
|
||||
bool force_singlebyte = 0;
|
||||
bool cancel = 0;
|
||||
ptrdiff_t nchars = 0;
|
||||
|
||||
while ((ch = READCHAR) >= 0
|
||||
@ -3033,7 +3037,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
||||
read_symbol:
|
||||
{
|
||||
char *p = read_buffer;
|
||||
int quoted = 0;
|
||||
bool quoted = 0;
|
||||
EMACS_INT start_position = readchar_count - 1;
|
||||
|
||||
{
|
||||
@ -3250,17 +3254,17 @@ substitute_in_interval (INTERVAL interval, Lisp_Object arg)
|
||||
/* Convert STRING to a number, assuming base BASE. Return a fixnum if CP has
|
||||
integer syntax and fits in a fixnum, else return the nearest float if CP has
|
||||
either floating point or integer syntax and BASE is 10, else return nil. If
|
||||
IGNORE_TRAILING is nonzero, consider just the longest prefix of CP that has
|
||||
IGNORE_TRAILING, consider just the longest prefix of CP that has
|
||||
valid floating point syntax. Signal an overflow if BASE is not 10 and the
|
||||
number has integer syntax but does not fit. */
|
||||
|
||||
Lisp_Object
|
||||
string_to_number (char const *string, int base, int ignore_trailing)
|
||||
string_to_number (char const *string, int base, bool ignore_trailing)
|
||||
{
|
||||
int state;
|
||||
char const *cp = string;
|
||||
int leading_digit;
|
||||
int float_syntax = 0;
|
||||
bool float_syntax = 0;
|
||||
double value = 0;
|
||||
|
||||
/* Compute NaN and infinities using a variable, to cope with compilers that
|
||||
@ -3270,9 +3274,9 @@ string_to_number (char const *string, int base, int ignore_trailing)
|
||||
/* Negate the value ourselves. This treats 0, NaNs, and infinity properly on
|
||||
IEEE floating point hosts, and works around a formerly-common bug where
|
||||
atof ("-0.0") drops the sign. */
|
||||
int negative = *cp == '-';
|
||||
bool negative = *cp == '-';
|
||||
|
||||
int signedp = negative || *cp == '+';
|
||||
bool signedp = negative || *cp == '+';
|
||||
cp += signedp;
|
||||
|
||||
state = 0;
|
||||
@ -3365,7 +3369,7 @@ string_to_number (char const *string, int base, int ignore_trailing)
|
||||
uintmax_t n;
|
||||
|
||||
/* Fast special case for single-digit integers. This also avoids a
|
||||
glitch when BASE is 16 and IGNORE_TRAILING is nonzero, because in that
|
||||
glitch when BASE is 16 and IGNORE_TRAILING, because in that
|
||||
case some versions of strtoumax accept numbers like "0x1" that Emacs
|
||||
does not allow. */
|
||||
if (digit_to_number (string[signedp + 1], base) < 0)
|
||||
@ -3401,12 +3405,12 @@ string_to_number (char const *string, int base, int ignore_trailing)
|
||||
|
||||
|
||||
static Lisp_Object
|
||||
read_vector (Lisp_Object readcharfun, int bytecodeflag)
|
||||
read_vector (Lisp_Object readcharfun, bool bytecodeflag)
|
||||
{
|
||||
ptrdiff_t i, size;
|
||||
register Lisp_Object *ptr;
|
||||
register Lisp_Object tem, item, vector;
|
||||
register struct Lisp_Cons *otem;
|
||||
Lisp_Object *ptr;
|
||||
Lisp_Object tem, item, vector;
|
||||
struct Lisp_Cons *otem;
|
||||
Lisp_Object len;
|
||||
|
||||
tem = read_list (1, readcharfun);
|
||||
@ -3478,13 +3482,13 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag)
|
||||
return vector;
|
||||
}
|
||||
|
||||
/* FLAG = 1 means check for ] to terminate rather than ) and . */
|
||||
/* FLAG means check for ] to terminate rather than ) and . */
|
||||
|
||||
static Lisp_Object
|
||||
read_list (int flag, register Lisp_Object readcharfun)
|
||||
read_list (bool flag, Lisp_Object readcharfun)
|
||||
{
|
||||
Lisp_Object val, tail;
|
||||
register Lisp_Object elt, tem;
|
||||
Lisp_Object elt, tem;
|
||||
struct gcpro gcpro1, gcpro2;
|
||||
/* 0 is the normal case.
|
||||
1 means this list is a doc reference; replace it with the number 0.
|
||||
@ -3492,7 +3496,7 @@ read_list (int flag, register Lisp_Object readcharfun)
|
||||
int doc_reference = 0;
|
||||
|
||||
/* Initialize this to 1 if we are reading a list. */
|
||||
int first_in_list = flag <= 0;
|
||||
bool first_in_list = flag <= 0;
|
||||
|
||||
val = Qnil;
|
||||
tail = Qnil;
|
||||
|
@ -84,7 +84,7 @@ macro before appending to it. */)
|
||||
{
|
||||
ptrdiff_t i;
|
||||
EMACS_INT len;
|
||||
int cvt;
|
||||
bool cvt;
|
||||
|
||||
/* Check the type of last-kbd-macro in case Lisp code changed it. */
|
||||
CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
|
||||
|
@ -833,6 +833,7 @@ $(BLD)/fileio.$(O) : \
|
||||
$(SRC)/blockinput.h \
|
||||
$(SRC)/commands.h \
|
||||
$(NT_INC)/pwd.h \
|
||||
$(NT_INC)/sys/file.h \
|
||||
$(NT_INC)/sys/stat.h \
|
||||
$(NT_INC)/unistd.h \
|
||||
$(BUFFER_H) \
|
||||
@ -1632,6 +1633,7 @@ $(BLD)/w32select.$(O) : \
|
||||
$(CHARSET_H) \
|
||||
$(CODING_H) \
|
||||
$(CONFIG_H) \
|
||||
$(KEYBOARD_H) \
|
||||
$(LISP_H) \
|
||||
$(W32TERM_H)
|
||||
|
||||
|
16
src/marker.c
16
src/marker.c
@ -91,7 +91,7 @@ clear_charpos_cache (struct buffer *b)
|
||||
#define CONSIDER(CHARPOS, BYTEPOS) \
|
||||
{ \
|
||||
ptrdiff_t this_charpos = (CHARPOS); \
|
||||
int changed = 0; \
|
||||
bool changed = 0; \
|
||||
\
|
||||
if (this_charpos == charpos) \
|
||||
{ \
|
||||
@ -190,7 +190,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
|
||||
|
||||
if (charpos - best_below < best_above - charpos)
|
||||
{
|
||||
int record = charpos - best_below > 5000;
|
||||
bool record = charpos - best_below > 5000;
|
||||
|
||||
while (best_below != charpos)
|
||||
{
|
||||
@ -215,7 +215,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos)
|
||||
}
|
||||
else
|
||||
{
|
||||
int record = best_above - charpos > 5000;
|
||||
bool record = best_above - charpos > 5000;
|
||||
|
||||
while (best_above != charpos)
|
||||
{
|
||||
@ -335,7 +335,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
|
||||
|
||||
if (bytepos - best_below_byte < best_above_byte - bytepos)
|
||||
{
|
||||
int record = bytepos - best_below_byte > 5000;
|
||||
bool record = bytepos - best_below_byte > 5000;
|
||||
|
||||
while (best_below_byte < bytepos)
|
||||
{
|
||||
@ -362,7 +362,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
|
||||
}
|
||||
else
|
||||
{
|
||||
int record = best_above_byte - bytepos > 5000;
|
||||
bool record = best_above_byte - bytepos > 5000;
|
||||
|
||||
while (best_above_byte > bytepos)
|
||||
{
|
||||
@ -479,10 +479,10 @@ live_buffer (Lisp_Object buffer)
|
||||
|
||||
static Lisp_Object
|
||||
set_marker_internal (Lisp_Object marker, Lisp_Object position,
|
||||
Lisp_Object buffer, int restricted)
|
||||
Lisp_Object buffer, bool restricted)
|
||||
{
|
||||
register struct Lisp_Marker *m;
|
||||
register struct buffer *b = live_buffer (buffer);
|
||||
struct Lisp_Marker *m;
|
||||
struct buffer *b = live_buffer (buffer);
|
||||
|
||||
CHECK_MARKER (marker);
|
||||
m = XMARKER (marker);
|
||||
|
27
src/menu.c
27
src/menu.c
@ -519,14 +519,15 @@ list_of_panes (Lisp_Object menu)
|
||||
/* Set up data in menu_items for a menu bar item
|
||||
whose event type is ITEM_KEY (with string ITEM_NAME)
|
||||
and whose contents come from the list of keymaps MAPS. */
|
||||
int
|
||||
parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, Lisp_Object maps)
|
||||
bool
|
||||
parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name,
|
||||
Lisp_Object maps)
|
||||
{
|
||||
Lisp_Object length;
|
||||
EMACS_INT len;
|
||||
Lisp_Object *mapvec;
|
||||
ptrdiff_t i;
|
||||
int top_level_items = 0;
|
||||
bool top_level_items = 0;
|
||||
USE_SAFE_ALLOCA;
|
||||
|
||||
length = Flength (maps);
|
||||
@ -616,13 +617,13 @@ free_menubar_widget_value_tree (widget_value *wv)
|
||||
in menu_items starting at index START, up to index END. */
|
||||
|
||||
widget_value *
|
||||
digest_single_submenu (int start, int end, int top_level_items)
|
||||
digest_single_submenu (int start, int end, bool top_level_items)
|
||||
{
|
||||
widget_value *wv, *prev_wv, *save_wv, *first_wv;
|
||||
int i;
|
||||
int submenu_depth = 0;
|
||||
widget_value **submenu_stack;
|
||||
int panes_seen = 0;
|
||||
bool panes_seen = 0;
|
||||
|
||||
submenu_stack = alloca (menu_items_used * sizeof *submenu_stack);
|
||||
wv = xmalloc_widget_value ();
|
||||
@ -668,7 +669,7 @@ digest_single_submenu (int start, int end, int top_level_items)
|
||||
Lisp_Object pane_name;
|
||||
const char *pane_string;
|
||||
|
||||
panes_seen++;
|
||||
panes_seen = 1;
|
||||
|
||||
pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
|
||||
|
||||
@ -735,7 +736,7 @@ digest_single_submenu (int start, int end, int top_level_items)
|
||||
Lisp_Object help;
|
||||
|
||||
/* All items should be contained in panes. */
|
||||
if (panes_seen == 0)
|
||||
if (! panes_seen)
|
||||
emacs_abort ();
|
||||
|
||||
item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME);
|
||||
@ -957,9 +958,9 @@ find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object
|
||||
|
||||
#ifdef HAVE_NS
|
||||
/* As above, but return the menu selection instead of storing in kb buffer.
|
||||
If keymaps==1, return full prefixes to selection. */
|
||||
If KEYMAPS, return full prefixes to selection. */
|
||||
Lisp_Object
|
||||
find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data)
|
||||
find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data)
|
||||
{
|
||||
Lisp_Object prefix, entry;
|
||||
int i;
|
||||
@ -999,7 +1000,7 @@ find_and_return_menu_selection (FRAME_PTR f, int keymaps, void *client_data)
|
||||
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
|
||||
if (aref_addr (menu_items, i) == client_data)
|
||||
{
|
||||
if (keymaps != 0)
|
||||
if (keymaps)
|
||||
{
|
||||
int j;
|
||||
|
||||
@ -1071,8 +1072,8 @@ no quit occurs and `x-popup-menu' returns nil. */)
|
||||
Lisp_Object selection = Qnil;
|
||||
FRAME_PTR f = NULL;
|
||||
Lisp_Object x, y, window;
|
||||
int keymaps = 0;
|
||||
int for_click = 0;
|
||||
bool keymaps = 0;
|
||||
bool for_click = 0;
|
||||
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
|
||||
struct gcpro gcpro1;
|
||||
|
||||
@ -1083,7 +1084,7 @@ no quit occurs and `x-popup-menu' returns nil. */)
|
||||
|
||||
#ifdef HAVE_MENUS
|
||||
{
|
||||
int get_current_pos_p = 0;
|
||||
bool get_current_pos_p = 0;
|
||||
/* FIXME!! check_w32 (); or check_x (); or check_ns (); */
|
||||
|
||||
/* Decode the first argument: find the window and the coordinates. */
|
||||
|
@ -29,7 +29,7 @@ extern void init_menu_items (void);
|
||||
extern void finish_menu_items (void) ATTRIBUTE_CONST;
|
||||
extern void discard_menu_items (void);
|
||||
extern void save_menu_items (void);
|
||||
extern int parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object);
|
||||
extern bool parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object);
|
||||
extern void list_of_panes (Lisp_Object);
|
||||
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \
|
||||
|| defined (HAVE_NS)
|
||||
@ -38,7 +38,7 @@ extern void update_submenu_strings (widget_value *);
|
||||
extern void find_and_call_menu_selection (FRAME_PTR, int,
|
||||
Lisp_Object, void *);
|
||||
extern widget_value *xmalloc_widget_value (void);
|
||||
extern widget_value *digest_single_submenu (int, int, int);
|
||||
extern widget_value *digest_single_submenu (int, int, bool);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X_WINDOWS
|
||||
@ -47,8 +47,8 @@ extern void mouse_position_for_popup (FRAME_PTR f, int *x, int *y);
|
||||
|
||||
extern Lisp_Object w32_menu_show (FRAME_PTR, int, int, int, int,
|
||||
Lisp_Object, const char **);
|
||||
extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, int, int,
|
||||
extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, bool, bool,
|
||||
Lisp_Object, const char **);
|
||||
extern Lisp_Object xmenu_show (FRAME_PTR, int, int, int, int,
|
||||
extern Lisp_Object xmenu_show (FRAME_PTR, int, int, bool, bool,
|
||||
Lisp_Object, const char **, Time);
|
||||
#endif /* MENU_H */
|
||||
|
@ -173,17 +173,6 @@ without invoking the usual minibuffer commands. */)
|
||||
|
||||
static Lisp_Object read_minibuf_unwind (Lisp_Object);
|
||||
static Lisp_Object run_exit_minibuf_hook (Lisp_Object);
|
||||
static Lisp_Object read_minibuf (Lisp_Object, Lisp_Object,
|
||||
Lisp_Object,
|
||||
int, Lisp_Object,
|
||||
Lisp_Object, Lisp_Object,
|
||||
int, int);
|
||||
static Lisp_Object read_minibuf_noninteractive (Lisp_Object, Lisp_Object,
|
||||
Lisp_Object, Lisp_Object,
|
||||
int, Lisp_Object,
|
||||
Lisp_Object, Lisp_Object,
|
||||
int, int);
|
||||
static Lisp_Object string_to_object (Lisp_Object, Lisp_Object);
|
||||
|
||||
|
||||
/* Read a Lisp object from VAL and return it. If VAL is an empty
|
||||
@ -233,10 +222,10 @@ string_to_object (Lisp_Object val, Lisp_Object defalt)
|
||||
static Lisp_Object
|
||||
read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
|
||||
Lisp_Object prompt, Lisp_Object backup_n,
|
||||
int expflag,
|
||||
bool expflag,
|
||||
Lisp_Object histvar, Lisp_Object histpos,
|
||||
Lisp_Object defalt,
|
||||
int allow_props, int inherit_input_method)
|
||||
bool allow_props, bool inherit_input_method)
|
||||
{
|
||||
ptrdiff_t size, len;
|
||||
char *line;
|
||||
@ -376,23 +365,23 @@ If the current buffer is not a minibuffer, return its entire contents. */)
|
||||
beginning of INITIAL if N <= 0.
|
||||
|
||||
Normally return the result as a string (the text that was read),
|
||||
but if EXPFLAG is nonzero, read it and return the object read.
|
||||
but if EXPFLAG, read it and return the object read.
|
||||
If HISTVAR is given, save the value read on that history only if it doesn't
|
||||
match the front of that history list exactly. The value is pushed onto
|
||||
the list as the string that was read.
|
||||
|
||||
DEFALT specifies the default value for the sake of history commands.
|
||||
|
||||
If ALLOW_PROPS is nonzero, we do not throw away text properties.
|
||||
If ALLOW_PROPS, do not throw away text properties.
|
||||
|
||||
if INHERIT_INPUT_METHOD is nonzero, the minibuffer inherits the
|
||||
if INHERIT_INPUT_METHOD, the minibuffer inherits the
|
||||
current input method. */
|
||||
|
||||
static Lisp_Object
|
||||
read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
|
||||
int expflag,
|
||||
bool expflag,
|
||||
Lisp_Object histvar, Lisp_Object histpos, Lisp_Object defalt,
|
||||
int allow_props, int inherit_input_method)
|
||||
bool allow_props, bool inherit_input_method)
|
||||
{
|
||||
Lisp_Object val;
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
@ -1447,7 +1436,7 @@ is used to further constrain the set of candidates. */)
|
||||
if (bestmatchsize != SCHARS (eltstring)
|
||||
|| bestmatchsize != matchsize)
|
||||
/* Don't count the same string multiple times. */
|
||||
matchcount++;
|
||||
matchcount += matchcount <= 1;
|
||||
bestmatchsize = matchsize;
|
||||
if (matchsize <= SCHARS (string)
|
||||
/* If completion-ignore-case is non-nil, don't
|
||||
|
34
src/nsfont.m
34
src/nsfont.m
@ -729,16 +729,6 @@ Properties to be considered are same as for list(). */
|
||||
NSRect brect;
|
||||
Lisp_Object font_object;
|
||||
int fixLeopardBug;
|
||||
static NSMutableDictionary *fontCache = nil;
|
||||
NSNumber *cached;
|
||||
|
||||
/* 2008/03/08: The same font may end up being requested for different
|
||||
entities, due to small differences in numeric values or other issues,
|
||||
or for different copies of the same entity. Therefore we cache to
|
||||
avoid creating multiple struct font objects (with metrics cache, etc.)
|
||||
for the same NSFont object. */
|
||||
if (fontCache == nil)
|
||||
fontCache = [[NSMutableDictionary alloc] init];
|
||||
|
||||
if (NSFONT_TRACE)
|
||||
{
|
||||
@ -794,28 +784,8 @@ when setting family in ns_spec_to_descriptor(). */
|
||||
if (NSFONT_TRACE)
|
||||
NSLog (@"%@\n", nsfont);
|
||||
|
||||
/* Check the cache */
|
||||
cached = [fontCache objectForKey: nsfont];
|
||||
if (cached != nil && !synthItal)
|
||||
{
|
||||
if (NSFONT_TRACE)
|
||||
fprintf(stderr, "*** nsfont_open CACHE HIT!\n");
|
||||
XHASH (font_object) = [cached unsignedLongLongValue];
|
||||
return font_object;
|
||||
}
|
||||
else
|
||||
{
|
||||
font_object = font_make_object (VECSIZE (struct nsfont_info),
|
||||
font_entity, pixel_size);
|
||||
if (!synthItal)
|
||||
{
|
||||
[fontCache setObject: [NSNumber
|
||||
numberWithUnsignedLongLong:
|
||||
(unsigned long long) XHASH (font_object)]
|
||||
forKey: nsfont];
|
||||
}
|
||||
}
|
||||
|
||||
font_object = font_make_object (VECSIZE (struct nsfont_info),
|
||||
font_entity, pixel_size);
|
||||
font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);
|
||||
font = (struct font *) font_info;
|
||||
if (!font)
|
||||
|
@ -181,7 +181,8 @@
|
||||
/* Fully parse one or more of the submenus. */
|
||||
int n = 0;
|
||||
int *submenu_start, *submenu_end;
|
||||
int *submenu_top_level_items, *submenu_n_panes;
|
||||
bool *submenu_top_level_items;
|
||||
int *submenu_n_panes;
|
||||
struct buffer *prev = current_buffer;
|
||||
Lisp_Object buffer;
|
||||
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
|
||||
@ -740,7 +741,7 @@ - (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame
|
||||
|
||||
/* run a menu in popup mode */
|
||||
- (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
|
||||
keymaps: (int)keymaps
|
||||
keymaps: (bool)keymaps
|
||||
{
|
||||
EmacsView *view = FRAME_NS_VIEW (f);
|
||||
NSEvent *e, *event;
|
||||
@ -779,7 +780,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
|
||||
========================================================================== */
|
||||
|
||||
Lisp_Object
|
||||
ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
|
||||
ns_menu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
|
||||
Lisp_Object title, const char **error)
|
||||
{
|
||||
EmacsMenu *pmenu;
|
||||
@ -801,7 +802,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
|
||||
|
||||
#if 0
|
||||
/* FIXME: a couple of one-line differences prevent reuse */
|
||||
wv = digest_single_submenu (0, menu_items_used, Qnil);
|
||||
wv = digest_single_submenu (0, menu_items_used, 0);
|
||||
#else
|
||||
{
|
||||
widget_value *save_wv = 0, *prev_wv = 0;
|
||||
|
@ -161,7 +161,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
||||
- (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame *)f;
|
||||
- (void) clear;
|
||||
- (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
|
||||
keymaps: (int)keymaps;
|
||||
keymaps: (bool)keymaps;
|
||||
@end
|
||||
|
||||
|
||||
@ -792,7 +792,7 @@ extern void free_frame_tool_bar (FRAME_PTR f);
|
||||
extern void find_and_call_menu_selection (FRAME_PTR f,
|
||||
int menu_bar_items_used, Lisp_Object vector, void *client_data);
|
||||
extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f,
|
||||
int keymaps,
|
||||
bool keymaps,
|
||||
void *client_data);
|
||||
extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents,
|
||||
Lisp_Object header);
|
||||
|
39
src/nsterm.m
39
src/nsterm.m
@ -208,6 +208,13 @@ Updated by Christian Limpach (chris@nice.ch)
|
||||
*ns_pending_service_args;
|
||||
static BOOL ns_do_open_file = NO;
|
||||
|
||||
static struct {
|
||||
struct input_event *q;
|
||||
int nr, cap;
|
||||
} hold_event_q = {
|
||||
NULL, 0, 0
|
||||
};
|
||||
|
||||
/* Convert modifiers in a NeXTstep event to emacs style modifiers. */
|
||||
#define NS_FUNCTION_KEY_MASK 0x800000
|
||||
#define NSLeftControlKeyMask (0x000001 | NSControlKeyMask)
|
||||
@ -273,7 +280,7 @@ Updated by Christian Limpach (chris@nice.ch)
|
||||
kbd_buffer_store_event_hold (emacs_event, q_event_ptr); \
|
||||
} \
|
||||
else \
|
||||
kbd_buffer_store_event (emacs_event); \
|
||||
hold_event (emacs_event); \
|
||||
EVENT_INIT (*emacs_event); \
|
||||
ns_send_appdefined (-1); \
|
||||
}
|
||||
@ -292,6 +299,19 @@ Updated by Christian Limpach (chris@nice.ch)
|
||||
|
||||
========================================================================== */
|
||||
|
||||
static void
|
||||
hold_event (struct input_event *event)
|
||||
{
|
||||
if (hold_event_q.nr == hold_event_q.cap)
|
||||
{
|
||||
if (hold_event_q.cap == 0) hold_event_q.cap = 10;
|
||||
else hold_event_q.cap *= 2;
|
||||
hold_event_q.q = (struct input_event *)
|
||||
xrealloc (hold_event_q.q, hold_event_q.cap * sizeof (*hold_event_q.q));
|
||||
}
|
||||
|
||||
hold_event_q.q[hold_event_q.nr++] = *event;
|
||||
}
|
||||
|
||||
static Lisp_Object
|
||||
append2 (Lisp_Object list, Lisp_Object item)
|
||||
@ -3348,6 +3368,15 @@ overwriting cursor (usually when cursor on a tab) */
|
||||
if ([NSApp modalWindow] != nil)
|
||||
return -1;
|
||||
|
||||
if (hold_event_q.nr > 0)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < hold_event_q.nr; ++i)
|
||||
kbd_buffer_store_event_hold (&hold_event_q.q[i], hold_quit);
|
||||
hold_event_q.nr = 0;
|
||||
return i;
|
||||
}
|
||||
|
||||
block_input ();
|
||||
n_emacs_events_pending = 0;
|
||||
EVENT_INIT (ev);
|
||||
@ -6645,6 +6674,12 @@ - (int) checkSamePosition: (int) position portion: (int) portion
|
||||
[self setFloatValue: pos knobProportion: por];
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Events may come here even if the event loop is not running.
|
||||
If we don't enter the event loop, the scroll bar will not update.
|
||||
So send SIGIO to ourselves. */
|
||||
if (apploopnr == 0) kill (0, SIGIO);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@ -6685,7 +6720,7 @@ - (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e
|
||||
kbd_buffer_store_event_hold (emacs_event, q_event_ptr);
|
||||
}
|
||||
else
|
||||
kbd_buffer_store_event (emacs_event);
|
||||
hold_event (emacs_event);
|
||||
EVENT_INIT (*emacs_event);
|
||||
ns_send_appdefined (-1);
|
||||
}
|
||||
|
@ -646,23 +646,6 @@ allocate_pty (void)
|
||||
PTY_OPEN;
|
||||
#else /* no PTY_OPEN */
|
||||
{
|
||||
{ /* Some systems name their pseudoterminals so that there are gaps in
|
||||
the usual sequence - for example, on HP9000/S700 systems, there
|
||||
are no pseudoterminals with names ending in 'f'. So we wait for
|
||||
three failures in a row before deciding that we've reached the
|
||||
end of the ptys. */
|
||||
int failed_count = 0;
|
||||
struct stat stb;
|
||||
|
||||
if (stat (pty_name, &stb) < 0)
|
||||
{
|
||||
failed_count++;
|
||||
if (failed_count >= 3)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
failed_count = 0;
|
||||
}
|
||||
# ifdef O_NONBLOCK
|
||||
fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0);
|
||||
# else
|
||||
|
@ -1612,7 +1612,6 @@ init_environment (char ** argv)
|
||||
LPBYTE lpval;
|
||||
DWORD dwType;
|
||||
char locale_name[32];
|
||||
struct stat ignored;
|
||||
char default_home[MAX_PATH];
|
||||
int appdata = 0;
|
||||
|
||||
@ -1653,7 +1652,7 @@ init_environment (char ** argv)
|
||||
/* For backwards compatibility, check if a .emacs file exists in C:/
|
||||
If not, then we can try to default to the appdata directory under the
|
||||
user's profile, which is more likely to be writable. */
|
||||
if (stat ("C:/.emacs", &ignored) < 0)
|
||||
if (!check_existing ("C:/.emacs"))
|
||||
{
|
||||
HRESULT profile_result;
|
||||
/* Dynamically load ShGetFolderPath, as it won't exist on versions
|
||||
|
@ -2333,7 +2333,9 @@ w32_name_of_message (UINT msg)
|
||||
}
|
||||
#endif /* EMACSDEBUG */
|
||||
|
||||
/* Here's an overview of how Emacs input works on MS-Windows.
|
||||
/* Here's an overview of how Emacs input works in GUI sessions on
|
||||
MS-Windows. (For description of non-GUI input, see the commentary
|
||||
before w32_console_read_socket in w32inevt.c.)
|
||||
|
||||
System messages are read and processed by w32_msg_pump below. This
|
||||
function runs in a separate thread. It handles a small number of
|
||||
|
@ -576,6 +576,38 @@ maybe_generate_resize_event (void)
|
||||
0, 0, 0);
|
||||
}
|
||||
|
||||
/* Here's an overview of how Emacs input works in non-GUI sessions on
|
||||
MS-Windows. (For description of the GUI input, see the commentary
|
||||
before w32_msg_pump in w32fns.c.)
|
||||
|
||||
When Emacs is idle, it loops inside wait_reading_process_output,
|
||||
calling pselect periodically to check whether any input is
|
||||
available. On Windows, pselect is redirected to sys_select, which
|
||||
uses MsgWaitForMultipleObjects to wait for input, either from the
|
||||
keyboard or from any of the Emacs subprocesses. In addition,
|
||||
MsgWaitForMultipleObjects wakes up when some Windows message is
|
||||
posted to the input queue of the Emacs's main thread (which is the
|
||||
thread in which sys_select runs).
|
||||
|
||||
When the Emacs's console window has focus, Windows sends input
|
||||
events that originate from the keyboard or the mouse; these events
|
||||
wake up MsgWaitForMultipleObjects, which reports that input is
|
||||
available. Emacs then calls w32_console_read_socket, below, to
|
||||
read the input. w32_console_read_socket uses
|
||||
GetNumberOfConsoleInputEvents and ReadConsoleInput to peek at and
|
||||
read the console input events.
|
||||
|
||||
One type of non-keyboard input event that gets reported as input
|
||||
available is due to the Emacs's console window receiving focus.
|
||||
When that happens, Emacs gets the FOCUS_EVENT event and sys_select
|
||||
reports some input; however, w32_console_read_socket ignores such
|
||||
events when called to read them.
|
||||
|
||||
Note that any other Windows message sent to the main thread will
|
||||
also wake up MsgWaitForMultipleObjects. These messages get
|
||||
immediately dispatched to their destinations by calling
|
||||
drain_message_queue. */
|
||||
|
||||
int
|
||||
w32_console_read_socket (struct terminal *terminal,
|
||||
struct input_event *hold_quit)
|
||||
|
25
src/xmenu.c
25
src/xmenu.c
@ -111,7 +111,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
||||
static Lisp_Object Qdebug_on_next_call;
|
||||
|
||||
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
|
||||
static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object,
|
||||
static Lisp_Object xdialog_show (FRAME_PTR, bool, Lisp_Object, Lisp_Object,
|
||||
const char **);
|
||||
#endif
|
||||
|
||||
@ -930,7 +930,8 @@ set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
|
||||
widget_value *wv, *first_wv, *prev_wv = 0;
|
||||
int i;
|
||||
int *submenu_start, *submenu_end;
|
||||
int *submenu_top_level_items, *submenu_n_panes;
|
||||
bool *submenu_top_level_items;
|
||||
int *submenu_n_panes;
|
||||
|
||||
if (! FRAME_X_P (f))
|
||||
emacs_abort ();
|
||||
@ -1346,8 +1347,8 @@ free_frame_menubar (FRAME_PTR f)
|
||||
/* F is the frame the menu is for.
|
||||
X and Y are the frame-relative specified position,
|
||||
relative to the inside upper left corner of the frame F.
|
||||
FOR_CLICK is nonzero if this menu was invoked for a mouse click.
|
||||
KEYMAPS is 1 if this menu was specified with keymaps;
|
||||
FOR_CLICK is true if this menu was invoked for a mouse click.
|
||||
KEYMAPS is true if this menu was specified with keymaps;
|
||||
in that case, we return a list containing the chosen item's value
|
||||
and perhaps also the pane's prefix.
|
||||
TITLE is the specified menu title.
|
||||
@ -1427,14 +1428,14 @@ pop_down_menu (Lisp_Object arg)
|
||||
menu_item_selection will be set to the selection. */
|
||||
static void
|
||||
create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y,
|
||||
int for_click, Time timestamp)
|
||||
bool for_click, Time timestamp)
|
||||
{
|
||||
int i;
|
||||
GtkWidget *menu;
|
||||
GtkMenuPositionFunc pos_func = 0; /* Pop up at pointer. */
|
||||
struct next_popup_x_y popup_x_y;
|
||||
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
|
||||
int use_pos_func = ! for_click;
|
||||
bool use_pos_func = ! for_click;
|
||||
|
||||
#ifdef HAVE_GTK3
|
||||
/* Always use position function for Gtk3. Otherwise menus may become
|
||||
@ -1539,7 +1540,7 @@ pop_down_menu (Lisp_Object arg)
|
||||
menu_item_selection will be set to the selection. */
|
||||
static void
|
||||
create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
|
||||
int x, int y, int for_click, Time timestamp)
|
||||
int x, int y, bool for_click, Time timestamp)
|
||||
{
|
||||
int i;
|
||||
Arg av[2];
|
||||
@ -1623,7 +1624,7 @@ cleanup_widget_value_tree (Lisp_Object arg)
|
||||
}
|
||||
|
||||
Lisp_Object
|
||||
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
|
||||
xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
|
||||
Lisp_Object title, const char **error_name, Time timestamp)
|
||||
{
|
||||
int i;
|
||||
@ -1878,7 +1879,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
|
||||
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
|
||||
if (menu_item_selection == aref_addr (menu_items, i))
|
||||
{
|
||||
if (keymaps != 0)
|
||||
if (keymaps)
|
||||
{
|
||||
int j;
|
||||
|
||||
@ -2011,7 +2012,7 @@ static const char * button_names [] = {
|
||||
|
||||
static Lisp_Object
|
||||
xdialog_show (FRAME_PTR f,
|
||||
int keymaps,
|
||||
bool keymaps,
|
||||
Lisp_Object title,
|
||||
Lisp_Object header,
|
||||
const char **error_name)
|
||||
@ -2277,7 +2278,7 @@ pop_down_menu (Lisp_Object arg)
|
||||
|
||||
|
||||
Lisp_Object
|
||||
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
|
||||
xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
|
||||
Lisp_Object title, const char **error_name, Time timestamp)
|
||||
{
|
||||
Window root;
|
||||
@ -2528,7 +2529,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
|
||||
{
|
||||
entry
|
||||
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
|
||||
if (keymaps != 0)
|
||||
if (keymaps)
|
||||
{
|
||||
entry = Fcons (entry, Qnil);
|
||||
if (!NILP (pane_prefix))
|
||||
|
@ -1,3 +1,8 @@
|
||||
2012-10-14 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* automated/compile-tests.el (compile-tests--test-regexps-data):
|
||||
Add new data for msft's new format.
|
||||
|
||||
2012-09-08 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* automated/ruby-mode-tests.el:
|
||||
|
@ -215,6 +215,10 @@
|
||||
1 nil 23 "d:\\tmp\\test.c")
|
||||
("d:\\tmp\\test.c(1145) : see declaration of 'nsRefPtr'"
|
||||
1 nil 1145 "d:\\tmp\\test.c")
|
||||
("1>test_main.cpp(29): error C2144: syntax error : 'int' should be preceded by ';'"
|
||||
3 nil 29 "test_main.cpp")
|
||||
("1>test_main.cpp(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int"
|
||||
3 nil 29 "test_main.cpp")
|
||||
;; watcom
|
||||
("..\src\ctrl\lister.c(109): Error! E1009: Expecting ';' but found '{'"
|
||||
1 nil 109 "..\src\ctrl\lister.c")
|
||||
|
Loading…
Reference in New Issue
Block a user