emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/server.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/server.el
Date: Thu, 15 Aug 2002 16:13:48 -0400

Index: emacs/lisp/server.el
diff -c emacs/lisp/server.el:1.78 emacs/lisp/server.el:1.79
*** emacs/lisp/server.el:1.78   Tue Dec 18 11:42:38 2001
--- emacs/lisp/server.el        Thu Aug 15 16:13:48 2002
***************
*** 251,289 ****
                       (substring request (match-beginning 0) (1- (match-end 
0))))
                      (pos 0))
                  (setq request (substring request (match-end 0)))
!                 (if (string-match "\\`-nowait" arg)
!                     (setq nowait t)
!                   (cond
!                       ;; ARG is a line number option.
!                    ((string-match "\\`\\+[0-9]+\\'" arg)
!                     (setq lineno (string-to-int (substring arg 1))))
!                    ;; ARG is line number:column option. 
!                    ((string-match "\\`+\\([0-9]+\\):\\([0-9]+\\)\\'" arg)
!                     (setq lineno (string-to-int (match-string 1 arg))
!                           columnno (string-to-int (match-string 2 arg))))
!                    (t
!                     ;; ARG is a file name.
!                     ;; Collapse multiple slashes to single slashes.
!                     (setq arg (command-line-normalize-file-name arg))
!                     ;; Undo the quoting that emacsclient does
!                     ;; for certain special characters.
!                     (while (string-match "&." arg pos)
!                       (setq pos (1+ (match-beginning 0)))
!                       (let ((nextchar (aref arg pos)))
!                         (cond ((= nextchar ?&)
!                                (setq arg (replace-match "&" t t arg)))
!                               ((= nextchar ?-)
!                                (setq arg (replace-match "-" t t arg)))
!                               (t
!                                (setq arg (replace-match " " t t arg))))))
!                     ;; Now decode the file name if necessary.
!                     (if coding-system
!                         (setq arg (decode-coding-string arg coding-system)))
!                     (setq files
!                           (cons (list arg lineno columnno)
!                                 files))
!                     (setq lineno 1)
!                     (setq columnno 0))))))
              (run-hooks 'pre-command-hook)
              (server-visit-files files client nowait)
              (run-hooks 'post-command-hook)
--- 251,289 ----
                       (substring request (match-beginning 0) (1- (match-end 
0))))
                      (pos 0))
                  (setq request (substring request (match-end 0)))
!                 (cond
!                  ((string-match "\\`-nowait" arg)
!                   (setq nowait t))
!                  ;; ARG is a line number option.
!                  ((string-match "\\`\\+[0-9]+\\'" arg)
!                   (setq lineno (string-to-int (substring arg 1))))
!                  ;; ARG is line number:column option. 
!                  ((string-match "\\`+\\([0-9]+\\):\\([0-9]+\\)\\'" arg)
!                   (setq lineno (string-to-int (match-string 1 arg))
!                         columnno (string-to-int (match-string 2 arg))))
!                  (t
!                   ;; ARG is a file name.
!                   ;; Collapse multiple slashes to single slashes.
!                   (setq arg (command-line-normalize-file-name arg))
!                   ;; Undo the quoting that emacsclient does
!                   ;; for certain special characters.
!                   (while (string-match "&." arg pos)
!                     (setq pos (1+ (match-beginning 0)))
!                     (let ((nextchar (aref arg pos)))
!                       (cond ((= nextchar ?&)
!                              (setq arg (replace-match "&" t t arg)))
!                             ((= nextchar ?-)
!                              (setq arg (replace-match "-" t t arg)))
!                             (t
!                              (setq arg (replace-match " " t t arg))))))
!                   ;; Now decode the file name if necessary.
!                   (if coding-system
!                       (setq arg (decode-coding-string arg coding-system)))
!                   (setq files
!                         (cons (list arg lineno columnno)
!                               files))
!                   (setq lineno 1)
!                   (setq columnno 0)))))
              (run-hooks 'pre-command-hook)
              (server-visit-files files client nowait)
              (run-hooks 'post-command-hook)
***************
*** 304,309 ****
--- 304,315 ----
    ;; Save for later any partial line that remains.
    (setq server-previous-string string))
  
+ (defun server-goto-line-column (file-line-col)
+   (goto-line (nth 1 file-line-col))
+   (let ((column-number (nth 2 file-line-col)))
+     (if (> column-number 0)
+       (move-to-column (1- column-number)))))
+ 
  (defun server-visit-files (files client &optional nowait)
    "Finds FILES and returns the list CLIENT with the buffers nconc'd.
  FILES is an alist whose elements are (FILENAME LINENUMBER COLUMNNUMBER).
***************
*** 325,332 ****
            (if (and obuf (set-buffer obuf))
                (progn
                  (cond ((file-exists-p filen)
!                        (if (or (not (verify-visited-file-modtime obuf))
!                                (buffer-modified-p obuf))
                             (revert-buffer t nil)))
                        (t
                         (if (y-or-n-p
--- 331,337 ----
            (if (and obuf (set-buffer obuf))
                (progn
                  (cond ((file-exists-p filen)
!                        (if (not (verify-visited-file-modtime obuf))
                             (revert-buffer t nil)))
                        (t
                         (if (y-or-n-p
***************
*** 335,346 ****
                                      ", write buffer to file? "))
                             (write-file filen))))
                  (setq server-existing-buffer t)
!                 (goto-line (nth 1 (car files))))
              (set-buffer (find-file-noselect filen))
!             (goto-line (nth 1 (car files)))
!             (let ((column-number (nth 2 (car files))))
!               (when (> column-number 0)
!                 (move-to-column (1- column-number))))
              (run-hooks 'server-visit-hook)))
          (if (not nowait)
              (setq server-buffer-clients
--- 340,348 ----
                                      ", write buffer to file? "))
                             (write-file filen))))
                  (setq server-existing-buffer t)
!                 (server-goto-line-column (car files)))
              (set-buffer (find-file-noselect filen))
!             (server-goto-line-column (car files))
              (run-hooks 'server-visit-hook)))
          (if (not nowait)
              (setq server-buffer-clients




reply via email to

[Prev in Thread] Current Thread [Next in Thread]