1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-23 10:34:07 +00:00

Merge from mainline.

This commit is contained in:
Paul Eggert 2011-02-11 21:15:47 -08:00
commit 7cd330deb6
15 changed files with 163 additions and 94 deletions

View File

@ -138,7 +138,7 @@
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program. If not, see <http://www.gnu.org/licenses/>. */

View File

@ -1,3 +1,35 @@
2011-02-12 Phil Hagelberg <phil@hagelb.org>
* emacs-lisp/package.el: Allow packages to be reinstalled.
(package--write-file-no-coding): Remove EXCL arg.
(package-unpack-single): Don't use it.
2011-02-12 Karl Pflästerer <k@rl.pflaesterer.de> (tiny change)
* vc/vc-svn.el: Adapt to Subversion change, with no .svn directory
in each sub directory.
(vc-svn-registered): Use vc-svn-root.
(vc-svn-root): New function. Make vc-svn-responsible-p an alias.
(vc-svn-repository-hostname): Use "svn info".
2011-02-11 Deniz Dogan <deniz.a.m.dogan@gmail.com>
* simple.el (delete-trailing-whitespace): New optional buffer
bound parameters.
2011-02-11 Bastien Guerry <bzg@altern.org>
* files.el (basic-save-buffer): save unmodified buffers when
the file pointed by buffer-file-name doesn't exist.
2011-02-11 Deniz Dogan <deniz.a.m.dogan@gmail.com>
* net/rcirc.el (defun-rcirc-join): Accept multiple channels.
2011-02-11 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl-specs.el (multiple-value-bind): Fix debug spec.
2011-02-11 Juanma Barranquero <lekktu@gmail.com> 2011-02-11 Juanma Barranquero <lekktu@gmail.com>
* net/rcirc.el (rcirc-send-ctcp): Remove spurious arg to `format'. * net/rcirc.el (rcirc-send-ctcp): Remove spurious arg to `format'.

View File

@ -67,7 +67,7 @@
(def-edebug-spec multiple-value-list (form)) (def-edebug-spec multiple-value-list (form))
(def-edebug-spec multiple-value-call (function-form body)) (def-edebug-spec multiple-value-call (function-form body))
(def-edebug-spec multiple-value-bind (def-edebug-spec multiple-value-bind
((&rest symbolp) form cl-declarations body)) ((&rest symbolp) form body))
(def-edebug-spec multiple-value-setq ((&rest symbolp) form)) (def-edebug-spec multiple-value-setq ((&rest symbolp) form))
(def-edebug-spec multiple-value-prog1 (form body)) (def-edebug-spec multiple-value-prog1 (form body))

View File

