* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v [not found] ` <f7ccd24b0811200035p91e01d3ideef573f393eb71c@mail.gmail.com> @ 2008-11-21 5:30 ` Karl Fogel 0 siblings, 0 replies; 21+ messages in thread From: Karl Fogel @ 2008-11-21 5:30 UTC (permalink / raw) To: Juanma Barranquero; +Cc: emacs-devel "Juanma Barranquero" <lekktu@gmail.com> writes: >> I like the `make-obsolete' part (good idea!), but why take out that text >> from the doc string? > > To avoid repeating the information. After (make-obsolete 'old 'new > "when"), using describe-function on OLD will show the obsolescence > info (though the docstring of OLD is not really modified): Ah, sounds good then. I didn't know describe-function would do that. ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <E1KvFgL-00034A-Gp@cvs.savannah.gnu.org>]
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v [not found] <E1KvFgL-00034A-Gp@cvs.savannah.gnu.org> @ 2008-11-19 7:50 ` Karl Fogel 2008-11-20 5:39 ` Miles Bader 2008-11-21 19:29 ` Stefan Monnier 0 siblings, 2 replies; 21+ messages in thread From: Karl Fogel @ 2008-11-19 7:50 UTC (permalink / raw) To: Chong Yidong; +Cc: emacs-devel Regarding this change: Chong Yidong <cyd@stupidchicken.com> writes: > [[[ > (bookmark-get-bookmark-record): Signal error for invalid bookmark. > ]]] > > Index: bookmark.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/bookmark.el,v > retrieving revision 1.117 > retrieving revision 1.118 > diff -u -b -r1.117 -r1.118 > --- bookmark.el 29 Oct 2008 17:42:49 -0000 1.117 > +++ bookmark.el 29 Oct 2008 18:22:12 -0000 1.118 > @@ -330,7 +330,8 @@ > (defun bookmark-get-bookmark-record (bookmark) > "Return the guts of the entry for BOOKMARK in `bookmark-alist'. > That is, all information but the name." > - (let ((alist (cdr (bookmark-get-bookmark bookmark)))) > + (let ((alist (cdr (or (bookmark-get-bookmark bookmark) > + (error "Invalid bookmark %s" bookmark))))) > ;; The bookmark objects can either look like (NAME ALIST) or > ;; (NAME . ALIST), so we have to distinguish the two here. > (if (and (null (cdr alist)) (consp (caar alist))) Seeing this change made me ask: "Why doesn't `bookmark-get-bookmark' just return error itself, if no such bookmark?" Answer: "Because some callers might expect it to return nil in that case, rather than error." (Even though it is not documented to do either -- its doc string is silent on this question!) I think there are only two callers who would care, though. In `bookmark-store', we have this: (if (and (bookmark-get-bookmark stripped-name) (not no-overwrite)) ;; already existing bookmark under that name and ;; no prefix arg means just overwrite old bookmark ;; Use the new (NAME . ALIST) format. (setcdr (bookmark-get-bookmark stripped-name) alist) ;; otherwise just cons it onto the front (either the bookmark ;; doesn't exist already, or there is no prefix arg. In either ;; case, we want the new bookmark consed onto the alist...) (push (cons stripped-name alist) bookmark-alist)) And `bookmark-delete', this: (or (bookmark-get-bookmark bookmark-current-bookmark) (setq bookmark-current-bookmark nil))) I'm tempted to add an optional NOERROR parameter to `bookmark-get-bookmark'. That way we'd many more error checks for free, and could remove the special-case error check added in Chong Yidong's change above. Any objections to that? As an aside: it's very difficult to review & respond to commits to Emacs, because the ChangeLog entry arrives in a separate email from the diff. If the change package were kept intact (i.e., arrived as one email, the way every other project in the universe does it), we'd probably get more review here. -Karl ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-19 7:50 ` Karl Fogel @ 2008-11-20 5:39 ` Miles Bader 2008-11-20 9:37 ` Andreas Schwab 2008-11-21 19:29 ` Stefan Monnier 1 sibling, 1 reply; 21+ messages in thread From: Miles Bader @ 2008-11-20 5:39 UTC (permalink / raw) To: Karl Fogel; +Cc: Chong Yidong, emacs-devel Karl Fogel <kfogel@red-bean.com> writes: > As an aside: it's very difficult to review & respond to commits to > Emacs, because the ChangeLog entry arrives in a separate email from the > diff. If the change package were kept intact (i.e., arrived as one > email, the way every other project in the universe does it), we'd > probably get more review here. I'd suggest tracking the git mirror instead; it does a pretty good job of packaging up related file changes into single commits, as long as the user committed them all at once with CVS. Many people _don't_ do that, of course, but that's largely for historical reasons, and hopefully they can be convinced to start doing so. -Miles -- Advice, n. The smallest current coin. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-20 5:39 ` Miles Bader @ 2008-11-20 9:37 ` Andreas Schwab 2008-11-20 10:09 ` Miles Bader 0 siblings, 1 reply; 21+ messages in thread From: Andreas Schwab @ 2008-11-20 9:37 UTC (permalink / raw) To: Miles Bader; +Cc: Karl Fogel, Chong Yidong, emacs-devel Miles Bader <miles@gnu.org> writes: > I'd suggest tracking the git mirror instead; it does a pretty good job > of packaging up related file changes into single commits, as long as the > user committed them all at once with CVS. Those are also exactly the commits that show up as a single mail on emacs-commit. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-20 9:37 ` Andreas Schwab @ 2008-11-20 10:09 ` Miles Bader 2008-11-20 20:22 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Miles Bader @ 2008-11-20 10:09 UTC (permalink / raw) To: Andreas Schwab; +Cc: Karl Fogel, Chong Yidong, emacs-devel Andreas Schwab <schwab@suse.de> writes: >> I'd suggest tracking the git mirror instead; it does a pretty good job >> of packaging up related file changes into single commits, as long as the >> user committed them all at once with CVS. > > Those are also exactly the commits that show up as a single mail on > emacs-commit. Hmmm, so all the more reason for people to stop committing stuff separately... :-/ -Miles -- Christian, n. One who follows the teachings of Christ so long as they are not inconsistent with a life of sin. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-20 10:09 ` Miles Bader @ 2008-11-20 20:22 ` Eli Zaretskii 2008-11-20 20:32 ` Juanma Barranquero 2008-11-21 5:38 ` Karl Fogel 0 siblings, 2 replies; 21+ messages in thread From: Eli Zaretskii @ 2008-11-20 20:22 UTC (permalink / raw) To: Miles Bader; +Cc: kfogel, schwab, cyd, emacs-devel > From: Miles Bader <miles@gnu.org> > Date: Thu, 20 Nov 2008 19:09:38 +0900 > Cc: Karl Fogel <kfogel@red-bean.com>, Chong Yidong <cyd@stupidchicken.com>, > emacs-devel@gnu.org > > Hmmm, so all the more reason for people to stop committing stuff > separately... :-/ As long as we use CVS, which lacks the means to see the change history of a single file, committing several files at once makes "cvs log" unusable for the purposes of tracking the history of changes to some specific code fragment in a single file, something I need to do a lot in Emacs. That is why I commit the files individually, and then commit all their ChangeLog entries in one go. Don't expect me to change that any time soon. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-20 20:22 ` Eli Zaretskii @ 2008-11-20 20:32 ` Juanma Barranquero 2008-11-20 20:44 ` Eli Zaretskii 2008-11-21 5:38 ` Karl Fogel 1 sibling, 1 reply; 21+ messages in thread From: Juanma Barranquero @ 2008-11-20 20:32 UTC (permalink / raw) To: Eli Zaretskii; +Cc: kfogel, schwab, cyd, emacs-devel, Miles Bader On Thu, Nov 20, 2008 at 21:22, Eli Zaretskii <eliz@gnu.org> wrote: > As long as we use CVS, which lacks the means to see the change history > of a single file, committing several files at once makes "cvs log" > unusable for the purposes of tracking the history of changes to some > specific code fragment in a single file Why, if I may ask? Juanma ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-20 20:32 ` Juanma Barranquero @ 2008-11-20 20:44 ` Eli Zaretskii 0 siblings, 0 replies; 21+ messages in thread From: Eli Zaretskii @ 2008-11-20 20:44 UTC (permalink / raw) To: Juanma Barranquero; +Cc: kfogel, schwab, cyd, miles, emacs-devel > Date: Thu, 20 Nov 2008 21:32:01 +0100 > From: "Juanma Barranquero" <lekktu@gmail.com> > Cc: kfogel@red-bean.com, schwab@suse.de, cyd@stupidchicken.com, > emacs-devel@gnu.org, Miles Bader <miles@gnu.org> > > On Thu, Nov 20, 2008 at 21:22, Eli Zaretskii <eliz@gnu.org> wrote: > > > As long as we use CVS, which lacks the means to see the change history > > of a single file, committing several files at once makes "cvs log" > > unusable for the purposes of tracking the history of changes to some > > specific code fragment in a single file > > Why, if I may ask? Because the changes to the file I'm interested in are all but lost in the heap of changes to other files. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-20 20:22 ` Eli Zaretskii 2008-11-20 20:32 ` Juanma Barranquero @ 2008-11-21 5:38 ` Karl Fogel 2008-11-21 11:43 ` Eli Zaretskii 1 sibling, 1 reply; 21+ messages in thread From: Karl Fogel @ 2008-11-21 5:38 UTC (permalink / raw) To: Eli Zaretskii; +Cc: schwab, cyd, emacs-devel, Miles Bader Eli Zaretskii <eliz@gnu.org> writes: > As long as we use CVS, which lacks the means to see the change history > of a single file, Hrm? 'cvs log FILENAME' > committing several files at once makes "cvs log" > unusable for the purposes of tracking the history of changes to some > specific code fragment in a single file, something I need to do a lot > in Emacs. 'cvs annotate' ...and, of course, http://www.red-bean.com/cvs2cl/, which re-unifies CVS changesets quite reliably. http://cvs2svn.tigris.org/ also does so (note that it can be used for conversion to git as well as to svn, despite its name -- really, it's mainly a CVS changeset re-unifier, and only secondarily a converter). These tools are fairly widely used. > That is why I commit the files individually, and then commit all their > ChangeLog entries in one go. Don't expect me to change that any time > soon. By doing so, you are tossing away information that *can* be reconstructed (as per above). When we convert to a modern version control system, other people's multi-file changes will be unified back into single changesets, but yours will not be, if you commit in the way you describe above. -Karl ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-21 5:38 ` Karl Fogel @ 2008-11-21 11:43 ` Eli Zaretskii 2008-11-23 19:11 ` martin rudalics 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2008-11-21 11:43 UTC (permalink / raw) To: Karl Fogel; +Cc: schwab, cyd, emacs-devel, miles > From: Karl Fogel <kfogel@red-bean.com> > Cc: Miles Bader <miles@gnu.org>, schwab@suse.de, cyd@stupidchicken.com, emacs-devel@gnu.org > Date: Fri, 21 Nov 2008 00:38:45 -0500 > > Eli Zaretskii <eliz@gnu.org> writes: > > As long as we use CVS, which lacks the means to see the change history > > of a single file, > > Hrm? 'cvs log FILENAME' That's the whole point: if several files are committed in one go, the log message for each file will be usually taken from several ChangeLog entries, sometimes from several different directories (e.g., if C files and Lisp files are modified together, or if the documentation is changed as well). Then "cvs log FILENAME" will show a huge pile of different entries for each FILENAME in the changeset. What I want is an option to "cvs log" that will show only the entries of the one file I'm interested in. CVS doesn't record that information, so I'm down to grepping "cvs log" output, which is unreliable because I don't always know what I'm looking for, and because of inconsistencies in how the ChangeLog entries are formatted. > > committing several files at once makes "cvs log" > > unusable for the purposes of tracking the history of changes to some > > specific code fragment in a single file, something I need to do a lot > > in Emacs. > > 'cvs annotate' Not useful for tracking history, since it lacks the ability to show a series of changes, or at least I'm not familiar with a way of having it do that. > > That is why I commit the files individually, and then commit all their > > ChangeLog entries in one go. Don't expect me to change that any time > > soon. > > By doing so, you are tossing away information that *can* be > reconstructed (as per above). That information is available in the ChangeLog files. > When we convert to a modern version control system, other people's > multi-file changes will be unified back into single changesets, but > yours will not be, if you commit in the way you describe above. Sorry, I hate wasting many minutes, sometimes hours, looking for a history of a specific code fragment, so I will not make this problem more grave by my own contributions. When we switch to a more modern VCS, I will review my practices, of course, but until then, we are stuck with CVS and its limitations. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-21 11:43 ` Eli Zaretskii @ 2008-11-23 19:11 ` martin rudalics 2008-11-24 20:20 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: martin rudalics @ 2008-11-23 19:11 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Karl Fogel, schwab, cyd, miles, emacs-devel [-- Attachment #1: Type: text/plain, Size: 833 bytes --] > That's the whole point: if several files are committed in one go, the > log message for each file will be usually taken from several ChangeLog > entries, sometimes from several different directories (e.g., if C > files and Lisp files are modified together, or if the documentation is > changed as well). Then "cvs log FILENAME" will show a huge pile of > different entries for each FILENAME in the changeset. What I want is > an option to "cvs log" that will show only the entries of the one file > I'm interested in. CVS doesn't record that information, so I'm down > to grepping "cvs log" output, which is unreliable because I don't > always know what I'm looking for, and because of inconsistencies in > how the ChangeLog entries are formatted. How about something in the direction of the attached patch? martin [-- Attachment #2: log-view.diff --] [-- Type: text/plain, Size: 5866 bytes --] *** log-view.el.~1.55.~ 2008-06-16 11:28:44.000000000 +0200 --- log-view.el 2008-11-23 20:06:16.218750000 +0100 *************** *** 137,142 **** --- 137,145 ---- ([backtab] . log-view-msg-prev) ("N" . log-view-file-next) ("P" . log-view-file-prev) + ("o" . log-view-show-object-only) + ("c" . log-view-show-current-only) + ("y" . log-view-show-any) ("\M-n" . log-view-file-next) ("\M-p" . log-view-file-prev)) "Log-View's keymap." *************** *** 171,177 **** ["Next File" log-view-file-next :help "Go to the next count'th file"] ["Previous File" log-view-file-prev ! :help "Go to the previous count'th file"])) (defvar log-view-mode-hook nil "Hook run at the end of `log-view-mode'.") --- 174,187 ---- ["Next File" log-view-file-next :help "Go to the next count'th file"] ["Previous File" log-view-file-prev ! :help "Go to the previous count'th file"] ! "-----" ! ["Show Object Only" log-view-show-object-only ! :help "Show entries for object at point only"] ! ["Show Current Only" log-view-show-current-only ! :help "Show entries for current file only"] ! ["Show Any" log-view-show-any ! :help "Show any entry"])) (defvar log-view-mode-hook nil "Hook run at the end of `log-view-mode'.") *************** *** 532,537 **** --- 542,673 ---- (list log-view-vc-backend nil) to fr))) + + (defun log-view-hide (from to) + "Hide text within FROM and TO." + (when (< from to) + (put-text-property from to 'invisible t))) + + (defun log-view-show-any () + "Show any entry. + Show any entry hidden by a previous `log-view-show-object-only' + or `log-view-show-current-only' command." + (interactive) + (let ((inhibit-read-only t)) + (remove-text-properties (point-min) (point-max) '(invisible nil)))) + + (defun log-view-object-at-point () + "Return name of object at point. + The object at point must be a name preceded by a left paren or a + comma and followed by a right paren or a comma." + (save-excursion + (save-restriction + (narrow-to-region (line-beginning-position) (line-end-position)) + (let ((from (save-excursion + (when (re-search-backward ",[ ]+\\|(" nil t) + (match-end 0)))) + (to (save-excursion + (when (re-search-forward ",\\|)" nil t) + (match-beginning 0))))) + (when (and from to) + (buffer-substring-no-properties from to)))))) + + (defun log-view-show-object-only () + "Show log entries for object at point only." + (interactive) + (let* ((name (log-view-object-at-point)) + (name-rq (when name (regexp-quote name))) + (inhibit-read-only t) + from to) + (unless name + (error "No fun round point")) + ;; Avoid to get the same object for another file. + (log-view-show-current-only) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (setq from (when (re-search-forward log-view-message-re nil t) + (line-beginning-position))) + (while (< from (point-max)) + (setq to (if (re-search-forward log-view-message-re nil t) + (line-beginning-position) + (point-max))) + (save-excursion + (goto-char from) + (unless (and (re-search-forward name-rq to t) + (string-equal name (log-view-object-at-point))) + (log-view-hide from to))) + (setq from to) + (goto-char to) + (forward-line)))))) + + (defconst log-view-show-entry-re "^[ \t\n]*\\*[ \t]+") + + (defun log-view-show-current-only () + "Show log entries for current file only." + (interactive) + (log-view-show-any) + (let* ((name (file-name-nondirectory (log-view-current-file))) + (name-rq (when name (regexp-quote name))) + (name-re + (when name (concat ".*" name-rq))) + (log-view-show-entry-and-name-re + (when name + (concat log-view-show-entry-re ".*" name-rq))) + (inhibit-read-only t) + from to) + (unless name + (error "Couldn't find file name")) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (< (setq from + (if (re-search-forward log-view-message-re nil 'move) + (line-beginning-position 2) + (point-max))) + (point-max)) + (setq to (if (re-search-forward log-view-message-re nil t) + (line-beginning-position 0) + (point-max))) + (goto-char from) + (let ((before-from (line-beginning-position)) + before-to after-from within-from within-to) + (while (re-search-forward log-view-show-entry-re to t) + (if (looking-at name-re) + ;; Relevant entry. + (setq before-to before-from) + ;; Irrelevant entry. + (setq before-to + (if (re-search-forward + log-view-show-entry-and-name-re to 'move) + (line-beginning-position) + to))) + (log-view-hide before-from before-to) + (setq after-from + (if (re-search-forward log-view-show-entry-re to 'move) + (line-beginning-position) + to)) + (when (< before-to after-from) + (goto-char before-to) + ;; Handle the special case where a common ChangeLog text + ;; is written for entries from different files. + (when (and (re-search-forward ":[ \t\n]+" after-from t) + (setq within-from (match-beginning 0)) + (looking-at log-view-show-entry-re) + (re-search-forward ":[ \t\n]+[^*]" to t) + (setq within-to (match-beginning 0))) + (log-view-hide within-from within-to) + (setq after-from + (if (re-search-forward log-view-show-entry-re to 'move) + (line-beginning-position) + to)))) + (goto-char (setq before-from after-from))) + (when after-from + (log-view-hide after-from to))) + (goto-char to)))))) + (provide 'log-view) ;; arch-tag: 0d64220b-ce7e-4f62-9c2a-6b04c2f81f4f ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-23 19:11 ` martin rudalics @ 2008-11-24 20:20 ` Eli Zaretskii 2008-11-25 15:23 ` Karl Fogel 2008-11-25 16:25 ` martin rudalics 0 siblings, 2 replies; 21+ messages in thread From: Eli Zaretskii @ 2008-11-24 20:20 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel > Date: Sun, 23 Nov 2008 20:11:45 +0100 > From: martin rudalics <rudalics@gmx.at> > Cc: Karl Fogel <kfogel@red-bean.com>, schwab@suse.de, cyd@stupidchicken.com, > miles@gnu.org, emacs-devel@gnu.org > > How about something in the direction of the attached patch? Thanks, but could you perhaps describe in a few words what is this supposed to do? I'm too busy these days to find time to play with patches. What use cases does this support? What will it show for the monster commits like the on in lisp/org a few days ago, where the same function in the same file could be mentioned several times in the same log message? What will it show for change logs like the one below, assuming I'm looking for the log entries of kmacro-edit-lossage? 2008-10-11 Romain Francoise <romain@orebokech.com> * help.el (view-lossage): Fix docstring, lossage is now 300 keys. * kmacro.el (kmacro-edit-lossage): Ditto. * edmacro.el (edit-kbd-macro): Ditto. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-24 20:20 ` Eli Zaretskii @ 2008-11-25 15:23 ` Karl Fogel 2008-11-25 16:25 ` martin rudalics 2008-11-25 16:25 ` martin rudalics 1 sibling, 1 reply; 21+ messages in thread From: Karl Fogel @ 2008-11-25 15:23 UTC (permalink / raw) To: Eli Zaretskii; +Cc: martin rudalics, emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> Date: Sun, 23 Nov 2008 20:11:45 +0100 >> From: martin rudalics <rudalics@gmx.at> >> Cc: Karl Fogel <kfogel@red-bean.com>, schwab@suse.de, cyd@stupidchicken.com, >> miles@gnu.org, emacs-devel@gnu.org >> >> How about something in the direction of the attached patch? > > Thanks, but could you perhaps describe in a few words what is this > supposed to do? What Eli said, yeah. Ironic that we're (I think) talking about a patch to make log messages more useable, but the patch arrived without a log message :-). Having one would make the change much more comprehensible to those who have to decide whether to invest one minute to decide whether to invest the next five minutes, and so on... Thanks, -Karl ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-25 15:23 ` Karl Fogel @ 2008-11-25 16:25 ` martin rudalics 0 siblings, 0 replies; 21+ messages in thread From: martin rudalics @ 2008-11-25 16:25 UTC (permalink / raw) To: Karl Fogel; +Cc: Eli Zaretskii, emacs-devel > Ironic that we're (I think) talking about a patch to make log messages > more useable, but the patch arrived without a log message :-). Having > one would make the change much more comprehensible to those who have to > decide whether to invest one minute to decide whether to invest the next > five minutes, and so on... ... sorry, my bad. martin ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-24 20:20 ` Eli Zaretskii 2008-11-25 15:23 ` Karl Fogel @ 2008-11-25 16:25 ` martin rudalics 2008-11-25 21:07 ` Eli Zaretskii 2008-11-25 21:44 ` Stefan Monnier 1 sibling, 2 replies; 21+ messages in thread From: martin rudalics @ 2008-11-25 16:25 UTC (permalink / raw) To: Eli Zaretskii; +Cc: emacs-devel > Thanks, but could you perhaps describe in a few words what is this > supposed to do? I'm too busy these days to find time to play with > patches. What use cases does this support? What will it show for the > monster commits like the on in lisp/org a few days ago, where the same > function in the same file could be mentioned several times in the same > log message? What will it show for change logs like the one below, > assuming I'm looking for the log entries of kmacro-edit-lossage? > > 2008-10-11 Romain Francoise <romain@orebokech.com> > > * help.el (view-lossage): Fix docstring, lossage is now 300 keys. > * kmacro.el (kmacro-edit-lossage): Ditto. > * edmacro.el (edit-kbd-macro): Ditto. I didn't know you cared about ChangeLog buffers (where such entries have been around ever since). My patch was intended for Log-View mode. Anyway, the idea is to show only entries related to the current file, that is in the above example, just show 2008-10-11 Romain Francoise <romain@orebokech.com> * kmacro.el (kmacro-edit-lossage): Fix docstring, lossage is now 300 keys. I'll send you a better patch (for ChangeLog buffers too) as soon as I satisfactorily solved things like the "Ditto" (and "Likewise") issue. martin ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-25 16:25 ` martin rudalics @ 2008-11-25 21:07 ` Eli Zaretskii 2008-11-26 2:17 ` Stephen J. Turnbull 2008-11-27 13:41 ` martin rudalics 2008-11-25 21:44 ` Stefan Monnier 1 sibling, 2 replies; 21+ messages in thread From: Eli Zaretskii @ 2008-11-25 21:07 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel > Date: Tue, 25 Nov 2008 17:25:32 +0100 > From: martin rudalics <rudalics@gmx.at> > CC: emacs-devel@gnu.org > > > 2008-10-11 Romain Francoise <romain@orebokech.com> > > > > * help.el (view-lossage): Fix docstring, lossage is now 300 keys. > > * kmacro.el (kmacro-edit-lossage): Ditto. > > * edmacro.el (edit-kbd-macro): Ditto. > > I didn't know you cared about ChangeLog buffers I don't. I care about VC logs (in the context of this discussion). The problem is, people who commit several files at once tend to simply copy the ChangeLog entries verbatim, complete with the TABs and date lines, as CVS log entries for their commits. Please try "cvs log lisp/org/org.el", and you will see what I mean. > My patch was intended for Log-View mode. And that is the only thing I care about here. We are on the same page, I just have a bit more gray hair ;-) > Anyway, the idea is to show only entries related to the current file, > that is in the above example, just show > > 2008-10-11 Romain Francoise <romain@orebokech.com> > > * kmacro.el (kmacro-edit-lossage): Fix docstring, lossage is now 300 keys. Yes, that's what I want. I hope you won't find this too hard to implement, what with all the possible variations of this ``style'' of log entries. > I'll send you a better patch (for ChangeLog buffers too) as soon as I > satisfactorily solved things like the "Ditto" (and "Likewise") issue. Thanks. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-25 21:07 ` Eli Zaretskii @ 2008-11-26 2:17 ` Stephen J. Turnbull 2008-11-27 13:41 ` martin rudalics 1 sibling, 0 replies; 21+ messages in thread From: Stephen J. Turnbull @ 2008-11-26 2:17 UTC (permalink / raw) To: Eli Zaretskii; +Cc: martin rudalics, emacs-devel Eli Zaretskii writes: > > Anyway, the idea is to show only entries related to the current file, > > that is in the above example, just show > > > > 2008-10-11 Romain Francoise <romain@orebokech.com> > > > > * kmacro.el (kmacro-edit-lossage): Fix docstring, lossage is now 300 keys. > > Yes, that's what I want. I hope you won't find this too hard to > implement, what with all the possible variations of this ``style'' of > log entries. If that's implementable, it shouldn't be too hard to refine to the parenthesized objects. Don't kill yourself, but XEmacs has a fair number of 1000-line ChangeLogs from Ben Wing making that level of refinement useful. (For me it's not urgent since I use isearch in the ChangeLog at the function level anyway, and I'm sure by the time I can change my habits it will be implemented. ;-) ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-25 21:07 ` Eli Zaretskii 2008-11-26 2:17 ` Stephen J. Turnbull @ 2008-11-27 13:41 ` martin rudalics 2008-11-27 16:35 ` Stefan Monnier 1 sibling, 1 reply; 21+ messages in thread From: martin rudalics @ 2008-11-27 13:41 UTC (permalink / raw) To: Eli Zaretskii; +Cc: emacs-devel [-- Attachment #1: Type: text/plain, Size: 747 bytes --] >> 2008-10-11 Romain Francoise <romain@orebokech.com> >> >> * kmacro.el (kmacro-edit-lossage): Fix docstring, lossage is now 300 keys. > > Yes, that's what I want. I hope you won't find this too hard to > implement, what with all the possible variations of this ``style'' of > log entries. I attached an improved version of this. When in a Log-View mode buffer, type `c' to shadow/hide all (well, most) entries not related to the current file. Type `o' when on an object in a parenthesized list, to only show entries for that object. Type `y' to remove any shadowing or hiding. Use `log-view-shadow' to toggle shadowing (it's currently by default on for the `c' command to find errors sooner). Suggestions welcome, martin. [-- Attachment #2: log-view.el.diff --] [-- Type: text/plain, Size: 11093 bytes --] *** log-view.el.~1.56.~ 2008-11-25 07:49:21.937500000 +0100 --- log-view.el 2008-11-27 10:50:46.250000000 +0100 *************** *** 137,142 **** --- 137,145 ---- ([backtab] . log-view-msg-prev) ("N" . log-view-file-next) ("P" . log-view-file-prev) + ("o" . log-view-show-object-only) + ("c" . log-view-show-current-only) + ("y" . log-view-show-any) ("\M-n" . log-view-file-next) ("\M-p" . log-view-file-prev)) "Log-View's keymap." *************** *** 171,177 **** ["Next File" log-view-file-next :help "Go to the next count'th file"] ["Previous File" log-view-file-prev ! :help "Go to the previous count'th file"])) (defvar log-view-mode-hook nil "Hook run at the end of `log-view-mode'.") --- 174,187 ---- ["Next File" log-view-file-next :help "Go to the next count'th file"] ["Previous File" log-view-file-prev ! :help "Go to the previous count'th file"] ! "-----" ! ["Show Object Only" log-view-show-object-only ! :help "Show entries for object at point only"] ! ["Show Current Only" log-view-show-current-only ! :help "Show entries for current file only"] ! ["Show Any" log-view-show-any ! :help "Show any entry"])) (defvar log-view-mode-hook nil "Hook run at the end of `log-view-mode'.") *************** *** 196,201 **** --- 206,221 ---- (put 'log-view-message-face 'face-alias 'log-view-message) (defvar log-view-message-face 'log-view-message) + (defcustom log-view-shadow 'current-only + "When non-nil, shadow entries with selective viewing. + That means, text normally hidden by `log-view-show-current-only' + is shadowed instead. When this is t, also shadow text normally + hidden by `log-view-show-object-only'." + :type '(choice (const :tag "Never" nil) + (const :tag "For current file only" 'current-only) + (const :tag "Always" t)) + :group 'log-view) + (defvar log-view-file-re (concat "^\\(?:Working file: \\(?1:.+\\)" ;RCS and CVS. ;; Subversion has no such thing?? *************** *** 532,537 **** --- 552,795 ---- (list log-view-vc-backend nil) to fr))) + ;;; View entries selectively. + (defconst log-view-entry-re "^[ \t]*\\*[ \t]+") + + (defvar log-view-entry-or-paren-re + (concat "\\(?:" log-view-entry-re "\\)\\|\\(?:^[ \t]*(\\)")) + + (defvar log-view-hide-is-shadow nil) + + (defun log-view--hide (from to &optional before) + "Hide text between FROM and TO. + Optional arg BEFORE non-nil means hide empty lines before FROM + and do not hide last line before TO. If `log-view-shadow' is + non-nil, shadow text instead of hiding it." + (when before + (save-excursion + ;; Skip empty lines preceding FROM. + (if (and (> from (point-min)) + (get-text-property (1- from) 'invisible)) + ;; There is invisible text, look before it. + (progn + (goto-char + (previous-single-property-change from 'invisible)) + (skip-chars-backward "[ \t\n]") + (forward-line) + (setq from (point))) + ;; No invisible text, look right here. + (goto-char from) + (skip-chars-backward "[ \t\n]") + (forward-line) + (setq from (point)))) + ;; Do not hide last line before TO. + (setq to (save-excursion + (goto-char to) + (forward-line -1) + (point)))) + ;; Hide or shadow text. + (when (< from to) + (if log-view-hide-is-shadow + (let ((overlay (make-overlay from to))) + (overlay-put overlay 'face 'shadow)) + (put-text-property from to 'invisible t)))) + + (defun log-view--object-at-point () + "Return name of object at point. + The object at point is the string at point preceded by a left + paren or a comma and followed by a right paren or a comma. + Return nil if there's no such string." + (save-excursion + (save-restriction + (narrow-to-region (line-beginning-position) (line-end-position)) + (let ((from (save-excursion + (when (re-search-backward "(\\|,[ ]+" nil t) + (match-end 0)))) + (to (save-excursion + (when (re-search-forward ")\\|," nil t) + (match-beginning 0))))) + (when (and from to) + (buffer-substring-no-properties from to)))))) + + (defun log-view--prev-match (regexp &optional bound move) + "Return position of previous match for REGEXP. + Optional argument BOUND non-nil means don't search before BOUND. + BOUND defaults to `point-min'. Return BOUND when nothing is + found. Optional argument MOVE non-nil means also move point + there. Else keep point unchanged." + (setq bound (or bound (point-min))) + (if move + (goto-char (if (re-search-backward regexp bound t) + (match-beginning 0) + bound)) + (save-excursion + (if (re-search-backward regexp bound t) + (match-beginning 0) + bound)))) + + (defun log-view--next-match(regexp &optional bound move) + "Return position of next match for REGEXP. + Optional argument BOUND non-nil means don't search before BOUND. + BOUND defaults to `point-max'. Return BOUND when nothing is + found. Optional argument MOVE non-nil means also move point + there. Else keep point unchanged." + (setq bound (or bound (point-max))) + (if move + (goto-char (if (re-search-forward regexp bound t) + (match-beginning 0) + bound)) + (save-excursion + (if (re-search-forward regexp bound t) + (match-beginning 0) + bound)))) + + (defun log-view--collapse-comments (from to) + "Try to collapse entry comments between FROM and TO." + ;; point must be where the entry is. + (let (at) + (cond + ;; Handle messages like + ;; foo.ext (foobar): + ;; bar.ext (foobar): Make foobar prominent. + ((save-excursion + (and (re-search-forward ":[ \t\n]+" to t) + (setq at (match-beginning 0)) + (looking-at log-view-entry-re) + (re-search-forward ":[ \t\n]+[^*]" to t))) + (log-view--hide at (match-beginning 0)) + (goto-char (match-end 0)) + (log-view--next-match log-view-entry-re to t)) + ;; Handle messages like + ;; foo.ext (foobar): Make foobar prominent. + ;; bar.ext (foobar): Likewise. + ((and (re-search-forward ":[ \t]+" to t) + (setq at (match-beginning 0)) + (looking-at "\\(?:[Ll]ikewise\\|[Dd]itto\\)[.]*") + (let ((string (match-string-no-properties 0)) + (display-from (match-beginning 0)) + (display-to (match-end 0))) + (goto-char at) + (while (and (re-search-backward "):[ \t]+" from t) + (save-excursion + (goto-char (match-end 0)) + (looking-at string)))) + (goto-char (match-end 0)) + (put-text-property + display-from display-to + 'display + (buffer-substring-no-properties + (point) + (save-excursion + (log-view--next-match log-view-entry-or-paren-re at t) + ;; Skip last newline char. + (skip-chars-backward "[ \t\n]") + (point)))) + (goto-char at) + (log-view--next-match log-view-entry-re to t))))))) + + (defun log-view-show-any () + "Show any entries obscured by selective viewing. + Show any entries hidden by a previous `log-view-show-object-only' + or `log-view-show-current-only' command." + (interactive) + (let ((inhibit-read-only t)) + ;; This must be changed as soon as people want to install their own + ;; invisible or display stuff. + (remove-text-properties (point-min) (point-max) '(invisible nil display nil)) + (remove-overlays nil nil 'face 'shadow))) + + (defun log-view-show-current-only () + "Selectively show log entries for current file only." + (interactive) + (log-view-show-any) + (setq log-view-hide-is-shadow log-view-shadow) + (let* ((name (or (file-name-nondirectory (log-view-current-file)) + (error "No current file"))) + (name-rq (regexp-quote name)) + (name-re (concat ".*" name-rq)) + (entry-and-name-re (concat log-view-entry-re ".*" name-rq)) + (inhibit-read-only t) + (buffer-undo-list t) + from to) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + ;; Search for next entry. + (while (re-search-forward log-view-entry-re nil t) + (setq from (match-beginning 0)) + (setq to (log-view--next-match log-view-message-re)) + (if (looking-at name-re) + ;; A relevant entry, make sure it has a comment. + (log-view--collapse-comments + (log-view--prev-match log-view-message-re) to) + ;; An irrelevant entry, hide it. + (if (< (log-view--next-match log-view-entry-re to t) to) + ;; There's a following entry. + (log-view--hide from (point)) + ;; No following entry. + (log-view--hide from to t)))))))) + + (defun log-view-show-object-only () + "Selectively show log entries for object at point only." + (interactive) + (log-view-show-any) + (setq log-view-hide-is-shadow (eq log-view-shadow t)) + (let* ((name (or (log-view--object-at-point) + (error "No suitable object found"))) + (name-rq (regexp-quote name)) + (name-re (concat "\\(?:(\\|,\\)[ \t\n]*\\(" name-rq + "\\)[ \t\n]*\\(?:)\\|,\\)")) + (inhibit-read-only t) + (buffer-undo-list t) + (last-from (point-min)) + from to paren-from paren-to) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (setq to (log-view--next-match log-view-message-re nil t)) + (setq paren-to to) + (while (re-search-forward name-re nil t) + (goto-char (match-beginning 1)) + ;; We found a relevant entry, record its message. + (setq from (log-view--prev-match log-view-message-re)) + ;; Record its open paren, it _should_ be on this line ... + (setq paren-from (save-excursion + (if (re-search-backward "(" from t) + (match-beginning 0) + from))) + (if (= from last-from) + ;; We're still in the previous message. Hide any + ;; preceding entries. + (log-view--hide paren-to paren-from) + ;; We're in a new message, record that. + (setq last-from from) + ;; Hide any entries in previous message. + (log-view--hide paren-to to t) + ;; Hide any messages after previous one. + (log-view--hide to from) + ;; Hide everything from first entry or paren in message to + ;; our paren. + (log-view--hide + (save-excursion + (goto-char from) + (log-view--next-match log-view-entry-or-paren-re paren-from)) + paren-from) + (setq to (log-view--next-match log-view-message-re))) + (setq paren-to (progn + (re-search-forward ")" to 'move) + (log-view--next-match + log-view-entry-or-paren-re to))) + (log-view--collapse-comments from to) + (when (> (point) paren-to) + (setq paren-to (log-view--next-match + log-view-entry-or-paren-re to 'move)))) + ;; Hide any entries in previous message. + (log-view--hide paren-to to t) + ;; Hide any messages left. + (log-view--hide to (point-max)))))) + (provide 'log-view) ;; arch-tag: 0d64220b-ce7e-4f62-9c2a-6b04c2f81f4f ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-27 13:41 ` martin rudalics @ 2008-11-27 16:35 ` Stefan Monnier 0 siblings, 0 replies; 21+ messages in thread From: Stefan Monnier @ 2008-11-27 16:35 UTC (permalink / raw) To: martin rudalics; +Cc: Eli Zaretskii, emacs-devel > I attached an improved version of this. When in a Log-View mode buffer, > type `c' to shadow/hide all (well, most) entries not related to the > current file. Type `o' when on an object in a parenthesized list, to > only show entries for that object. Type `y' to remove any shadowing or > hiding. Use `log-view-shadow' to toggle shadowing (it's currently by > default on for the `c' command to find errors sooner). Rather than "shadow" I'd prefer a name like "focus", or "limit" (limit the view to a subset, that's the name used in Gnus's summary, it uses the / key prefix). Stefan ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-25 16:25 ` martin rudalics 2008-11-25 21:07 ` Eli Zaretskii @ 2008-11-25 21:44 ` Stefan Monnier 1 sibling, 0 replies; 21+ messages in thread From: Stefan Monnier @ 2008-11-25 21:44 UTC (permalink / raw) To: martin rudalics; +Cc: Eli Zaretskii, emacs-devel >> * help.el (view-lossage): Fix docstring, lossage is now 300 keys. >> * kmacro.el (kmacro-edit-lossage): Ditto. >> * edmacro.el (edit-kbd-macro): Ditto. BTW, I'd rather not use "ditto" and use the following form instead: * help.el (view-lossage): * kmacro.el (kmacro-edit-lossage): * edmacro.el (edit-kbd-macro): Fix docstring, lossage is now 300 keys. -- Stefan ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v 2008-11-19 7:50 ` Karl Fogel 2008-11-20 5:39 ` Miles Bader @ 2008-11-21 19:29 ` Stefan Monnier 1 sibling, 0 replies; 21+ messages in thread From: Stefan Monnier @ 2008-11-21 19:29 UTC (permalink / raw) To: Karl Fogel; +Cc: Chong Yidong, emacs-devel > I'm tempted to add an optional NOERROR parameter to > `bookmark-get-bookmark'. That way we'd many more error checks for free, Done, Stefan ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2008-11-27 16:35 UTC | newest] Thread overview: 21+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <E1L2i1k-0000XC-CX@cvs.savannah.gnu.org> [not found] ` <f7ccd24b0811191458o3e2ad7d3v2370385de7dbb748@mail.gmail.com> [not found] ` <87bpwbdkza.fsf@red-bean.com> [not found] ` <f7ccd24b0811200035p91e01d3ideef573f393eb71c@mail.gmail.com> 2008-11-21 5:30 ` [Emacs-diffs] Changes to emacs/lisp/bookmark.el,v Karl Fogel [not found] <E1KvFgL-00034A-Gp@cvs.savannah.gnu.org> 2008-11-19 7:50 ` Karl Fogel 2008-11-20 5:39 ` Miles Bader 2008-11-20 9:37 ` Andreas Schwab 2008-11-20 10:09 ` Miles Bader 2008-11-20 20:22 ` Eli Zaretskii 2008-11-20 20:32 ` Juanma Barranquero 2008-11-20 20:44 ` Eli Zaretskii 2008-11-21 5:38 ` Karl Fogel 2008-11-21 11:43 ` Eli Zaretskii 2008-11-23 19:11 ` martin rudalics 2008-11-24 20:20 ` Eli Zaretskii 2008-11-25 15:23 ` Karl Fogel 2008-11-25 16:25 ` martin rudalics 2008-11-25 16:25 ` martin rudalics 2008-11-25 21:07 ` Eli Zaretskii 2008-11-26 2:17 ` Stephen J. Turnbull 2008-11-27 13:41 ` martin rudalics 2008-11-27 16:35 ` Stefan Monnier 2008-11-25 21:44 ` Stefan Monnier 2008-11-21 19:29 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).