Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
PleasantDilemma
Dec 5, 2006

The Last Hope for Peace

Deus Rex posted:

This is a stupid question, but have you tried changing the number to be bigger on your Mac (like evaluating:

Lisp code:
(set-face-attribute 'default nil :height 200)
in the scratch buffer), and seeing if it changes? I've noticed font scales are different in Emacs on Mac OS and Linux. The default font size may be different as well.

Well, that worked, I feel pretty silly now. Thanks for the tip! I wonder if this machine has a high resolution/dpi screen and perhaps thats why the scale is different.

Adbot
ADBOT LOVES YOU

midnightclimax
Dec 3, 2011

by XyloJW
Does anyone know how I can change the way "bold" looks within org? I googled this a while ago, and all I got was a statement saying that emacs function is disabled in org. But still, there must be a definition that tells org how to display "bold"? Basically I want it to look like a highlight, maybe someone knows a solution.

fishbacon
Nov 4, 2009
wonderful yet strange smell
Emacs on Windows will start supporting running daemon in version 25.1, I am pretty excited about this:
http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS#n766

I would prefer not to use Windows but when I have to it is nice to have the same sort of workflow I do on Linux.

midnightclimax posted:

Does anyone know how I can change the way "bold" looks within org? I googled this a while ago, and all I got was a statement saying that emacs function is disabled in org. But still, there must be a definition that tells org how to display "bold"? Basically I want it to look like a highlight, maybe someone knows a solution.

I just tried:

Lisp code:
(require 'org)
(add-to-list 'org-emphasis-alist '("*" highlight))
in my init and it worked. So try that.

midnightclimax
Dec 3, 2011

by XyloJW

Mr. Fish posted:

Emacs on Windows will start supporting running daemon in version 25.1, I am pretty excited about this:
http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS#n766

I would prefer not to use Windows but when I have to it is nice to have the same sort of workflow I do on Linux.


I just tried:

Lisp code:
(require 'org)
(add-to-list 'org-emphasis-alist '("*" highlight))
in my init and it worked. So try that.

Huh. Ok, well that wasn't hard.

wooger
Apr 16, 2005

YOU RESENT?

Mr. Fish posted:

Emacs on Windows will start supporting running daemon in version 25.1, I am pretty excited about this:
http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS#n766

I would prefer not to use Windows but when I have to it is nice to have the same sort of workflow I do on Linux.

I use the server mode for Emacs on windows in 24.x at present, via some init.el code, what difference does this make to me?

I guess it just means there's no window required and I can't accidentally start the client before the server is started, which I occasionally manage by clicking the wrong shortcut.

fishbacon
Nov 4, 2009
wonderful yet strange smell

wooger posted:

I use the server mode for Emacs on windows in 24.x at present, via some init.el code, what difference does this make to me?

I guess it just means there's no window required and I can't accidentally start the client before the server is started, which I occasionally manage by clicking the wrong shortcut.

That is exactly what it means, personally I find it frustrating that I can close my server by accident.

wooger
Apr 16, 2005

YOU RESENT?

Mr. Fish posted:

That is exactly what it means, personally I find it frustrating that I can close my server by accident.

Indeed. Emacs is definitely something that makes windows bearable.

Jerry Bindle
May 16, 2003
This is stupid but i can't figure it out from the docs. How do you get tangle to not automatically wrap c code in a main()?

code:
#+begin_src c :tangle ~/blaaah.h :exports none :noweb yes
#include <blerp.h>
#define hello jpg
#+end_src
code:
int main() {
#include <blerp.h>
#define hello
return 0;
}
Edit: The answer is contained here http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-C.html

Jerry Bindle fucked around with this message at 18:02 on Mar 2, 2015

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Mr. Fish posted:

That is exactly what it means, personally I find it frustrating that I can close my server by accident.

Wait. How do you close your server by accident? I've literally never had this issue (on Windows anyway). I guess we must have different configs.

Here's what I do: http://www.emacswiki.org/emacs/EmacsClient#toc16 (plus server-start in my .emacs, of course). Apparently I run the following command when double-clicking a text file in the Explorer to open it in emacs:

code:
"C:\Program Files (x86)\emacs\bin\emacsclientw.exe" -n --alternate-editor="C:\Program Files (x86)\emacs\bin\runemacs.exe" "%1"

Avenging Dentist fucked around with this message at 21:26 on Mar 2, 2015

tak
Jan 31, 2003

lol demowned
Grimey Drawer

Avenging Dentist posted:

Wait. How do you close your server by accident? I've literally never had this issue (on Windows anyway). I guess we must have different configs.

Here's what I do: http://www.emacswiki.org/emacs/EmacsClient#toc16 (plus server-start in my .emacs, of course). Apparently I run the following command when double-clicking a text file in the Explorer to open it in emacs:

On emacs version<25.1 on Windows, if you close all emacs frames the server process is killed. The addition to 25.1 is that closing all frames still leaves an `emacs.exe --daemon' process open in the background, so you can just reattach to it by running emacsclient.

The --alternate-editor/-a option to emacsclient specifies a command to run if no server process is running, so killing the server doesn't prevent you from using emacsclient.exe but it does require rerunning all your init code and losing open buffers etc. if you do so.

midnightclimax
Dec 3, 2011

by XyloJW
Another question about org mode. I realize that I can link to stuff with the #+NAME: prefix. What I'd like to know now, is it possible to create custom link targets like #+FLOWER: or #+TREES:?

pgroce
Oct 24, 2002

midnightclimax posted:

Another question about org mode. I realize that I can link to stuff with the #+NAME: prefix. What I'd like to know now, is it possible to create custom link targets like #+FLOWER: or #+TREES:?

I'm not sure what you're asking here. #+$X>:$Y is org-mode's keyword format. #+NAME is one keyword, specifying labeled positions in the document (which can be used as link targets). You can specify new ones like #+FLOWER and it won't break org, but you'd have to define the semantics of #+FLOWER yourself, likely with a fair amount of code. (I've never looked into it that much.)

Could you share a use case?

midnightclimax
Dec 3, 2011

by XyloJW

pgroce posted:

I'm not sure what you're asking here. #+$X>:$Y is org-mode's keyword format. #+NAME is one keyword, specifying labeled positions in the document (which can be used as link targets). You can specify new ones like #+FLOWER and it won't break org, but you'd have to define the semantics of #+FLOWER yourself, likely with a fair amount of code. (I've never looked into it that much.)

Could you share a use case?

Well the idea is to designate the type of link (in this case flowers or tree) without the need to additionally add a tag. It would remove one step (adding a tag), and show you immediately the type of category the link target is about. The alternative would probably be to create a sub-headline for each entry. I don't know, I thought it's not that hard to create and imho would make parsing files easier.

Catalyst-proof
May 11, 2011

better waste some time with you

midnightclimax posted:

Well the idea is to designate the type of link (in this case flowers or tree) without the need to additionally add a tag. It would remove one step (adding a tag), and show you immediately the type of category the link target is about. The alternative would probably be to create a sub-headline for each entry. I don't know, I thought it's not that hard to create and imho would make parsing files easier.

org-add-link-type may work for you?

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Oh man, and I wrote a bunch of elisp to transform a jira issue ID into its corresponding URL... could have just used this.

Org mode never ceases to amaze me.

midnightclimax
Dec 3, 2011

by XyloJW

very cool, thanks

pgroce
Oct 24, 2002

Dessert Rose posted:

Oh man, and I wrote a bunch of elisp to transform a jira issue ID into its corresponding URL... could have just used this.

Org mode never ceases to amaze me.

Literally just did exactly the same thing. How many people are reinventing wheels around Jira and Emacs right now?

On a not-unrelated note: If anyone's written elisp to talk to Jira's REST API that they'd be willing to share, I'd love to see it.

Catalyst-proof
May 11, 2011

better waste some time with you
projectile 0.12 is out, and it seems to be tightly integrated with helm, which is exciting news.

midnightclimax
Dec 3, 2011

by XyloJW
Is there any way to use 'ace-jump to line' when visual word wrap is enabled? I did a bit of googling, and couldn't really find anything. But maybe there's another package, that allows me to do this.

(basically treat a wrapped line as separate lines, hope I didn't break someone's brain)
(not April Fool's)

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
OK so, I'm about 4 days into using evil and I like it but it feels like the model I use to manage buffers doesn't really work with emacs.

Basically, I rebind shift and left/right to move to the previous/next buffer. Then I use lots of splits and use up/down/left/right to navigate the splits. The problem is that emacs/helm makes tons and tons of buffers so rather than left/right navigating through the stuff i'm working on, it navigates through buffers that I can't even use because they're just storing something for helm.

I'm 100% sold on emacs otherwise but this is just killing me. What am I doing wrong?

Progressive JPEG
Feb 19, 2003

I use tabbar to organize buffers, with a custom grouping defined. Ctrl+PgUp/PgDn switches between tabs, while Ctrl+Shift+PgUp/PgDn switches the displayed tab group. The grouping results in all the "*Whatever*" emacs garbage being shunted off into a separate tab group, keeping it out of the way of what I'm working on.

Here's all the relevant stuff I have in my .emacs (incl keyboard bindings). Someone else may have a better way of doing some of this:
code:
(require 'tabbar)

;how to group tabs (copied/modified from tabbar.el 2.0)
(defun tabbar-buffer-groups-custom ()
  "Return the list of group names the current buffer belongs to.
Return a list of one element based on major mode."
  (list
   (cond
    ((or (get-buffer-process (current-buffer))
         ; Check if the major mode derives from `comint-mode' or
         ; `compilation-mode'.
         (tabbar-buffer-mode-derived-p
          major-mode '(comint-mode compilation-mode))) "Process")
    ((string-equal "*" (substring (buffer-name) 0 1)) "Emacs")
    ((eq major-mode 'dired-mode) "Dired")
    ((memq major-mode '(help-mode apropos-mode Info-mode Man-mode)) "Help")
    ((memq major-mode
           '(c++-mode c-mode csharp-made go-mode java-mode python-mode)) "Code")
    (t "Other")
    )))
(setq tabbar-buffer-groups-function 'tabbar-buffer-groups-custom)

(tabbar-mode 1);turn it on (after configuring -- avoids flicker?)

(global-set-key (kbd "C-<next>") 'tabbar-forward-tab)
(global-set-key (kbd "C-<prior>") 'tabbar-backward-tab)
(global-set-key (kbd "C-S-<next>") 'tabbar-forward-group)
(global-set-key (kbd "C-S-<prior>") 'tabbar-backward-group)
e: Also it looks like I've been installing tabbar via the emacs-goodies package, available on both Debian-based and Fedora.

Progressive JPEG fucked around with this message at 17:35 on Apr 22, 2015

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
Perfect that sounds like what I want, I'll give it a shot.

aerique
Jul 16, 2008

MALE SHOEGAZE posted:

OK so, I'm about 4 days into using evil and I like it but it feels like the model I use to manage buffers doesn't really work with emacs.

Basically, I rebind shift and left/right to move to the previous/next buffer. Then I use lots of splits and use up/down/left/right to navigate the splits. The problem is that emacs/helm makes tons and tons of buffers so rather than left/right navigating through the stuff i'm working on, it navigates through buffers that I can't even use because they're just storing something for helm.

I'm 100% sold on emacs otherwise but this is just killing me. What am I doing wrong?

You're not necessarily doing anything wrong, you just need to adapt Emacs to your preferences. I also use (alt-)up/down/left/right to navigate splits, I've also got a key bound to quickly switch back to the previous buffer and I have customized the "display-buffer-alist" variable (check what it does using "C-h v" or "M-x describe-variable"). The latter makes sure specific buffers open where and how I want them to.

I'll paste the code below but it's not really for public consumption: it has never been run by anyone but myself.

code:
(global-set-key (kbd "C-<backspace>") 'switch-to-last-buffer)

;; This is a work in progress and currently a whitelist.
;; FIXME gives problems on Windows and OS X (older Emacs 24?)
(when (on-unix)
  ;; What about display-buffer-base-action?
  (setq display-buffer-alist
        '(("*Buffer List*"  . (display-buffer-largest-other-window . nil))
          ("*cscope*"       . (display-buffer-largest-other-window . nil))
          ("*grep*"         . (display-buffer-largest-other-window . nil))
          ("*Help*"         . (display-buffer-largest-other-window . nil))
          ("*helm.*"        . (display-buffer-largest-other-window . nil))
          ;(".*imenu*"       . (display-buffer-pop-up-window        . nil))
          ("*Ibuffer*"      . (display-buffer-largest-other-window . nil))
          ("*Man .*"        . (display-buffer-largest-other-window . nil))
          (".*"             . (display-buffer-largest-other-window . nil)))))

(defvar switch-to-last-buffer-hash-table (make-hash-table))

(defun switch-to-last-buffer-store ()
  (interactive)
  (puthash (selected-window) (current-buffer)
           switch-to-last-buffer-hash-table))

(defun switch-to-last-buffer ()
  (interactive)
  (let ((last-buffer (gethash (selected-window)
                     switch-to-last-buffer-hash-table)))
    (when last-buffer
      (switch-to-last-buffer-store)
      (switch-to-buffer last-buffer))))

;; XXX What does /protected/ do?
(ad-add-advice #'switch-to-buffer '(switch-to-last-buffer-store nil t (lambda () (switch-to-last-buffer-store))) 'before 'first)

;; Use #'get-largest-window: [url]https://www.gnu.org/software/emacs/manual/html_node/elisp/Cyclic-Window-Ordering.html#Cyclic-Window-Ordering[/url]
(defun display-buffer-largest-other-window (buffer alist)
  "Display BUFFER on the same frame in the largest window (currently
only the height is checked) that is not currently the active window."
  (let ((sorted-windows (sort (loop for w in (window-list) collect w)
                              (lambda (a b)
                                (> (window-height a) (window-height b))))))
    (catch '--cl-block-display-buffer-largest-other-window--
      (loop for sw in sorted-windows
            do (unless (or (equal sw (selected-window))
                           (window-minibuffer-p sw)
                           (window-dedicated-p sw))
                           (window--display-buffer buffer sw 'reuse)
               (return-from display-buffer-largest-other-window sw))))))

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
I think I've asked this before ITT but I still haven't really found a good answer, only a couple bugs from four years and several major emacs versions ago.

Emacs python-mode for me is very slow in certain circumstances: On large files, doing something like deleting a closing paren and leaving the opening paren. Locks up emacs for a while, the only solution is to just wait until it comes back. Also, jumping around in a relatively large file (I'm talking ~3-5klines) gives a second or two of lockup before redrawing at the right place.

Anybody run into something similar?

aerique
Jul 16, 2008

Phobeste posted:

Emacs python-mode [...]

Anybody run into something similar?

More-or-less, but no solution.

I also use the default Python mode, with FlyCheck and company-anaconda for autocompletion. Turning off FlyCheck seems to alleviate the slowdowns somewhat but I'm actually not sure whether it's just an illusion.

Not really a helpful reply but at least you now known you're not alone out there.

Perhaps try out another Python mode?

Hollow Talk
Feb 2, 2014
This is also only vaguely related, but I have similar problems even with something relatively simple like flyspell and large org-mode buffers, where I have to disable flycheck because it slows down too much, so this might either be a bottleneck for things that need to run over the whole document, or it might be some sort of problem with big buffers. Org-mode's own unfolding of large sectioning takes a while with its own commands as well, while show-all works almost instantly. So this might be a problem depending on how exactly the auto-completion/checker etc. is written and how extensively it has to do things with big files.

PleasantDilemma
Dec 5, 2006

The Last Hope for Peace
Why is it that when I scroll around in a buffer, the cursor will stay in the visible area? I'm used to modern GUI editors where the cursor stays fixed while I scroll through a file. Is there a flag or mode to get the behavior I'm used to?

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

PlesantDilemma posted:

Why is it that when I scroll around in a buffer, the cursor will stay in the visible area? I'm used to modern GUI editors where the cursor stays fixed while I scroll through a file. Is there a flag or mode to get the behavior I'm used to?

As far as I know the point is always visible in the window. You might look into saving a mark before you go scrolling if you care about it.

leftist heap
Feb 28, 2013

Fun Shoe
Anyone use haskell-mode? What the heck is going on here?



It's underlining seemingly arbitrary stuff. Maybe I'm just not getting it. Happens on blank lines too.

AlexG
Jul 15, 2004
If you can't solve a problem with gaffer tape, it's probably insoluble anyway.
Highlighting possible indentation positions?
code:
(defcustom haskell-indentation-show-indentations t
  "If t the current line's indentation points will be showed as
underscore overlays in new haskell-mode buffers.  Use
`haskell-indentation-enable-show-indentations' and `haskell-indentation-disable-show-indentations'
to switch the behavior for already existing buffers."
  :type 'boolean
  :group 'haskell-indentation)

leftist heap
Feb 28, 2013

Fun Shoe
Bingo. Thanks.

tak
Jan 31, 2003

lol demowned
Grimey Drawer

PlesantDilemma posted:

Why is it that when I scroll around in a buffer, the cursor will stay in the visible area? I'm used to modern GUI editors where the cursor stays fixed while I scroll through a file. Is there a flag or mode to get the behavior I'm used to?

Try scroll-restore.

The point will still around as you scroll -- there's no way to change that AFAIK, it's just how emacs works -- but it will move back to its original position when you scroll back.

Deus Rex
Mar 5, 2005

tak posted:

Try scroll-restore.

The point will still around as you scroll -- there's no way to change that AFAIK, it's just how emacs works -- but it will move back to its original position when you scroll back.

Ugh:

quote:

This server could not prove that it is elpa.gnu.org; its security certificate expired 45 day(s) ago. This may be caused by a misconfiguration or an attacker intercepting your connection. Your computer's clock is currently set to Saturday, April 25, 2015. Does that look right? If not, you should correct your system's clock and then refresh this page.

Anyway PlesantDilemma, it's not perfect but as a workaround but you could store the point in a register before you scroll around. See C-h f point-to-register.

midnightclimax
Dec 3, 2011

by XyloJW
Is it possible to define which frames in a desktop session are at the bottom, and which ones are at the top? Right now it seems that the top-most frame to open, is the one that was created last. Any way to change that? (to be more clear: I have frames a,b,c; and I would like a to be on top of b, c being the one at the bottom.

Deus Rex
Mar 5, 2005

midnightclimax posted:

Is it possible to define which frames in a desktop session are at the bottom, and which ones are at the top? Right now it seems that the top-most frame to open, is the one that was created last. Any way to change that? (to be more clear: I have frames a,b,c; and I would like a to be on top of b, c being the one at the bottom.

What do you mean by on top and bottom? Like, spatially, on the screen (in the Y or Z dimension)? In some queue?

midnightclimax
Dec 3, 2011

by XyloJW

Deus Rex posted:

What do you mean by on top and bottom? Like, spatially, on the screen (in the Y or Z dimension)? In some queue?

Yeah, spatially on the z axis. Right now if you create a second frame and save the desktop, the second one will be in front (z-axis) of the first one (when you reload the desktop). It's just something I thought about after using a wm/Linux desktop with transparency settings.

midnightclimax fucked around with this message at 18:00 on Apr 30, 2015

bollig
Apr 7, 2006

Never Forget.
So now that we've had some time to digest Spacemacs, is there more of a consensus? I've personally gotten some pretty divided reviews, of the little reading on it I've been doing. A bit of background, I'm midway through my first year as a Computational Linguistics masters student, and I've spent the last 6 months shaking hands with VIM (I started with emacs, but after reading about the VIM keybindings, I went with that). But I now am a lot more interested in all the crazy poo poo that Emacs can do. Long story short, I want to keep the VIM keybindings (at least for text editing/coding) but want to do the emacs poo poo.

Right now I'm rolling Evil, but a lot of ex-VIM people say Spacemacs is good poo poo.

You guys seem a bit divided on it, from the reading I've done on the last 5 pages or so, but I'm willing to hear your input.

bollig fucked around with this message at 15:52 on May 7, 2015

Catalyst-proof
May 11, 2011

better waste some time with you
There's clearly a lot of thought put into it, and some of its infrastructure looks insanely cool (checking for new updates, the tabbed spacebar UI), but I simply couldn't get used to it. I'm far too used to thinking of Emacs as a non-modal editor to switch up like that. And I'm wary of what will start happening once I want to add more and more of my normal customized setup into Spacemacs, and bad interactions, or modules that can't be adapted to the Spacemacs paradigm.

bollig
Apr 7, 2006

Never Forget.

horse mans posted:

There's clearly a lot of thought put into it, and some of its infrastructure looks insanely cool (checking for new updates, the tabbed spacebar UI), but I simply couldn't get used to it. I'm far too used to thinking of Emacs as a non-modal editor to switch up like that. And I'm wary of what will start happening once I want to add more and more of my normal customized setup into Spacemacs, and bad interactions, or modules that can't be adapted to the Spacemacs paradigm.

That's kind of where I'm leaning with it. I have some time to mess around with it tomorrow. I guess the question to ask would be if there is anything I ~wouldn't~ be able to do with Spacemacs.

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

bollig posted:

So now that we've had some time to digest Spacemacs, is there more of a consensus? I've personally gotten some pretty divided reviews, of the little reading on it I've been doing. A bit of background, I'm midway through my first year as a Computational Linguistics masters student, and I've spent the last 6 months shaking hands with VIM (I started with emacs, but after reading about the VIM keybindings, I went with that). But I now am a lot more interested in all the crazy poo poo that Emacs can do. Long story short, I want to keep the VIM keybindings (at least for text editing/coding) but want to do the emacs poo poo.

Right now I'm rolling Evil, but a lot of ex-VIM people say Spacemacs is good poo poo.

You guys seem a bit divided on it, from the reading I've done on the last 5 pages or so, but I'm willing to hear your input.

I'm really happy with it because I like vim but i wanted something more project oriented. I don' t have time to learn emacs but spacemacs had me up and running in no time.

I'm sure I'll eventually migrate away from spacemacs into my own thing, but if you're just trying to make the switch I definitely recommend it.

  • Locked thread