@ -577,23 +577,22 @@ Otherwise it uses an external `tar' program.
(let ((load-path (cons pkg-dir load-path))) (let ((load-path (cons pkg-dir load-path)))
(byte-recompile-directory pkg-dir 0 t))))) (byte-recompile-directory pkg-dir 0 t)))))
(defun package--write-file-no-coding (file-name excl) (defun package--write-file-no-coding (file-name)
(let ((buffer-file-coding-system 'no-conversion)) (let ((buffer-file-coding-system 'no-conversion))
(write-region (point-min) (point-max) file-name nil nil nil excl))) (write-region (point-min) (point-max) file-name)))
(defun package-unpack-single (file-name version desc requires) (defun package-unpack-single (file-name version desc requires)
"Install the contents of the current buffer as a package." "Install the contents of the current buffer as a package."
;; Special case "package". ;; Special case "package".
(if (string= file-name "package") (if (string= file-name "package")
(package--write-file-no-coding (package--write-file-no-coding
(expand-file-name (concat file-name ".el") package-user-dir) (expand-file-name (concat file-name ".el") package-user-dir))
nil)
(let* ((pkg-dir (expand-file-name (concat file-name "-" version) (let* ((pkg-dir (expand-file-name (concat file-name "-" version)
package-user-dir)) package-user-dir))
(el-file (expand-file-name (concat file-name ".el") pkg-dir)) (el-file (expand-file-name (concat file-name ".el") pkg-dir))
(pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir))) (pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir)))
(make-directory pkg-dir t) (make-directory pkg-dir t)
(package--write-file-no-coding el-file 'excl) (package--write-file-no-coding el-file)
(let ((print-level nil) (let ((print-level nil)
(print-length nil)) (print-length nil))
(write-region (write-region

View File

@ -4309,7 +4309,11 @@ Before and after saving the buffer, this function runs
;; In an indirect buffer, save its base buffer instead. ;; In an indirect buffer, save its base buffer instead.
(if (buffer-base-buffer) (if (buffer-base-buffer)
(set-buffer (buffer-base-buffer))) (set-buffer (buffer-base-buffer)))
(if (buffer-modified-p) (if (or (buffer-modified-p)
;; handle the case when no modification has been made but
;; the file disappeared since visited
(and buffer-file-name
(not (file-exists-p buffer-file-name))))
(let ((recent-save (recent-auto-save-p)) (let ((recent-save (recent-auto-save-p))
setmodes) setmodes)
;; If buffer has no file name, ask user for one. ;; If buffer has no file name, ask user for one.

View File

@ -116,7 +116,7 @@ Whether the passphrase is cached at all is controlled by
:type 'integer) :type 'integer)
(defcustom mml2015-signers nil (defcustom mml2015-signers nil
"A list of your own key ID which will be used to sign a message. "A list of your own key ID(s) which will be used to sign a message.
If set, it overrides the setting of `mml2015-sign-with-sender'." If set, it overrides the setting of `mml2015-sign-with-sender'."
:group 'mime-security :group 'mime-security
:type '(repeat (string :tag "Key ID"))) :type '(repeat (string :tag "Key ID")))

View File

