From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] Could we get rid of Org specific "mark ring" Date: Sat, 24 Feb 2018 23:30:47 +0100 Message-ID: <87muzy10mg.fsf@nicolasgoaziou.fr> References: <87o9lcntdq.fsf@nicolasgoaziou.fr> <87po5rxcgq.fsf@nicolasgoaziou.fr> <87fu6nx93a.fsf@nicolasgoaziou.fr> <87bmhbx7z6.fsf@nicolasgoaziou.fr> <87lggew91v.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epiLD-0008BN-H6 for emacs-orgmode@gnu.org; Sat, 24 Feb 2018 17:30:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epiLC-0006zE-9K for emacs-orgmode@gnu.org; Sat, 24 Feb 2018 17:30:51 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:52458) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1epiLC-0006y5-2H for emacs-orgmode@gnu.org; Sat, 24 Feb 2018 17:30:50 -0500 In-Reply-To: (Samuel Wales's message of "Wed, 31 Jan 2018 12:24:46 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Samuel Wales Cc: Allen Li , Org Mode List Hello, Samuel Wales writes: > in my usage, the current distinction between org-mark-ring and > mark-ring does not disturb me at all. i agree that it would be good > to be able to use global-mark-ring as a substitute for both > global-mark-ring and org-mark-ring, but ONLY if it takes me to the > exact location just like org-mark-ring does. > > i use mark-ring extensively. this is when i mark manually, or in > cases like isearch or bob. it is intuitive and i never have to think > about the distinction from org-mark-ring. i agree that some users > would expect the mark to be set also. which i think is a good idea, > for both global and local mark rings. but ONLY if the global one goes > to the exact spot. I do not discuss your needs. My concern is about common use of the mark ring. A dedicated mark ring for Org buffers sounds overkill. Note that, in order to get back old behaviour once `org-mark-ring' is an alias for `push-mark', you could do the following (untested, but you get the idea): (setq my-org-places (make-ring 16)) (setq my--org-places-count 0) (defun my-push-org-location (&optional location &rest _) (when (eq major-mode 'org-mode) (ring-insert my-org-places (copy-marker (or location (point)))))) (advice-add 'push-mark :before #'my-push-org-location) (defun my-jump-org-location () (interactive) (when (ring-empty-p my-org-places) (error "No Org location stored")) (if (eq last-command 'my-jump-org-location) (cl-incf my--org-places-count) (setq my--org-places-count 0)) (let* ((m (ring-ref my-org-places)) (buffer (marker-buffer m)) (positon (marker-position m))) (set-buffer buffer) (or (and (>= position (point-min)) (<= position (point-max))) (if widen-automatically (widen) (error "Org location is outside accessible part of buffer"))) (goto-char position) (switch-to-buffer buffer))) (global-set-key (kbd "C-c &") #'my-jump-org-location) > i do not use global-mark-ring. this is because [1] nonergo binding > [fixable] [2] i haven't made prev and next for it [fixable] [3] it > makes ZERO sense to me why it behaves so strangely. > > i expect global-mark-ring to take me to the exact spot. period. when > it doesn't, i get so confused that i just stop using it. i don't > understand why anybody finds it intuitive. do a lot of people use it? > unlike the local mark ring, i have never seen actual use of it > mentioned in the community. perhaps its users have tiny files. You could file an Emacs bug report about it. Regards, -- Nicolas Goaziou