From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 May 2014 06:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17482@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139996216022093 (code B ref -1); Tue, 13 May 2014 06:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 May 2014 06:22:40 +0000 Received: from localhost ([127.0.0.1]:33177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wk66p-0005kH-EW for submit@debbugs.gnu.org; Tue, 13 May 2014 02:22:39 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57170 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wk66m-0005k3-4o for submit@debbugs.gnu.org; Tue, 13 May 2014 02:22:36 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Wk66l-0005l1-MO; Tue, 13 May 2014 02:22:35 -0400 From: Glenn Morris X-Spook: IMF FTS2000 HAMASMOIS ARPA Tony Blair Baranyi Honduras X-Ran: nPq'uPSNA0q?/:sn{lCnH4Ufi%`'A|vm X-Hue: magenta X-Attribution: GM Date: Tue, 13 May 2014 02:22:35 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.7 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Package: emacs Version: 24.3.91 Severity: important emacs -Q C-x C-f /tmp/foo.todo -> args-out-of-range error (.todo is a pretty generic extension for me. I don't want it to open a specialized Emacs mode. I don't feel strongly about it though. Perhaps the NEWS file should say that .todo files now open in todo-mode. They didn't before.) Debugger entered--Lisp error: (args-out-of-range 1 2) narrow-to-region(2 1) (let ((name (todo-current-category)) cat-begin cat-end done-start done-se= p-start done-end) (widen) (goto-char (point-min)) (re-search-forward (conca= t "^" (regexp-quote (concat todo-category-beg name)) "$") nil t) (setq cat-= begin (1+ (line-end-position))) (setq cat-end (if (re-search-forward (conca= t "^" (regexp-quote todo-category-beg)) nil t) (match-beginning 0) (point-m= ax))) (setq mode-line-buffer-identification (funcall todo-mode-line-functio= n name)) (narrow-to-region cat-begin cat-end) (todo-prefix-overlays) (goto-= char (point-min)) (if (re-search-forward (concat "\n\\(" (regexp-quote todo= -category-done) "\\)") nil t) (progn (setq done-start (match-beginning 0)) = (setq done-sep-start (match-beginning 1)) (setq done-end (match-end 0))) (e= rror "Category %s is missing todo-category-done string" name)) (if todo-sho= w-done-only (narrow-to-region (1+ done-end) (point-max)) (if (and todo-show= -with-done (re-search-forward todo-done-string-start nil t)) (progn (setq d= one-start cat-end) (let* ((done-sep todo-done-separator) (ov (progn ... ...= ))) (if ov nil (setq ov (make-overlay done-sep-start done-end)) (overlay-pu= t ov (quote todo) (quote separator)) (overlay-put ov (quote display) done-s= ep))))) (narrow-to-region (point-min) done-start) (if todo-highlight-item (= progn (require (quote hl-line)) (hl-line-mode 1))))) todo-category-select() (and (member this-command todo-visit-files-commands) (=3D (- (point-max) = (point-min)) (buffer-size)) (member major-mode (quote (todo-mode todo-archi= ve-mode))) (todo-category-select)) todo-display-as-todo-file() run-hooks(find-file-hook) after-find-file(t t) find-file-noselect-1(# "/tmp/foo.todo" nil nil "/tmp/foo= .todo" nil) find-file-noselect("/tmp/foo.todo" nil nil t) find-file("/tmp/foo.todo" t) call-interactively(find-file nil nil) command-execute(find-file) From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 May 2014 15:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.13999966691339 (code B ref 17482); Tue, 13 May 2014 15:58:02 +0000 Received: (at 17482) by debbugs.gnu.org; 13 May 2014 15:57:49 +0000 Received: from localhost ([127.0.0.1]:34183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkF5Q-0000LV-5t for submit@debbugs.gnu.org; Tue, 13 May 2014 11:57:48 -0400 Received: from mout.gmx.net ([212.227.17.21]:60184) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkF5N-0000LH-IQ for 17482@debbugs.gnu.org; Tue, 13 May 2014 11:57:46 -0400 Received: from rosalinde.fritz.box ([89.245.115.4]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M8JyQ-1WwykP3WIE-00vtK7; Tue, 13 May 2014 17:57:36 +0200 From: Stephen Berman References: Date: Tue, 13 May 2014 17:57:04 +0200 In-Reply-To: (Glenn Morris's message of "Tue, 13 May 2014 02:22:35 -0400") Message-ID: <87zjilzn73.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:K3Ce0+SYHoU5CDoySuNW5axJ0lZAFkX8KRasUB7qB4QgKwCNr6T rJbapXy8UbpuI+T1Y+8fX0N7EDGkHyGfAh9T+dVcmebVrhBiG4ftLX6OZcdOsRebGCJ6/iF pji/2jjKBReSBgHuGOKG0inegYbl/l7Clp1PQzArt1ZWRsCQc9LXI+ZjzVTJsH+Ts/dbSW/ 3h3ENpX7/xKsJm6kAXYig== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tue, 13 May 2014 02:22:35 -0400 Glenn Morris wrote: > Package: emacs > Version: 24.3.91 > Severity: important > > emacs -Q > C-x C-f /tmp/foo.todo > -> args-out-of-range error > > (.todo is a pretty generic extension for me. I don't want it to open a > specialized Emacs mode. I don't feel strongly about it though. > Perhaps the NEWS file should say that .todo files now open in todo-mode. > They didn't before.) Perhaps it was presumptuous of me to appropriate the .todo extension for Todo mode. I'm not aware of any policy about this, and I do see that a number of modes add an extension to auto-mode-alist unconditionally, while others merely suggest doing that in the user's init file. However, I've come up with the following fix, which keeps automatic recognition of Todo mode files located in `todo-directory', which is where all Todo mode files are stored, but allows you to create and visit foo.todo in the default major mode anywhere else. If this works for you and it's not an unacceptable abuse of auto-mode-alist, I'll commit it to emacs-24. Thanks for the report. Steve Berman === modified file 'lisp/calendar/todo-mode.el' *** lisp/calendar/todo-mode.el 2014-05-09 07:50:42 +0000 --- lisp/calendar/todo-mode.el 2014-05-13 15:37:39 +0000 *************** *** 6401,6411 **** (defun todo-display-as-todo-file () "Show todo files correctly when visited from outside of Todo mode. ! Added to `find-file-hook' in Todo mode and Todo Archive mode." ! (and (member this-command todo-visit-files-commands) ! (= (- (point-max) (point-min)) (buffer-size)) ! (member major-mode '(todo-mode todo-archive-mode)) ! (todo-category-select))) (defun todo-add-to-buffer-list () "Add name of just visited todo file to `todo-file-buffers'. --- 6401,6425 ---- (defun todo-display-as-todo-file () "Show todo files correctly when visited from outside of Todo mode. ! Added to `find-file-hook' in Todo mode, Todo Archive mode and ! Todo Filtered Items mode. ! ! This is intended only for visiting an existing todo, archive, or ! filtered items file, and signals an error if you try to create a ! new one using, e.g., `find-file'." ! (if (equal (file-truename todo-directory) ! (file-name-directory (file-truename (buffer-file-name)))) ! (when (member this-command todo-visit-files-commands) ! (if (> (buffer-size) 0) ! (and (= (- (point-max) (point-min)) (buffer-size)) ! (memq major-mode '(todo-mode todo-archive-mode)) ! (todo-category-select)) ! (kill-buffer) ! (user-error "To add a new todo file, type %s in Todo mode" ! (substitute-command-keys "\\[todo-add-file]")))) ! (kill-all-local-variables) ! (setq buffer-read-only nil) ! (set-buffer-major-mode (current-buffer)))) (defun todo-add-to-buffer-list () "Add name of just visited todo file to `todo-file-buffers'. *************** *** 6454,6459 **** --- 6468,6474 ---- "Make some settings that apply to multiple Todo modes." (add-to-invisibility-spec 'todo) (setq buffer-read-only t) + (add-hook 'find-file-hook 'todo-display-as-todo-file nil t) (when (and (boundp 'desktop-save-mode) desktop-save-mode) (setq-local desktop-save-buffer 'todo-desktop-save-buffer)) (when (boundp 'hl-line-range-function) *************** *** 6466,6473 **** (defun todo-modes-set-3 () "Make some settings that apply to multiple Todo modes." (setq-local todo-categories (todo-set-categories)) ! (setq-local todo-category-number 1) ! (add-hook 'find-file-hook 'todo-display-as-todo-file nil t)) (put 'todo-mode 'mode-class 'special) --- 6481,6487 ---- (defun todo-modes-set-3 () "Make some settings that apply to multiple Todo modes." (setq-local todo-categories (todo-set-categories)) ! (setq-local todo-category-number 1)) (put 'todo-mode 'mode-class 'special) *************** *** 6555,6566 **** (todo-modes-set-1) (todo-modes-set-2)) ;;;###autoload ! (add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-mode)) ;;;###autoload ! (add-to-list 'auto-mode-alist '("\\.toda\\'" . todo-archive-mode)) ;;;###autoload ! (add-to-list 'auto-mode-alist '("\\.tod[tyr]\\'" . todo-filtered-items-mode)) ;; ----------------------------------------------------------------------------- (provide 'todo-mode) --- 6569,6607 ---- (todo-modes-set-1) (todo-modes-set-2)) + ;; All Todo mode files reside in `todo-directory', but maybe the user + ;; wants to be able to have files with these extensions in other modes + ;; elsewhere (bug#17482). So we conditionalize automatic major mode + ;; selection on the file's location. + + ;;;###autoload + (defun todo-maybe-todo-mode () + (if (equal (file-truename todo-directory) + (file-name-directory (file-truename (buffer-file-name)))) + (todo-mode) + (set-buffer-major-mode (current-buffer)))) + + ;;;###autoload + (defun todo-maybe-todo-archive-mode () + (if (equal (file-truename todo-directory) + (file-name-directory (file-truename (buffer-file-name)))) + (todo-archive-mode) + (set-buffer-major-mode (current-buffer)))) + + ;;;###autoload + (defun todo-maybe-todo-filtered-items-mode () + (if (equal (file-truename todo-directory) + (file-name-directory (file-truename (buffer-file-name)))) + (todo-filtered-items-mode) + (set-buffer-major-mode (current-buffer)))) + ;;;###autoload ! (add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-maybe-todo-mode)) ;;;###autoload ! (add-to-list 'auto-mode-alist '("\\.toda\\'" . todo-maybe-todo-archive-mode)) ;;;###autoload ! (add-to-list 'auto-mode-alist ! '("\\.tod[tyr]\\'" . todo-maybe-todo-filtered-items-mode)) ;; ----------------------------------------------------------------------------- (provide 'todo-mode) From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 May 2014 16:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.13999969742007 (code B ref 17482); Tue, 13 May 2014 16:03:02 +0000 Received: (at 17482) by debbugs.gnu.org; 13 May 2014 16:02:54 +0000 Received: from localhost ([127.0.0.1]:34187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkFAL-0000WI-Rz for submit@debbugs.gnu.org; Tue, 13 May 2014 12:02:54 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:40802 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkFAK-0000W8-7n for 17482@debbugs.gnu.org; Tue, 13 May 2014 12:02:52 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WkFAJ-0004kG-8g; Tue, 13 May 2014 12:02:51 -0400 From: Glenn Morris References: <87zjilzn73.fsf@rosalinde.fritz.box> X-Spook: Lon Horiuchi Telex Audiotel Vince Foster Albanian FIPS140 X-Ran: "2Wy#r(Dy3R]=nEs*Bm5$,5A[y2a(Q?rK*Q*F`diUO=7ap.Jxqr!1tb7C!v$~ZXfZ{Ug\\ X-Hue: white X-Attribution: GM Date: Tue, 13 May 2014 12:02:51 -0400 In-Reply-To: <87zjilzn73.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Tue, 13 May 2014 17:57:04 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Stephen Berman wrote: > Perhaps it was presumptuous of me to appropriate the .todo extension for > Todo mode. I'm not aware of any policy about this, and I do see that a > number of modes add an extension to auto-mode-alist unconditionally, > while others merely suggest doing that in the user's init file. > However, I've come up with the following fix, which keeps automatic > recognition of Todo mode files located in `todo-directory', which is > where all Todo mode files are stored, but allows you to create and visit > foo.todo in the default major mode anywhere else. If this works for you > and it's not an unacceptable abuse of auto-mode-alist, I'll commit it to > emacs-24. Thanks for the report. Thanks. I'm not sure you need to go to that trouble. As I said, I don't feel strongly about it. It's something I'd be happy to just change in my .emacs. Maybe wait and see if anyone else has a strong opinion, otherwise leave as-is. The args-out-of-range thing was what I actually wanted to report! :) From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 May 2014 16:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.13999984074653 (code B ref 17482); Tue, 13 May 2014 16:27:01 +0000 Received: (at 17482) by debbugs.gnu.org; 13 May 2014 16:26:47 +0000 Received: from localhost ([127.0.0.1]:34196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkFXS-0001Cz-M5 for submit@debbugs.gnu.org; Tue, 13 May 2014 12:26:47 -0400 Received: from mout.gmx.net ([212.227.17.20]:55239) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkFXP-0001Cg-EG for 17482@debbugs.gnu.org; Tue, 13 May 2014 12:26:44 -0400 Received: from rosalinde.fritz.box ([89.245.115.4]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MC8iq-1WbU5r12jw-008rZM; Tue, 13 May 2014 18:26:35 +0200 From: Stephen Berman References: <87zjilzn73.fsf@rosalinde.fritz.box> Date: Tue, 13 May 2014 18:26:03 +0200 In-Reply-To: (Glenn Morris's message of "Tue, 13 May 2014 12:02:51 -0400") Message-ID: <87vbt9zlus.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:1QqSiKsb+yJQxYwV3B1WkWYo4nQ67fa+iaiNfRYcpFt5nbdtYqY qKdGAshmVX08JUb3ZJTHi/FvczgfyRFDh+IHU2ejYXPH61wPYRtXVtC/j2R+Tih8GninE0o ujmdqEfj8+RY9gyRVpvAHzlQ1enIt0EkaBWmDDo8GRYS/31lku7sfY4lwlFB1rz/FwS+Goy 7GchXl/qOloQpHHkapwuw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tue, 13 May 2014 12:02:51 -0400 Glenn Morris wrote: > Stephen Berman wrote: > >> Perhaps it was presumptuous of me to appropriate the .todo extension for >> Todo mode. I'm not aware of any policy about this, and I do see that a >> number of modes add an extension to auto-mode-alist unconditionally, >> while others merely suggest doing that in the user's init file. >> However, I've come up with the following fix, which keeps automatic >> recognition of Todo mode files located in `todo-directory', which is >> where all Todo mode files are stored, but allows you to create and visit >> foo.todo in the default major mode anywhere else. If this works for you >> and it's not an unacceptable abuse of auto-mode-alist, I'll commit it to >> emacs-24. Thanks for the report. > > Thanks. I'm not sure you need to go to that trouble. > As I said, I don't feel strongly about it. > It's something I'd be happy to just change in my .emacs. > Maybe wait and see if anyone else has a strong opinion, otherwise > leave as-is. > > The args-out-of-range thing was what I actually wanted to report! :) Well, that error arose precisely because you tried to visit a file in Todo mode (because of auto-mode-alist) that was not in todo-directory, which lead to certain variables not getting set that should have been, resulting in the error. This was a situation I did not foresee (that someone would want to have a *.todo file but not use Todo mode -- cheeky!). I actually think this is the least invasive fix that would avoid this problem. If I untie the extensions from auto-mode-alist, I think it will require quite a bit more alteration of todo-mode.el. So, if there are no serious objections, I'd just as soon apply this patch. Steve Berman From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 May 2014 19:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140001005131367 (code B ref 17482); Tue, 13 May 2014 19:41:02 +0000 Received: (at 17482) by debbugs.gnu.org; 13 May 2014 19:40:51 +0000 Received: from localhost ([127.0.0.1]:34371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkIZH-00089r-DJ for submit@debbugs.gnu.org; Tue, 13 May 2014 15:40:51 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:57870) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkIZF-00089g-5n for 17482@debbugs.gnu.org; Tue, 13 May 2014 15:40:49 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s4DJeloM009826; Tue, 13 May 2014 15:40:48 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id BA5B0AE173; Tue, 13 May 2014 15:40:46 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87zjilzn73.fsf@rosalinde.fritz.box> Date: Tue, 13 May 2014 15:40:46 -0400 In-Reply-To: <87zjilzn73.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Tue, 13 May 2014 17:57:04 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4941=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4941> : inlines <862> : streams <1181868> : uri <1755870> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) > -(add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-mode)) > +(add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-maybe-todo-mode)) I don't think it's really an improvement. The better solution is to change todo-mode so that it doesn't burp when used in a file that doesn't follow the expected conventions of todo-mode. Make it fail more gracefully. Stefan From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 May 2014 22:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140002047421515 (code B ref 17482); Tue, 13 May 2014 22:35:02 +0000 Received: (at 17482) by debbugs.gnu.org; 13 May 2014 22:34:34 +0000 Received: from localhost ([127.0.0.1]:34490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkLHN-0005aw-8a for submit@debbugs.gnu.org; Tue, 13 May 2014 18:34:33 -0400 Received: from mout.gmx.net ([212.227.15.18]:59006) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkLHK-0005aa-FI for 17482@debbugs.gnu.org; Tue, 13 May 2014 18:34:31 -0400 Received: from rosalinde.fritz.box ([89.245.115.4]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MV5tl-1WJBsB3Jkb-00YRfe; Wed, 14 May 2014 00:34:23 +0200 From: Stephen Berman References: <87zjilzn73.fsf@rosalinde.fritz.box> Date: Wed, 14 May 2014 00:33:51 +0200 In-Reply-To: (Stefan Monnier's message of "Tue, 13 May 2014 15:40:46 -0400") Message-ID: <87r43xz4ts.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:fWtxskCf902/JsSmU3cAG+VS9cY6g6qdzWnXdcuTK7DmeWLHRYu hPfsJ+GUfRCJWrC5O7tvtdtP7ljv6AsFGVptpuOf/lo+5gBgUqa3+vaAHV7yhpBg397G4wj JnSjjP66e/hQyliAQuIMyCbMsFXAv0F04dZA4JsFpFHpVEUJYKZ49xwQMVN7SR+IdTiRinm VHCnVoKFnS4IC1kz82IHA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tue, 13 May 2014 15:40:46 -0400 Stefan Monnier wrote: >> -(add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-mode)) >> +(add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-maybe-todo-mode)) > > I don't think it's really an improvement. > > The better solution is to change todo-mode so that it doesn't burp when > used in a file that doesn't follow the expected conventions of > todo-mode. Make it fail more gracefully. Are you saying todo-mode.el should keep using auto-mode-alist in the standard way? If so, then there are basically two cases to handle: (i) Trying to create a file foo.todo within Emacs but outside of Todo mode, e.g. with `M-x find-file foo.todo'. It's no problem to make this raise an error and tell the user to add a new file in Todo mode, as part of my patch did; is that failing gracefully enough? (ii) Trying to visit a file foo.todo that was created outside of Emacs. There are several subcases to consider here: (a) The file resides in `todo-directory', was created before loading todo-mode and happens to be a valid Todo file: then I think there is no problem. (b) The file happens to be a valid Todo file but was either created after loading todo-mode or resides outside of `todo-directory': then using todo-mode commands confined to that file or accessing other todo files in `todo-directory' should work all right, but that file cannot be accessed or referenced from other todo files, which will likely result in disrupting workflow at least, and possibly raising errors. (c) The file format is not valid: this could (depending on the nature of the ill-formedness) raise the todo-mode error "Invalid or missing todo-categories sexp" and any further attempt to use Todo mode commands may be no-ops or raise args-out-of-range or other errors. Certain kinds of ill-formedness can be repaired (there already is the command todo-repair-categories-sexp), but since such a file could contain anything, I don't see a way to add a reliable general repair mechanism, so the only recourse is to repair the file by hand or delete it. I don't see any way to make todo-mode always fail gracefully in cases (iib) and (iic), but at least my patch avoids the need for such failure when the file is outside of `todo-directory'. (I don't have a good suggestion for when the file resides in `todo-directory' and is invalid or valid but created after loading todo-mode, other than to say "Don't do that", which I think is not unreasonable advice.) Moreover, with hindsight I think Glenn's desire to visit a file foo.todo without putting it in Todo mode is quite reasonable, and I don't see how to allow this if todo-mode uses auto-mode-alist in the standard way; do you? Steve Berman From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 03:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140003778326068 (code B ref 17482); Wed, 14 May 2014 03:24:02 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 03:23:03 +0000 Received: from localhost ([127.0.0.1]:34564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkPmY-0006mJ-9l for submit@debbugs.gnu.org; Tue, 13 May 2014 23:23:02 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:37328) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkPmV-0006lo-Kj for 17482@debbugs.gnu.org; Tue, 13 May 2014 23:23:00 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s4E3MuXn017560; Tue, 13 May 2014 23:22:58 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id C6286AE173; Tue, 13 May 2014 23:22:56 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> Date: Tue, 13 May 2014 23:22:56 -0400 In-Reply-To: <87r43xz4ts.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 14 May 2014 00:33:51 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4941=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4941> : inlines <864> : streams <1182159> : uri <1756144> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) > Are you saying todo-mode.el should keep using auto-mode-alist in the > standard way? Yes. > If so, then there are basically two cases to handle: > (i) Trying to create a file foo.todo within Emacs but outside of Todo > mode, e.g. with `M-x find-file foo.todo'. It's no problem to make this > raise an error and tell the user to add a new file in Todo mode, as part > of my patch did; is that failing gracefully enough? Why do you need to signal an error? For me the driving design should be that code that doesn't use todo-mode commands should be able to find-file any file with a ".todo" extension, make changes to it via things like delete-region and insert and then save the file. And all this without errors. As soon as the user actually uses a todo-mode command, you can signal any error you like, of course. Stefan From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 15:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140008026112669 (code B ref 17482); Wed, 14 May 2014 15:11:01 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 15:11:01 +0000 Received: from localhost ([127.0.0.1]:35306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wkapg-0003IG-D9 for submit@debbugs.gnu.org; Wed, 14 May 2014 11:11:00 -0400 Received: from mout.gmx.net ([212.227.15.19]:53840) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wkapd-0003I0-SR for 17482@debbugs.gnu.org; Wed, 14 May 2014 11:10:58 -0400 Received: from rosalinde.fritz.box ([89.245.107.238]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MRGPP-1WMm0g1WSl-00UcOn; Wed, 14 May 2014 17:10:45 +0200 From: Stephen Berman In-Reply-To: (Stefan Monnier's message of "Tue, 13 May 2014 23:22:56 -0400") References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) Date: Wed, 14 May 2014 17:10:12 +0200 Message-ID: <87lhu4xup7.fsf@rosalinde.fritz.box> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:J0ZP0L9oSowbzzHIUIaPNpzxwkNOEnFWzWUYAt21mbulWGNMxFI am/t+0UuEljL/bzyXO0mp8fYId8jj4y+TUvluvyUOVTzmyCaotpfYqTbefOwce0z5HQDG6m WCalonFRea2cvvPR/J2TQIhDQ/1MgdZthnWTqQrDI4fPmgzsAgZcBvp3db8F8yQffqmn/qV FkAiSK6jL4ILsTJPgoQaw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tue, 13 May 2014 23:22:56 -0400 Stefan Monnier wrote: >> Are you saying todo-mode.el should keep using auto-mode-alist in the >> standard way? > > Yes. > >> If so, then there are basically two cases to handle: > >> (i) Trying to create a file foo.todo within Emacs but outside of Todo >> mode, e.g. with `M-x find-file foo.todo'. It's no problem to make this >> raise an error and tell the user to add a new file in Todo mode, as part >> of my patch did; is that failing gracefully enough? > > Why do you need to signal an error? > > For me the driving design should be that code that doesn't use todo-mode > commands should be able to find-file any file with a ".todo" extension, > make changes to it via things like delete-region and insert and then > save the file. And all this without errors. > > As soon as the user actually uses a todo-mode command, you can signal > any error you like, of course. Unfortunately, I didn't pay heed to your design goals while implementing todo-mode (I wasn't aware of them). But there's a fairly easy way to accommodate them, and as a side effect avoid the bug Glenn reported and also accommodate his wish to do `M-x find-file foo.todo' without putting the file in Todo mode: by simply foregoing use of auto-mode-alist. Really, it was misguided of me to want to use it, because by design and intent all Todo files reside in `todo-directory', so on the one hand auto-mode-alist isn't necessary, and on the other hand any file foo.todo located elsewhere but put in Todo mode can be problematic. If I make this change, it will also require abandoning one of the documented features of Todo mode: that visiting a todo file in any way (or rather, any way listed by `todo-visit-files-commands') will automatically display it correctly in Todo mode, i.e., read-only and narrowed to the selected category, with internal formatting hidden. But that feature conflicts with your design goals, and anyway it's only a minor convenience at best, and at worst leads to bugs, as Glenn's report shows. If you agree with my proposal, I'll start implementing it. I don't anticipate any major hurdles, but since a lot of the current code relies on the effects of using auto-mode-alist, it may take some time for me to test the changes and make sure everything still works as it should. But I think any attempt to retain use of auto-mode-alist and also comply with your design goals will be much more difficult to work out. Steve Berman From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 16:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140008652828490 (code B ref 17482); Wed, 14 May 2014 16:56:02 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 16:55:28 +0000 Received: from localhost ([127.0.0.1]:35403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkcSm-0007PS-9M for submit@debbugs.gnu.org; Wed, 14 May 2014 12:55:28 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:46145) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkcSj-0007PJ-8x for 17482@debbugs.gnu.org; Wed, 14 May 2014 12:55:25 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s4EGtMPa009269; Wed, 14 May 2014 12:55:23 -0400 Received: by pastel.home (Postfix, from userid 20848) id 9EA5A601E4; Wed, 14 May 2014 12:55:22 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> Date: Wed, 14 May 2014 12:55:22 -0400 In-Reply-To: <87lhu4xup7.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 14 May 2014 17:10:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4942=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4942> : inlines <867> : streams <1182714> : uri <1756681> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) > Unfortunately, I didn't pay heed to your design goals while implementing > todo-mode (I wasn't aware of them). But there's a fairly easy way to > accommodate them, and as a side effect avoid the bug Glenn reported and > also accommodate his wish to do `M-x find-file foo.todo' without putting > the file in Todo mode: by simply foregoing use of auto-mode-alist. > Really, it was misguided of me to want to use it, because by design and > intent all Todo files reside in `todo-directory', so on the one hand > auto-mode-alist isn't necessary, and on the other hand any file foo.todo > located elsewhere but put in Todo mode can be problematic. Maybe a quick way to "reach" the design goal is to wrap the body of todo-mode in a `with-demoted-errors'. Stefan From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 17:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Stephen Berman , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.14000895972528 (code B ref 17482); Wed, 14 May 2014 17:47:01 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 17:46:37 +0000 Received: from localhost ([127.0.0.1]:35485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkdGG-0000ei-JI for submit@debbugs.gnu.org; Wed, 14 May 2014 13:46:36 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:43173 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkdGE-0000eX-Cw for 17482@debbugs.gnu.org; Wed, 14 May 2014 13:46:35 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WkdGD-0005i2-JQ; Wed, 14 May 2014 13:46:33 -0400 From: Glenn Morris References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> X-Spook: $400 million in gold bullion EuroFed clandestine X-Ran: \or?EgX~C1MK8np/*1fiY5.}4;97l*+-82m+NZS.gJ0Qg[s''*6 (Stefan Monnier's message of "Wed, 14 May 2014 12:55:22 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.9 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.9 (----) Stefan Monnier wrote: > Maybe a quick way to "reach" the design goal is to wrap the body of > todo-mode in a `with-demoted-errors'. It's better, but I think it's still not great if I visit blah.todo and get "args-out-of-range" as a message rather than an error. From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 19:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: Stefan Monnier , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140009747110335 (code B ref 17482); Wed, 14 May 2014 19:58:02 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 19:57:51 +0000 Received: from localhost ([127.0.0.1]:34870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkfJE-0002gb-Rq for submit@debbugs.gnu.org; Wed, 14 May 2014 15:57:49 -0400 Received: from mout.gmx.net ([212.227.17.21]:52099) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkfJA-0002gG-S3 for 17482@debbugs.gnu.org; Wed, 14 May 2014 15:57:46 -0400 Received: from rosalinde.fritz.box ([89.245.107.238]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M0PdN-1X54yT3DFF-00uYV3; Wed, 14 May 2014 21:57:36 +0200 From: Stephen Berman References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> Date: Wed, 14 May 2014 21:57:04 +0200 In-Reply-To: (Glenn Morris's message of "Wed, 14 May 2014 13:46:33 -0400") Message-ID: <87bnv0xhf3.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:ZuC/PY4smVxCQQUXo+xMNST6jIIMs9k7ICnLoPlM3NSQW5A2kMc 2r2djYawnKz3oIazQEQFcPXumMoLPu2UKu18rboPbUsMYNK0APjQL7WGxTjABeOCi79PLY5 nDaU0FJKZOeLHNn7LtxOB8o9XK2F9D/FTlmFXABasvmb6t4aeKgjOBPyyTt1FQhPluxgJEp ZSGnx2QH3e9sxOgUTMmBA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, 14 May 2014 13:46:33 -0400 Glenn Morris wrote: > Stefan Monnier wrote: > >> Maybe a quick way to "reach" the design goal is to wrap the body of >> todo-mode in a `with-demoted-errors'. > > It's better, but I think it's still not great if I visit blah.todo and > get "args-out-of-range" as a message rather than an error. I agree. Moreover, if blah.todo is not empty but not a valid Todo file, visiting it will raise a different error from a different part of the code, so it would be necessary to have multiple uses of `with-demoted-errors'. And there's still the issue of why *.todo files not in `todo-directory' should be in Todo mode. And the only sensible answer is: they shouldn't be. So I am convinced that todo-mode should not use auto-mode-alist: it's not needed and it only causes problems. I somehow became blinded by the idea that it's nice to be able to visit a todo-mode file with `find-file' or from Dired and have it be in todo-mode and display properly, but this was just a mistake and now I've seen the light. So unless there's a really good reason not to, I'll go ahead and excise the use of auto-mode-alist; I'll post a patch for review before committing. Steve Berman From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 20:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: Stefan Monnier , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140009771010912 (code B ref 17482); Wed, 14 May 2014 20:02:01 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 20:01:50 +0000 Received: from localhost ([127.0.0.1]:34874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkfN6-0002ps-C5 for submit@debbugs.gnu.org; Wed, 14 May 2014 16:01:49 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46185 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkfN2-0002pc-MA for 17482@debbugs.gnu.org; Wed, 14 May 2014 16:01:45 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WkfN1-0006G4-SB; Wed, 14 May 2014 16:01:43 -0400 From: Glenn Morris References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> X-Spook: president eavesdropping ISEC AUTODIN Arnett import Rand X-Ran: U4NurK[6;q]:Sm+]'-Xq]8;~F4pBovN[G*jK:b1,SZlh-X51|\72k'WSRO+{xsjj?PO'X8 X-Hue: blue X-Attribution: GM Date: Wed, 14 May 2014 16:01:43 -0400 In-Reply-To: <87bnv0xhf3.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 14 May 2014 21:57:04 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Stephen Berman wrote: > [...] it's nice to be able to visit a todo-mode file with `find-file' > or from Dired and have it be in todo-mode and display properly You could use a file-local variable mode: cookie for that (I speak without having looked at the code at all). From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 20:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: Stefan Monnier , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140009972014899 (code B ref 17482); Wed, 14 May 2014 20:36:01 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 20:35:20 +0000 Received: from localhost ([127.0.0.1]:34891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkftX-0003sD-Jv for submit@debbugs.gnu.org; Wed, 14 May 2014 16:35:20 -0400 Received: from mout.gmx.net ([212.227.17.21]:58498) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkftU-0003rr-Ty for 17482@debbugs.gnu.org; Wed, 14 May 2014 16:35:17 -0400 Received: from rosalinde.fritz.box ([89.245.107.238]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LwJRe-1Wre6s3k5e-0181x5; Wed, 14 May 2014 22:35:09 +0200 From: Stephen Berman References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> Date: Wed, 14 May 2014 22:34:36 +0200 In-Reply-To: (Glenn Morris's message of "Wed, 14 May 2014 16:01:43 -0400") Message-ID: <8761l8xfoj.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:X9uB1gvftOe/sC+31vXnM9F/69TDJQ9j86d/5DGCgkuT+rHZ/9R 4cXUyN64AKrGHFpdXVbCAiTqT87JSSWpQ3TVWIZD91vcWoZlsXvMjMZb/iKlM1DU/qkeMMg hIY8s3ZQTK6XwTbCJ0MVEh3HQOfeeQE2geZXqWVzk9Y96ekQLeaL7wU78GOoFxF8b0gjLvN p7KLj8qk6tz+iimNgEBpw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, 14 May 2014 16:01:43 -0400 Glenn Morris wrote: > Stephen Berman wrote: > >> [...] it's nice to be able to visit a todo-mode file with `find-file' >> or from Dired and have it be in todo-mode and display properly > > You could use a file-local variable mode: cookie for that > (I speak without having looked at the code at all). Yes, that's in fact what the original todo-mode.el does, but I never really liked it and dropped from my version it long ago, though it is a convenient way to get that effect. But it also counteracts Stefan's "design goal" of being able to use standard Emacs commands on Todo files. Although I didn't follow this goal while reimplementing todo-mode.el, I now think it's justified: Todo mode has its own entry points and editing commands and there's no real need to give it a stranglehold on Todo files. It's conceptually similar to Gnus: you can visit and edit a mail file as a normal text file, but in Gnus it's in a special mode with special commands. And the risk assessment is the same: you can corrupt a mail file outside of Gnus if you're not careful. Steve Berman From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 21:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140010388226944 (code B ref 17482); Wed, 14 May 2014 21:45:02 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 21:44:42 +0000 Received: from localhost ([127.0.0.1]:34928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wkgyg-00070V-4P for submit@debbugs.gnu.org; Wed, 14 May 2014 17:44:42 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:58600) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wkgyd-00070K-Mg for 17482@debbugs.gnu.org; Wed, 14 May 2014 17:44:40 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s4ELiaSk032236; Wed, 14 May 2014 17:44:37 -0400 Received: by pastel.home (Postfix, from userid 20848) id 4E65A60366; Wed, 14 May 2014 17:44:36 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> <8761l8xfoj.fsf@rosalinde.fritz.box> Date: Wed, 14 May 2014 17:44:36 -0400 In-Reply-To: <8761l8xfoj.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 14 May 2014 22:34:36 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4942=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4942> : inlines <869> : streams <1182922> : uri <1756878> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) > convenient way to get that effect. But it also counteracts Stefan's > "design goal" of being able to use standard Emacs commands on Todo > files. No, that's OK: for files which we know positively to be Todo files, we can use special processing. Stefan From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 22:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140010476028872 (code B ref 17482); Wed, 14 May 2014 22:00:03 +0000 Received: (at 17482) by debbugs.gnu.org; 14 May 2014 21:59:20 +0000 Received: from localhost ([127.0.0.1]:34939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkhCp-0007Vb-NL for submit@debbugs.gnu.org; Wed, 14 May 2014 17:59:19 -0400 Received: from mout.gmx.net ([212.227.17.21]:49771) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkhCn-0007VL-OA for 17482@debbugs.gnu.org; Wed, 14 May 2014 17:59:18 -0400 Received: from rosalinde.fritz.box ([89.245.107.238]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0M7CRe-1WyFa72vjS-00x405; Wed, 14 May 2014 23:59:09 +0200 From: Stephen Berman References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> <8761l8xfoj.fsf@rosalinde.fritz.box> Date: Wed, 14 May 2014 23:58:37 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 14 May 2014 17:44:36 -0400") Message-ID: <871tvwxbsi.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:a1BXEeBfpiG4KN5I/MX+87bJubAUs1hEH1oAIwGieDP1DEKPlaz 36L4aAZeAqC1EQvir1iOeI0gwDs3InY8t6bNk5wTCbrnosKNFkrIaafvEfYKrNYfMZMgzES 4MnguUqCEgIG+w1N9vXHTkIEjSvDRUR4HTxqIia1eX0NsJX3XWY1PgDANgphcTej9A8n5Sb ZVcSd1o+xjc5t5212Y5sQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, 14 May 2014 17:44:36 -0400 Stefan Monnier wrote: >> convenient way to get that effect. But it also counteracts Stefan's >> "design goal" of being able to use standard Emacs commands on Todo >> files. > > No, that's OK: for files which we know positively to be Todo files, we > can use special processing. Ok, I understand (that also answers a question I was tempted to ask you about why SES files don't violate your design goals). But I would consider this to be a new feature (which I still have doubts about), which could be considered for the trunk, but not for emacs-24. In contrast, the use of auto-mode-alist is a bug-inducing misfeature and should be removed before the release. Steve Berman From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 May 2014 02:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: Glenn Morris , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140012069128601 (code B ref 17482); Thu, 15 May 2014 02:25:02 +0000 Received: (at 17482) by debbugs.gnu.org; 15 May 2014 02:24:51 +0000 Received: from localhost ([127.0.0.1]:35050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WklLm-0007RF-SD for submit@debbugs.gnu.org; Wed, 14 May 2014 22:24:51 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48724) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WklLg-0007Qw-8u for 17482@debbugs.gnu.org; Wed, 14 May 2014 22:24:49 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s4F2OfR4012549; Wed, 14 May 2014 22:24:42 -0400 Received: by pastel.home (Postfix, from userid 20848) id A484860366; Wed, 14 May 2014 22:24:41 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> <8761l8xfoj.fsf@rosalinde.fritz.box> <871tvwxbsi.fsf@rosalinde.fritz.box> Date: Wed, 14 May 2014 22:24:41 -0400 In-Reply-To: <871tvwxbsi.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 14 May 2014 23:58:37 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4942=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4942> : inlines <870> : streams <1183088> : uri <1757034> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) > Ok, I understand (that also answers a question I was tempted to ask you > about why SES files don't violate your design goals). But I would > consider this to be a new feature (which I still have doubts about), > which could be considered for the trunk, but not for emacs-24. In > contrast, the use of auto-mode-alist is a bug-inducing misfeature and > should be removed before the release. Sounds OK. Stefan From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 May 2014 17:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: Stefan Monnier , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140086441112058 (code B ref 17482); Fri, 23 May 2014 17:01:02 +0000 Received: (at 17482) by debbugs.gnu.org; 23 May 2014 17:00:11 +0000 Received: from localhost ([127.0.0.1]:58083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WnspC-00038J-TZ for submit@debbugs.gnu.org; Fri, 23 May 2014 13:00:11 -0400 Received: from mout.gmx.net ([212.227.15.15]:61557) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wnsp6-000376-9k for 17482@debbugs.gnu.org; Fri, 23 May 2014 13:00:04 -0400 Received: from rosalinde.fritz.box ([89.245.71.228]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lev1D-1X5pRQ1gsB-00qmDx; Fri, 23 May 2014 18:59:51 +0200 From: Stephen Berman References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> Date: Fri, 23 May 2014 18:59:46 +0200 In-Reply-To: <87bnv0xhf3.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 14 May 2014 21:57:04 +0200") Message-ID: <87ppj4e8hp.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:MTRr1TeauGtdNJD6fjnQdSXLnAI8rY9QbBJ/JYCCZXQ7uKv3tza UKu8f57uKqDWwnXnRBRH1gHOjbzBX/1F1StEAxM32qXUeA9LPXhntzbh6nGNtdWCvXHnLcf /djZxo6V1ZV4t9Eg2hlvmYIMEaAG3zuANyS2QY6H/cyZtMMcBspzOsfpEkbrjvLyKEGxKl9 N1gaQT+ekwrowtC8VZOzQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, 14 May 2014 21:57:04 +0200 Stephen Berman wrote: > On Wed, 14 May 2014 13:46:33 -0400 Glenn Morris wrote: > >> Stefan Monnier wrote: >> >>> Maybe a quick way to "reach" the design goal is to wrap the body of >>> todo-mode in a `with-demoted-errors'. >> >> It's better, but I think it's still not great if I visit blah.todo and >> get "args-out-of-range" as a message rather than an error. > > I agree. Moreover, if blah.todo is not empty but not a valid Todo file, > visiting it will raise a different error from a different part of the > code, so it would be necessary to have multiple uses of > `with-demoted-errors'. And there's still the issue of why *.todo files > not in `todo-directory' should be in Todo mode. And the only sensible > answer is: they shouldn't be. So I am convinced that todo-mode should > not use auto-mode-alist: it's not needed and it only causes problems. I > somehow became blinded by the idea that it's nice to be able to visit a > todo-mode file with `find-file' or from Dired and have it be in > todo-mode and display properly, but this was just a mistake and now I've > seen the light. So unless there's a really good reason not to, I'll go > ahead and excise the use of auto-mode-alist; I'll post a patch for > review before committing. > > Steve Berman On Wed, 14 May 2014 22:24:41 -0400 Stefan Monnier wrote: >> Ok, I understand (that also answers a question I was tempted to ask you >> about why SES files don't violate your design goals). But I would >> consider this to be a new feature (which I still have doubts about), >> which could be considered for the trunk, but not for emacs-24. In >> contrast, the use of auto-mode-alist is a bug-inducing misfeature and >> should be removed before the release. > > Sounds OK. The required changes to remove the use of auto-mode-alist amount mainly to calling the appropriate Todo mode function when visting a Todo file, if it isn't already in that mode, so in view of Stefan's approval of the plan not to use auto-mode-alist here, I've refrained from posting the patch and simply committed it. Glenn, if you want to test and (hopefully) confirm that this bug is fixed, I'll wait for your response; otherwise, I'll take the liberty of closing it in a day or two. Besides fixing this bug, in the process of making and testing the changes I found a handful of other bugs, which I've already fixed in a separate changeset (bzr 117142 in emacs-24). Steve Berman From unknown Sun Jun 22 04:04:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17482: args-out-of-range when visiting foo.todo Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 May 2014 17:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: Stefan Monnier , 17482@debbugs.gnu.org Received: via spool by 17482-submit@debbugs.gnu.org id=B17482.140086638016050 (code B ref 17482); Fri, 23 May 2014 17:33:02 +0000 Received: (at 17482) by debbugs.gnu.org; 23 May 2014 17:33:00 +0000 Received: from localhost ([127.0.0.1]:58127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WntKx-0004Ae-Gr for submit@debbugs.gnu.org; Fri, 23 May 2014 13:33:00 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:42813 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WntKr-0004AR-5m for 17482@debbugs.gnu.org; Fri, 23 May 2014 13:32:54 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WntKq-0001Rp-PG; Fri, 23 May 2014 13:32:48 -0400 From: Glenn Morris References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> <87ppj4e8hp.fsf@rosalinde.fritz.box> X-Spook: EuroFed Crowell Bletchley Park NATO David John Oates X-Ran: Ce9TFIc]x4$%5Ec"1>p6\,4x/R"6|HMg2)x<}u2AzSK4E*'Qw=xF!,,S@%p4t*/56w+([? X-Hue: yellow X-Attribution: GM Date: Fri, 23 May 2014 13:32:48 -0400 In-Reply-To: <87ppj4e8hp.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Fri, 23 May 2014 18:59:46 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Well, I visited foo.todo and no longer saw an error, so works for me, thanks. From unknown Sun Jun 22 04:04:17 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Glenn Morris Subject: bug#17482: closed (Re: bug#17482: args-out-of-range when visiting foo.todo) Message-ID: References: <87fvk0mhqd.fsf@rosalinde.fritz.box> X-Gnu-PR-Message: they-closed 17482 X-Gnu-PR-Package: emacs Reply-To: 17482@debbugs.gnu.org Date: Fri, 23 May 2014 19:14:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1400872443-322-1" This is a multi-part message in MIME format... ------------=_1400872443-322-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17482: args-out-of-range when visiting foo.todo which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 17482@debbugs.gnu.org. --=20 17482: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17482 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1400872443-322-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17482-done) by debbugs.gnu.org; 23 May 2014 19:13:13 +0000 Received: from localhost ([127.0.0.1]:58188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wnuu0-0008VA-PK for submit@debbugs.gnu.org; Fri, 23 May 2014 15:13:13 -0400 Received: from mout.gmx.net ([212.227.17.21]:52174) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wnutx-0008Uh-J0 for 17482-done@debbugs.gnu.org; Fri, 23 May 2014 15:13:10 -0400 Received: from rosalinde.fritz.box ([89.245.71.228]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M0smx-1X1JHX3tKp-00v6eS; Fri, 23 May 2014 21:13:01 +0200 From: Stephen Berman To: Glenn Morris Subject: Re: bug#17482: args-out-of-range when visiting foo.todo References: <87zjilzn73.fsf@rosalinde.fritz.box> <87r43xz4ts.fsf@rosalinde.fritz.box> <87lhu4xup7.fsf@rosalinde.fritz.box> <87bnv0xhf3.fsf@rosalinde.fritz.box> <87ppj4e8hp.fsf@rosalinde.fritz.box> Date: Fri, 23 May 2014 21:12:58 +0200 In-Reply-To: (Glenn Morris's message of "Fri, 23 May 2014 13:32:48 -0400") Message-ID: <87fvk0mhqd.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:s3744SsAZgbEyMBh/4sXjqk4hO5bk+ayRGtOtc+ba5CkdgLrAjl JwBcqIheN/M40rWCwrFIDRd45BlrU5sJD3VnP+0bgoAHCXTgE3UbsnefuElnTt9BUHBubVi yUcVU+lV8Ua8PCHT5gz7hNuSOIrpyGX4u9G+Wezh00PjHDBZn3VA/9q6PynGNVdDtdjHvah /Vy+yjyvpUjRELYecHOmQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17482-done Cc: Stefan Monnier , 17482-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, 23 May 2014 13:32:48 -0400 Glenn Morris wrote: > Well, I visited foo.todo and no longer saw an error, so works for me, > thanks. Thanks for confirming; closing. Steve Berman ------------=_1400872443-322-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 May 2014 06:22:40 +0000 Received: from localhost ([127.0.0.1]:33177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wk66p-0005kH-EW for submit@debbugs.gnu.org; Tue, 13 May 2014 02:22:39 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57170 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wk66m-0005k3-4o for submit@debbugs.gnu.org; Tue, 13 May 2014 02:22:36 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Wk66l-0005l1-MO; Tue, 13 May 2014 02:22:35 -0400 From: Glenn Morris To: submit@debbugs.gnu.org Subject: args-out-of-range when visiting foo.todo X-Spook: IMF FTS2000 HAMASMOIS ARPA Tony Blair Baranyi Honduras X-Ran: nPq'uPSNA0q?/:sn{lCnH4Ufi%`'A|vm X-Hue: magenta X-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 13 May 2014 02:22:35 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Package: emacs Version: 24.3.91 Severity: important emacs -Q C-x C-f /tmp/foo.todo -> args-out-of-range error (.todo is a pretty generic extension for me. I don't want it to open a specialized Emacs mode. I don't feel strongly about it though. Perhaps the NEWS file should say that .todo files now open in todo-mode. They didn't before.) Debugger entered--Lisp error: (args-out-of-range 1 2) narrow-to-region(2 1) (let ((name (todo-current-category)) cat-begin cat-end done-start done-se= p-start done-end) (widen) (goto-char (point-min)) (re-search-forward (conca= t "^" (regexp-quote (concat todo-category-beg name)) "$") nil t) (setq cat-= begin (1+ (line-end-position))) (setq cat-end (if (re-search-forward (conca= t "^" (regexp-quote todo-category-beg)) nil t) (match-beginning 0) (point-m= ax))) (setq mode-line-buffer-identification (funcall todo-mode-line-functio= n name)) (narrow-to-region cat-begin cat-end) (todo-prefix-overlays) (goto-= char (point-min)) (if (re-search-forward (concat "\n\\(" (regexp-quote todo= -category-done) "\\)") nil t) (progn (setq done-start (match-beginning 0)) = (setq done-sep-start (match-beginning 1)) (setq done-end (match-end 0))) (e= rror "Category %s is missing todo-category-done string" name)) (if todo-sho= w-done-only (narrow-to-region (1+ done-end) (point-max)) (if (and todo-show= -with-done (re-search-forward todo-done-string-start nil t)) (progn (setq d= one-start cat-end) (let* ((done-sep todo-done-separator) (ov (progn ... ...= ))) (if ov nil (setq ov (make-overlay done-sep-start done-end)) (overlay-pu= t ov (quote todo) (quote separator)) (overlay-put ov (quote display) done-s= ep))))) (narrow-to-region (point-min) done-start) (if todo-highlight-item (= progn (require (quote hl-line)) (hl-line-mode 1))))) todo-category-select() (and (member this-command todo-visit-files-commands) (=3D (- (point-max) = (point-min)) (buffer-size)) (member major-mode (quote (todo-mode todo-archi= ve-mode))) (todo-category-select)) todo-display-as-todo-file() run-hooks(find-file-hook) after-find-file(t t) find-file-noselect-1(# "/tmp/foo.todo" nil nil "/tmp/foo= .todo" nil) find-file-noselect("/tmp/foo.todo" nil nil t) find-file("/tmp/foo.todo" t) call-interactively(find-file nil nil) command-execute(find-file) ------------=_1400872443-322-1--