Now on revision 112560. ------------------------------------------------------------ revno: 112560 committer: Leo Liu branch nick: trunk timestamp: Sun 2013-05-12 12:10:40 +0800 message: * progmodes/octave.el (inferior-octave-startup): Store the value of __octave_srcdir__ for octave-source-directories. (inferior-octave-check-process): New function refactored out of inferior-octave-send-list-and-digest. (octave-source-directories) (octave-find-definition-filename-function): New variables. (octave-source-directories) (octave-find-definition-default-filename): New functions. (octave-find-definition): Improve to find functions implemented in C++. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-12 01:34:30 +0000 +++ lisp/ChangeLog 2013-05-12 04:10:40 +0000 @@ -1,3 +1,15 @@ +2013-05-12 Leo Liu + + * progmodes/octave.el (inferior-octave-startup): Store the value + of __octave_srcdir__ for octave-source-directories. + (inferior-octave-check-process): New function refactored out of + inferior-octave-send-list-and-digest. + (octave-source-directories) + (octave-find-definition-filename-function): New variables. + (octave-source-directories) + (octave-find-definition-default-filename): New functions. + (octave-find-definition): Improve to find functions implemented in C++. + 2013-05-12 Glenn Morris * calendar/diary-lib.el (diary-outlook-format-1): === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-05-11 13:22:06 +0000 +++ lisp/progmodes/octave.el 2013-05-12 04:10:40 +0000 @@ -736,6 +736,10 @@ (car inferior-octave-output-list)) (inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n"))) + (inferior-octave-send-list-and-digest + (list "if exist(\"__octave_srcdir__\") disp(__octave_srcdir__) endif\n")) + (process-put proc 'octave-srcdir (car inferior-octave-output-list)) + ;; O.K., now we are ready for the Inferior Octave startup commands. (inferior-octave-send-list-and-digest (list "more off;\n" @@ -762,7 +766,7 @@ (defvar inferior-octave-completion-table ;; - ;; Use cache to avod repetitive computation of completions due to + ;; Use cache to avoid repetitive computation of completions due to ;; bug#11906 - http://debbugs.gnu.org/11906 - which may cause ;; noticeable delay. CACHE: (CMD TIME VALUE). (let ((cache)) @@ -837,14 +841,17 @@ (setq inferior-octave-receive-in-progress nil)) (setq inferior-octave-output-string string)) +(defun inferior-octave-check-process () + (or (and inferior-octave-process + (process-live-p inferior-octave-process)) + (error (substitute-command-keys + "No inferior octave process running. Type \\[run-octave]")))) + (defun inferior-octave-send-list-and-digest (list) "Send LIST to the inferior Octave process and digest the output. The elements of LIST have to be strings and are sent one by one. All output is passed to the filter `inferior-octave-output-digest'." - (or (and inferior-octave-process - (process-live-p inferior-octave-process)) - (error (substitute-command-keys - "No inferior octave process running. Type \\[run-octave]"))) + (inferior-octave-check-process) (let* ((proc inferior-octave-process) (filter (process-filter proc)) string) @@ -1615,16 +1622,50 @@ (match-end 0) :type 'octave-help-function)))))))) -(defcustom octave-binary-file-extensions '("oct" "mex") - "A list of binary file extensions for Octave." - :type '(repeat string) +(defcustom octave-source-directories nil + "A list of directories for Octave sources." + :type '(repeat directory) :group 'octave :version "24.4") +(defun octave-source-directories () + (inferior-octave-check-process) + (let ((srcdir (process-get inferior-octave-process 'octave-srcdir))) + (if srcdir + (cons srcdir octave-source-directories) + octave-source-directories))) + +(defvar octave-find-definition-filename-function + #'octave-find-definition-default-filename) + +(defun octave-find-definition-default-filename (name) + "Default value for `octave-find-definition-filename-function'." + (pcase (file-name-extension name) + (`"oct" + (octave-find-definition-default-filename + (concat "libinterp/dldfcn/" + (file-name-sans-extension (file-name-nondirectory name)) + ".cc"))) + (`"cc" + (let ((file (or (locate-file name (octave-source-directories)) + (locate-file (file-name-nondirectory name) + (octave-source-directories))))) + (or (and file (file-exists-p file)) + (error "File `%s' not found" name)) + file)) + (`"mex" + (if (yes-or-no-p (format "File `%s' may be binary; open? " + (file-name-nondirectory name))) + name + (user-error "Aborted"))) + (t name))) + (defvar find-tag-marker-ring) (defun octave-find-definition (fn) - "Find the definition of FN." + "Find the definition of FN. +Definitions for functions implemented in C++ can be found if +`octave-source-directories' is set correctly." (interactive (list (octave-completing-read))) (inferior-octave-send-list-and-digest ;; help NAME is more verbose @@ -1636,15 +1677,11 @@ (match-string 1 line)))) (if (not file) (user-error "%s" (or line (format "`%s' not found" fn))) - (when (and (member (file-name-extension file) - octave-binary-file-extensions) - (not (yes-or-no-p (format "File `%s' may be binary; open? " - (file-name-nondirectory file))))) - (error "Aborted")) (require 'etags) (ring-insert find-tag-marker-ring (point-marker)) - (find-file file) - (octave-goto-function-definition)))) + (find-file (funcall octave-find-definition-filename-function file)) + (or (octave-goto-function-definition) + (forward-comment (point-max)))))) (provide 'octave) ------------------------------------------------------------ revno: 112559 fixes bug: http://debbugs.gnu.org/14349 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-11 18:34:30 -0700 message: * diary-lib.el (diary-outlook-format-1): Don't include dayname in the output. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 23:58:36 +0000 +++ lisp/ChangeLog 2013-05-12 01:34:30 +0000 @@ -1,3 +1,8 @@ +2013-05-12 Glenn Morris + + * calendar/diary-lib.el (diary-outlook-format-1): + Don't include dayname in the output. (Bug#14349) + 2013-05-11 Glenn Morris * emacs-lisp/autoload.el (generated-autoload-load-name): Doc fix. === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2013-05-04 23:55:57 +0000 +++ lisp/calendar/diary-lib.el 2013-05-12 01:34:30 +0000 @@ -366,7 +366,7 @@ ;; use the standard function calendar-date-string. (concat (if month (calendar-date-string (list month (string-to-number day) - (string-to-number year))) + (string-to-number year)) nil t) (cond ((eq calendar-date-style 'iso) "\\3 \\1 \\2") ; YMD ((eq calendar-date-style 'european) "\\2 \\1 \\3") ; DMY (t "\\1 \\2 \\3"))) ; MDY ------------------------------------------------------------ revno: 112558 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-11 16:58:36 -0700 message: * lisp/emacs-lisp/autoload.el (generated-autoload-load-name): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 23:54:14 +0000 +++ lisp/ChangeLog 2013-05-11 23:58:36 +0000 @@ -1,5 +1,7 @@ 2013-05-11 Glenn Morris + * emacs-lisp/autoload.el (generated-autoload-load-name): Doc fix. + * cus-dep.el (custom-make-dependencies): Only use safe local variables. Treat cc-provide like provide. === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/autoload.el 2013-05-11 23:58:36 +0000 @@ -52,7 +52,10 @@ (defvar generated-autoload-load-name nil "Load name for `autoload' statements generated from autoload cookies. -If nil, this defaults to the file name, sans extension.") +If nil, this defaults to the file name, sans extension. +Typically, you need to set this when the directory containing the file +is not in `load-path'. +This also affects the generated cus-load.el file.") ;;;###autoload (put 'generated-autoload-load-name 'safe-local-variable 'stringp) ------------------------------------------------------------ revno: 112557 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-11 16:55:46 -0700 message: Set generated-autoload-load-name in some more cedet files There are no autoloads in these files, but there are defcustoms. See bug#5277. * ede/project-am.el, semantic/db-ebrowse.el, semantic/grammar.el: * semantic/sb.el, semantic/bovine/grammar.el, semantic/wisent/comp.el: * semantic/wisent/grammar.el, semantic/wisent/wisent.el: * srecode/fields.el: Set generated-autoload-load-name. diff: === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2013-05-11 02:27:28 +0000 +++ lisp/cedet/ChangeLog 2013-05-11 23:55:46 +0000 @@ -1,5 +1,10 @@ 2013-05-11 Glenn Morris + * ede/project-am.el, semantic/db-ebrowse.el, semantic/grammar.el: + * semantic/sb.el, semantic/bovine/grammar.el, semantic/wisent/comp.el: + * semantic/wisent/grammar.el, semantic/wisent/wisent.el: + * srecode/fields.el: Set generated-autoload-load-name (for cus-load). + * ede/locate.el (cedet-cscope-version-check) (cedet-cscope-support-for-directory): * semantic/grammar.el (semantic-grammar-wy--install-parser): === modified file 'lisp/cedet/ede/project-am.el' --- lisp/cedet/ede/project-am.el 2013-05-11 02:21:29 +0000 +++ lisp/cedet/ede/project-am.el 2013-05-11 23:55:46 +0000 @@ -1014,4 +1014,8 @@ (provide 'ede/project-am) +;; Local variables: +;; generated-autoload-load-name: "ede/project-am" +;; End: + ;;; ede/project-am.el ends here === modified file 'lisp/cedet/semantic/bovine/grammar.el' --- lisp/cedet/semantic/bovine/grammar.el 2013-01-01 09:11:05 +0000 +++ lisp/cedet/semantic/bovine/grammar.el 2013-05-11 23:55:46 +0000 @@ -503,4 +503,8 @@ (provide 'semantic/bovine/grammar) +;; Local variables: +;; generated-autoload-load-name: "semantic/bovine/grammar" +;; End: + ;;; semantic/bovine/grammar.el ends here === modified file 'lisp/cedet/semantic/db-ebrowse.el' --- lisp/cedet/semantic/db-ebrowse.el 2013-01-01 09:11:05 +0000 +++ lisp/cedet/semantic/db-ebrowse.el 2013-05-11 23:55:46 +0000 @@ -660,4 +660,8 @@ (provide 'semantic/db-ebrowse) +;; Local variables: +;; generated-autoload-load-name: "semantic/db-ebrowse" +;; End: + ;;; semantic/db-ebrowse.el ends here === modified file 'lisp/cedet/semantic/grammar.el' --- lisp/cedet/semantic/grammar.el 2013-05-11 02:27:28 +0000 +++ lisp/cedet/semantic/grammar.el 2013-05-11 23:55:46 +0000 @@ -1909,4 +1909,8 @@ (provide 'semantic/grammar) +;; Local variables: +;; generated-autoload-load-name: "semantic/grammar" +;; End: + ;;; semantic/grammar.el ends here === modified file 'lisp/cedet/semantic/sb.el' --- lisp/cedet/semantic/sb.el 2013-03-21 22:11:03 +0000 +++ lisp/cedet/semantic/sb.el 2013-05-11 23:55:46 +0000 @@ -425,4 +425,8 @@ (provide 'semantic/sb) +;; Local variables: +;; generated-autoload-load-name: "semantic/sb" +;; End: + ;;; semantic/sb.el ends here === modified file 'lisp/cedet/semantic/wisent/comp.el' --- lisp/cedet/semantic/wisent/comp.el 2013-01-01 09:11:05 +0000 +++ lisp/cedet/semantic/wisent/comp.el 2013-05-11 23:55:46 +0000 @@ -3548,6 +3548,7 @@ ;; Local variables: ;; byte-compile-warnings: (not lexical) +;; generated-autoload-load-name: "semantic/wisent/comp" ;; End: ;;; semantic/wisent/comp.el ends here === modified file 'lisp/cedet/semantic/wisent/grammar.el' --- lisp/cedet/semantic/wisent/grammar.el 2013-01-01 09:11:05 +0000 +++ lisp/cedet/semantic/wisent/grammar.el 2013-05-11 23:55:46 +0000 @@ -523,4 +523,8 @@ (provide 'semantic/wisent/grammar) +;; Local variables: +;; generated-autoload-load-name: "semantic/wisent/grammar" +;; End: + ;;; semantic/wisent/grammar.el ends here === modified file 'lisp/cedet/semantic/wisent/wisent.el' --- lisp/cedet/semantic/wisent/wisent.el 2013-03-04 07:39:48 +0000 +++ lisp/cedet/semantic/wisent/wisent.el 2013-05-11 23:55:46 +0000 @@ -475,4 +475,8 @@ (provide 'semantic/wisent/wisent) +;; Local variables: +;; generated-autoload-load-name: "semantic/wisent/wisent" +;; End: + ;;; semantic/wisent/wisent.el ends here === modified file 'lisp/cedet/srecode/fields.el' --- lisp/cedet/srecode/fields.el 2013-01-01 09:11:05 +0000 +++ lisp/cedet/srecode/fields.el 2013-05-11 23:55:46 +0000 @@ -447,4 +447,8 @@ (provide 'srecode/fields) +;; Local variables: +;; generated-autoload-load-name: "srecode/fields" +;; End: + ;;; srecode/fields.el ends here ------------------------------------------------------------ revno: 112556 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-11 16:54:14 -0700 message: * cus-dep.el (custom-make-dependencies): Only use safe local variables. Treat cc-provide like provide. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 23:52:27 +0000 +++ lisp/ChangeLog 2013-05-11 23:54:14 +0000 @@ -1,3 +1,8 @@ +2013-05-11 Glenn Morris + + * cus-dep.el (custom-make-dependencies): Only use safe local variables. + Treat cc-provide like provide. + 2013-05-11 Kevin Ryde * cus-dep.el (custom-make-dependencies): === modified file 'lisp/cus-dep.el' --- lisp/cus-dep.el 2013-05-11 23:52:27 +0000 +++ lisp/cus-dep.el 2013-05-11 23:54:14 +0000 @@ -42,6 +42,7 @@ "Batch function to extract custom dependencies from .el files. Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (let ((enable-local-eval nil) + (enable-local-variables :safe) subdir) (with-temp-buffer ;; Use up command-line-args-left else Emacs can try to open @@ -70,7 +71,7 @@ (load-file-name file)) (if (save-excursion (re-search-forward - (concat "(provide[ \t\n]+\\('\\|(quote[ \t\n]\\)[ \t\n]*" + (concat "(\\(cc-\\)?provide[ \t\n]+\\('\\|(quote[ \t\n]\\)[ \t\n]*" (regexp-quote name) "[ \t\n)]") nil t)) (setq name (intern name))) ------------------------------------------------------------ revno: 112555 fixes bug: http://debbugs.gnu.org/5277 author: Kevin Ryde committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-11 16:52:27 -0700 message: Use generated-autoload-load-name for cus-load.el. * lisp/cus-dep.el (custom-make-dependencies): Use generated-autoload-load-name for the sake of files such such cedet/semantic/bovine/c.el, where the base file name is not in load-path. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 23:41:52 +0000 +++ lisp/ChangeLog 2013-05-11 23:52:27 +0000 @@ -1,3 +1,10 @@ +2013-05-11 Kevin Ryde + + * cus-dep.el (custom-make-dependencies): + Use generated-autoload-load-name for the sake of files such + such cedet/semantic/bovine/c.el, where the base file name + is not in load-path. (Bug#5277) + 2013-05-11 Glenn Morris * dos-vars.el, emacs-lisp/cl-indent.el, emulation/tpu-extras.el: === modified file 'lisp/cus-dep.el' --- lisp/cus-dep.el 2013-01-01 09:11:05 +0000 +++ lisp/cus-dep.el 2013-05-11 23:52:27 +0000 @@ -36,7 +36,7 @@ ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" "Regexp matching file names not to scan for `custom-make-dependencies'.") -(autoload 'autoload-rubric "autoload") +(require 'autoload) (defun custom-make-dependencies () "Batch function to extract custom dependencies from .el files. @@ -60,10 +60,13 @@ (string-match preloaded file) (not (file-exists-p file))) (erase-buffer) + (kill-all-local-variables) (insert-file-contents file) + (hack-local-variables) (goto-char (point-min)) (string-match "\\`\\(.*\\)\\.el\\'" file) - (let ((name (file-name-nondirectory (match-string 1 file))) + (let ((name (or generated-autoload-load-name ; see bug#5277 + (file-name-nondirectory (match-string 1 file)))) (load-file-name file)) (if (save-excursion (re-search-forward ------------------------------------------------------------ revno: 112554 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-05-11 16:41:52 -0700 message: Make some files provide features * dos-vars.el, emacs-lisp/cl-indent.el, emulation/tpu-extras.el: Provide features. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 13:22:06 +0000 +++ lisp/ChangeLog 2013-05-11 23:41:52 +0000 @@ -1,3 +1,8 @@ +2013-05-11 Glenn Morris + + * dos-vars.el, emacs-lisp/cl-indent.el, emulation/tpu-extras.el: + Provide features. + 2013-05-11 Leo Liu * progmodes/octave.el (octave-indent-comment): Improve. === modified file 'lisp/dos-vars.el' --- lisp/dos-vars.el 2013-01-01 09:11:05 +0000 +++ lisp/dos-vars.el 2013-05-11 23:41:52 +0000 @@ -43,4 +43,6 @@ :type '(hook) :version "20.3.3") +(provide 'dos-vars) + ;;; dos-vars.el ends here === modified file 'lisp/emacs-lisp/cl-indent.el' --- lisp/emacs-lisp/cl-indent.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/cl-indent.el 2013-05-11 23:41:52 +0000 @@ -809,4 +809,6 @@ ;(put 'defclass 'common-lisp-indent-function '((&whole 2 &rest (&whole 2 &rest 1) &rest (&whole 2 &rest 1))) ;(put 'defgeneric 'common-lisp-indent-function 'defun) +(provide 'cl-indent) + ;;; cl-indent.el ends here === modified file 'lisp/emulation/tpu-extras.el' --- lisp/emulation/tpu-extras.el 2013-01-01 09:11:05 +0000 +++ lisp/emulation/tpu-extras.el 2013-05-11 23:41:52 +0000 @@ -436,6 +436,8 @@ (interactive) (tpu-cursor-free-mode -1)) +(provide 'tpu-extras) + ;; Local Variables: ;; generated-autoload-file: "tpu-edt.el" ;; End: ------------------------------------------------------------ revno: 112553 committer: Leo Liu branch nick: trunk timestamp: Sat 2013-05-11 21:22:06 +0800 message: * progmodes/octave.el (octave-indent-comment): Improve. (octave-eldoc-message-style, octave-eldoc-cache): New variables. (octave-eldoc-function-signatures, octave-eldoc-function): New functions. (octave-mode, inferior-octave-mode): Add eldoc support. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 13:14:07 +0000 +++ lisp/ChangeLog 2013-05-11 13:22:06 +0000 @@ -1,3 +1,11 @@ +2013-05-11 Leo Liu + + * progmodes/octave.el (octave-indent-comment): Improve. + (octave-eldoc-message-style, octave-eldoc-cache): New variables. + (octave-eldoc-function-signatures, octave-eldoc-function): New + functions. + (octave-mode, inferior-octave-mode): Add eldoc support. + 2013-05-11 Richard Stallman * epa.el (epa-decrypt-file): Take output file name as argument === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-05-11 07:39:59 +0000 +++ lisp/progmodes/octave.el 2013-05-11 13:22:06 +0000 @@ -434,7 +434,9 @@ "A function for `smie-indent-functions' (which see)." (save-excursion (back-to-indentation) - (when (and (looking-at-p "\\s<") (not (looking-at-p "\\s<\\s<"))) + (when (and (not (octave-in-string-or-comment-p)) + (looking-at-p "\\s<\\(?:[^{}]\\|$\\)") + (not (looking-at-p "\\s<\\s<"))) (comment-choose-indent)))) @@ -554,6 +556,7 @@ (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)) + (setq-local eldoc-documentation-function 'octave-eldoc-function) (easy-menu-add octave-mode-menu)) @@ -658,6 +661,7 @@ (setq font-lock-defaults '(inferior-octave-font-lock-keywords nil nil)) (setq-local info-lookup-mode 'octave-mode) + (setq-local eldoc-documentation-function 'octave-eldoc-function) (setq comint-input-ring-file-name (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist") @@ -1484,6 +1488,70 @@ +(defcustom octave-eldoc-message-style 'auto + "Octave eldoc message style: auto, oneline, multiline." + :type '(choice (const :tag "Automatic" auto) + (const :tag "One Line" oneline) + (const :tag "Multi Line" multiline)) + :group 'octave + :version "24.4") + +;; (FN SIGNATURE1 SIGNATURE2 ...) +(defvar octave-eldoc-cache nil) + +(defun octave-eldoc-function-signatures (fn) + (unless (equal fn (car octave-eldoc-cache)) + (inferior-octave-send-list-and-digest + (list (format "\ +if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n" + fn fn))) + (let (result) + (dolist (line inferior-octave-output-list) + (when (string-match + "\\s-*\\(?:--[^:]+\\|usage\\):\\s-*\\(.*\\)$" + line) + (push (match-string 1 line) result))) + (setq octave-eldoc-cache + (cons (substring-no-properties fn) + (nreverse result))))) + (cdr octave-eldoc-cache)) + +(defun octave-eldoc-function () + "A function for `eldoc-documentation-function' (which see)." + (when (and inferior-octave-process + (process-live-p inferior-octave-process)) + (let* ((ppss (syntax-ppss)) + (paren-pos (cadr ppss)) + (fn (save-excursion + (if (and paren-pos + ;; PAREN-POS must be after the prompt + (>= paren-pos + (if (eq (get-buffer-process (current-buffer)) + inferior-octave-process) + (process-mark inferior-octave-process) + (point-min))) + (or (not (eq (get-buffer-process (current-buffer)) + inferior-octave-process)) + (< (process-mark inferior-octave-process) + paren-pos)) + (eq (char-after paren-pos) ?\()) + (goto-char paren-pos) + (setq paren-pos nil)) + (when (or (< (skip-syntax-backward "-") 0) paren-pos) + (thing-at-point 'symbol)))) + (sigs (and fn (octave-eldoc-function-signatures fn))) + (oneline (mapconcat 'identity sigs + (propertize " | " 'face 'warning))) + (multiline (mapconcat (lambda (s) (concat "-- " s)) sigs "\n"))) + ;; + ;; Return the value according to style. + (pcase octave-eldoc-message-style + (`auto (if (< (length oneline) (window-width (minibuffer-window))) + oneline + multiline)) + (`oneline oneline) + (`multiline multiline))))) + (defcustom octave-help-buffer "*Octave Help*" "Buffer name for `octave-help'." :type 'string ------------------------------------------------------------ revno: 112552 committer: Richard Stallman branch nick: trunk timestamp: Sat 2013-05-11 09:14:07 -0400 message: * epa.el (epa-decrypt-file): Take output file name as argument and read it using `interactive'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 07:39:59 +0000 +++ lisp/ChangeLog 2013-05-11 13:14:07 +0000 @@ -1,3 +1,8 @@ +2013-05-11 Richard Stallman + + * epa.el (epa-decrypt-file): Take output file name as argument + and read it using `interactive'. + 2013-05-11 Leo Liu * progmodes/octave.el (octave-beginning-of-line) === modified file 'lisp/epa.el' --- lisp/epa.el 2013-02-12 04:46:18 +0000 +++ lisp/epa.el 2013-05-11 13:14:07 +0000 @@ -621,30 +621,33 @@ (message "%s..." prompt)))) ;;;###autoload -(defun epa-decrypt-file (file) - "Decrypt FILE." - (interactive "fFile: ") - (setq file (expand-file-name file)) - (let* ((default-name (file-name-sans-extension file)) - (plain (expand-file-name - (read-file-name - (concat "To file (default " - (file-name-nondirectory default-name) - ") ") - (file-name-directory default-name) - default-name))) - (context (epg-make-context epa-protocol))) +(defun epa-decrypt-file (decrypt-file plain-file) + "Decrypt DECRYPT-FILE into PLAIN-FILE." + (interactive + (let (file default-name plain) + (setq file (read-file-name "File to decrypt: ")) + (setq default-name (file-name-sans-extension (expand-file-name file))) + (setq plain (expand-file-name + (read-file-name + (concat "To file (default " + (file-name-nondirectory default-name) + ") ") + (file-name-directory default-name) + default-name))) + (list file plain))) + (setq decrypt-file (expand-file-name decrypt-file)) + (let ((context (epg-make-context epa-protocol))) (epg-context-set-passphrase-callback context #'epa-passphrase-callback-function) (epg-context-set-progress-callback context (cons #'epa-progress-callback-function (format "Decrypting %s..." - (file-name-nondirectory file)))) - (message "Decrypting %s..." (file-name-nondirectory file)) - (epg-decrypt-file context file plain) - (message "Decrypting %s...wrote %s" (file-name-nondirectory file) - (file-name-nondirectory plain)) + (file-name-nondirectory decrypt-file)))) + (message "Decrypting %s..." (file-name-nondirectory decrypt-file)) + (epg-decrypt-file context decrypt-file plain-file) + (message "Decrypting %s...wrote %s" (file-name-nondirectory decrypt-file) + (file-name-nondirectory plain-file)) (if (epg-context-result-for context 'verify) (epa-display-info (epg-verify-result-to-string (epg-context-result-for context 'verify)))))) ------------------------------------------------------------ revno: 112551 committer: Leo Liu branch nick: trunk timestamp: Sat 2013-05-11 15:39:59 +0800 message: * progmodes/octave.el (octave-begin-keywords, octave-end-keywords) (octave-reserved-words, octave-smie-bnf-table) (octave-smie-rules): Add new keywords from Octave 3.6.4. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 06:20:10 +0000 +++ lisp/ChangeLog 2013-05-11 07:39:59 +0000 @@ -5,6 +5,9 @@ out of more syntactic contructs since moving to smie. (octave-indent-comment): New function. (octave-mode): Use it in smie-indent-functions. (Bug#14350) + (octave-begin-keywords, octave-end-keywords) + (octave-reserved-words, octave-smie-bnf-table) + (octave-smie-rules): Add new keywords from Octave 3.6.4. 2013-05-11 Glenn Morris === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-05-11 06:20:10 +0000 +++ lisp/progmodes/octave.el 2013-05-11 07:39:59 +0000 @@ -68,20 +68,22 @@ "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")) + '("classdef" "do" "enumeration" "events" "for" "function" "if" "methods" + "parfor" "properties" "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" + '("endclassdef" "endenumeration" "endevents" "endfor" "endfunction" "endif" + "endmethods" "endparfor" "endproperties" "endswitch" "end_try_catch" "end_unwind_protect" "endwhile" "until" "end")) (defvar octave-reserved-words (append octave-begin-keywords octave-else-keywords octave-end-keywords - '("break" "continue" "end" "global" "persistent" "return")) + '("break" "continue" "global" "persistent" "return")) "Reserved words in Octave.") (defvar octave-function-header-regexp @@ -303,6 +305,8 @@ ("unwind_protect" exp "unwind_protect_cleanup" exp "end") ("for" exp "endfor") ("for" exp "end") + ("parfor" exp "endparfor") + ("parfor" exp "end") ("do" exp "until" atom) ("while" exp "endwhile") ("while" exp "end") @@ -316,7 +320,17 @@ ("switch" exp "case" exp "case" exp "otherwise" exp "endswitch") ("switch" exp "case" exp "case" exp "otherwise" exp "end") ("function" exp "endfunction") - ("function" exp "end")) + ("function" exp "end") + ("enumeration" exp "endenumeration") + ("enumeration" exp "end") + ("events" exp "endevents") + ("events" exp "end") + ("methods" exp "endmethods") + ("methods" exp "end") + ("properties" exp "endproperties") + ("properties" exp "end") + ("classdef" exp "endclassdef") + ("classdef" exp "end")) ;; (fundesc (atom "=" atom)) )) @@ -406,8 +420,10 @@ ;; aligns it with "switch". (`(:before . "case") (if (not (smie-rule-sibling-p)) octave-block-offset)) (`(:after . ";") - (if (smie-rule-parent-p "function" "if" "while" "else" "elseif" "for" - "otherwise" "case" "try" "catch" "unwind_protect" + (if (smie-rule-parent-p "classdef" "events" "enumeration" "function" "if" + "while" "else" "elseif" "for" "parfor" + "properties" "methods" "otherwise" "case" + "try" "catch" "unwind_protect" "unwind_protect_cleanup") (smie-rule-parent octave-block-offset) ;; For (invalid) code between switch and case. ------------------------------------------------------------ revno: 112550 fixes bug: http://debbugs.gnu.org/14350 committer: Leo Liu branch nick: trunk timestamp: Sat 2013-05-11 14:20:10 +0800 message: * progmodes/octave.el (octave-indent-comment): New function. (octave-mode): Use it in smie-indent-functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-11 03:50:34 +0000 +++ lisp/ChangeLog 2013-05-11 06:20:10 +0000 @@ -3,6 +3,8 @@ * progmodes/octave.el (octave-beginning-of-line) (octave-end-of-line): Check before using up-list because it jumps out of more syntactic contructs since moving to smie. + (octave-indent-comment): New function. + (octave-mode): Use it in smie-indent-functions. (Bug#14350) 2013-05-11 Glenn Morris === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-05-11 03:50:34 +0000 +++ lisp/progmodes/octave.el 2013-05-11 06:20:10 +0000 @@ -414,6 +414,13 @@ ;; (if (smie-parent-p "switch") 4) 0)))) +(defun octave-indent-comment () + "A function for `smie-indent-functions' (which see)." + (save-excursion + (back-to-indentation) + (when (and (looking-at-p "\\s<") (not (looking-at-p "\\s<\\s<"))) + (comment-choose-indent)))) + (defvar octave-font-lock-keywords (list @@ -488,6 +495,7 @@ :forward-token #'octave-smie-forward-token :backward-token #'octave-smie-backward-token) (setq-local smie-indent-basic 'octave-block-offset) + (add-hook 'smie-indent-functions #'octave-indent-comment nil t) (setq-local smie-blink-matching-triggers (cons ?\; smie-blink-matching-triggers))