From e53052d3bf33296268db3aadcf5531f69f8e55ae Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Apr 2013 10:34:26 -0400 Subject: [PATCH 1/8] * lisp/progmodes/octave.el (octave-smie-forward-token): Properly skip \n and comment, even if it's not an implicit ;. Fixes: debbugs:14218 --- lisp/ChangeLog | 11 ++++++++--- lisp/progmodes/octave.el | 11 ++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 340dc41a744..e236b923932 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-26 Stefan Monnier + + * progmodes/octave.el (octave-smie-forward-token): Properly skip + \n and comment, even if it's not an implicit ; (bug#14218). + 2013-04-26 Glenn Morris * subr.el (read-number): Once more use `read' rather than @@ -20,7 +25,7 @@ * progmodes/octave.el (octave-submit-bug-report): Obsolete. (octave-mode, inferior-octave-mode): Use setq-local. - (octave-not-in-string-or-comment-p): Renamed to + (octave-not-in-string-or-comment-p): Rename to octave-in-string-or-comment-p. (octave-in-comment-p, octave-in-string-p) (octave-in-string-or-comment-p): Replace defsubst with defun. @@ -36,8 +41,8 @@ 2013-04-25 Leo Liu - * progmodes/octave.el (octave-completion-at-point-function): Make - use of inferior octave process. + * progmodes/octave.el (octave-completion-at-point-function): + Make use of inferior octave process. (octave-initialize-completions): Remove. (inferior-octave-completion-table): New function. (inferior-octave-completion-at-point): Use it. diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 640775bfe8b..c5f83a50654 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -461,11 +461,12 @@ Non-nil means always go to the next Octave code line after sending." (forward-comment 1)) (cond ((and (looking-at "$\\|[%#]") - (not (smie-rule-bolp)) - ;; Ignore it if it's within parentheses. - (prog1 (let ((ppss (syntax-ppss))) - (not (and (nth 1 ppss) - (eq ?\( (char-after (nth 1 ppss)))))) + ;; Ignore it if it's within parentheses or if the newline does not end + ;; some preceding text. + (prog1 (and (not (smie-rule-bolp)) + (let ((ppss (syntax-ppss))) + (not (and (nth 1 ppss) + (eq ?\( (char-after (nth 1 ppss))))))) (forward-comment (point-max)))) ;; Why bother distinguishing \n and ;? ";") ;;"\n" From 140ef50c0494870fd6b817f8f9b7e8d2cee81b64 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Apr 2013 10:47:07 -0400 Subject: [PATCH 2/8] * lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Disable undo. Fixes: debbugs:14274 --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/tabulated-list.el | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e236b923932..290f23a3550 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-04-26 Stefan Monnier + * emacs-lisp/tabulated-list.el (tabulated-list-mode): Disable undo + (bug#14274). + * progmodes/octave.el (octave-smie-forward-token): Properly skip \n and comment, even if it's not an implicit ; (bug#14218). diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index da487e463e2..6dba423010f 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -519,12 +519,11 @@ printer is `tabulated-list-print-entry', but a mode that keeps data in an ewoc may instead specify a printer function (e.g., one that calls `ewoc-enter-last'), with `tabulated-list-print-entry' as the ewoc pretty-printer." - (setq truncate-lines t) - (setq buffer-read-only t) - (set (make-local-variable 'revert-buffer-function) - 'tabulated-list-revert) - (set (make-local-variable 'glyphless-char-display) - tabulated-list-glyphless-char-display)) + (setq-local truncate-lines t) + (setq-local buffer-read-only t) + (setq-local buffer-undo-list t) + (setq-local revert-buffer-function #'tabulated-list-revert) + (setq-local glyphless-char-display tabulated-list-glyphless-char-display)) (put 'tabulated-list-mode 'mode-class 'special) From e55d3b0408c33aef72cddb6076617dacbf9ea4c0 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 27 Apr 2013 00:44:38 +0800 Subject: [PATCH 3/8] * progmodes/octave.el (octave-sync-function-file-names): New function. (octave-mode): Use it in before-save-hook. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/octave.el | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 290f23a3550..f57bf838cd5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-26 Leo Liu + + * progmodes/octave.el (octave-sync-function-file-names): New function. + (octave-mode): Use it in before-save-hook. + 2013-04-26 Stefan Monnier * emacs-lisp/tabulated-list.el (tabulated-list-mode): Disable undo diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index c5f83a50654..3c24205eb8e 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -626,6 +626,7 @@ including a reproducible test case and send the message." (add-hook 'completion-at-point-functions 'octave-completion-at-point-function nil t) + (add-hook 'before-save-hook 'octave-sync-function-file-names nil t) (setq-local beginning-of-defun-function 'octave-beginning-of-defun) (easy-menu-add octave-mode-menu)) @@ -1008,6 +1009,26 @@ directory and makes this the current buffer's default directory." nil (delete-horizontal-space) (insert (concat " " octave-continuation-string)))) + +(defun octave-sync-function-file-names () + "Ensure function name agree with function file name. +See Info node `(octave)Function Files'." + (interactive) + (save-excursion + (when (and buffer-file-name + (prog2 + (goto-char (point-min)) + (equal (funcall smie-forward-token-function) "function") + (forward-word -1))) + (let ((file (file-name-sans-extension + (file-name-nondirectory buffer-file-name))) + (func (and (re-search-forward octave-function-header-regexp nil t) + (match-string 3)))) + (when (and (not (equal file func)) + (yes-or-no-p + "Function name different from file name. Fix? ")) + (replace-match file nil nil nil 3)))))) + ;;; Indentation From ff7210d55b30e175da1384ba707ce1340a0c4e11 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 27 Apr 2013 01:11:04 +0800 Subject: [PATCH 4/8] * progmodes/octave.el (octave-sync-function-file-names): Fix last change. --- lisp/progmodes/octave.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 3c24205eb8e..f8b9e4f6fab 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1024,7 +1024,8 @@ See Info node `(octave)Function Files'." (file-name-nondirectory buffer-file-name))) (func (and (re-search-forward octave-function-header-regexp nil t) (match-string 3)))) - (when (and (not (equal file func)) + (when (and func + (not (equal file func)) (yes-or-no-p "Function name different from file name. Fix? ")) (replace-match file nil nil nil 3)))))) From f780d632f2047ccf07208081aa477882ef4ecc2a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 26 Apr 2013 12:31:09 -0700 Subject: [PATCH 5/8] Port better to AIX. * configure.ac (CFLAGS): Append -O if the user did not specify CFLAGS, we did not already infer an optimization option, and -O works. AIX xlc needs -O, otherwise garbage collection doesn't work. * src/lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too, to pacify AIX xlc. Fixes: debbugs:14258 --- ChangeLog | 7 +++++++ configure.ac | 30 +++++++++++++++++++++++------- src/ChangeLog | 6 ++++++ src/lisp.h | 6 +++--- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f74726a743..cf1d4f0d54e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-04-26 Paul Eggert + + Port better to AIX (Bug#14258). + * configure.ac (CFLAGS): Append -O if the user did not specify CFLAGS, + we did not already infer an optimization option, and -O works. + AIX xlc needs -O, otherwise garbage collection doesn't work. + 2013-04-22 Paul Eggert * make-dist: Do not distribute admin/unidata/Makefile. diff --git a/configure.ac b/configure.ac index 2b3afc1fb80..6c59dcaa7e3 100644 --- a/configure.ac +++ b/configure.ac @@ -613,10 +613,10 @@ AC_DEFUN([gl_THREADLIB]) dnl Amongst other things, this sets AR and ARFLAGS. gl_EARLY -# It's helpful to have C macros available to GDB, so prefer -g3 to -g -# if -g3 works and the user does not specify CFLAGS. -# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. if test "$ac_test_CFLAGS" != set; then + # It's helpful to have C macros available to GDB, so prefer -g3 to -g + # if -g3 works and the user does not specify CFLAGS. + # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. case $CFLAGS in '-g') emacs_g3_CFLAGS='-g3';; @@ -632,13 +632,29 @@ if test "$ac_test_CFLAGS" != set; then [emacs_cv_prog_cc_g3], [AC_LINK_IFELSE([AC_LANG_PROGRAM()], [emacs_cv_prog_cc_g3=yes], - [emacs_cv_prog_cc_g3=no])]) - if test $emacs_cv_prog_cc_g3 = yes; then - CFLAGS=$emacs_g3_CFLAGS - else + [emacs_cv_prog_cc_g3=no])]) + if test $emacs_cv_prog_cc_g3 != yes; then CFLAGS=$emacs_save_CFLAGS fi fi + + case $CFLAGS in + *-O*) ;; + *) + # No optimization flag was inferred for this non-GCC compiler. + # Try -O. This is needed for xlc on AIX; see Bug#14258. + emacs_save_CFLAGS=$CFLAGS + test -z "$CFLAGS" || CFLAGS="$CFLAGS " + CFLAGS=${CFLAGS}-O + AC_CACHE_CHECK([whether $CC accepts -O], + [emacs_cv_prog_cc_o], + [AC_LINK_IFELSE([AC_LANG_PROGRAM()], + [emacs_cv_prog_cc_o=yes], + [emacs_cv_prog_cc_o=no])]) + if test $emacs_cv_prog_cc_o != yes; then + CFLAGS=$emacs_save_CFLAGS + fi ;; + esac fi AC_ARG_ENABLE([gcc-warnings], diff --git a/src/ChangeLog b/src/ChangeLog index 99e2c3d9a84..9ae5c29ab72 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-04-26 Paul Eggert + + Port better to AIX (Bug#14258). + * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too, + to pacify AIX xlc. + 2013-04-24 Kenichi Handa * coding.c (decode_coding_iso_2022): When an invalid escape diff --git a/src/lisp.h b/src/lisp.h index bcb866b4cc4..e2c24eed352 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -231,9 +231,9 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 }; #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 #define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) -/* Stolen from GDB. The only known compiler that doesn't support - enums in bitfields is MSVC. */ -#ifdef _MSC_VER +/* Idea stolen from GDB. MSVC doesn't support enums in bitfields, + and xlc complains vociferously about them. */ +#if defined _MSC_VER || defined __IBMC__ #define ENUM_BF(TYPE) unsigned int #else #define ENUM_BF(TYPE) enum TYPE From f6bfc06324c0e9671e5fa843c96702ff84452087 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Sat, 27 Apr 2013 00:55:06 +0100 Subject: [PATCH 6/8] Fix docstring buglet in remember.el --- lisp/ChangeLog | 5 +++++ lisp/textmodes/remember.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f57bf838cd5..c88cf1103bc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-26 Reuben Thomas + + * textmodes/remember.el (remember-store-in-files): document that + the file name format is fed through format-time-string. + 2013-04-26 Leo Liu * progmodes/octave.el (octave-sync-function-file-names): New function. diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 76ffeaf30be..c8bafd8176a 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -444,7 +444,8 @@ If you want to remember a region, supply a universal prefix to (defun remember-store-in-files () "Store remember data in a file in `remember-data-directory'. -The file is named after `remember-directory-file-name-format'." +The file is named after `remember-directory-file-name-format' fed through +`format-time-string'." (let ((name (format-time-string remember-directory-file-name-format (current-time))) (text (buffer-string))) From d40ab5cfd916005305c5632c7be56b61a105da12 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 27 Apr 2013 08:38:41 +0200 Subject: [PATCH 7/8] lisp/ChangeLog: Tiny ChangeLog formatting fix. --- lisp/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c88cf1103bc..30c49c942c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,7 @@ 2013-04-26 Reuben Thomas - * textmodes/remember.el (remember-store-in-files): document that - the file name format is fed through format-time-string. + * textmodes/remember.el (remember-store-in-files): Document that + the file name format is passed to `format-time-string'. 2013-04-26 Leo Liu From 8beecaeda0d28bff0c4d3c2758bb938c656728b5 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 27 Apr 2013 06:17:37 -0400 Subject: [PATCH 8/8] Auto-commit of generated files. --- autogen/configure | 49 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/autogen/configure b/autogen/configure index 7ddac01fb10..bd900b5afef 100755 --- a/autogen/configure +++ b/autogen/configure @@ -7271,10 +7271,10 @@ esac # Code from module xalloc-oversized: -# It's helpful to have C macros available to GDB, so prefer -g3 to -g -# if -g3 works and the user does not specify CFLAGS. -# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. if test "$ac_test_CFLAGS" != set; then + # It's helpful to have C macros available to GDB, so prefer -g3 to -g + # if -g3 works and the user does not specify CFLAGS. + # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. case $CFLAGS in '-g') emacs_g3_CFLAGS='-g3';; @@ -7312,12 +7312,49 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_g3" >&5 $as_echo "$emacs_cv_prog_cc_g3" >&6; } - if test $emacs_cv_prog_cc_g3 = yes; then - CFLAGS=$emacs_g3_CFLAGS - else + if test $emacs_cv_prog_cc_g3 != yes; then CFLAGS=$emacs_save_CFLAGS fi fi + + case $CFLAGS in + *-O*) ;; + *) + # No optimization flag was inferred for this non-GCC compiler. + # Try -O. This is needed for xlc on AIX; see Bug#14258. + emacs_save_CFLAGS=$CFLAGS + test -z "$CFLAGS" || CFLAGS="$CFLAGS " + CFLAGS=${CFLAGS}-O + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -O" >&5 +$as_echo_n "checking whether $CC accepts -O... " >&6; } +if test "${emacs_cv_prog_cc_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + emacs_cv_prog_cc_o=yes +else + emacs_cv_prog_cc_o=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_o" >&5 +$as_echo "$emacs_cv_prog_cc_o" >&6; } + if test $emacs_cv_prog_cc_o != yes; then + CFLAGS=$emacs_save_CFLAGS + fi ;; + esac fi # Check whether --enable-gcc-warnings was given.