all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] 21.2 add-log.el::change-log-version-number-search bug fix
@ 2005-09-11 18:59 Jari Aalto
  0 siblings, 0 replies; only message in thread
From: Jari Aalto @ 2005-09-11 18:59 UTC (permalink / raw)



Here fix for BUG that I encountered: Open empty file from directory which 
is revision controlled. Since the file is empty, the search command
`re-search-forward' fils when END is `0' (must be at least 1).

The only actual change here is " (and (> size 1)". Everything else
is indentation change.


2005-09-11  Jari Aalto  <jari.aalto@cante.net>

        * add-log.el (change-log-version-number-search): Before
        searching with `change-log-version-number-regexp-list',
        check that buffer size > 1. Fixes error: "Invalid search bound"
        when `end' was 0 on empty buffer.

*** modified file 'add-log.el'
--- add-log.el
+++ add-log.el
@@ -311,7 +311,9 @@
              (/ size 10)
            size))
         version)
-    (or (and buffer-file-name (vc-workfile-version buffer-file-name))
+    (or (and buffer-file-name
+             (vc-workfile-version buffer-file-name))
+        (and (> size 1)
        (save-restriction
          (widen)
          (let ((regexps change-log-version-number-regexp-list))
@@ -320,7 +322,7 @@
                (goto-char (point-min))
                (when (re-search-forward (pop regexps) end t)
                  (setq version (match-string 1)
-                       regexps nil)))))))))
+                             regexps nil))))))))))
 
 
 ;;;###autoload


-----------------------------------------------------------------------
Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
  re-search-forward("^(def[^ 	\n]+[ 	]+[^ 	\n][ 	]\"\\([0-9]+.[0-9.]+\\)" 0 t)
  (if (re-search-forward (pop regexps) end t) (progn (setq version ... regexps nil)))
  (when (re-search-forward (pop regexps) end t) (setq version (match-string 1) regexps nil))
  (save-excursion (goto-char (point-min)) (when (re-search-forward ... end t) (setq version ... regexps nil)))
  (while regexps (save-excursion (goto-char ...) (when ... ...)))
  (let ((regexps change-log-version-number-regexp-list)) (while regexps (save-excursion ... ...)))
  (save-restriction (widen) (let (...) (while regexps ...)))
  (or (and buffer-file-name (vc-workfile-version buffer-file-name)) (save-restriction (widen) (let ... ...)))
  (let* ((size ...) (end ...) version) (or (and buffer-file-name ...) (save-restriction ... ...)))
  change-log-version-number-search()
  (and change-log-version-info-enabled (change-log-version-number-search))
  (let* ((defun ...) (version ...) (buf-file-name ...) (buffer-file ...) (file-name ...) (entry ...) bound) (if (or ... ...) (find-file-other-window file-name) (find-file file-name)) (or (eq major-mode ...) (change-log-mode)) (undo-boundary) (goto-char (point-min)) (let (...) (if ... ... ...)) (setq bound (progn ... ...)) (goto-char (point-min)) (cond (... ...) (... ... ... ... ... ... ...) (t ... ... ... ... ... ... ... ...)) (if defun (progn ... ... ... ... ...) (unless ... ... ...)))
  add-change-log-entry(nil nil t)
  add-change-log-entry-other-window()
* call-interactively(add-change-log-entry-other-window)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-11 18:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-11 18:59 [PATCH] 21.2 add-log.el::change-log-version-number-search bug fix Jari Aalto

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.