unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Boruch Baum <boruch_baum@gmx.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 18183@debbugs.gnu.org
Subject: bug#18183: 24.3; table-fixed-width-mode fails with kill/yank
Date: Mon, 7 Dec 2020 13:21:56 -0500	[thread overview]
Message-ID: <20201207182156.q2wzdjjbiyt63kh5@E15-2016.optimum.net> (raw)
In-Reply-To: <87wnxtiubi.fsf@gnus.org>

I think I have a fix, centered around adding two lines to function
table--update-cell. In the snippet below, the new lines are marked with
an arrow ; <--------


(defun table--update-cell (&optional now)
  "Update the table cell contents.
When the optional parameter NOW is nil it only sets up the update
timer.  If it is non-nil the function copies the contents of the cell
cache buffer into the designated cell in the table buffer."
  (if (null table-update-timer) nil
    (table--cancel-timer table-update-timer)
    (setq table-update-timer nil))
  (if (or (not now)
	  (and (boundp 'quail-converting)
	       quail-converting) ;; defer operation while current quail work is not finished.
	  (and (boundp 'quail-translating)
	       quail-translating))
      (setq table-update-timer
	    (table--set-timer table-time-before-update
			      (function table--update-cell)
			      'now))
    (save-current-buffer
      (set-buffer table-cell-buffer)
      (let ((cache-buffer (get-buffer-create table-cache-buffer-name))
	    (org-coord (table--get-coordinate))
            (fixed table-fixed-width-mode) ; <--------
	    (in-cell (equal (table--cell-to-coord (table--probe-cell))
			    (cons table-cell-info-lu-coordinate table-cell-info-rb-coordinate)))
	    rectangle)
	(set-buffer cache-buffer)
        (setq-local table-fixed-width-mode fixed) ; <---------
	(setq rectangle
	      (extract-rectangle
	       1
	       (table--goto-coordinate (cons table-cell-info-width (1- table-cell-info-height)))))
	(set-buffer table-cell-buffer)
	(delete-rectangle (table--goto-coordinate table-cell-info-lu-coordinate)
			  (table--goto-coordinate table-cell-info-rb-coordinate))
	(table--goto-coordinate table-cell-info-lu-coordinate)
	(table--insert-rectangle rectangle)
	(let* ((cell (table--probe-cell))) ; must probe again in case of wide characters
	  (table--put-cell-property cell)
	  (table--put-cell-justify-property cell table-cell-info-justify)
	  (table--put-cell-valign-property cell table-cell-info-valign))
	(table--goto-coordinate
	 (if in-cell
	     (table--transcoord-cache-to-table table-cell-cache-point-coordinate)
	   org-coord))))
    ;; simulate undo behavior under overwrite-mode
    (if (and overwrite-mode (not (eq buffer-undo-list t)))
	(setq buffer-undo-list (cons nil buffer-undo-list)))))


--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





  parent reply	other threads:[~2020-12-07 18:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-03 18:15 bug#18183: 24.3; table-fixed-width-mode fails with kill/yank Boruch Baum
2020-12-04 11:29 ` Lars Ingebrigtsen
2020-12-06  9:06   ` Boruch Baum
2020-12-06 14:30     ` Lars Ingebrigtsen
2020-12-06 18:20       ` Boruch Baum
2020-12-07 13:53         ` Lars Ingebrigtsen
2020-12-07 14:06           ` Lars Ingebrigtsen
2020-12-07 17:36             ` Boruch Baum
2020-12-07 18:21             ` Boruch Baum [this message]
2020-12-08 13:39               ` Lars Ingebrigtsen
2020-12-07 19:18             ` Boruch Baum
2020-12-08  7:18             ` Boruch Baum
2020-12-08 13:40               ` Lars Ingebrigtsen
2020-12-08 13:56                 ` Boruch Baum
2020-12-08 13:59                   ` Lars Ingebrigtsen
2020-12-08 14:30                     ` Michael Albinus
2020-12-08 14:49                       ` Lars Ingebrigtsen
2020-12-10 10:37                         ` Bastien
2020-12-14  9:36                           ` Boruch Baum
2020-12-14 18:21                             ` Bastien
2020-12-14 19:32                               ` Boruch Baum
2020-12-08  7:46             ` Boruch Baum
2020-12-07 16:02           ` Boruch Baum
     [not found]           ` <20201209115145.oamb5hjjv65bw23s@E15-2016.optimum.net>
2020-12-09 11:53             ` Boruch Baum
2020-12-09 19:35               ` Lars Ingebrigtsen
2020-12-10  7:04                 ` Boruch Baum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201207182156.q2wzdjjbiyt63kh5@E15-2016.optimum.net \
    --to=boruch_baum@gmx.com \
    --cc=18183@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).