Now on revision 112423. ------------------------------------------------------------ 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): " ------------------------------------------------------------ revno: 112422 committer: Paul Eggert branch nick: trunk timestamp: Sun 2013-04-28 21:48:30 -0700 message: Merge from gnulib. This incorporates: 2013-04-28 extern-inline: work around bug in Sun c99 diff: === modified file 'ChangeLog' --- ChangeLog 2013-04-27 19:30:33 +0000 +++ ChangeLog 2013-04-29 04:48:30 +0000 @@ -1,3 +1,8 @@ +2013-04-29 Paul Eggert + + Merge from gnulib, incorporating: + 2013-04-28 extern-inline: work around bug in Sun c99 + 2013-04-27 Paul Eggert Merge from gnulib, incorporating: === modified file 'm4/extern-inline.m4' --- m4/extern-inline.m4 2013-03-01 15:16:43 +0000 +++ m4/extern-inline.m4 2013-04-29 04:48:30 +0000 @@ -21,13 +21,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: 112421 committer: Leo Liu branch nick: trunk timestamp: Mon 2013-04-29 12:37:36 +0800 message: * progmodes/octave.el (inferior-octave-startup-hook): Obsolete. (inferior-octave-startup): Remove inferior-octave-startup-hook. (octave-function-file-comment): Fix typo. (octave-sync-function-file-names): Use read-char-choice. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-28 16:39:10 +0000 +++ lisp/ChangeLog 2013-04-29 04:37:36 +0000 @@ -1,3 +1,10 @@ +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. + (octave-sync-function-file-names): Use read-char-choice. + 2013-04-28 Jay Belanger * calc/calc.el (math-normalize): Don't set `math-normalize-error' === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-27 17:07:01 +0000 +++ lisp/progmodes/octave.el 2013-04-29 04:37:36 +0000 @@ -641,7 +641,8 @@ (defvar inferior-octave-output-string nil) (defvar inferior-octave-receive-in-progress nil) -(defvar inferior-octave-startup-hook nil) +(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.") @@ -785,8 +786,6 @@ ;; And finally, everything is back to normal. (set-process-filter proc 'inferior-octave-output-filter) - (run-hooks 'inferior-octave-startup-hook) - (run-hooks 'inferior-octave-startup-hook) ;; Just in case, to be sure a cd in the startup file ;; won't have detrimental effects. (inferior-octave-resync-dirs))) @@ -966,7 +965,7 @@ ;;; First non-copyright comment block (defun octave-function-file-comment () - "Beginnning and end positions of the function file comment." + "Beginning and end positions of the function file comment." (save-excursion (goto-char (point-min)) (let ((bound (progn (forward-comment (point-max)) (point)))) @@ -994,17 +993,32 @@ (pcase-let ((`(,start ,_end ,name-start ,name-end) (octave-function-file-p))) (when (and start name-start) - (let ((func (buffer-substring name-start name-end)) - (file (file-name-sans-extension - (file-name-nondirectory buffer-file-name)))) - (save-excursion - (when (and (not (equal file func)) - (progn - (goto-char name-start) - (yes-or-no-p - "Function name different from file name. Fix? "))) - (delete-region name-start name-end) - (insert file)))))))) + (let* ((func (buffer-substring name-start name-end)) + (file (file-name-sans-extension + (file-name-nondirectory buffer-file-name))) + (help-form (format "\ +a: Use function name `%s' +b: Use file name `%s' +q: Don't fix\n" func file)) + (c (unless (equal file func) + (save-window-excursion + (help-form-show) + (read-char-choice + "Which name to use? (a/b/q) " '(?a ?b ?q)))))) + (pcase c + (`?a (let ((newname (expand-file-name + (concat func (file-name-extension + buffer-file-name t))))) + (when (or (not (file-exists-p newname)) + (yes-or-no-p + (format "Target file %s exists; proceed? " newname))) + (when (file-exists-p buffer-file-name) + (rename-file buffer-file-name newname t)) + (set-visited-file-name newname)))) + (`?b (save-excursion + (goto-char name-start) + (delete-region name-start name-end) + (insert file))))))))) (defun octave-update-function-file-comment (beg end) "Query replace function names in function file comment." ------------------------------------------------------------ revno: 112420 fixes bug: http://debbugs.gnu.org/14287 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2013-04-28 21:21:01 +0300 message: Fix bug #14287 with decoding EOL by *-dos coding systems. src/coding.c (decode_coding_gap): Don't remove the character before a newline unless it's a CR character. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-04-28 13:11:16 +0000 +++ src/ChangeLog 2013-04-28 18:21:01 +0000 @@ -1,3 +1,8 @@ +2013-04-28 Eli Zaretskii + + * coding.c (decode_coding_gap): Don't remove the character before + a newline unless it's a CR character. (Bug#14287) + 2013-04-28 Dan Nicolaescu * dispextern.h (struct face): Move enum face_underline_type === modified file 'src/coding.c' --- src/coding.c 2013-04-24 15:09:49 +0000 +++ src/coding.c 2013-04-28 18:21:01 +0000 @@ -7774,7 +7774,7 @@ while (src_beg < src) { *--dst = *--src; - if (*src == '\n') + if (*src == '\n' && src > src_beg && src[-1] == '\r') src--; } diff = dst - src; ------------------------------------------------------------ revno: 112419 committer: Jay Belanger branch nick: trunk timestamp: Sun 2013-04-28 11:39:10 -0500 message: * calc/calc.el (math-normalize): Don't set `math-normalize-error' to t for the less important warnings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-27 22:03:42 +0000 +++ lisp/ChangeLog 2013-04-28 16:39:10 +0000 @@ -1,3 +1,8 @@ +2013-04-28 Jay Belanger + + * calc/calc.el (math-normalize): Don't set `math-normalize-error' + to t for the less important warnings. + 2013-04-27 Darren Hoo (tiny change) * isearch.el (isearch-fail-pos): Check for empty `cmds'. (Bug#14268) === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2013-04-05 02:20:35 +0000 +++ lisp/calc/calc.el 2013-04-28 16:39:10 +0000 @@ -2701,7 +2701,6 @@ (cons (car math-normalize-a) args)) nil) (wrong-type-argument - (setq math-normalize-error t) (or calc-next-why (calc-record-why "Wrong type of argument" (cons (car math-normalize-a) args))) @@ -2712,7 +2711,6 @@ (cons (car math-normalize-a) args)) nil) (inexact-result - (setq math-normalize-error t) (calc-record-why "No exact representation for result" (cons (car math-normalize-a) args)) nil) ------------------------------------------------------------ revno: 112418 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2013-04-28 09:11:16 -0400 message: * dispextern.h (struct face): Move enum face_underline_type earlier so that bitfields can be in the same word. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-04-28 09:55:20 +0000 +++ src/ChangeLog 2013-04-28 13:11:16 +0000 @@ -1,3 +1,8 @@ +2013-04-28 Dan Nicolaescu + + * dispextern.h (struct face): Move enum face_underline_type + earlier so that bitfields can be in the same word. + 2013-04-28 Jan Djärv * nsfns.m (handlePanelKeys): New function. === modified file 'src/dispextern.h' --- src/dispextern.h 2013-04-15 07:27:56 +0000 +++ src/dispextern.h 2013-04-28 13:11:16 +0000 @@ -1591,13 +1591,13 @@ shadow colors derived from the background color of the face. */ enum face_box_type box; + /* Style of underlining. */ + enum face_underline_type underline_type; + /* If `box' above specifies a 3D type, 1 means use box_color for drawing shadows. */ unsigned use_box_color_for_shadows_p : 1; - /* Style of underlining. */ - enum face_underline_type underline_type; - /* Non-zero if text in this face should be underlined, overlined, strike-through or have a box drawn around it. */ unsigned underline_p : 1; ------------------------------------------------------------ revno: 112417 fixes bug: http://debbugs.gnu.org/14296 committer: Jan D. branch nick: trunk timestamp: Sun 2013-04-28 11:55:20 +0200 message: * nsfns.m (handlePanelKeys): New function. (EmacsOpenPanel:performKeyEquivalent:) (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle arrows/function/control and copy/paste keys. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-04-27 21:12:17 +0000 +++ src/ChangeLog 2013-04-28 09:55:20 +0000 @@ -1,3 +1,10 @@ +2013-04-28 Jan Djärv + + * nsfns.m (handlePanelKeys): New function. + (EmacsOpenPanel:performKeyEquivalent:) + (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle + arrows/function/control and copy/paste keys (Bug#14296). + 2013-04-27 Juri Linkov * callint.c (Fcall_interactively): Call `Qread_number' for === modified file 'src/nsfns.m' --- src/nsfns.m 2013-04-07 04:41:19 +0000 +++ src/nsfns.m 2013-04-28 09:55:20 +0000 @@ -1477,7 +1477,7 @@ [panel setCanChooseFiles: YES]; } - block_input (); + block_input (); #if defined (NS_IMPL_COCOA) && \ MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 if (! NILP (mustmatch) || ! NILP (dir_only_p)) @@ -2544,6 +2544,75 @@ ========================================================================== */ +/* + Handle arrow/function/control keys and copy/paste/cut in file dialogs. + Return YES if handeled, NO if not. + */ +static BOOL +handlePanelKeys (NSSavePanel *panel, NSEvent *theEvent) +{ + NSString *s; + int i; + BOOL ret = NO; + + if ([theEvent type] != NSKeyDown) return NO; + s = [theEvent characters]; + + for (i = 0; i < [s length]; ++i) + { + int ch = (int) [s characterAtIndex: i]; + switch (ch) + { + case NSHomeFunctionKey: + case NSDownArrowFunctionKey: + case NSUpArrowFunctionKey: + case NSLeftArrowFunctionKey: + case NSRightArrowFunctionKey: + case NSPageUpFunctionKey: + case NSPageDownFunctionKey: + case NSEndFunctionKey: + [panel sendEvent: theEvent]; + ret = YES; + break; + /* As we don't have the standard key commands for + copy/paste/cut/select-all in our edit menu, we must handle + them here. TODO: handle Emacs key bindings for copy/cut/select-all + here, paste works, because we have that in our Edit menu. + I.e. refactor out code in nsterm.m, keyDown: to figure out the + correct modifier. + */ + case 'x': // Cut + case 'c': // Copy + case 'v': // Paste + case 'a': // Select all + if ([theEvent modifierFlags] & NSCommandKeyMask) + { + [NSApp sendAction: + (ch == 'x' + ? @selector(cut:) + : (ch == 'c' + ? @selector(copy:) + : (ch == 'v' + ? @selector(paste:) + : @selector(selectAll:)))) + to:nil from:panel]; + ret = YES; + } + default: + // Send all control keys, as the text field supports C-a, C-f, C-e + // C-b and more. + if ([theEvent modifierFlags] & NSControlKeyMask) + { + [panel sendEvent: theEvent]; + ret = YES; + } + break; + } + } + + + return ret; +} @implementation EmacsSavePanel #ifdef NS_IMPL_COCOA @@ -2572,6 +2641,14 @@ { return ns_directory_from_panel (self); } + +- (BOOL)performKeyEquivalent:(NSEvent *)theEvent +{ + BOOL ret = handlePanelKeys (self, theEvent); + if (! ret) + ret = [super performKeyEquivalent:theEvent]; + return ret; +} @end @@ -2609,7 +2686,14 @@ { return ns_directory_from_panel (self); } - +- (BOOL)performKeyEquivalent:(NSEvent *)theEvent +{ + // NSOpenPanel inherits NSSavePanel, so passing self is OK. + BOOL ret = handlePanelKeys (self, theEvent); + if (! ret) + ret = [super performKeyEquivalent:theEvent]; + return ret; +} @end ------------------------------------------------------------ revno: 112416 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2013-04-27 23:57:29 +0000 message: lisp/gnus/sieve-manage.el (sieve-manage-authenticator-alist): Update the sieve port to "sieve" now that it has an official IANA port assigned diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-04-27 21:32:17 +0000 +++ lisp/gnus/ChangeLog 2013-04-27 23:57:29 +0000 @@ -3,6 +3,11 @@ * gnus.el (gnus-list-debbugs): Use require rather than autoload. (Bug#14262) +2013-04-27 Julien Danjou + + * sieve-manage.el (sieve-manage-authenticator-alist): Update the sieve + port to "sieve" now that it has an official IANA port assigned. + 2013-04-26 Katsumi Yamaoka * mail-source.el (mail-source-fetch-pop, mail-source-check-pop): === modified file 'lisp/gnus/sieve-manage.el' --- lisp/gnus/sieve-manage.el 2013-01-01 09:11:05 +0000 +++ lisp/gnus/sieve-manage.el 2013-04-27 23:57:29 +0000 @@ -149,9 +149,10 @@ for doing the actual authentication." :group 'sieve-manage) -(defcustom sieve-manage-default-port 2000 +(defcustom sieve-manage-default-port "sieve" "Default port number or service name for managesieve protocol." - :type 'integer + :type '(choice integer string) + :version "24.4" :group 'sieve-manage) (defcustom sieve-manage-default-stream 'network