Now on revision 112431. ------------------------------------------------------------ revno: 112431 committer: Leo Liu branch nick: trunk timestamp: Wed 2013-05-01 14:13:20 +0800 message: * progmodes/octave.el (octave-abbrev-table): Remove abbrev definitions. Use completion-at-point to insert keywords. (octave-abbrev-start): Remove. (inferior-octave-mode, octave-mode): Use :abbrev-table instead. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-30 16:27:36 +0000 +++ lisp/ChangeLog 2013-05-01 06:13:20 +0000 @@ -1,3 +1,10 @@ +2013-05-01 Leo Liu + + * progmodes/octave.el (octave-abbrev-table): Remove abbrev + definitions. Use completion-at-point to insert keywords. + (octave-abbrev-start): Remove. + (inferior-octave-mode, octave-mode): Use :abbrev-table instead. + 2013-04-30 Leo Liu * progmodes/octave.el (inferior-octave-prompt-read-only): Fix last === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-30 16:27:36 +0000 +++ lisp/progmodes/octave.el 2013-05-01 06:13:20 +0000 @@ -42,54 +42,26 @@ (define-obsolete-function-alias 'octave-submit-bug-report 'report-emacs-bug "24.4") -(define-abbrev-table 'octave-abbrev-table - (mapcar (lambda (e) (append e '(nil 0 t))) - '(("`a" "all_va_args") - ("`b" "break") - ("`cs" "case") - ("`ca" "catch") - ("`c" "continue") - ("`el" "else") - ("`eli" "elseif") - ("`et" "end_try_catch") - ("`eu" "end_unwind_protect") - ("`ef" "endfor") - ("`efu" "endfunction") - ("`ei" "endif") - ("`es" "endswitch") - ("`ew" "endwhile") - ("`f" "for") - ("`fu" "function") - ("`gl" "global") - ("`gp" "gplot") - ("`gs" "gsplot") - ("`if" "if ()") - ("`o" "otherwise") - ("`rp" "replot") - ("`r" "return") - ("`s" "switch") - ("`t" "try") - ("`u" "until ()") - ("`up" "unwind_protect") - ("`upc" "unwind_protect_cleanup") - ("`w" "while ()"))) +(define-abbrev-table 'octave-abbrev-table nil "Abbrev table for Octave's reserved words. -Used in `octave-mode' and `inferior-octave-mode' buffers. -All Octave abbrevs start with a grave accent (`)." - :regexp "\\(?:[^`]\\|^\\)\\(\\(?:\\<\\|`\\)\\w+\\)\\W*") +Used in `octave-mode' and `inferior-octave-mode' buffers.") (defvar octave-comment-char ?# "Character to start an Octave comment.") + (defvar octave-comment-start (string octave-comment-char ?\s) "String to insert to start a new Octave in-line comment.") + (defvar octave-comment-start-skip "\\s<+\\s-*" "Regexp to match the start of an Octave comment up to its body.") (defvar octave-begin-keywords '("do" "for" "function" "if" "switch" "try" "unwind_protect" "while")) + (defvar octave-else-keywords '("case" "catch" "else" "elseif" "otherwise" "unwind_protect_cleanup")) + (defvar octave-end-keywords '("endfor" "endfunction" "endif" "endswitch" "end_try_catch" "end_unwind_protect" "endwhile" "until" "end")) @@ -172,7 +144,6 @@ (defvar octave-mode-map (let ((map (make-sparse-keymap))) - (define-key map "`" 'octave-abbrev-start) (define-key map "\e\n" 'octave-indent-new-comment-line) (define-key map "\M-\C-q" 'octave-indent-defun) (define-key map "\C-c\C-p" 'octave-previous-code-line) @@ -232,9 +203,6 @@ "-" ["Indent Line" indent-according-to-mode t] ["Complete Symbol" completion-at-point t] - "-" - ["Toggle Abbrev Mode" abbrev-mode - :style toggle :selected abbrev-mode] ["Toggle Auto-Fill Mode" auto-fill-mode :style toggle :selected auto-fill-function] "-" @@ -331,11 +299,13 @@ "Non-nil means display `inferior-octave-buffer' after sending to it." :type 'boolean :group 'octave) + (defcustom octave-send-line-auto-forward t "Control auto-forward after sending to the inferior Octave process. Non-nil means always go to the next Octave code line after sending." :type 'boolean :group 'octave) + (defcustom octave-send-echo-input t "Non-nil means echo input sent to the inferior Octave process." :type 'boolean @@ -499,7 +469,7 @@ computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically. Function definitions can also be stored in files and used in batch mode." - (setq local-abbrev-table octave-abbrev-table) + :abbrev-table octave-abbrev-table (smie-setup octave-smie-grammar #'octave-smie-rules :forward-token #'octave-smie-forward-token @@ -650,9 +620,8 @@ (define-derived-mode inferior-octave-mode comint-mode "Inferior Octave" "Major mode for interacting with an inferior Octave process." - (setq comint-prompt-regexp inferior-octave-prompt - mode-line-process '(":%s") - local-abbrev-table octave-abbrev-table) + :abbrev-table octave-abbrev-table + (setq comint-prompt-regexp inferior-octave-prompt) (setq-local comment-start octave-comment-start) (setq-local comment-end "") @@ -1367,22 +1336,6 @@ 'completion-at-point "24.1") ;;; Electric characters && friends - -(defun octave-abbrev-start () - "Start entering an Octave abbreviation. -If Abbrev mode is turned on, typing ` (grave accent) followed by ? or -\\[help-command] lists all Octave abbrevs. Any other key combination is -executed normally. -Note that all Octave mode abbrevs start with a grave accent." - (interactive) - (self-insert-command 1) - (when abbrev-mode - (set-temporary-overlay-map - (let ((map (make-sparse-keymap))) - (define-key map [??] 'list-abbrevs) - (define-key map (vector help-char) 'list-abbrevs) - map)))) - (define-skeleton octave-insert-defun "Insert an Octave function skeleton. Prompt for the function's name, arguments and return values (to be ------------------------------------------------------------ revno: 112430 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2013-05-01 00:37:07 +0000 message: lisp/gnus/ChangeLog: Add Bug# diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-05-01 00:29:13 +0000 +++ lisp/gnus/ChangeLog 2013-05-01 00:37:07 +0000 @@ -1,6 +1,7 @@ 2013-05-01 Katsumi Yamaoka * gnus-util.el (gnus-emacs-completing-read): Fix a filter for XEmacs. + (Bug#14304) 2013-04-27 Glenn Morris ------------------------------------------------------------ revno: 112429 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2013-05-01 00:29:13 +0000 message: gnus-util.el (gnus-emacs-completing-read): Fix a filter for XEmacs diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-04-27 23:57:29 +0000 +++ lisp/gnus/ChangeLog 2013-05-01 00:29:13 +0000 @@ -1,3 +1,7 @@ +2013-05-01 Katsumi Yamaoka + + * gnus-util.el (gnus-emacs-completing-read): Fix a filter for XEmacs. + 2013-04-27 Glenn Morris * gnus.el (gnus-list-debbugs): === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2013-02-14 00:44:38 +0000 +++ lisp/gnus/gnus-util.el 2013-05-01 00:29:13 +0000 @@ -1549,9 +1549,12 @@ "Call standard `completing-read-function'." (let ((completion-styles gnus-completion-styles)) (completing-read prompt - ;; Old XEmacs (at least 21.4) expect an alist for - ;; collection. - (mapcar 'list collection) + ;; Old XEmacs (at least 21.4) expect an alist, + ;; in which the car of each element is a string, + ;; for collection. + (mapcar (lambda (elem) + (list (format "%s" (or (car-safe elem) elem)))) + collection) nil require-match initial-input history def))) (autoload 'ido-completing-read "ido") ------------------------------------------------------------ revno: 112428 committer: Leo Liu branch nick: trunk timestamp: Wed 2013-05-01 00:27:36 +0800 message: * progmodes/octave.el (inferior-octave-prompt-read-only): Fix last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-30 16:19:14 +0000 +++ lisp/ChangeLog 2013-04-30 16:27:36 +0000 @@ -1,3 +1,8 @@ +2013-04-30 Leo Liu + + * progmodes/octave.el (inferior-octave-prompt-read-only): Fix last + change. + 2013-04-30 Alan Mackenzie Handle arbitrarily long C++ member initialisation lists. === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-30 15:20:46 +0000 +++ lisp/progmodes/octave.el 2013-04-30 16:27:36 +0000 @@ -568,11 +568,9 @@ :type 'regexp :group 'octave) -(defcustom inferior-octave-prompt-read-only t +(defcustom inferior-octave-prompt-read-only comint-prompt-read-only "If non-nil, the Octave prompt is read only. -The read only region includes the newline before the prompt. -Setting this variable does not affect existing Octave runs. -This feature utilizes the `comint-prompt-read-only' variable." +See `comint-prompt-read-only' for details." :type 'boolean :group 'octave :version "24.4") ------------------------------------------------------------ revno: 112427 committer: Alan Mackenzie branch nick: trunk timestamp: Tue 2013-04-30 16:19:14 +0000 message: Handle arbitrarily long C++ member initialisation lists. * progmodes/cc-engine.el (c-back-over-member-initializers): new function. (c-guess-basic-syntax): New CASE 5R (extracted from 5B) to handle (most) member init lists. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-30 15:20:46 +0000 +++ lisp/ChangeLog 2013-04-30 16:19:14 +0000 @@ -1,3 +1,11 @@ +2013-04-30 Alan Mackenzie + + Handle arbitrarily long C++ member initialisation lists. + * progmodes/cc-engine.el (c-back-over-member-initializers): new + function. + (c-guess-basic-syntax): New CASE 5R (extracted from 5B) to handle + (most) member init lists. + 2013-04-30 Rüdiger Sonderfeld * progmodes/octave.el (inferior-octave-prompt-read-only): New user === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-04-03 17:50:39 +0000 +++ lisp/progmodes/cc-engine.el 2013-04-30 16:19:14 +0000 @@ -6475,6 +6475,52 @@ (c-go-list-forward) t))) +(defun c-back-over-member-initializers () + ;; Test whether we are in a C++ member initializer list, and if so, go back + ;; to the introducing ":", returning the position of the opening paren of + ;; the function's arglist. Otherwise return nil, leaving point unchanged. + (let ((here (point)) + (paren-state (c-parse-state)) + res) + + (setq res + (catch 'done + (if (not (c-at-toplevel-p)) + (progn + (while (not (c-at-toplevel-p)) + (goto-char (c-pull-open-brace paren-state))) + (c-backward-syntactic-ws) + (when (not (c-simple-skip-symbol-backward)) + (throw 'done nil)) + (c-backward-syntactic-ws)) + (c-backward-syntactic-ws) + (when (memq (char-before) '(?\) ?})) + (when (not (c-go-list-backward)) + (throw 'done nil)) + (c-backward-syntactic-ws)) + (when (c-simple-skip-symbol-backward) + (c-backward-syntactic-ws))) + + (while (eq (char-before) ?,) + (backward-char) + (c-backward-syntactic-ws) + + (when (not (memq (char-before) '(?\) ?}))) + (throw 'done nil)) + (when (not (c-go-list-backward)) + (throw 'done nil)) + (c-backward-syntactic-ws) + (when (not (c-simple-skip-symbol-backward)) + (throw 'done nil)) + (c-backward-syntactic-ws)) + + (and + (eq (char-before) ?:) + (c-just-after-func-arglist-p)))) + + (or res (goto-char here)) + res)) + ;; Handling of large scale constructs like statements and declarations. @@ -9677,18 +9723,13 @@ ;; 2007-11-09) )))) - ;; CASE 5B: After a function header but before the body (or - ;; the ending semicolon if there's no body). + ;; CASE 5R: Member init list. (Used to be part of CASE 5B.1) + ;; Note there is no limit on the backward search here, since member + ;; init lists can, in practice, be very large. ((save-excursion - (when (setq placeholder (c-just-after-func-arglist-p - (max lim (c-determine-limit 500)))) + (when (setq placeholder (c-back-over-member-initializers)) (setq tmp-pos (point)))) - (cond - - ;; CASE 5B.1: Member init list. - ((eq (char-after tmp-pos) ?:) - (if (or (>= tmp-pos indent-point) - (= (c-point 'bosws) (1+ tmp-pos))) + (if (= (c-point 'bosws) (1+ tmp-pos)) (progn ;; There is no preceding member init clause. ;; Indent relative to the beginning of indentation @@ -9701,6 +9742,23 @@ (c-forward-syntactic-ws) (c-add-syntax 'member-init-cont (point)))) + ;; CASE 5B: After a function header but before the body (or + ;; the ending semicolon if there's no body). + ((save-excursion + (when (setq placeholder (c-just-after-func-arglist-p + (max lim (c-determine-limit 500)))) + (setq tmp-pos (point)))) + (cond + + ;; CASE 5B.1: Member init list. + ((eq (char-after tmp-pos) ?:) + ;; There is no preceding member init clause. + ;; Indent relative to the beginning of indentation + ;; for the topmost-intro line that contains the + ;; prototype's open paren. + (goto-char placeholder) + (c-add-syntax 'member-init-intro (c-point 'boi))) + ;; CASE 5B.2: K&R arg decl intro ((and c-recognize-knr-p (c-in-knr-argdecl lim)) ------------------------------------------------------------ revno: 112426 author: Rüdiger Sonderfeld committer: Leo Liu branch nick: trunk timestamp: Tue 2013-04-30 23:20:46 +0800 message: * progmodes/octave.el (inferior-octave-prompt-read-only): New user variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-30 14:23:03 +0000 +++ lisp/ChangeLog 2013-04-30 15:20:46 +0000 @@ -1,3 +1,8 @@ +2013-04-30 Rüdiger Sonderfeld + + * progmodes/octave.el (inferior-octave-prompt-read-only): New user + variable. + 2013-04-30 Leo Liu * progmodes/octave.el (octave-variables): Remove. No builtin === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-30 14:23:03 +0000 +++ lisp/progmodes/octave.el 2013-04-30 15:20:46 +0000 @@ -568,6 +568,15 @@ :type 'regexp :group 'octave) +(defcustom inferior-octave-prompt-read-only t + "If non-nil, the Octave prompt is read only. +The read only region includes the newline before the prompt. +Setting this variable does not affect existing Octave runs. +This feature utilizes the `comint-prompt-read-only' variable." + :type 'boolean + :group 'octave + :version "24.4") + (defcustom inferior-octave-startup-file nil "Name of the inferior Octave startup file. The contents of this file are sent to the inferior Octave process on @@ -661,6 +670,7 @@ comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024)) (setq-local comint-dynamic-complete-functions inferior-octave-dynamic-complete-functions) + (setq-local comint-prompt-read-only inferior-octave-prompt-read-only) (add-hook 'comint-input-filter-functions 'inferior-octave-directory-tracker nil t) (comint-read-input-ring t)) ------------------------------------------------------------ revno: 112425 committer: Leo Liu branch nick: trunk timestamp: Tue 2013-04-30 22:23:03 +0800 message: * progmodes/octave.el (octave-variables): Remove. No builtin variables any more. All converted to functions. (octave-font-lock-keywords, octave-completion-at-point-function): Fix uses. (octave-font-lock-texinfo-comment): New user variable. (octave-texinfo-font-lock-keywords): New variable for texinfo comment block. (octave-function-comment-block): New face. (octave-font-lock-texinfo-comment): New function. (octave-mode): Font lock texinfo comment block. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-29 20:09:18 +0000 +++ lisp/ChangeLog 2013-04-30 14:23:03 +0000 @@ -1,3 +1,16 @@ +2013-04-30 Leo Liu + + * progmodes/octave.el (octave-variables): Remove. No builtin + variables any more. All converted to functions. + (octave-font-lock-keywords, octave-completion-at-point-function): + Fix uses. + (octave-font-lock-texinfo-comment): New user variable. + (octave-texinfo-font-lock-keywords): New variable for texinfo + comment block. + (octave-function-comment-block): New face. + (octave-font-lock-texinfo-comment): New function. + (octave-mode): Font lock texinfo comment block. + 2013-04-29 Leo Liu * progmodes/octave.el (octave-font-lock-keywords): Handle 'end' in === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-29 20:09:18 +0000 +++ lisp/progmodes/octave.el 2013-04-30 14:23:03 +0000 @@ -108,37 +108,6 @@ "which" "who" "whos") "Text functions in Octave.") -(defvar octave-variables - '("DEFAULT_EXEC_PATH" "DEFAULT_LOADPATH" - "EDITOR" "EXEC_PATH" "F_DUPFD" "F_GETFD" "F_GETFL" "F_SETFD" - "F_SETFL" "I" "IMAGE_PATH" "Inf" "J" - "NaN" "OCTAVE_VERSION" "O_APPEND" "O_CREAT" "O_EXCL" - "O_NONBLOCK" "O_RDONLY" "O_RDWR" "O_TRUNC" "O_WRONLY" "PAGER" "PS1" - "PS2" "PS4" "PWD" "SEEK_CUR" "SEEK_END" "SEEK_SET" "__F_DUPFD__" - "__F_GETFD__" "__F_GETFL__" "__F_SETFD__" "__F_SETFL__" "__I__" - "__Inf__" "__J__" "__NaN__" "__OCTAVE_VERSION__" "__O_APPEND__" - "__O_CREAT__" "__O_EXCL__" "__O_NONBLOCK__" "__O_RDONLY__" - "__O_RDWR__" "__O_TRUNC__" "__O_WRONLY__" "__PWD__" "__SEEK_CUR__" - "__SEEK_END__" "__SEEK_SET__" "__argv__" "__e__" "__eps__" - "__i__" "__inf__" "__j__" "__nan__" "__pi__" - "__program_invocation_name__" "__program_name__" "__realmax__" - "__realmin__" "__stderr__" "__stdin__" "__stdout__" "ans" "argv" - "beep_on_error" "completion_append_char" - "crash_dumps_octave_core" "default_save_format" - "e" "echo_executing_commands" "eps" - "error_text" "gnuplot_binary" "history_file" - "history_size" "ignore_function_time_stamp" - "inf" "nan" "nargin" "output_max_field_width" "output_precision" - "page_output_immediately" "page_screen_output" "pi" - "print_answer_id_name" "print_empty_dimensions" - "program_invocation_name" "program_name" - "realmax" "realmin" "return_last_computed_value" "save_precision" - "saving_history" "sighup_dumps_octave_core" "sigterm_dumps_octave_core" - "silent_functions" "split_long_rows" "stderr" "stdin" "stdout" - "string_fill_char" "struct_levels_to_print" - "suppress_verbose_help_message") - "Builtin variables in Octave.") - (defvar octave-function-header-regexp (concat "^\\s-*\\_<\\(function\\)\\_>" "\\([^=;\n]*=[ \t]*\\|[ \t]*\\)\\(\\(?:\\w\\|\\s_\\)+\\)\\_>") @@ -171,9 +140,6 @@ (if (boundp 'font-lock-builtin-face) 'font-lock-builtin-face 'font-lock-preprocessor-face)) - ;; Fontify all builtin variables. - (cons (concat "\\_<" (regexp-opt octave-variables) "\\_>") - 'font-lock-variable-name-face) ;; Fontify all function declarations. (list octave-function-header-regexp '(1 font-lock-keyword-face) @@ -312,6 +278,12 @@ table) "Syntax table in use in `octave-mode' buffers.") +(defcustom octave-font-lock-texinfo-comment t + "Control whether to highlight the texinfo comment block." + :type 'boolean + :group 'octave + :version "24.4") + (defcustom octave-blink-matching-block t "Control the blinking of matching Octave block keywords. Non-nil means show matching begin of block when inserting a space, @@ -575,6 +547,7 @@ '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) + (and octave-font-lock-texinfo-comment (octave-font-lock-texinfo-comment)) (easy-menu-add octave-mode-menu)) @@ -1049,6 +1022,50 @@ nil 'delimited nil nil beg end) (message "Function names match"))))) +;; Adapted from texinfo-font-lock-keywords +(defvar octave-texinfo-font-lock-keywords + `(("@\\([a-zA-Z]+\\|[^ \t\n]\\)" 1 font-lock-keyword-face prepend) ;commands + ("^\\*\\([^\n:]*\\)" 1 font-lock-function-name-face prepend) ;menu items + ("@\\(emph\\|i\\|sc\\){\\([^}]+\\)" 2 'italic prepend) + ("@\\(strong\\|b\\){\\([^}]+\\)" 2 'bold prepend) + ("@\\(kbd\\|key\\|url\\|uref\\){\\([^}]+\\)" + 2 font-lock-string-face prepend) + ("@\\(file\\|email\\){\\([^}]+\\)" 2 font-lock-string-face prepend) + ("@\\(samp\\|code\\|var\\|math\\|env\\|command\\|option\\){\\([^}]+\\)" + 2 font-lock-variable-name-face prepend) + ("@\\(cite\\|x?ref\\|pxref\\|dfn\\|inforef\\){\\([^}]+\\)" + 2 font-lock-constant-face prepend) + ("@\\(anchor\\){\\([^}]+\\)" 2 font-lock-type-face prepend) + ("@\\(dmn\\|acronym\\|value\\){\\([^}]+\\)" + 2 font-lock-builtin-face prepend) + ("@\\(end\\|itemx?\\) +\\(.+\\)" 2 font-lock-keyword-face prepend)) + "Additional keywords to highlight in texinfo comment block.") + +(defface octave-function-comment-block + '((t (:inherit font-lock-doc-face))) + "Face used to highlight function comment block." + :group 'octave) + +(defun octave-font-lock-texinfo-comment () + (font-lock-add-keywords + nil + '(((lambda (limit) + (while (and (search-forward "-*- texinfo -*-" limit t) + (octave-in-comment-p)) + (let ((beg (nth 8 (syntax-ppss))) + (end (progn + (octave-skip-comment-forward (point-max)) + (point)))) + (put-text-property beg end 'font-lock-multiline t) + (font-lock-prepend-text-property + beg end 'face 'octave-function-comment-block) + (dolist (kw octave-texinfo-font-lock-keywords) + (goto-char beg) + (while (re-search-forward (car kw) end 'move) + (font-lock-apply-highlight (cdr kw)))))) + nil))) + 'append)) + ;;; Indentation @@ -1336,8 +1353,7 @@ (process-live-p inferior-octave-process) (inferior-octave-completion-table)) (append octave-reserved-words - octave-text-functions - octave-variables))))) + octave-text-functions))))) (define-obsolete-function-alias 'octave-complete-symbol 'completion-at-point "24.1") ------------------------------------------------------------ revno: 112424 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-04-30 06:17:35 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2013-03-27 10:17:37 +0000 +++ autogen/config.in 2013-04-30 10:17:35 +0000 @@ -1579,13 +1579,21 @@ Suppress extern inline with HP-UX cc, as it appears to be broken; see . - Suppress the use of extern inline on Apple's platforms, - as Libc-825.25 (2012-09-19) is incompatible with it; see + Suppress extern inline with Sun C in standards-conformance mode, as it + mishandles inline functions that call each other. E.g., for 'inline void f + (void) { } inline void g (void) { f (); }', c99 incorrectly complains + 'reference to static identifier "f" in extern inline function'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress the use of extern inline on Apple's platforms, as Libc at least + through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g., . Perhaps Apple will fix this some day. */ #if ((__GNUC__ \ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ - : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ + && !(defined __SUNPRO_C && __STDC__))) \ && !defined __APPLE__) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline ------------------------------------------------------------ revno: 112423 committer: Leo Liu branch nick: trunk timestamp: Tue 2013-04-30 04:09:18 +0800 message: * progmodes/octave.el (octave-font-lock-keywords): Handle 'end' in indexing expression. (octave-continuation-string): Do not use \. (inferior-octave-complete-impossible): Remove. (inferior-octave-completion-table) (inferior-octave-completion-at-point): Remove its uses. (inferior-octave-startup): completion_matches was introduced to Octave in 1996 so safe to assume it. (octave-function-file-comment): Improve to follow how Octave does it. (octave-update-function-file-comment): Tweak. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-29 04:37:36 +0000 +++ lisp/ChangeLog 2013-04-29 20:09:18 +0000 @@ -1,5 +1,18 @@ 2013-04-29 Leo Liu + * progmodes/octave.el (octave-font-lock-keywords): Handle 'end' in + indexing expression. + (octave-continuation-string): Do not use \. + (inferior-octave-complete-impossible): Remove. + (inferior-octave-completion-table) + (inferior-octave-completion-at-point): Remove its uses. + (inferior-octave-startup): completion_matches was introduced to + Octave in 1996 so safe to assume it. + (octave-function-file-comment): Improve to follow how Octave does it. + (octave-update-function-file-comment): Tweak. + +2013-04-29 Leo Liu + * progmodes/octave.el (inferior-octave-startup-hook): Obsolete. (inferior-octave-startup): Remove inferior-octave-startup-hook. (octave-function-file-comment): Fix typo. === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-29 04:37:36 +0000 +++ lisp/progmodes/octave.el 2013-04-29 20:09:18 +0000 @@ -155,6 +155,17 @@ octave-text-functions)) "\\)\\_>") 'font-lock-keyword-face) + ;; Note: 'end' also serves as the last index in an indexing expression. + ;; Ref: http://www.mathworks.com/help/matlab/ref/end.html + '("\\_" (0 (save-excursion + (condition-case nil + (progn + (goto-char (match-beginning 0)) + (backward-up-list) + (unless (eq (char-after) ?\() + font-lock-keyword-face)) + (error font-lock-keyword-face))) + t)) ;; Fontify all builtin operators. (cons "\\(&\\||\\|<=\\|>=\\|==\\|<\\|>\\|!=\\|!\\)" (if (boundp 'font-lock-builtin-face) @@ -321,15 +332,17 @@ "Extra indentation applied to Octave continuation lines." :type 'integer :group 'octave) + (eval-and-compile (defconst octave-continuation-marker-regexp "\\\\\\|\\.\\.\\.")) + (defvar octave-continuation-regexp (concat "[^#%\n]*\\(" octave-continuation-marker-regexp "\\)\\s-*\\(\\s<.*\\)?$")) -(defcustom octave-continuation-string "\\" - "Character string used for Octave continuation lines. Normally \\." - :type 'string - :group 'octave) + +;; Char \ is considered a bad decision for continuing a line. +(defconst octave-continuation-string "..." + "Character string used for Octave continuation lines.") (defvar octave-mode-imenu-generic-expression (list @@ -644,9 +657,6 @@ (define-obsolete-variable-alias 'inferior-octave-startup-hook 'inferior-octave-mode-hook "24.4") -(defvar inferior-octave-complete-impossible nil - "Non-nil means that `inferior-octave-complete' is impossible.") - (defvar inferior-octave-has-built-in-variables nil "Non-nil means that Octave has built-in variables.") @@ -778,11 +788,6 @@ 'identity inferior-octave-output-list "\n") "\n")) inferior-octave-output-string)) - ;; Next, we check whether Octave supports `completion_matches' ... - (inferior-octave-send-list-and-digest - (list "exist \"completion_matches\"\n")) - (setq inferior-octave-complete-impossible - (not (string-match "5$" (car inferior-octave-output-list)))) ;; And finally, everything is back to normal. (set-process-filter proc 'inferior-octave-output-filter) @@ -791,13 +796,12 @@ (inferior-octave-resync-dirs))) (defun inferior-octave-completion-table () - (unless inferior-octave-complete-impossible - (completion-table-dynamic - (lambda (command) - (inferior-octave-send-list-and-digest - (list (concat "completion_matches (\"" command "\");\n"))) - (sort (delete-dups inferior-octave-output-list) - 'string-lessp))))) + (completion-table-dynamic + (lambda (command) + (inferior-octave-send-list-and-digest + (list (concat "completion_matches (\"" command "\");\n"))) + (sort (delete-dups inferior-octave-output-list) + 'string-lessp)))) (defun inferior-octave-completion-at-point () "Return the data to complete the Octave symbol at point." @@ -806,13 +810,8 @@ (save-excursion (skip-syntax-backward "w_" (comint-line-beginning-position)) (point)))) - (cond ((eq start end) nil) - (inferior-octave-complete-impossible - (message (concat - "Your Octave does not have `completion_matches'. " - "Please upgrade to version 2.X.")) - nil) - (t (list start end (inferior-octave-completion-table)))))) + (when (> end start) + (list start end (inferior-octave-completion-table))))) (define-obsolete-function-alias 'inferior-octave-complete 'completion-at-point "24.1") @@ -968,22 +967,20 @@ "Beginning and end positions of the function file comment." (save-excursion (goto-char (point-min)) - (let ((bound (progn (forward-comment (point-max)) (point)))) - (goto-char (point-min)) - ;; Copyright block: octave/libinterp/parse-tree/lex.ll around line 1634 - (when (save-excursion - (comment-search-forward bound t) - (when (eq (char-after) ?\{) ; case of block comment - (forward-char 1)) - (skip-syntax-forward "-") - (let ((case-fold-search t)) - (looking-at-p "\\(?:copyright\\|author\\)\\_>"))) - (octave-skip-comment-forward bound)) - (let ((beg (comment-search-forward bound t))) - (when beg - (goto-char beg) - (octave-skip-comment-forward bound) - (list beg (point))))))) + ;; Copyright block: octave/libinterp/parse-tree/lex.ll around line 1634 + (while (save-excursion + (when (comment-search-forward (point-max) t) + (when (eq (char-after) ?\{) ; case of block comment + (forward-char 1)) + (skip-syntax-forward "-") + (let ((case-fold-search t)) + (looking-at-p "\\(?:copyright\\|author\\)\\_>")))) + (octave-skip-comment-forward (point-max))) + (let ((beg (comment-search-forward (point-max) t))) + (when beg + (goto-char beg) + (octave-skip-comment-forward (point-max)) + (list beg (point)))))) (defun octave-sync-function-file-names () "Ensure function name agree with function file name. @@ -1037,11 +1034,10 @@ (error "Function name not found"))) (old-func (progn (goto-char beg) - (when (and (re-search-forward - "usage:\\|@deftypefn" end t) - (re-search-forward - "[=}]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>" - (line-end-position) t)) + (when (re-search-forward + "[=}]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>" + (min (line-end-position 4) end) + t) (match-string 1)))) (old-func (read-string (format (if old-func "Name to replace (default %s): "