@ -2098,14 +2098,18 @@ activity. Only run if the buffer is not visible and
(when (not existing-buffer) (when (not existing-buffer)
(rcirc-cmd-whois nick)))) (rcirc-cmd-whois nick))))
(defun-rcirc-command join (channel) (defun-rcirc-command join (channels)
"Join CHANNEL." "Join CHANNELS.
(interactive "sJoin channel: ") CHANNELS is a comma- or space-separated string of channel names."
(let ((buffer (rcirc-get-buffer-create process (interactive "sJoin channels: ")
(car (split-string channel))))) (let* ((split-channels (split-string channels "[ ,]" t))
(rcirc-send-string process (concat "JOIN " channel)) (buffers (mapcar (lambda (ch)
(rcirc-get-buffer-create process ch))
split-channels)))
(rcirc-send-string process (concat "JOIN " channels))
(when (not (eq (selected-window) (minibuffer-window))) (when (not (eq (selected-window) (minibuffer-window)))
(switch-to-buffer buffer)))) (dolist (b buffers) ;; order the new channel buffers in the buffer list
(switch-to-buffer b)))))
;; TODO: /part #channel reason, or consider removing #channel altogether ;; TODO: /part #channel reason, or consider removing #channel altogether
(defun-rcirc-command part (channel) (defun-rcirc-command part (channel)

View File

@ -614,22 +614,30 @@ On nonblank line, delete any immediately following blank lines."
(if (looking-at "^[ \t]*\n\\'") (if (looking-at "^[ \t]*\n\\'")
(delete-region (point) (point-max))))) (delete-region (point) (point-max)))))
(defun delete-trailing-whitespace () (defun delete-trailing-whitespace (&optional start end)
"Delete all the trailing whitespace across the current buffer. "Delete all the trailing whitespace across the current buffer.
All whitespace after the last non-whitespace character in a line is deleted. All whitespace after the last non-whitespace character in a line is deleted.
This respects narrowing, created by \\[narrow-to-region] and friends. This respects narrowing, created by \\[narrow-to-region] and friends.
A formfeed is not considered whitespace by this function." A formfeed is not considered whitespace by this function.
(interactive "*") If the region is active, only delete whitespace within the region."
(interactive (progn
(barf-if-buffer-read-only)
(if (use-region-p)
(list (region-beginning) (region-end))
(list nil nil))))
(save-match-data (save-match-data
(save-excursion (save-excursion
(goto-char (point-min)) (let ((end-marker (copy-marker (or end (point-max))))
(while (re-search-forward "\\s-$" nil t) (start (or start (point-min))))
(skip-syntax-backward "-" (save-excursion (forward-line 0) (point))) (goto-char start)
;; Don't delete formfeeds, even if they are considered whitespace. (while (re-search-forward "\\s-$" end-marker t)
(save-match-data (skip-syntax-backward "-" (save-excursion (forward-line 0) (point)))
(if (looking-at ".*\f") ;; Don't delete formfeeds, even if they are considered whitespace.
(goto-char (match-end 0)))) (save-match-data
(delete-region (point) (match-end 0)))))) (if (looking-at ".*\f")
(goto-char (match-end 0))))
(delete-region (point) (match-end 0)))
(set-marker end-marker nil)))))
(defun newline-and-indent () (defun newline-and-indent ()
"Insert a newline, then indent according to major mode. "Insert a newline, then indent according to major mode.

View File

@ -117,17 +117,13 @@ If you want to force an empty list of arguments, use t."
;;;###autoload (getenv "SVN_ASP_DOT_NET_HACK")) ;;;###autoload (getenv "SVN_ASP_DOT_NET_HACK"))
;;;###autoload "_svn") ;;;###autoload "_svn")
;;;###autoload (t ".svn")))) ;;;###autoload (t ".svn"))))
;;;###autoload (when (file-readable-p (expand-file-name ;;;###autoload (when (vc-find-root f admin-dir)
;;;###autoload (concat admin-dir "/entries")
;;;###autoload (file-name-directory f)))
;;;###autoload (load "vc-svn") ;;;###autoload (load "vc-svn")
;;;###autoload (vc-svn-registered f)))) ;;;###autoload (vc-svn-registered f))))
(defun vc-svn-registered (file) (defun vc-svn-registered (file)
"Check if FILE is SVN registered." "Check if FILE is SVN registered."
(when (file-readable-p (expand-file-name (concat vc-svn-admin-directory (when (vc-svn-root file)
"/entries")
(file-name-directory file)))
(with-temp-buffer (with-temp-buffer
(cd (file-name-directory file)) (cd (file-name-directory file))
(let* (process-file-side-effects (let* (process-file-side-effects
@ -275,14 +271,12 @@ Passes either `vc-svn-register-switches' or `vc-register-switches'
to the SVN command." to the SVN command."
(apply 'vc-svn-command nil 0 files "add" (vc-switches 'SVN 'register))) (apply 'vc-svn-command nil 0 files "add" (vc-switches 'SVN 'register)))
(defun vc-svn-responsible-p (file) (defun vc-svn-root (file)
"Return non-nil if SVN thinks it is responsible for FILE." (vc-find-root file vc-svn-admin-directory))
(file-directory-p (expand-file-name vc-svn-admin-directory
(if (file-directory-p file)
file
(file-name-directory file)))))
(defalias 'vc-svn-could-register 'vc-svn-responsible-p (defalias 'vc-svn-responsible-p 'vc-svn-root)
(defalias 'vc-svn-could-register 'vc-svn-root
"Return non-nil if FILE could be registered in SVN. "Return non-nil if FILE could be registered in SVN.
This is only possible if SVN is responsible for FILE's directory.") This is only possible if SVN is responsible for FILE's directory.")
@ -594,20 +588,10 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
(defun vc-svn-repository-hostname (dirname) (defun vc-svn-repository-hostname (dirname)
(with-temp-buffer (with-temp-buffer
(let ((coding-system-for-read (let (process-file-side-effects)
(or file-name-coding-system (vc-svn-command t t dirname "info" "--xml"))
default-file-name-coding-system)))
(vc-insert-file (expand-file-name (concat vc-svn-admin-directory
"/entries")
dirname)))
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward (when (re-search-forward "<url>\\(.*\\)</url>" nil t)
;; Old `svn' used name="svn:this_dir", newer use just name="".
(concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*"
"\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
"url=\"\\(?1:[^\"]+\\)\""
;; Yet newer ones don't use XML any more.
"\\|^\ndir\n[0-9]+\n\\(?1:.*\\)") nil t)
;; This is not a hostname but a URL. This may actually be considered ;; This is not a hostname but a URL. This may actually be considered
;; as a feature since it allows vc-svn-stay-local to specify different ;; as a feature since it allows vc-svn-stay-local to specify different
;; behavior for different modules on the same server. ;; behavior for different modules on the same server.

View File

@ -1,3 +1,19 @@
2011-02-11 Glenn Morris <rgm@gnu.org>
* Makefile.in (USE_X_TOOLKIT, RM, TOOLKIT_DEFINES): Remove.
(ALL_CFLAGS): Remove -I.
(config_h, lisp_h, src_h): New variables.
(globals_h): Rename from $globals.
($(globals_h)): Check cd exit status.
(lwlib.o): Remove special rule.
(lwlib-utils.o, lwlib.o, lwlib-Xlw.o, lwlib-Xaw.o, lwlib-Xm.o)
(xlwmenu.o): Add lisp.h and config.h to prereqs.
(lwlib-utils.o): Add lwlib.h to prereqs.
(lwlib.o): Add lwlib-utils.h and lwlib-Xm.h to prereqs.
(lwlib-Xlw.o): Add xlwmenu.h to prereqs.
(xlwmenu.o): Add ../src/xterm.h to prereqs.
(mostlyclean): Forget about "core" files.
2011-02-10 Glenn Morris <rgm@gnu.org> 2011-02-10 Glenn Morris <rgm@gnu.org>
* lwlib-Xaw.c, lwlib-Xlw.c, lwlib-Xm.c, lwlib-utils.c, lwlib.c: * lwlib-Xaw.c, lwlib-Xlw.c, lwlib-Xm.c, lwlib-utils.c, lwlib.c:

View File

@ -36,61 +36,64 @@ CC=@CC@
CFLAGS=@CFLAGS@ CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@ CPPFLAGS=@CPPFLAGS@
RANLIB=@RANLIB@ RANLIB=@RANLIB@
# See below--@X_TOOLKIT_TYPE@ is used below.
USE_X_TOOLKIT=@X_TOOLKIT_TYPE@
AR = ar cq AR = ar cq
RM = rm -f
LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
MOTIF_OBJS = lwlib-Xm.o MOTIF_OBJS = lwlib-Xm.o
TOOLKIT_DEFINES = ## LUCID_OBJS or MOTIF_OBJS.
TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS) TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
# ../src is needed to find config.h. ## ../src is where the generated file (config.h, globals.h) are.
## $(srcdir)/../src is where the non-generated files (lisp.h) are.
## (In an out-of-tree build, these two are not the same.)
## $(srcdir) is where the lwlib sources are.
## There are no generated lwlib files, hence no need for -I.
ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
$(C_SWITCH_X_SYSTEM) $(C_SWITCH_MACHINE) \ $(C_SWITCH_X_SYSTEM) $(C_SWITCH_MACHINE) \
${C_WARNINGS_SWITCH} ${PROFILING_CFLAGS} $(CFLAGS) \ $(C_WARNINGS_SWITCH) $(PROFILING_CFLAGS) $(CFLAGS) \
-DHAVE_CONFIG_H -Demacs -I. -I../src -I${srcdir} -I${srcdir}/../src -DHAVE_CONFIG_H -Demacs -I../src -I$(srcdir) -I$(srcdir)/../src
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) ${ALL_CFLAGS} $< $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
all:: liblw.a all:: liblw.a
liblw.a: $(OBJS) liblw.a: $(OBJS)
$(RM) $@ rm -f $@
$(AR) $@ $(OBJS) $(AR) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
## Generated files in ../src, non-generated in $(srcdir)/../src.
config_h = ../src/config.h
lisp_h = $(srcdir)/../src/lisp.h
## lisp.h includes this. ## lisp.h includes this.
globals = ../src/globals.h globals_h = ../src/globals.h
src_h = $(config_h) $(lisp_h) $(globals_h)
$(globals): $(globals_h):
cd ../src; $(MAKE) $(MFLAGS) globals.h cd ../src && $(MAKE) $(MFLAGS) globals.h
# Depend on Makefile so that we recompile if TOOLKIT_DEFINES changes. lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h
lwlib.o: $(srcdir)/lwlib.c Makefile lwlib.o: $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \
$(CC) -c $(CPPFLAGS) $(TOOLKIT_DEFINES) $(ALL_CFLAGS) $(srcdir)/lwlib.c lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h
lwlib-Xlw.o: $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h
lwlib-utils.o: $(globals) lwlib-utils.c lwlib-utils.h lwlib-Xaw.o: $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
lwlib.o: $(globals) lwlib.c lwlib.h lwlib-int.h lwlib-Xaw.h lwlib-Xlw.h lwlib-Xm.o: $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
lwlib-Xlw.o: $(globals) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.o: $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \
lwlib-Xaw.o: $(globals) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h $(srcdir)/../src/xterm.h
lwlib-Xm.o: $(globals) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
xlwmenu.o: $(globals) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h
mostlyclean: mostlyclean:
$(RM) *.o core liblw.a \#* rm -f *.o liblw.a \#*
clean: mostlyclean clean: mostlyclean
distclean: clean distclean: clean
$(RM) Makefile rm -f Makefile
maintainer-clean: distclean maintainer-clean: distclean
$(RM) TAGS rm -f TAGS
TAGS: TAGS:
../lib-src/etags $(srcdir)/*.[ch] ../lib-src/etags $(srcdir)/*.[ch]

View File

@ -1,4 +1,4 @@
2011-02-10 Paul Eggert <eggert@cs.ucla.edu> 2011-02-12 Paul Eggert <eggert@cs.ucla.edu>
Remove no-longer needed getloadavg symbols. Remove no-longer needed getloadavg symbols.
* m/alpha.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove. * m/alpha.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
@ -24,6 +24,19 @@
* src/s/netbsd.h (HAVE_GETLOADAVG): Likewise. * src/s/netbsd.h (HAVE_GETLOADAVG): Likewise.
* config.in: Regenerate. * config.in: Regenerate.
2011-02-12 Paul Eggert <eggert@cs.ucla.edu>
Port to Solaris 10, which doesn't support FC_HINT_STYLE.
* xftfont.c (FC_HINT_STYLE): #define to "hintstyle" if not
defined.
* xsettings.c (parse_settings, apply_xft_settings): Don't assume
FC_HINT_STYLE is supported.
2011-02-11 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (x_set_frame_alpha): Access data before it is free:d.
Make sure we don't do x_catch_errors twice.
2011-02-10 Glenn Morris <rgm@gnu.org> 2011-02-10 Glenn Morris <rgm@gnu.org>
* Makefile.in (really-lwlib): Depend on globals.h, for parallel builds. * Makefile.in (really-lwlib): Depend on globals.h, for parallel builds.

View File

@ -187,17 +187,20 @@ xftfont_fix_match (FcPattern *pat, FcPattern *match)
double dpi; double dpi;
FcPatternGetBool (pat, FC_ANTIALIAS, 0, &b); FcPatternGetBool (pat, FC_ANTIALIAS, 0, &b);
if (! b) if (! b)
{ {
FcPatternDel (match, FC_ANTIALIAS); FcPatternDel (match, FC_ANTIALIAS);
FcPatternAddBool (match, FC_ANTIALIAS, FcFalse); FcPatternAddBool (match, FC_ANTIALIAS, FcFalse);
} }
FcPatternGetBool (pat, FC_HINTING, 0, &b); FcPatternGetBool (pat, FC_HINTING, 0, &b);
if (! b) if (! b)
{ {
FcPatternDel (match, FC_HINTING); FcPatternDel (match, FC_HINTING);
FcPatternAddBool (match, FC_HINTING, FcFalse); FcPatternAddBool (match, FC_HINTING, FcFalse);
} }
#ifndef FC_HINT_STYLE
# define FC_HINT_STYLE "hintstyle"
#endif
if (FcResultMatch == FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i)) if (FcResultMatch == FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i))
{ {
FcPatternDel (match, FC_HINT_STYLE); FcPatternDel (match, FC_HINT_STYLE);
@ -781,4 +784,3 @@ syms_of_xftfont (void)
register_font_driver (&xftfont_driver, NULL); register_font_driver (&xftfont_driver, NULL);
} }

View File

@ -75,7 +75,7 @@ enum {
SEEN_FONT = 0x40, SEEN_FONT = 0x40,
SEEN_TB_STYLE = 0x80, SEEN_TB_STYLE = 0x80,
}; };
struct xsettings struct xsettings
{ {
#ifdef HAVE_XFT #ifdef HAVE_XFT
FcBool aa, hinting; FcBool aa, hinting;
@ -104,7 +104,7 @@ something_changedCB (GConfClient *client,
gpointer user_data) gpointer user_data)
{ {
GConfValue *v = gconf_entry_get_value (entry); GConfValue *v = gconf_entry_get_value (entry);
if (!v) return; if (!v) return;
if (v->type == GCONF_VALUE_STRING) if (v->type == GCONF_VALUE_STRING)
{ {
@ -196,7 +196,7 @@ get_prop_window (struct x_display_info *dpyinfo)
4 CARD32 last-change-serial 4 CARD32 last-change-serial
and then the value, For string: and then the value, For string:
bytes type what bytes type what
------------------------------------ ------------------------------------
4 CARD32 n = value-length 4 CARD32 n = value-length
@ -280,7 +280,7 @@ parse_settings (unsigned char *prop,
(strcmp (XSETTINGS_FONT_NAME, name) == 0) (strcmp (XSETTINGS_FONT_NAME, name) == 0)
|| (strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0); || (strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0);
switch (type) switch (type)
{ {
case 0: /* Integer */ case 0: /* Integer */
if (bytes_parsed+4 > bytes) return BadLength; if (bytes_parsed+4 > bytes) return BadLength;
@ -310,14 +310,14 @@ parse_settings (unsigned char *prop,
case 2: /* RGB value */ case 2: /* RGB value */
/* No need to parse this */ /* No need to parse this */
if (bytes_parsed+8 > bytes) return BadLength; if (bytes_parsed+8 > bytes) return BadLength;
bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */ bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */
break; break;
default: /* Parse Error */ default: /* Parse Error */
return BadValue; return BadValue;
} }
if (want_this) if (want_this)
{ {
++settings_seen; ++settings_seen;
if (strcmp (name, XSETTINGS_FONT_NAME) == 0) if (strcmp (name, XSETTINGS_FONT_NAME) == 0)
@ -341,6 +341,7 @@ parse_settings (unsigned char *prop,
settings->seen |= SEEN_HINTING; settings->seen |= SEEN_HINTING;
settings->hinting = ival != 0; settings->hinting = ival != 0;
} }
# ifdef FC_HINT_STYLE
else if (strcmp (name, "Xft/HintStyle") == 0) else if (strcmp (name, "Xft/HintStyle") == 0)
{ {
settings->seen |= SEEN_HINTSTYLE; settings->seen |= SEEN_HINTSTYLE;
@ -355,6 +356,7 @@ parse_settings (unsigned char *prop,
else else
settings->seen &= ~SEEN_HINTSTYLE; settings->seen &= ~SEEN_HINTSTYLE;
} }
# endif
else if (strcmp (name, "Xft/RGBA") == 0) else if (strcmp (name, "Xft/RGBA") == 0)
{ {
settings->seen |= SEEN_RGBA; settings->seen |= SEEN_RGBA;
@ -442,7 +444,9 @@ apply_xft_settings (struct x_display_info *dpyinfo,
pat); pat);
FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa); FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa);
FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting); FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting);
# ifdef FC_HINT_STYLE
FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &oldsettings.hintstyle); FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &oldsettings.hintstyle);
# endif
FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter); FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter);
FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba); FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba);
FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi); FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi);
@ -488,6 +492,7 @@ apply_xft_settings (struct x_display_info *dpyinfo,
if (strlen (buf) > 0) strcat (buf, ", "); if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter); sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter);
# ifdef FC_HINT_STYLE
if ((settings->seen & SEEN_HINTSTYLE) != 0 if ((settings->seen & SEEN_HINTSTYLE) != 0
&& oldsettings.hintstyle != settings->hintstyle) && oldsettings.hintstyle != settings->hintstyle)
{ {
@ -496,6 +501,7 @@ apply_xft_settings (struct x_display_info *dpyinfo,
++changed; ++changed;
oldsettings.hintstyle = settings->hintstyle; oldsettings.hintstyle = settings->hintstyle;
} }
# endif
if (strlen (buf) > 0) strcat (buf, ", "); if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle); sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle);
@ -508,7 +514,7 @@ apply_xft_settings (struct x_display_info *dpyinfo,
FcPatternAddDouble (pat, FC_DPI, settings->dpi); FcPatternAddDouble (pat, FC_DPI, settings->dpi);
++changed; ++changed;
oldsettings.dpi = settings->dpi; oldsettings.dpi = settings->dpi;
/* Change the DPI on this display and all frames on the display. */ /* Change the DPI on this display and all frames on the display. */
dpyinfo->resy = dpyinfo->resx = settings->dpi; dpyinfo->resy = dpyinfo->resx = settings->dpi;
FOR_EACH_FRAME (tail, frame) FOR_EACH_FRAME (tail, frame)
@ -565,7 +571,7 @@ read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p)
if (settings.seen & SEEN_FONT) if (settings.seen & SEEN_FONT)
{ {
if (!current_font || strcmp (current_font, settings.font) != 0) if (!current_font || strcmp (current_font, settings.font) != 0)
{ {
free (current_font); free (current_font);
current_font = settings.font; current_font = settings.font;
@ -774,4 +780,3 @@ If this variable is nil, Emacs ignores system font changes. */);
Fprovide (intern_c_string ("dynamic-setting"), Qnil); Fprovide (intern_c_string ("dynamic-setting"), Qnil);
} }

View File

@ -488,17 +488,16 @@ x_set_frame_alpha (struct frame *f)
if (rc == Success && actual != None) if (rc == Success && actual != None)
{ {
unsigned long value = *(unsigned long *)data;
XFree ((void *) data); XFree ((void *) data);
if (*(unsigned long *)data == opac) if (value == opac)
{ {
x_uncatch_errors (); x_uncatch_errors ();
return; return;
} }
} }
x_uncatch_errors ();
} }
x_catch_errors (dpy);
XChangeProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity, XChangeProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity,
XA_CARDINAL, 32, PropModeReplace, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &opac, 1L); (unsigned char *) &opac, 1L);