summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog24
-rw-r--r--lisp/emacs-lisp/tabulated-list.el11
-rw-r--r--lisp/progmodes/octave.el33
-rw-r--r--lisp/textmodes/remember.el3
4 files changed, 56 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 340dc41a744..30c49c942c6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,21 @@
+2013-04-26 Reuben Thomas <rrt@sc3d.org>
+
+ * textmodes/remember.el (remember-store-in-files): Document that
+ the file name format is passed to `format-time-string'.
+
+2013-04-26 Leo Liu <sdl.web@gmail.com>
+
+ * progmodes/octave.el (octave-sync-function-file-names): New function.
+ (octave-mode): Use it in before-save-hook.
+
+2013-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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).
+
2013-04-26 Glenn Morris <rgm@gnu.org>
* subr.el (read-number): Once more use `read' rather than
@@ -20,7 +38,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 +54,8 @@
2013-04-25 Leo Liu <sdl.web@gmail.com>
- * 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/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)
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 640775bfe8b..f8b9e4f6fab 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"
@@ -625,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))
@@ -1007,6 +1009,27 @@ 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 func
+ (not (equal file func))
+ (yes-or-no-p
+ "Function name different from file name. Fix? "))
+ (replace-match file nil nil nil 3))))))
+
;;; Indentation
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)))