1 new commit in xemacs-base:
https://bitbucket.org/xemacs/xemacs-base/commits/956c7e5673fe/
Changeset: 956c7e5673fe
User: Jerry James
Date: 2014-08-10 03:55:05
Summary: Implement assoc-string (in Lisp, versus the C implementation used in Emacs).
See <CAHCOHQk9m6pmDz9HSVoWdGZpvzVc6Y1gEk5m6UNF15b0VwGuDQ(a)mail.gmail.com> in
xemacs-patches.
Affected #: 2 files
diff -r 06f247e269bfbba4b2944ab529e846dfab7eae2e -r 956c7e5673fe0fa42bfd0733fe425127b92d46ac ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-04 Jerry James <james(a)xemacs.org>
+
+ * subr-more.el (assoc-string): New function from GNU Emacs.
+
2014-05-15 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 2.41 released.
diff -r 06f247e269bfbba4b2944ab529e846dfab7eae2e -r 956c7e5673fe0fa42bfd0733fe425127b92d46ac subr-more.el
--- a/subr-more.el
+++ b/subr-more.el
@@ -171,4 +171,28 @@
(progn ,@body)
(error (message "Error: %S" ,err) nil))))
+;;;###autoload
+(defun assoc-string (key list &optional case-fold)
+ "Like `assoc' but specifically for strings (and symbols).
+
+This returns the first element of LIST whose car matches the string or
+symbol KEY, or NIL if no match exists. When performing the comparison,
+symbols are first converted to strings. If the optional arg CASE-FOLD
+is non-nil, case is ignored.
+
+Unlike `assoc', KEY can also match an entry in LIST consisting of a
+single string, rather than a cons cell whose car is a string."
+ (when (symbolp key)
+ (setq key (symbol-name key)))
+ (let* ((tail list) elt elt2 elt3 result)
+ (while (and (null result) tail)
+ (setq elt (car tail)
+ elt2 (if (consp elt) (car elt) elt)
+ elt3 (if (symbolp elt2) (symbol-name elt2) elt2)
+ result (and (stringp elt3)
+ (eq (compare-strings elt3 0 nil key 0 nil case-fold) t)
+ elt)
+ tail (cdr tail)))
+ result))
+
;;; subr-more.el ends here
Repository URL: https://bitbucket.org/xemacs/xemacs-base/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
APPROVE COMMIT
On Wed, Aug 6, 2014 at 2:55 PM, Mats Lidell <matsl(a)xemacs.org> wrote:
> I thought so but got confused. Thanks for clarifying.
>
Actually, I was a little confused, too. :-) I know it's an abomination
but ... well, if we want to stay compatible ....
Anyway, I'm going to push this patch. Sorry for the nausea, Stephen.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
A patch with the following ChangeLog has been commited to
xemacs-packages/net-utils:
2014-08-06 Mats Lidell <matsl(a)xemacs.org>
* idna.el: New file from GNU Libidn. Added Coding cookie and
load protection if utf-8 support is missing.
* punycode.el: Ditto.
Yours
--
%% Mats
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
PATCH packages
Emacs has had a function named assoc-string for about a decade now.
We have a couple of packages that have workarounds for our lack of the
function. I'm working on a package update that brings in more uses of
it. I figured it was time to stop working around its absence. This
patch provides a Lisp implementation in xemacs-base/subr-more.el. It
is functionally identical to the Emacs version (but not code
identical, since the Emacs version is written in C).
The patch also removes workarounds from the calendar and leim packages.
The patch is attached.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
Steve, I saw the ;; #### May need generalization to other separators? comment
and took that as a prompt to work on the function. A break from merging the
bytecomp code.
It’s frustrating that FcNameParse is still failing when handed a charset
attribute that has just been returned by FcNameUnparse. I’m sure you reported
the bug back in the day. I’ve just skimmed the fontconfig source and it
doesn’t look particularly unfixable.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1407316765 -3600
# Wed Aug 06 10:19:25 2014 +0100
# Node ID 2dee57a2c2d6579c30cc5cc74181cd42a3873bf5
# Parent 8139bdf8db044f7bbd89b4c7e7bde26da6fb6b99
Improve style, #'fc-name-parse-harder.
lisp/ChangeLog addition:
2014-08-06 Aidan Kehoe <kehoea(a)parhasard.net>
* fontconfig.el (fc-name-parse-harder):
Improve style here, don't re-implement #'split-string-by-char with
its ESCAPE-CHAR argument, look for a string prefix in a list of
candidates in a more CL-idiomatic way, use the language's features
for boolean or.
diff -r 8139bdf8db04 -r 2dee57a2c2d6 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Aug 03 20:25:03 2014 +0100
+++ b/lisp/ChangeLog Wed Aug 06 10:19:25 2014 +0100
@@ -1,3 +1,11 @@
+2014-08-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * fontconfig.el (fc-name-parse-harder):
+ Improve style here, don't re-implement #'split-string-by-char with
+ its ESCAPE-CHAR argument, look for a string prefix in a list of
+ candidates in a more CL-idiomatic way, use the language's features
+ for boolean or.
+
2014-07-14 Aidan Kehoe <kehoea(a)parhasard.net>
* simple.el (raw-append-message):
diff -r 8139bdf8db04 -r 2dee57a2c2d6 lisp/fontconfig.el
--- a/lisp/fontconfig.el Sun Aug 03 20:25:03 2014 +0100
+++ b/lisp/fontconfig.el Wed Aug 06 10:19:25 2014 +0100
@@ -538,55 +538,46 @@
Unlike `fc-parse-name', unparseable objects are skipped and reported in the
*Warnings* buffer. \(The *Warnings* buffer is popped up unless all of the
unparsed objects are listed in `fc-name-parse-known-problem-attributes'.)"
- (labels ((repair-embedded-colons (l)
- ;; #### May need generalization to other separators?
- (let ((ll l))
- (while (cdr l)
- (when (string-match ".*\\\\$" (cadr l))
- (setcdr l (cons (concat (cadr l) ":" (caddr l)) (cdddr l))))
- (setq l (cdr l)))
- ll))
- (prepare-omits (object)
- (declare (special display))
- (let* ((reports fc-name-parse-known-problem-attributes)
- (report (car reports))
- (display-this t))
- (while reports
- (if (string= report (subseq object 0 (length report)))
- (setq object (concat "(KNOWN) " object)
- display-this nil
- reports nil)
- (setq report (pop reports))))
- (push display-this display)
- (concat object "\n")))
- (any (bools)
- (let (ret)
- (while bools
- (setq ret (or (pop bools) ret))))))
- (let* ((objects (repair-embedded-colons (split-string fontname ":")))
- (name (pop objects))
- (omits nil)
- (outcomes (list 'dummy)))
- (while objects
- (let ((object (pop objects)))
- (condition-case nil
- (let ((try (concat name ":" object)))
- (fc-name-parse try)
- (setq name try))
- (invalid-argument
- (push object omits)))))
+ (let* ((objects (split-string-by-char fontname ?: ?\\))
+ name omits display)
+ (labels ((prefixp (haystack needle)
+ "Return non-nil if HAYSTACK starts with NEEDLE."
+ (not (mismatch haystack needle :end1 (length needle))))
+ (prepare-omit (object)
+ (setq display
+ (or (if (find object
+ fc-name-parse-known-problem-attributes
+:test #'prefixp)
+ (progn
+ (setq object (concat "(KNOWN) " object))
+ ;; This attribute is known, don't display the
+ ;; error based on it alone.
+ nil)
+ ;; Attribute is not known.
+ t)
+ ;; Otherwise, if we're already decided we need to
+ ;; show them, respect that.
+ display))
+ object)
+ (fontconfig-quote (string)
+ (mapconcat #'identity (split-string-by-char string ?:) #r"\:")))
+ (when (find ?: objects :test #'position)
+ (setq objects (mapcar #'fontconfig-quote objects)))
+ (setq name (pop objects))
+ (dolist (object objects)
+ (condition-case nil
+ (let ((try (concat name ":" object)))
+ (fc-name-parse try)
+ (setq name try))
+ (invalid-argument (push object omits))))
(when omits
- (setq display nil)
- (setq omits (mapconcat #'prepare-omits omits ""))
- (lwarn 'fontconfig (if (apply #'any display) 'warning 'info)
- "Some objects in fontname weren't parsed (details in *Warnings*).
+ (setq omits (mapconcat #'prepare-omit omits "\n"))
+ (lwarn 'fontconfig (if display 'warning 'info)
+ "Some objects in fontname weren't parsed (details in *Warnings*).
This shouldn't affect your XEmacs except that the font may be inaccurate.
Please report any unparseable objects below not marked as KNOWN with
-M-x report-xemacs-bug. Objects:\n%sFontname:\n%s"
- omits
- fontname))
- (fc-name-parse name)
- )))
+M-x report-xemacs-bug. Objects:\n%sFontname:\n%s" omits fontname))
+ (fc-name-parse name))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1407093220 -3600
# Sun Aug 03 20:13:40 2014 +0100
# Node ID 75435be92103f23d1905b4a3a60295164a9dd2b4
# Parent b79e1e02bf012f32241a818847a2e9eedd5e3e96
Avoid make_uninit_string() for the command builder's echo_buf.
src/ChangeLog addition:
2014-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
* event-stream.c (allocate_command_builder):
* event-stream.c (Fnext_event):
Use #'make-string rather than make_uninit_string() when allocating
the command builder's echo_buf, avoiding having octets in the
string that do not correspond to valid internal-format text.
diff -r b79e1e02bf01 -r 75435be92103 src/ChangeLog
--- a/src/ChangeLog Mon Jul 14 13:42:42 2014 +0100
+++ b/src/ChangeLog Sun Aug 03 20:13:40 2014 +0100
@@ -1,3 +1,11 @@
+2014-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * event-stream.c (allocate_command_builder):
+ * event-stream.c (Fnext_event):
+ Use #'make-string rather than make_uninit_string() when allocating
+ the command builder's echo_buf, avoiding having octets in the
+ string that do not correspond to valid internal-format text.
+
2014-07-14 Aidan Kehoe <kehoea(a)parhasard.net>
* event-stream.c:
diff -r b79e1e02bf01 -r 75435be92103 src/event-stream.c
--- a/src/event-stream.c Mon Jul 14 13:42:42 2014 +0100
+++ b/src/event-stream.c Sun Aug 03 20:13:40 2014 +0100
@@ -380,7 +380,8 @@
reset_command_builder_event_chain (builder);
if (with_echo_buf)
{
- builder->echo_buf = make_uninit_string (300 * MAX_ICHAR_LEN);
+ builder->echo_buf = Fmake_string (make_fixnum (300 * MAX_ICHAR_LEN),
+ make_char (0));
}
else
{
@@ -2176,7 +2177,8 @@
if (XSTRING_LENGTH (command_builder->echo_buf) < len)
{
command_builder->echo_buf
- = make_uninit_string (len + 200 * MAX_ICHAR_LEN);
+ = Fmake_string (make_fixnum (len + 300 * MAX_ICHAR_LEN),
+ make_char (0));
}
args[0] = command_builder->echo_buf;
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1407093903 -3600
# Sun Aug 03 20:25:03 2014 +0100
# Node ID 8139bdf8db044f7bbd89b4c7e7bde26da6fb6b99
# Parent 75435be92103f23d1905b4a3a60295164a9dd2b4
buffer.c, pass a character, not a fixnum, as second arg to #'make-string
src/ChangeLog addition:
2014-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
[...]
* buffer.c (finish_init_buffer):
Pass a character as the second argument to #'make-string, not a
fixnum.
diff -r 75435be92103 -r 8139bdf8db04 src/ChangeLog
--- a/src/ChangeLog Sun Aug 03 20:13:40 2014 +0100
+++ b/src/ChangeLog Sun Aug 03 20:25:03 2014 +0100
@@ -5,6 +5,9 @@
Use #'make-string rather than make_uninit_string() when allocating
the command builder's echo_buf, avoiding having octets in the
string that do not correspond to valid internal-format text.
+ * buffer.c (finish_init_buffer):
+ Pass a character as the second argument to #'make-string, not a
+ fixnum.
2014-07-14 Aidan Kehoe <kehoea(a)parhasard.net>
diff -r 75435be92103 -r 8139bdf8db04 src/buffer.c
--- a/src/buffer.c Sun Aug 03 20:13:40 2014 +0100
+++ b/src/buffer.c Sun Aug 03 20:25:03 2014 +0100
@@ -636,7 +636,8 @@
init_buffer_markers (b);
init_buffer_syntax_cache (b);
- b->generated_modeline_string = Fmake_string (make_fixnum (84), make_fixnum (' '));
+ b->generated_modeline_string = Fmake_string (make_fixnum (84),
+ make_char (' '));
b->modeline_extent_table = make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK,
Qeq);
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/8139bdf8db04/
Changeset: 8139bdf8db04
User: kehoea
Date: 2014-08-03 21:25:03
Summary: buffer.c, pass a character, not a fixnum, as second arg to #'make-string
src/ChangeLog addition:
2014-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
[...]
* buffer.c (finish_init_buffer):
Pass a character as the second argument to #'make-string, not a
fixnum.
Affected #: 2 files
diff -r 75435be92103f23d1905b4a3a60295164a9dd2b4 -r 8139bdf8db044f7bbd89b4c7e7bde26da6fb6b99 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -5,6 +5,9 @@
Use #'make-string rather than make_uninit_string() when allocating
the command builder's echo_buf, avoiding having octets in the
string that do not correspond to valid internal-format text.
+ * buffer.c (finish_init_buffer):
+ Pass a character as the second argument to #'make-string, not a
+ fixnum.
2014-07-14 Aidan Kehoe <kehoea(a)parhasard.net>
diff -r 75435be92103f23d1905b4a3a60295164a9dd2b4 -r 8139bdf8db044f7bbd89b4c7e7bde26da6fb6b99 src/buffer.c
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -636,7 +636,8 @@
init_buffer_markers (b);
init_buffer_syntax_cache (b);
- b->generated_modeline_string = Fmake_string (make_fixnum (84), make_fixnum (' '));
+ b->generated_modeline_string = Fmake_string (make_fixnum (84),
+ make_char (' '));
b->modeline_extent_table = make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK,
Qeq);
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/1bb8128d2490/
Changeset: 1bb8128d2490
User: acm
Date: 2014-08-02 20:12:05
Summary: Fix confusion in C++ file caused by comma in "= {1,2},".
cc-engine.el (c-beginning-of-statement-1): In checking for a statement
boundary marked by "}", check there's no "=" before the "{".
(c-guess-basic-syntax CASE 9B): Call c-beginning-of-statement with
non-nil `comma-delim' argument.
cc-fonts.el (c-font-lock-declarators): Parse an initializer expression
more accurately.
Affected #: 2 files
diff -r 35a81ed7bf543fd761b6b224025c60f12a10260b -r 1bb8128d249099c24d9ad4535f40d4394d90c84b cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -1038,7 +1038,10 @@
;; Just gone back over a brace block?
((and
(eq (char-after) ?{)
- (not (c-looking-at-inexpr-block lim nil t)))
+ (not (c-looking-at-inexpr-block lim nil t))
+ (save-excursion
+ (c-backward-token-2 1 t nil)
+ (not (looking-at "=\\([^=]\\|$\\)"))))
(save-excursion
(c-forward-sexp) (point)))
;; Just gone back over some paren block?
@@ -10510,7 +10513,7 @@
(if (eq (point) (c-point 'boi))
(c-add-syntax 'brace-list-close (point))
(setq lim (c-most-enclosing-brace c-state-cache (point)))
- (c-beginning-of-statement-1 lim)
+ (c-beginning-of-statement-1 lim nil nil t)
(c-add-stmt-syntax 'brace-list-close nil t lim paren-state)))
(t
diff -r 35a81ed7bf543fd761b6b224025c60f12a10260b -r 1bb8128d249099c24d9ad4535f40d4394d90c84b cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -1009,7 +1009,8 @@
paren-depth
id-face got-init
c-last-identifier-range
- (separator-prop (if types 'c-decl-type-start 'c-decl-id-start)))
+ (separator-prop (if types 'c-decl-type-start 'c-decl-id-start))
+ brackets-after-id)
;; The following `while' fontifies a single declarator id each time round.
;; It loops only when LIST is non-nil.
@@ -1082,13 +1083,24 @@
;; Search syntactically to the end of the declarator (";",
;; ",", a closen paren, eob etc) or to the beginning of an
;; initializer or function prototype ("=" or "\\s\(").
- ;; Note that the open paren will match array specs in
- ;; square brackets, and we treat them as initializers too.
- (c-syntactic-re-search-forward
- "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
+ ;; Note that square brackets are now not also treated as
+ ;; initializers, since this broke when there were also
+ ;; initializing brace lists.
+ (let (found)
+ (while
+ (and (setq found
+ (c-syntactic-re-search-forward
+ "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
+ (eq (char-before) ?\[))
+ (backward-char)
+ (c-safe (c-forward-sexp 1))
+ (setq found nil)
+ (setq brackets-after-id t))
+ found))
(setq next-pos (match-beginning 0)
- id-face (if (eq (char-after next-pos) ?\()
+ id-face (if (and (eq (char-after next-pos) ?\()
+ (not brackets-after-id))
'font-lock-function-name-face
'font-lock-variable-name-face)
got-init (and (match-beginning 1)
@@ -1458,7 +1470,7 @@
(forward-char))
(setq bod-res (car (c-beginning-of-decl-1 decl-search-lim)))
(if (and (eq bod-res 'same)
- (progn
+ (save-excursion
(c-backward-syntactic-ws)
(eq (char-before) ?\})))
(c-beginning-of-decl-1 decl-search-lim))
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches