[PATCH] Include a bug from Nix we dropped on the floor
18 years, 1 month
Aidan Kehoe
Was looking through Gmane, and came across this. Sorry about the delay, Nix.
See the discussion here: http://thread.gmane.org/gmane.lisp.emacs-cl/128 for
more info.
lisp/ChangeLog addition:
2004-06-28 Nix <nix(a)esperi.org.uk>
* cmdloop.el (truncate-command-history-for-gc): Delay
execution of all things that look up variable bindings,
via `enqueue-eval-event'.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: lisp/cmdloop.el
===================================================================
RCS
Index: lisp/cmdloop.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/cmdloop.el,v
retrieving revision 1.22
diff -u -r1.22 cmdloop.el
--- lisp/cmdloop.el 2006/06/25 13:58:03 1.22
+++ lisp/cmdloop.el 2006/11/24 13:38:29
@@ -183,11 +183,26 @@
(defun truncate-command-history-for-gc ()
- (let ((tail (nthcdr 30 command-history)))
- (if tail (setcdr tail nil)))
- (let ((tail (nthcdr 30 values)))
- (if tail (setcdr tail nil)))
- )
+ ;; We should try to avoid accessing any bindings to speak of in this
+ ;; function; as this hook is called asynchronously, the search for
+ ;; those bindings might search local bindings from essentially
+ ;; arbitrary functions. We force the body of the function to run at
+ ;; command-loop level, where the danger of local bindings is much
+ ;; reduced; the code can still do its job because the command history
+ ;; and values list will not grow before then anyway.
+ ;;
+ ;; Nothing is done in batch mode, both because it is a waste of time
+ ;; (there is no command loop!) and because this any GCs during dumping
+ ;; will invoke this code, and if it were to enqueue an eval event,
+ ;; the portable dumper would try to dump it and fail.
+ (if (not (noninteractive))
+ (enqueue-eval-event
+ (lambda (arg)
+ (let ((tail (nthcdr 30 command-history)))
+ (if tail (setcdr tail nil)))
+ (let ((tail (nthcdr 30 values)))
+ (if tail (setcdr tail nil))))
+ nil)))
(add-hook 'pre-gc-hook 'truncate-command-history-for-gc)
--
Santa Maradona, priez pour moi!
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Update the docstring for make-char
18 years, 1 month
Aidan Kehoe
src/ChangeLog addition:
2006-11-17 Aidan Kehoe <kehoea(a)parhasard.net>
* text.c:
* text.c (Fmake_char):
`Octet' is incorrect; only the low seven bits are used. Mention
the MIME use of the term `charset' and cross-reference to
coding-system-p for the XEmacs implementation of the same
idea. Add an example call to (decode-char 'ucs ...), move the
decode-big5-char arguments to hex.
* text.c (Fsplit_char):
BREAKUP_ICHAR assigns charset the character set object, never its
name, so the get-charset call is superfluous.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/text.c
===================================================================
RCS
Index: src/text.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.c,v
retrieving revision 1.29
diff -u -r1.29 text.c
--- src/text.c 2006/08/24 21:21:36 1.29
+++ src/text.c 2006/11/17 16:18:32
@@ -4840,24 +4840,33 @@
/************************************************************************/
DEFUN ("make-char", Fmake_char, 2, 3, 0, /*
-Make a character from CHARSET and octets ARG1 and ARG2.
+Make a character from CHARSET and integers ARG1 and ARG2.
ARG2 is required only for characters from two-dimensional charsets.
-Each octet should be in the range 32 through 127 for a 96 or 96x96
-charset and 33 through 126 for a 94 or 94x94 charset. (Most charsets
-are either 96 or 94x94.) Note that this is 32 more than the values
-typically given for 94x94 charsets. When two octets are required, the
-order is "standard" -- the same as appears in ISO-2022 encodings,
-reference tables, etc.
+An XEmacs `charset' is a very distinct concept from a MIME charset,
+and unfortunately for the XEmacs documentation, the MIME
+interpretation is today the better known of the two. For information
+on how we implement the concept that MIME describes using the term,
+see `coding-system-p'. XEmacs takes its terminology from ISO/IEC
+2022, a much older standard that was mostly implemented in East Asia,
+and which the ECMA makes freely available as Ecma-035.pdf.
+
+The low-order seven bits of each integer should be in the range 32
+through 127 for a 96- or 96x96-character charset and 33 through 126
+for a 94- or 94x94-character charset--most XEmacs charsets are either
+96 or 94x94. This is 32 more than the values typically given for
+94x94 charsets. When two integers are required, the order is that
+that appears in in ISO-2022 encodings, and the standard documents'
+reference tables.
\(Note the following non-obvious result: Computerized translation
-tables often encode the two octets as the high and low bytes,
-respectively, of a hex short, while when there's only one octet, it
+tables often encode the two integers as the high and low bytes,
+respectively, of a hex short, while when there's only one integer, it
goes in the low byte. When decoding such a value, you need to treat
the two cases differently when calling make-char: One is (make-char
CHARSET HIGH LOW), the other is (make-char CHARSET LOW).)
-For example, (make-char 'latin-iso8859-2 185) or (make-char
+For example, \(make-char 'latin-iso8859-2 #xB9) or \(make-char
'latin-iso8859-2 57) will return the Latin 2 character s with caron.
As another example, the Japanese character for "kawa" (stream), which
@@ -4882,20 +4891,19 @@
These are equivalent to:
+\(decode-char 'ucs #x5DDD)
\(make-char 'chinese-gb2312 52 40)
\(make-char 'japanese-jisx0208 64 110)
\(make-char 'korean-ksc5601 116 57)
+\(decode-big5-char '(#xA4 . #x74))
\(make-char 'chinese-cns11643-1 76 87)
-\(decode-big5-char '(164 . 116))
-\(All codes above are two decimal numbers except for Big Five and ANSI
-Z39.64, which we don't support. We add 32 to each of the decimal
-numbers. Big Five is split in a rather hackish fashion into two
-charsets, `big5-1' and `big5-2', due to its excessive size -- 94x157,
-with the first codepoint in the range 0xA1 to 0xFE and the second in
-the range 0x40 to 0x7E or 0xA1 to 0xFE. `decode-big5-char' is used to
-generate the char from its codes, and `encode-big5-char' extracts the
-codes.)
+\(We add 32 to each of the decimal numbers passed to make-char. Big
+Five is split in a rather hackish fashion into two charsets, `big5-1'
+and `big5-2', due to its excessive size -- 94x157, with the first
+codepoint in the range 0xA1 to 0xFE and the second in the range 0x40
+to 0x7E or 0xA1 to 0xFE. `decode-big5-char' is used to generate the
+char from its codes, and `encode-big5-char' extracts the codes.)
When compiled without MULE, this function does not do much, but it's
provided for compatibility. In this case, the following CHARSET symbols
@@ -4933,7 +4941,7 @@
{
if (!NILP (arg2))
invalid_argument
- ("Charset is of dimension one; second octet must be nil", arg2);
+ ("Charset is of dimension one; second integer must be nil", arg2);
return make_char (make_ichar (charset, a1, 0));
}
@@ -5005,7 +5013,13 @@
*/
(character))
{
- /* This function can GC */
+ /* [ This function can GC ]
+
+ Apart from argument checking, I disagree, but that's mostly
+ irrelevant, because if you're calling this function often
+ enough that it matters, talk to us, and we'll probably
+ implement something for you in C. Aidan Kehoe, Fri Nov 17
+ 16:24:30 2006. */
struct gcpro gcpro1, gcpro2;
Lisp_Object charset = Qnil;
Lisp_Object rc = Qnil;
@@ -5016,7 +5030,7 @@
BREAKUP_ICHAR (XCHAR (character), charset, c1, c2);
- if (XCHARSET_DIMENSION (Fget_charset (charset)) == 2)
+ if (XCHARSET_DIMENSION (charset) == 2)
{
rc = list3 (XCHARSET_NAME (charset), make_int (c1), make_int (c2));
}
--
Santa Maradona, priez pour moi!
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5] Re: strlwr
18 years, 1 month
Adrian Aichner
APPROVE COMMIT 21.5
"Robert Pluim" <rpluim(a)gmail.com> writes:
> On 11/22/06, Stephen J. Turnbull <turnbull(a)sk.tsukuba.ac.jp> wrote:
>
> Ilya N. Golubev writes:
>
> > Your 2006-11-01 change of `sysdep.c' in main cvs trunk makes `strlwr',
> > `wcslen' require iso c99, and breaks compilation with pre- c99
> > compilers. Please fix.
>
> Adrian is currently not able to devote much attention to XEmacs; can
> you be more specific so that somebody else can do the work?
>
> From inspection of sysdep.c, I assume Ilya means something like this:
>
> 2006-11-23 Robert Pluim < rpluim(a)gmail.com>
>
> * sysdep.c (strlwr): Don't intermix declarations and code.
> (wcslen): ditto
Thanks for the patch, Robert!
I have just committed it with some minor whitespace fixes to the
ChangeLog entry.
Best regards!
Adrian
>
> Index: sysdep.c
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.c,v
> retrieving revision 1.84
> diff -u -r1.84 sysdep.c
> --- sysdep.c 2006/11/01 20:25:49 1.84
> +++ sysdep.c 2006/11/23 08:32:08
> @@ -3491,8 +3491,8 @@
> size_t
> wcslen (const wchar_t *s)
> {
> - if (s == NULL) return NULL;
> const wchar_t *p = s;
> + if (s == NULL) return NULL;
>
> while (*p++)
> ;
> @@ -3509,8 +3509,8 @@
> char *
> strlwr (char *s)
> {
> - if (s == NULL) return NULL;
> REGISTER char *c;
> + if (s == NULL) return NULL;
>
> for (c = s; *c; c++)
> {
>
> _______________________________________________
> XEmacs-Beta mailing list
> XEmacs-Beta(a)xemacs.org
> http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Fix non-MULE Xft build
18 years, 1 month
Michael Sperber
Stephen, could you review this?
2006-11-18 Mike Sperber <mike(a)xemacs.org>
* redisplay-x.c (separate_textual_runs): Don't try to call
ichar_to_unicode on non-MULE.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: src/redisplay-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-x.c,v
retrieving revision 1.44
diff -u -r1.44 redisplay-x.c
--- src/redisplay-x.c 5 Nov 2006 22:31:45 -0000 1.44
+++ src/redisplay-x.c 18 Nov 2006 19:22:03 -0000
@@ -245,8 +245,11 @@
if (translate_to_ucs_2)
{
UINT_16_BIT ucs2;
+#ifdef MULE
int ucs = ichar_to_unicode(ch);
-
+#else
+ int ucs = ch;
+#endif
/* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
REPLACMENT CHARACTER. */
ucs2 = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] packages: sync my timeclock.el contributions via planner-el development
18 years, 1 month
Adrian Aichner
Hello Jeff, thanks for all your work on calendar!
Please consider these timeclock.el features, which are already found
upstream in planner's development version of this file.
Best regards!
Adrian
packages ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: xemacs-packages/calendar/ChangeLog
Index: xemacs-packages/calendar/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/ChangeLog,v
retrieving revision 1.43
diff -u -U0 -r1.43 ChangeLog
--- xemacs-packages/calendar/ChangeLog 19 Nov 2006 00:31:22 -0000 1.43
+++ xemacs-packages/calendar/ChangeLog 20 Nov 2006 19:51:39 -0000
@@ -0,0 +1,24 @@
+2006-10-16 Adrian Aichner <adrian(a)xemacs.org>
+
+ * timeclock.el: Typo fixes.
+ * timeclock.el (timeclock-history): New.
+ * timeclock.el (timeclock-use-history): New.
+ * timeclock.el (timeclock-log): Honor timeclock-use-history.
+ * timeclock.el (timeclock-read-moment): Provide error on
+ unexpected data in timeclock-file, going unnoticed until now.
+ * timeclock.el (timeclock-find-discrep): Report line number of
+ discrepancy to ease manual fixing.
+
+2006-08-01 Adrian Aichner <adrian(a)xemacs.org>
+
+ * timeclock.el: Keep timeclock-file buffer around, so that an
+ encrypted timeclock-file does not have to be opened on each
+ clocking operation (requiring entry of encryption key).
+ * timeclock.el (timeclock-get-timeclock-file-buffer): New.
+ * timeclock.el (timeclock-log): Don't kill timeclock-file buffer.
+ * timeclock.el (timeclock-log-data): Use
+ `timeclock-get-timeclock-file-buffer', which avoids reading
+ timeclock-file, if it's already in a live buffer.
+ * timeclock.el (timeclock-find-discrep): Ditto.
+ * timeclock.el (timeclock-visit-timelog): Ditto.
+
packages source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: xemacs-packages/calendar/timeclock.el
===================================================================
RCS
Index: xemacs-packages/calendar/timeclock.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/timeclock.el,v
retrieving revision 1.4
diff -u -w -r1.4 timeclock.el
--- xemacs-packages/calendar/timeclock.el 23 Oct 2006 01:25:30 -0000 1.4
+++ xemacs-packages/calendar/timeclock.el 20 Nov 2006 19:44:21 -0000
@@ -26,6 +26,8 @@
;; Boston, MA 02110-1301, USA.
;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; and contrib/timeclock.el from
+;;; http://arch.gna.org/planner-el/archive-2006/planner-el--devel--0/
;;; Commentary:
@@ -150,6 +152,19 @@
:type 'boolean
:group 'timeclock)
+(defvar timeclock-history '()
+ "History of previously used timeclock values.")
+
+(defcustom timeclock-use-history nil
+ "*If non-nil, user is prompted for timestamp, previous values are
+available via history mechanism.
+
+\\{minibuffer-local-map}.
+
+This variable only has effect if set with \\[customize]."
+:type 'boolean
+:group 'timeclock)
+
(defvar timeclock-update-timer nil
"The timer used to update `timeclock-mode-string'.")
@@ -607,6 +622,12 @@
(defvar timeclock-project-list nil)
(defvar timeclock-last-project nil)
+(defun timeclock-get-timeclock-file-buffer (file)
+ "Return the buffer visiting timeclock-file FILE."
+ (or
+ (get-file-buffer file)
+ (find-file-noselect file)))
+
(defun timeclock-completing-read (prompt alist &optional default)
"A version of `completing-read' that works on both Emacs and XEmacs."
(if (featurep 'xemacs)
@@ -619,7 +640,7 @@
(defun timeclock-ask-for-project ()
"Ask the user for the project they are clocking into."
(timeclock-completing-read
- (format "Clock into which project (default %s): "
+ (format "Clock into which project (default \"%s\"): "
(or timeclock-last-project
(car timeclock-project-list)))
(mapcar 'list timeclock-project-list)
@@ -665,13 +686,19 @@
"Log the event CODE to the timeclock log, at the time of call.
If PROJECT is a string, it represents the project which the event is
being logged for. Normally only \"in\" events specify a project."
- (with-current-buffer (find-file-noselect timeclock-file)
+ (with-current-buffer
+ (timeclock-get-timeclock-file-buffer timeclock-file)
(goto-char (point-max))
(if (not (bolp))
(insert "\n"))
(let ((now (current-time)))
(insert code " "
+ (if timeclock-use-history
+ (read-string "timeclock time: "
(format-time-string "%Y/%m/%d %H:%M:%S" now)
+ 'timeclock-history
+ (format-time-string "%Y/%m/%d %H:%M:%S" now))
+ (format-time-string "%Y/%m/%d %H:%M:%S" now))
(or (and project
(stringp project)
(> (length project) 0)
@@ -689,7 +716,10 @@
(setq timeclock-last-event (list code now project)))
(save-buffer)
(run-hooks 'timeclock-event-hook)
- (kill-buffer (current-buffer))))
+ ;; APA: Don't kill buffer to avoid having to read in (potentially
+ ;; encrypted) file.
+ ;; (kill-buffer (current-buffer))
+ ))
(defvar timeclock-moment-regexp
(concat "\\([bhioO]\\)\\s-+"
@@ -698,7 +728,8 @@
(defsubst timeclock-read-moment ()
"Read the moment under point from the timelog."
- (if (looking-at timeclock-moment-regexp)
+ (cond
+ ((looking-at timeclock-moment-regexp)
(let ((code (match-string 1))
(year (string-to-number (match-string 2)))
(mon (string-to-number (match-string 3)))
@@ -707,7 +738,13 @@
(min (string-to-number (match-string 6)))
(sec (string-to-number (match-string 7)))
(project (match-string 8)))
- (list code (encode-time sec min hour mday mon year) project))))
+ (list code (encode-time sec min hour mday mon year) project)))
+ ((not (eobp))
+ (error "unexpected data in %s: %s"
+ timeclock-file
+ (buffer-substring
+ (point-at-bol)
+ (point-at-eol))))))
(defun timeclock-last-period (&optional moment)
"Return the value of the last event period.
@@ -991,7 +1028,8 @@
last-date-limited last-date-seconds last-date
(line 0) last beg day entry event)
(with-temp-buffer
- (insert-file-contents (or filename timeclock-file))
+ (insert-buffer
+ (timeclock-get-timeclock-file-buffer (or filename timeclock-file)))
(when recent-only
(goto-char (point-max))
(unless (re-search-backward "^b\\s-+" nil t)
@@ -1085,7 +1123,8 @@
timeclock-reason-list nil
timeclock-elapsed 0)
(with-temp-buffer
- (insert-file-contents timeclock-file)
+ (insert-buffer
+ (timeclock-get-timeclock-file-buffer timeclock-file))
(goto-char (point-max))
(unless (re-search-backward "^b\\s-+" nil t)
(goto-char (point-min)))
@@ -1375,7 +1414,8 @@
(defun timeclock-visit-timelog ()
"Open the file named by `timeclock-file' in another window."
(interactive)
- (find-file-other-window timeclock-file))
+ (switch-to-buffer-other-window
+ (timeclock-get-timeclock-file-buffer timeclock-file)))
(provide 'timeclock)
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[21.5] Fix handling of buffer-file-truename in info.el
18 years, 1 month
Stephen J. Turnbull
21.5
Corresponding patch for 21.4 submitted separately. See
Subject: [R21.4] buffer-file-truename vs. info.el
Message-ID: <877ixy4rpk.fsf(a)uwakimon.sk.tsukuba.ac.jp>
for discussion.
Note this is a git diff; apply with "patch -p1".
steve@uwakimon /playpen/src/XEmacs/git-integration $ git diff
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 663a24f..a38b498 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -0,0 +1,8 @@
+2006-11-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * info.el (Info-find-file-node, Info-insert-dir)
+ (Info-read-subfile, Info-insert-file-contents): Maintain invariant
+ `(equal buffer-file-truename (file-truename buffer-file-name))'.
+ Thanks to Nelson Ferreira <nelson.ferreira(a)ieee.org> for report
+ and discussion.
+
diff --git a/src/ChangeLog b/src/ChangeLog
index 6ec0a68..3e99ee2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -0,0 +1,7 @@
+2006-11-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * buffer.c (buffer-file-name): Document invariant.
+ (buffer-file-truename): Sync wording to buffer-file-name.
+ Thanks to Nelson Ferreira <nelson.ferreira(a)ieee.org> for report
+ and discussion.
+
diff --git a/lisp/info.el b/lisp/info.el
index 5c70168..1106117 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -717,7 +717,8 @@ node of a file of this name."
;; Nooooooooooo! Info-index can extend across more
;; than one file (e.g. XEmacs, Lispref)
;; Info-index-alternatives nil
- buffer-file-name nil)
+ buffer-file-name nil
+ buffer-file-truename nil)
(erase-buffer)
(if (string= "dir" (file-name-nondirectory filename))
(Info-insert-dir)
@@ -1052,7 +1053,8 @@ actually get any text from."
(message "Composing main Info directory...done"))
(setq Info-dir-contents (buffer-string)))
(setq default-directory (file-name-as-directory Info-dir-contents-directory))
- (setq buffer-file-name (caar Info-dir-file-attributes)))
+ (setq buffer-file-name (caar Info-dir-file-attributes)
+ buffer-file-truename (file-truename buffer-file-name)))
(defmacro Info-directory-files (dir-file &optional all full nosort files-only)
"Return a list of Info files living in the same directory as DIR-FILE.
@@ -1423,7 +1425,8 @@ invoke \"xemacs -batch -f Info-batch-reb
(throw 'foo t)))))
(or (equal Info-current-subfile lastfilename)
(let ((buffer-read-only nil))
- (setq buffer-file-name nil)
+ (setq buffer-file-name nil
+ buffer-file-truename nil)
(widen)
(erase-buffer)
(Info-insert-file-contents (Info-suffixed-file
@@ -1531,7 +1534,8 @@ versions of NAME. Only the suffixes are
(call-process shell-file-name nil t nil shell-command-switch command)
(message "")
(when visit
- (setq buffer-file-name file)
+ (setq buffer-file-name file
+ buffer-file-truename (file-truename buffer-file-name))
(set-buffer-modified-p nil)
(clear-visited-file-modtime)))
(insert-file-contents file visit))))
diff --git a/src/buffer.c b/src/buffer.c
index a20b7d9..652f578 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2635,6 +2635,8 @@ It may not be a list of functions.
DEFVAR_BUFFER_LOCAL ("buffer-file-name", filename /*
Name of file visited in current buffer, or nil if not visiting a file.
Each buffer has its own value of this variable.
+Code that sets or binds this variable must maintain the invariant
+`(equal buffer-file-truename (file-truename buffer-file-name))'.
*/ );
#if 0 /* FSFmacs */
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC] Cater to the fact that default face height might be 0
18 years, 1 month
Michael Sperber
This unbreaks run-temacs for me.
2006-11-18 Mike Sperber <mike(a)xemacs.org>
* window.c (window_pixel_height_to_char_height): Cater to the
possibility that defheight may be 0.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: src/window.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/window.c,v
retrieving revision 1.93
diff -u -r1.93 window.c
--- src/window.c 12 Nov 2006 13:40:09 -0000 1.93
+++ src/window.c 18 Nov 2006 18:15:13 -0000
@@ -4107,7 +4107,7 @@
{
int avail_height;
int defheight, defwidth;
- int char_height;
+ int char_height = 0;
Lisp_Object window = wrap_window (w);
@@ -4118,7 +4118,8 @@
default_face_height_and_width (window, &defheight, &defwidth);
- char_height = avail_height / defheight;
+ if (defheight)
+ char_height = avail_height / defheight;
/* It's the calling function's responsibility to check these values
and make sure they're not out of range.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5] Fix breakage in xftFont resource for tabs and menubar
18 years, 1 month
Stephen J. Turnbull
APPROVE COMMIT 21.5
Tested on Mac OS X "Tiger".
There have been several reports of problems with Xft font resources
recently. This patch addresses issues with use of *X resources* to
set Xft fonts for the Tabs and Menubar. It will not help the others
(including very poor Options Menu and Customize support, and problems
with buffer fonts).
Apparently some experimental work I was doing on creating an Xt
resource converter for Xft fonts leaked into an integration branch.
As part of that work I changed the name of the resource used for Xft
fonts from "xftFont" to "fcFontName", and reserved the xftFont
resource for the (incomplete) automatic converter.
This patch restores the functionality of the "xftFont" resource of the
Tabs and Menubar widgets. For completeness, I will mention that it
gives precedence to the fcFontName resource, but this is only for my
convenience; this patch should "just work" with properly set xftFont
resources in .Xresources.
I've also changed the default font for Tabs from the absurd Aircut to
Helvetica. (I'm currently using Bitstream Vera:italic, which is a
nice effect.)
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 32a1740..1dac37d 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,18 @@
+2006-11-17 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * xlwmenu.c (xlwMenuResources):
+ * xlwmenu.c (XlwMenuInitialize):
+ * xlwmenuP.h (_XlwMenu_part):
+ * xlwtabs.c (resources):
+ * xlwtabs.c (TabsInit):
+ * xlwtabsP.h (TabsPart):
+ New xftFontName member in each widget part struct, corresponds to
+ xftFont String resource.
+ Initialize renderFont private member from fcFontName if non-NULL,
+ otherwise initialize from xftFontName.
+
+ * xlwtabs.h: Update parameter table.
+
2006-06-16 Jerry James <james(a)xemacs.org>
* lwlib-Xlw.c (xlw_scrollbar_callback): Do not dereference
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index b6a5110..9445cb8 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -95,11 +95,11 @@ xlwMenuResources[] =
#ifdef USE_XFT_MENUBARS
{XtNfcFontName, XtCFcFontName, XtRString, sizeof (String),
offset(menu.fcFontName),
- XtRString, (XtPointer) "Helvetica-12:bold"},
+ XtRString, (XtPointer) NULL},
/* #### This needs to be fixed to give a proper type and converter for
XftFonts. See also xlwtabs.c. */
- {XtNxftFont, XtCXftFont, XtRPointer, sizeof(XtPointer),
- offset(menu.renderFont), XtRPointer, (XtPointer) NULL },
+ {XtNxftFont, XtCXftFont, XtRString, sizeof(XtPointer),
+ offset(menu.xftFontName), XtRString, (XtPointer) "Helvetica-12:bold" },
#endif
# ifdef USE_XFONTSET
/* #### Consider using the same method as for Motif; see the comment in
@@ -3241,6 +3241,9 @@ XlwMenuInitialize (Widget UNUSED (reques
#endif
#ifdef USE_XFT_MENUBARS
+ /* #### kludge for name change */
+ if (!mw->menu.fcFontName)
+ mw->menu.fcFontName = mw->menu.xftFontName;
/* to do this right, we should add a new Xt Resource type +
conversion function
*/
diff --git a/lwlib/xlwmenuP.h b/lwlib/xlwmenuP.h
index b14fde9..b091399 100644
--- a/lwlib/xlwmenuP.h
+++ b/lwlib/xlwmenuP.h
@@ -35,6 +35,7 @@ typedef struct _XlwMenu_part
XFontStruct * font;
#ifdef USE_XFT_MENUBARS
String fcFontName;
+ String xftFontName;
XftFont *renderFont;
#endif
# ifdef USE_XFONTSET
diff --git a/lwlib/xlwtabs.c b/lwlib/xlwtabs.c
index b13f0b4..e99ee61 100644
--- a/lwlib/xlwtabs.c
+++ b/lwlib/xlwtabs.c
@@ -153,11 +153,11 @@ static XtResource resources[] = {
/* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here?
or XtDefaultFont? */
{XtNfcFontName, XtCFcFontName, XtRString, sizeof(String),
- offset(fcFontName), XtRString, (XtPointer) "AirCut-16" },
+ offset(fcFontName), XtRString, (XtPointer) NULL },
/* #### This needs to be fixed to give a proper type and converter for
XftFonts. See also xlwmenu.c. */
- {XtNxftFont, XtCXftFont, XtRPointer, sizeof(XtPointer),
- offset(renderFont), XtRPointer, (XtPointer) NULL },
+ {XtNxftFont, XtCXftFont, XtRString, sizeof(String),
+ offset(xftFontName), XtRString, (XtPointer) "Helvetica-12" },
#endif
{XtNinternalWidth, XtCWidth, XtRDimension, sizeof(Dimension),
offset(internalWidth), XtRImmediate, (XtPointer)4 },
@@ -479,10 +479,12 @@ TabsInit(Widget request, Widget new_, Ar
newTw->tabs.tab_height = 2 * newTw->tabs.internalHeight + SHADWID ;
#ifdef USE_XFT_TABS
+ /* #### kludge for name change */
+ if (!newTw->tabs.fcFontName)
+ newTw->tabs.fcFontName = newTw->tabs.xftFontName;
/* must get font here
- to do this right, we should add a new Xt Resource type +
- conversion function
- */
+ #### to do this right, we should add a new Xt Resource type +
+ conversion function */
newTw->tabs.renderFont =
xft_open_font_by_name (XtDisplay ((Widget) newTw),
newTw->tabs.fcFontName);
diff --git a/lwlib/xlwtabs.h b/lwlib/xlwtabs.h
index 3216556..3f9694c 100644
--- a/lwlib/xlwtabs.h
+++ b/lwlib/xlwtabs.h
@@ -44,8 +44,8 @@
Name Class RepType Default Value
---- ----- ------- -------------
font Font XFontStruct* XtDefaultFont
- fcFontName FcFontName String AirCut-16 *0
- xftFont XftFont XtPointer NULL *8
+ fcFontName FcFontName String NULL *0
+ xftFont XftFont String Helvetica-12 *8
internalWidth Width Dimension 4 *1
internalHeight Height Dimension 2 *1
topWidget TopWidget Widget *2
diff --git a/lwlib/xlwtabsP.h b/lwlib/xlwtabsP.h
index 9bc6e44..b99c9b2 100644
--- a/lwlib/xlwtabsP.h
+++ b/lwlib/xlwtabsP.h
@@ -76,6 +76,7 @@ typedef struct {
#ifdef USE_XFT_TABS
XftFont *renderFont;
String fcFontName;
+ String xftFontName;
#endif
Dimension internalHeight, internalWidth ;
Widget topWidget ;
diff --git a/man/ChangeLog b/man/ChangeLog
index ed67b60..f53bd76 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,11 @@
+2006-11-16 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * internals/internals.texi
+ (Better Rendering Support -- Configuration with the Interim Patches):
+ Fix examples of configuration via X resources.
+ (Better Rendering Support -- Implementation): Fix description of
+ xftFont resources, introduce fcFontName resource.
+
2006-11-11 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/faces.texi (Face Convenience Functions):
diff --git a/man/internals/internals.texi b/man/internals/internals.texi
index 2f0df88..ca61879 100644
--- a/man/internals/internals.texi
+++ b/man/internals/internals.texi
@@ -27629,12 +27629,16 @@ of @file{Xft}'s rendering functionality
@item fontconfig
Fontconfig is dramatically different from the X model in several ways.
-In particular, @emph{fontconfig always returns a font}. However, the
+In particular, for the convenient interface @emph{fontconfig always
+returns a font}. However, the
font returned need not be anything like the desired font. This means
that XEmacs must adopt a strategy of delegating the search to
fontconfig, then sanity-checking the return, rather than trying to use
the fontconfig API to search using techniques appropriate for the X11
-core font API.
+core font API. (This isn't actually true. fontconfig has more complex
+interfaces which allow listing a subset of fonts that match a pattern,
+and don't go out of their may to return something no matter what. But
+the original patches didn't use this approach.)
@item Font menus
The @samp{Options->Font} and @samp{Options->Font Sizes} menus are
@@ -27647,17 +27651,20 @@ the size is strange. And the @samp{Opti
disabled, and has been for eons.
@item X resources
-Currently in Stephen's patch there are @emph{four} treatments of font
+Currently in Stephen's patch there are @emph{five} treatments of font
resources. There are the @samp{XEmacs.(a)var{face}.attributeFont}
resources used to set a single global font specification. In the
widgets, some (still) have a @samp{font} resource using the automatic
@file{Xt} resource conversion to @samp{FontStruct}, some have separate
-@samp{font} and @samp{xftFont} resources with the former automatically
+@samp{font} and @samp{fcFontName} resources with the former automatically
converted to @samp{FontStruct} by @file{Xt} and the latter left as a
-string, to be converted by @samp{XftParseName} later, and some have a
+string, to be converted by @samp{FcParseName} later, and some have a
single @samp{font} resource which is converted to @samp{FontStruct} by
@file{Xt} or the latter left as a string, depending on whether
-@file{Xft} was enabled by @samp{configure} or not.
+@file{Xft} was enabled by @samp{configure} or not. There is also the
+@samp{xftFont} resource which may be retargeted to use an Xt converter
+function, but currently simply just an alias for the @samp{fcFontName}
+resource.
Stephen thinks that all of these should be converted to use the face
approach, perhaps with some way to set specifications for individual
@@ -27894,8 +27901,12 @@ at best. Probably we will should to a s
this resource, and convert to a face in XEmacs rather than a font in
Xt/Xft.
@example
-XEmacs*Tabs.xftFont: Bitstream Vera Sans-16
-XEmacs*menubar*xftFont: Bitstream Vera Sans-16
+! DEPRECATED resource xftFont.
+! To be retargeted to an Xt converter which returns a font.
+!XEmacs*Tabs.xftFont: Bitstream Vera Sans-16
+!XEmacs*menubar*xftFont: Bitstream Vera Sans-16
+XEmacs*Tabs.fcFontName: Bitstream Vera Sans-16
+XEmacs*menubar*fcFontName: Bitstream Vera Sans-16
XEmacs.modeline.attributeFont: Bitstream Charter-16
XEmacs.default.attributeFont: Bitstream Vera Sans Mono-16
@end example
@@ -27903,7 +27914,14 @@ I highly recommend use of a proportional
allows a lot more text to fit there. (Previously the font sizes were
quite varied, and there was a comment that this weirdness gave good
balance. This isn't true on my main platform, Mac OS X, and needs to be
-rechecked on Linux, where it was observed.)
+rechecked on Linux, where it was observed.) Note that you can probably
+specify a particular Japanese font with something like
+@example
+XEmacs.default.attributeFont: Bitstream Vera Sans Mono,Sazanami Mincho-16
+@end example
+Order is important; Japanese fonts will support English, but Sazanami's
+Roman characters are not very pretty compared to the Bitstream font.
+@strong{Note:} @emph{This is untested, but should work in theory.}
@end itemize
**** End of patch
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: decoders writing control-1 chars?
18 years, 1 month
Ilya N. Golubev
> it seems I sent that to the
> list, and not to you explicitly.
Then thanks for resending, since I am not on any of the lists.
Adding `ccl-program-definition' did not directly fix the broken
conversion. It was practically necessary to figure what C code to
look at, and will remain so until no CCL coding system is ever used.
Will post separate patches on request.
src/ChangeLog
2006-10-31
* mule-ccl.c (ccl_driver): Fix implementation of
`CCL_WriteMultibyteChar2' / `write-multibyte-character': when
passed valid representations of `control-1' charset characters,
write the desired emchar, not garbage.
2006-10-29
* mule-ccl.c (Fccl_program_definition): New.
ChangeLog
2006-10-31
* etc/NEWS: Document fix of writing `control-1' emchars in CCL.
2006-10-29
* etc/NEWS: Document adding `ccl-program-definition'.
--- src/mule-ccl.c
+++ src/mule-ccl.c
@@ -1372,8 +1372,6 @@
i = reg[RRR]; /* charset */
if (i == LEADING_BYTE_ASCII)
i = reg[rrr] & 0xFF;
- else if (LEADING_BYTE_CONTROL_1 == i)
- i = ((reg[rrr] & 0xFF) - 0xA0);
else if (POSSIBLE_LEADING_BYTE_P(i) &&
!NILP(CHARSET_BY_LEADING_BYTE(i)))
{
@@ -2257,6 +2255,18 @@
return idx;
}
+/* Unfortunately, can not avoid modifying core code with this
+ addition. `ccl_get_compiled_code' is `static', so can not put this
+ function in dynamic module. */
+DEFUN ("ccl-program-definition", Fccl_program_definition, 1, 1, 0, /*
+Return CCL program registered as NAME. Retrieves data set up with
+`register-ccl-program'.
+*/
+ (name))
+{
+ return ccl_get_compiled_code (name);
+}
+
void
syms_of_mule_ccl (void)
@@ -2266,6 +2276,7 @@
DEFSUBR (Fccl_execute_on_string);
DEFSUBR (Fregister_ccl_program);
DEFSUBR (Fregister_code_conversion_map);
+ DEFSUBR (Fccl_program_definition);
}
void
--- etc/NEWS
+++ etc/NEWS
@@ -122,6 +122,8 @@
- New file extensions recognized: .ss, .pdb, .psw.
-- Fixed ldap libraries configuration.
-- Fixed `LDAP_OPT_ON' libraries configuration.
+ -- Added `ccl-program-definition'.
+ -- Fixed writing `control-1' emchars in CCL.
** The delete key now deletes forward by default.
@@ -888,6 +890,22 @@
evaluated expression. This makes it parallel with other descriptors,
which can also be expressions.
+** Added `ccl-program-definition'.
+
+It (along with `ccl-dump') is required to see what ccl code is
+actually used in current program state. Thus, a debugging feature.
+
+** Fixed writing `control-1' emchars in CCL.
+
+Previously, if CCL program passed valid representations of such
+characters to `write-multibyte-character', it would write garbage, not
+the desired emchar. Introduced in upstream revision 1.15.2.1
+(2005/11/28 02:10:19 +0), replaced with another garbage writing in
+upstream revision 1.15.2.2 (2005/12/07 01:17:03 +0). One CCL
+programming task affected by this is extending `mule-ucs' coding
+system decoding programs to decode unicode code points from 0x80 to
+0x9f to these emchars.
+
* Changes in XEmacs 21.0
========================
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Second dose on file_writable includes cygwin
18 years, 1 month
Benson Margulies
src/ChangeLog addition:
2006-11-19 Benson Margulies <benson(a)dchbk.us>
* fileio.c: Add code to use full Win32 API to check for write access.
Win32 has the general design policy that you aren't supposed to ask this question, since
security checks change depending on asynchronous processes. Nonetheless, there is a way,
by acting as if we are a server doing interpretive access control.
Index: src/fileio.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.66.2.7
diff -u -r1.66.2.7 fileio.c
--- src/fileio.c 2005/01/31 02:55:14 1.66.2.7
+++ src/fileio.c 2006/11/20 01:52:19
@@ -57,7 +57,13 @@
#define WIN32_FILENAMES
#ifdef WIN32_NATIVE
#include "nt.h"
+#include <aclapi.h>
#endif /* WIN32_NATIVE */
+#ifdef CYGWIN
+#include <w32api/aclapi.h>
+#endif
+
+
#define IS_DRIVE(x) isalpha (x)
/* Need to lower-case the drive letter, or else expanded
filenames will sometimes compare inequal, because
@@ -2267,11 +2273,81 @@
#endif /* not WIN32_NATIVE */
}
+
+
/* Return nonzero if file FILENAME exists and can be written. */
static int
check_writable (const char *filename)
{
+#if defined(WIN32_NATIVE) || defined(CYGWIN)
+#ifdef CYGWIN
+ char filename_buffer[PATH_MAX];
+#endif
+ // Since this has to work for a directory, we can't just call 'CreateFile'
+ PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */
+ /* these need not be freed, they point into pDesc */
+ PSID psidOwner;
+ PSID psidGroup;
+ PACL pDacl;
+ PACL pSacl;
+ /* end of insides of descriptor */
+ DWORD error;
+ DWORD attributes;
+ HANDLE tokenHandle;
+ GENERIC_MAPPING genericMapping;
+ DWORD accessMask;
+ PRIVILEGE_SET PrivilegeSet;
+ DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET );
+ BOOL fAccessGranted = FALSE;
+ DWORD dwAccessAllowed;
+
+#ifdef CYGWIN
+ cygwin_conv_to_full_win32_path(filename, filename_buffer);
+ filename = filename_buffer;
+#endif
+
+ /* Win32 prototype lacks const. */
+ error = GetNamedSecurityInfo((LPTSTR)filename, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,
+ &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc);
+ if(error != ERROR_SUCCESS) { // FAT?
+ attributes = GetFileAttributes(filename);
+ return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY));
+ }
+
+ genericMapping.GenericRead = FILE_GENERIC_READ;
+ genericMapping.GenericWrite = FILE_GENERIC_WRITE;
+ genericMapping.GenericExecute = FILE_GENERIC_EXECUTE;
+ genericMapping.GenericAll = FILE_ALL_ACCESS;
+
+ if(!ImpersonateSelf(SecurityDelegation)) {
+ return 0;
+ }
+ if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &tokenHandle)) {
+ return 0;
+ }
+
+ accessMask = GENERIC_WRITE;
+ MapGenericMask(&accessMask, &genericMapping);
+
+ if(!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
+ &PrivilegeSet, // receives privileges used in check
+ &dwPrivSetSize, // size of PrivilegeSet buffer
+ &dwAccessAllowed, // receives mask of allowed access rights
+ &fAccessGranted))
+ {
+ DWORD oops = GetLastError();
+ CloseHandle(tokenHandle);
+ RevertToSelf();
+ LocalFree(pDesc);
+ return 0;
+ }
+ CloseHandle(tokenHandle);
+ RevertToSelf();
+ LocalFree(pDesc);
+ return fAccessGranted == TRUE;
+#else
#ifdef HAVE_EACCESS
return (eaccess (filename, W_OK) >= 0);
#else
@@ -2281,6 +2357,7 @@
Opening with O_WRONLY could work for an ordinary file,
but would lose for directories. */
return (access (filename, W_OK) >= 0);
+#endif
#endif
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches